Update leenkx/blender/lnx/logicnode/custom/LN_create_style.py

This commit is contained in:
Onek8 2025-04-03 09:36:23 +00:00
parent 3ab9123000
commit 2a3f8db0bc

View File

@ -1,451 +1,451 @@
import array import array
from lnx.logicnode.lnx_nodes import * from lnx.logicnode.lnx_nodes import *
class CreateStyleNode(LnxLogicTreeNode): class CreateStyleNode(LnxLogicTreeNode):
"""Create Style""" """Create Style"""
bl_idname = 'LNCreateStyleNode' bl_idname = 'LNCreateStyleNode'
bl_label = 'Create Style' bl_label = 'Create Style'
bl_description = 'Create Style' bl_description = 'Create Style'
lnx_category = 'HTML' lnx_category = 'HTML'
lnx_version = 1 lnx_version = 1
min_inputs = 1 min_inputs = 1
@staticmethod @staticmethod
def get_enum_id_value(obj, prop_name, value): def get_enum_id_value(obj, prop_name, value):
return obj.bl_rna.properties[prop_name].enum_items[value].identifier return obj.bl_rna.properties[prop_name].enum_items[value].identifier
@staticmethod @staticmethod
def get_count_in(type_name): def get_count_in(type_name):
return { return {
'align-content': 0, 'align-content': 0,
'align-items': 1, 'align-items': 1,
'align-self': 2, 'align-self': 2,
'animation-delay': 3, 'animation-delay': 3,
'animation-direction': 4, 'animation-direction': 4,
'animation-duration': 5, 'animation-duration': 5,
'animation-fill-mode': 6, 'animation-fill-mode': 6,
'animation-iteration-count': 7, 'animation-iteration-count': 7,
'animation-name': 8, 'animation-name': 8,
'animation-play-state': 9, 'animation-play-state': 9,
'animation-timing-function': 10, 'animation-timing-function': 10,
'backface-visibility': 11, 'backface-visibility': 11,
'background': 12, 'background': 12,
'background-attachment': 13, 'background-attachment': 13,
'background-clip': 14, 'background-clip': 14,
'background-color': 15, 'background-color': 15,
'background-image': 16, 'background-image': 16,
'background-origin': 17, 'background-origin': 17,
'background-position': 18, 'background-position': 18,
'background-repeat': 19, 'background-repeat': 19,
'background-size': 20, 'background-size': 20,
'border': 21, 'border': 21,
'border-bottom': 22, 'border-bottom': 22,
'border-bottom-color': 23, 'border-bottom-color': 23,
'border-bottom-left-radius': 24, 'border-bottom-left-radius': 24,
'border-bottom-right-radius': 25, 'border-bottom-right-radius': 25,
'border-bottom-style': 26, 'border-bottom-style': 26,
'border-bottom-width': 27, 'border-bottom-width': 27,
'border-collapse': 28, 'border-collapse': 28,
'border-color': 29, 'border-color': 29,
'border-image': 30, 'border-image': 30,
'border-image-outset': 31, 'border-image-outset': 31,
'border-image-repeat': 32, 'border-image-repeat': 32,
'border-image-slice': 33, 'border-image-slice': 33,
'border-image-source': 34, 'border-image-source': 34,
'border-image-width': 35, 'border-image-width': 35,
'border-left': 36, 'border-left': 36,
'border-left-color': 37, 'border-left-color': 37,
'border-left-style': 38, 'border-left-style': 38,
'border-left-width': 39, 'border-left-width': 39,
'border-radius': 40, 'border-radius': 40,
'border-right': 41, 'border-right': 41,
'border-right-color': 42, 'border-right-color': 42,
'border-right-style': 43, 'border-right-style': 43,
'border-right-width': 44, 'border-right-width': 44,
'border-spacing': 45, 'border-spacing': 45,
'border-style': 46, 'border-style': 46,
'border-top': 47, 'border-top': 47,
'border-top-color': 48, 'border-top-color': 48,
'border-top-left-radius': 49, 'border-top-left-radius': 49,
'border-top-right-radius': 50, 'border-top-right-radius': 50,
'border-top-style': 51, 'border-top-style': 51,
'border-top-width': 52, 'border-top-width': 52,
'border-width': 53, 'border-width': 53,
'bottom': 54, 'bottom': 54,
'box-shadow': 55, 'box-shadow': 55,
'box-sizing': 56, 'box-sizing': 56,
'caption-side': 57, 'caption-side': 57,
'clear': 58, 'clear': 58,
'clip': 59, 'clip': 59,
'color': 60, 'color': 60,
'column-count': 61, 'column-count': 61,
'column-fill': 62, 'column-fill': 62,
'column-gap': 63, 'column-gap': 63,
'column-rule': 64, 'column-rule': 64,
'column-rule-color': 65, 'column-rule-color': 65,
'column-rule-style': 66, 'column-rule-style': 66,
'column-rule-width': 67, 'column-rule-width': 67,
'column-span': 68, 'column-span': 68,
'column-width': 69, 'column-width': 69,
'columns': 70, 'columns': 70,
'content': 71, 'content': 71,
'counter-increment': 72, 'counter-increment': 72,
'counter-reset': 73, 'counter-reset': 73,
'cursor': 74, 'cursor': 74,
'direction': 75, 'direction': 75,
'display': 76, 'display': 76,
'empty-cells': 77, 'empty-cells': 77,
'flex': 78, 'flex': 78,
'flex-basis': 79, 'flex-basis': 79,
'flex-direction': 80, 'flex-direction': 80,
'flex-flow': 81, 'flex-flow': 81,
'flex-grow': 82, 'flex-grow': 82,
'flex-shrink': 83, 'flex-shrink': 83,
'flex-wrap': 84, 'flex-wrap': 84,
'float': 85, 'float': 85,
'font': 86, 'font': 86,
'font-family': 87, 'font-family': 87,
'font-size': 88, 'font-size': 88,
'font-size-adjust': 89, 'font-size-adjust': 89,
'font-stretch': 90, 'font-stretch': 90,
'font-style': 91, 'font-style': 91,
'font-variant': 92, 'font-variant': 92,
'font-weight': 93, 'font-weight': 93,
'height': 94, 'height': 94,
'justify-content': 95, 'justify-content': 95,
'left': 96, 'left': 96,
'letter-spacing': 97, 'letter-spacing': 97,
'line-height': 98, 'line-height': 98,
'list-style': 99, 'list-style': 99,
'list-style-image': 100, 'list-style-image': 100,
'list-style-position': 101, 'list-style-position': 101,
'list-style-type': 102, 'list-style-type': 102,
'margin': 103, 'margin': 103,
'margin-bottom': 104, 'margin-bottom': 104,
'margin-left': 105, 'margin-left': 105,
'margin-right': 106, 'margin-right': 106,
'margin-top': 107, 'margin-top': 107,
'max-height': 108, 'max-height': 108,
'max-width': 109, 'max-width': 109,
'min-height': 110, 'min-height': 110,
'min-width': 111, 'min-width': 111,
'opacity': 112, 'opacity': 112,
'order': 113, 'order': 113,
'outline': 114, 'outline': 114,
'outline-color': 115, 'outline-color': 115,
'outline-offset': 116, 'outline-offset': 116,
'outline-style': 117, 'outline-style': 117,
'outline-width': 118, 'outline-width': 118,
'overflow': 119, 'overflow': 119,
'overflow-x': 120, 'overflow-x': 120,
'overflow-y': 121, 'overflow-y': 121,
'padding': 122, 'padding': 122,
'padding-bottom': 123, 'padding-bottom': 123,
'padding-left': 124, 'padding-left': 124,
'padding-right': 125, 'padding-right': 125,
'padding-top': 126, 'padding-top': 126,
'page-break-after': 127, 'page-break-after': 127,
'page-break-before': 128, 'page-break-before': 128,
'page-break-inside': 129, 'page-break-inside': 129,
'perspective': 130, 'perspective': 130,
'perspective-origin': 131, 'perspective-origin': 131,
'position': 132, 'position': 132,
'quotes': 133, 'quotes': 133,
'resize': 134, 'resize': 134,
'right': 135, 'right': 135,
'tab-size': 136, 'tab-size': 136,
'table-layout': 137, 'table-layout': 137,
'text-align': 138, 'text-align': 138,
'text-align-last': 139, 'text-align-last': 139,
'text-decoration': 140, 'text-decoration': 140,
'text-decoration-color': 141, 'text-decoration-color': 141,
'text-decoration-line': 142, 'text-decoration-line': 142,
'text-decoration-style': 143, 'text-decoration-style': 143,
'text-indent': 144, 'text-indent': 144,
'text-justify': 145, 'text-justify': 145,
'text-overflow': 146, 'text-overflow': 146,
'text-shadow': 147, 'text-shadow': 147,
'text-transform': 148, 'text-transform': 148,
'top': 149, 'top': 149,
'transform': 150, 'transform': 150,
'transform-origin': 151, 'transform-origin': 151,
'transform-style': 152, 'transform-style': 152,
'transition': 153, 'transition': 153,
'transition-delay': 154, 'transition-delay': 154,
'transition-duration': 155, 'transition-duration': 155,
'transition-property': 156, 'transition-property': 156,
'transition-timing-function': 157, 'transition-timing-function': 157,
'vertical-align': 158, 'vertical-align': 158,
'visibility': 159, 'visibility': 159,
'white-space': 160, 'white-space': 160,
'width': 161, 'width': 161,
'word-break': 162, 'word-break': 162,
'word-spacing': 163, 'word-spacing': 163,
'word-wrap': 164, 'word-wrap': 164,
'z-index': 165 'z-index': 165
}.get(type_name, 60) }.get(type_name, 60)
def get_enum(self): def get_enum(self):
ind = 0 ind = 0
properties = '' properties = ''
for i in self.inputs: for i in self.inputs:
if ind != 0: if ind != 0:
properties += self.inputs[ind].name + ':' properties += self.inputs[ind].name + ':'
ind += 1 ind += 1
self['property1'] = properties self['property1'] = properties
return self.get('property0', 60) return self.get('property0', 60)
def set_enum(self, value): def set_enum(self, value):
select_current = self.get_enum_id_value(self, 'property0', value) select_current = self.get_enum_id_value(self, 'property0', value)
select_prev = self.property0 select_prev = self.property0
if select_prev != select_current: if select_prev != select_current:
self.add_input('LnxStringSocket', select_current) self.add_input('LnxStringSocket', select_current)
self['property0'] = value self['property0'] = value
ind = 0 ind = 0
properties = '' properties = ''
for i in self.inputs: for i in self.inputs:
if ind != 0: if ind != 0:
properties += self.inputs[ind].name + ':' properties += self.inputs[ind].name + ':'
ind += 1 ind += 1
self['property1'] = properties self['property1'] = properties
property0: HaxeEnumProperty( property0: HaxeEnumProperty(
'property0', 'property0',
items = [('align-content', 'align-content', 'Align Content'), items = [('align-content', 'align-content', 'Align Content'),
('align-items', 'align-items', 'Align Items'), ('align-items', 'align-items', 'Align Items'),
('align-self', 'align-self', 'Align Self'), ('align-self', 'align-self', 'Align Self'),
('animation-delay', 'animation-delay', 'Animation Delay'), ('animation-delay', 'animation-delay', 'Animation Delay'),
('animation-direction', 'animation-direction', 'Animation Direction'), ('animation-direction', 'animation-direction', 'Animation Direction'),
('animation-duration', 'animation-duration', 'Animation Duration'), ('animation-duration', 'animation-duration', 'Animation Duration'),
('animation-fill-mode', 'animation-fill-mode', 'Animation Fill Mode'), ('animation-fill-mode', 'animation-fill-mode', 'Animation Fill Mode'),
('animation-iteration-count', 'animation-iteration-count', 'Animation Iteration Count'), ('animation-iteration-count', 'animation-iteration-count', 'Animation Iteration Count'),
('animation-name', 'animation-name', 'Animation Name'), ('animation-name', 'animation-name', 'Animation Name'),
('animation-play-state', 'animation-play-state', 'Animation Play State'), ('animation-play-state', 'animation-play-state', 'Animation Play State'),
('animation-timing-function', 'animation-timing-function', 'Animation Timing Function'), ('animation-timing-function', 'animation-timing-function', 'Animation Timing Function'),
('backface-visibility', 'backface-visibility', 'Backface Visibility'), ('backface-visibility', 'backface-visibility', 'Backface Visibility'),
('background', 'background', 'Background'), ('background', 'background', 'Background'),
('background-attachment', 'background-attachment', 'Background Attachment'), ('background-attachment', 'background-attachment', 'Background Attachment'),
('background-clip', 'background-clip', 'Background Clip'), ('background-clip', 'background-clip', 'Background Clip'),
('background-color', 'background-color', 'Background Color'), ('background-color', 'background-color', 'Background Color'),
('background-image', 'background-image', 'Background Image'), ('background-image', 'background-image', 'Background Image'),
('background-origin', 'background-origin', 'Background Origin'), ('background-origin', 'background-origin', 'Background Origin'),
('background-position', 'background-position', 'Background Position'), ('background-position', 'background-position', 'Background Position'),
('background-repeat', 'background-repeat', 'Background Repeat'), ('background-repeat', 'background-repeat', 'Background Repeat'),
('background-size', 'background-size', 'Background Size'), ('background-size', 'background-size', 'Background Size'),
('border', 'border', 'Border'), ('border', 'border', 'Border'),
('border-bottom', 'border-bottom', 'Border Bottom'), ('border-bottom', 'border-bottom', 'Border Bottom'),
('border-bottom-color', 'border-bottom-color', 'Border Bottom Color'), ('border-bottom-color', 'border-bottom-color', 'Border Bottom Color'),
('border-bottom-left-radius', 'border-bottom-left-radius', 'Border Bottom Left Radius'), ('border-bottom-left-radius', 'border-bottom-left-radius', 'Border Bottom Left Radius'),
('border-bottom-right-radius', 'border-bottom-right-radius', 'Border Bottom Right Radius'), ('border-bottom-right-radius', 'border-bottom-right-radius', 'Border Bottom Right Radius'),
('border-bottom-style', 'border-bottom-style', 'Border Bottom Style'), ('border-bottom-style', 'border-bottom-style', 'Border Bottom Style'),
('border-bottom-width', 'border-bottom-width', 'Border Bottom Width'), ('border-bottom-width', 'border-bottom-width', 'Border Bottom Width'),
('border-collapse', 'border-collapse', 'Border Collapse'), ('border-collapse', 'border-collapse', 'Border Collapse'),
('border-color', 'border-color', 'Border Color'), ('border-color', 'border-color', 'Border Color'),
('border-image', 'border-image', 'Border Image'), ('border-image', 'border-image', 'Border Image'),
('border-image-outset', 'border-image-outset', 'Border Image Outset'), ('border-image-outset', 'border-image-outset', 'Border Image Outset'),
('border-image-repeat', 'border-image-repeat', 'Border Image Repeat'), ('border-image-repeat', 'border-image-repeat', 'Border Image Repeat'),
('border-image-slice', 'border-image-slice', 'Border Image Slice'), ('border-image-slice', 'border-image-slice', 'Border Image Slice'),
('border-image-source', 'border-image-source', 'Border Image Source'), ('border-image-source', 'border-image-source', 'Border Image Source'),
('border-image-width', 'border-image-width', 'Border Image Width'), ('border-image-width', 'border-image-width', 'Border Image Width'),
('border-left', 'border-left', 'Border Left'), ('border-left', 'border-left', 'Border Left'),
('border-left-color', 'border-left-color', 'Border Left Color'), ('border-left-color', 'border-left-color', 'Border Left Color'),
('border-left-style', 'border-left-style', 'Border Left Style'), ('border-left-style', 'border-left-style', 'Border Left Style'),
('border-left-width', 'border-left-width', 'Border Left Width'), ('border-left-width', 'border-left-width', 'Border Left Width'),
('border-radius', 'border-radius', 'Border Radius'), ('border-radius', 'border-radius', 'Border Radius'),
('border-right', 'border-right', 'Border Right'), ('border-right', 'border-right', 'Border Right'),
('border-right-color', 'border-right-color', 'Border Right Color'), ('border-right-color', 'border-right-color', 'Border Right Color'),
('border-right-style', 'border-right-style', 'Border Right Style'), ('border-right-style', 'border-right-style', 'Border Right Style'),
('border-right-width', 'border-right-width', 'Border Right Width'), ('border-right-width', 'border-right-width', 'Border Right Width'),
('border-spacing', 'border-spacing', 'Border Spacing'), ('border-spacing', 'border-spacing', 'Border Spacing'),
('border-style', 'border-style', 'Border Style'), ('border-style', 'border-style', 'Border Style'),
('border-top', 'border-top', 'Border Top'), ('border-top', 'border-top', 'Border Top'),
('border-top-color', 'border-top-color', 'Border Top Color'), ('border-top-color', 'border-top-color', 'Border Top Color'),
('border-top-left-radius', 'border-top-left-radius', 'Border Top Left Radius'), ('border-top-left-radius', 'border-top-left-radius', 'Border Top Left Radius'),
('border-top-right-radius', 'border-top-right-radius', 'Border Top Right Radius'), ('border-top-right-radius', 'border-top-right-radius', 'Border Top Right Radius'),
('border-top-style', 'border-top-style', 'Border Top Style'), ('border-top-style', 'border-top-style', 'Border Top Style'),
('border-top-width', 'border-top-width', 'Border Top Width'), ('border-top-width', 'border-top-width', 'Border Top Width'),
('border-width', 'border-width', 'Border Width'), ('border-width', 'border-width', 'Border Width'),
('bottom', 'bottom', 'Bottom'), ('bottom', 'bottom', 'Bottom'),
('box-shadow', 'box-shadow', 'Box Shadow'), ('box-shadow', 'box-shadow', 'Box Shadow'),
('box-sizing', 'box-sizing', 'Box Sizing'), ('box-sizing', 'box-sizing', 'Box Sizing'),
('caption-side', 'caption-side', 'Caption Side'), ('caption-side', 'caption-side', 'Caption Side'),
('clear', 'clear', 'Clear'), ('clear', 'clear', 'Clear'),
('clip', 'clip', 'Clip'), ('clip', 'clip', 'Clip'),
('color', 'color', 'Color'), ('color', 'color', 'Color'),
('column-count', 'column-count', 'Column Count'), ('column-count', 'column-count', 'Column Count'),
('column-fill', 'column-fill', 'Column Fill'), ('column-fill', 'column-fill', 'Column Fill'),
('column-gap', 'column-gap', 'Column Gap'), ('column-gap', 'column-gap', 'Column Gap'),
('column-rule', 'column-rule', 'Column Rule'), ('column-rule', 'column-rule', 'Column Rule'),
('column-rule-color', 'column-rule-color', 'Column Rule Color'), ('column-rule-color', 'column-rule-color', 'Column Rule Color'),
('column-rule-style', 'column-rule-style', 'Column Rule Style'), ('column-rule-style', 'column-rule-style', 'Column Rule Style'),
('column-rule-width', 'column-rule-width', 'Column Rule Width'), ('column-rule-width', 'column-rule-width', 'Column Rule Width'),
('column-span', 'column-span', 'Column Span'), ('column-span', 'column-span', 'Column Span'),
('column-width', 'column-width', 'Column Width'), ('column-width', 'column-width', 'Column Width'),
('columns', 'columns', 'Columns'), ('columns', 'columns', 'Columns'),
('content', 'content', 'Content'), ('content', 'content', 'Content'),
('counter-increment', 'counter-increment', 'Counter Increment'), ('counter-increment', 'counter-increment', 'Counter Increment'),
('counter-reset', 'counter-reset', 'Counter Reset'), ('counter-reset', 'counter-reset', 'Counter Reset'),
('cursor', 'cursor', 'Cursor'), ('cursor', 'cursor', 'Cursor'),
('direction', 'direction', 'Direction'), ('direction', 'direction', 'Direction'),
('display', 'display', 'Display'), ('display', 'display', 'Display'),
('empty-cells', 'empty-cells', 'Empty Cells'), ('empty-cells', 'empty-cells', 'Empty Cells'),
('flex', 'flex', 'Flex'), ('flex', 'flex', 'Flex'),
('flex-basis', 'flex-basis', 'Flex Basis'), ('flex-basis', 'flex-basis', 'Flex Basis'),
('flex-direction', 'flex-direction', 'Flex Direction'), ('flex-direction', 'flex-direction', 'Flex Direction'),
('flex-flow', 'flex-flow', 'Flex Flow'), ('flex-flow', 'flex-flow', 'Flex Flow'),
('flex-grow', 'flex-grow', 'Flex Grow'), ('flex-grow', 'flex-grow', 'Flex Grow'),
('flex-shrink', 'flex-shrink', 'Flex Shrink'), ('flex-shrink', 'flex-shrink', 'Flex Shrink'),
('flex-wrap', 'flex-wrap', 'Flex Wrap'), ('flex-wrap', 'flex-wrap', 'Flex Wrap'),
('float', 'float', 'Float'), ('float', 'float', 'Float'),
('font', 'font', 'Font'), ('font', 'font', 'Font'),
('font-family', 'font-family', 'Font Family'), ('font-family', 'font-family', 'Font Family'),
('font-size', 'font-size', 'Font Size'), ('font-size', 'font-size', 'Font Size'),
('font-size-adjust', 'font-size-adjust', 'Font Size Adjust'), ('font-size-adjust', 'font-size-adjust', 'Font Size Adjust'),
('font-stretch', 'font-stretch', 'Font Stretch'), ('font-stretch', 'font-stretch', 'Font Stretch'),
('font-style', 'font-style', 'Font Style'), ('font-style', 'font-style', 'Font Style'),
('font-variant', 'font-variant', 'Font Variant'), ('font-variant', 'font-variant', 'Font Variant'),
('font-weight', 'font-weight', 'Font Weight'), ('font-weight', 'font-weight', 'Font Weight'),
('height', 'height', 'Height'), ('height', 'height', 'Height'),
('justify-content', 'justify-content', 'Justify Content'), ('justify-content', 'justify-content', 'Justify Content'),
('left', 'left', 'Left'), ('left', 'left', 'Left'),
('letter-spacing', 'letter-spacing', 'Letter Spacing'), ('letter-spacing', 'letter-spacing', 'Letter Spacing'),
('line-height', 'line-height', 'Line Height'), ('line-height', 'line-height', 'Line Height'),
('list-style', 'list-style', 'List Style'), ('list-style', 'list-style', 'List Style'),
('list-style-image', 'list-style-image', 'List Style Image'), ('list-style-image', 'list-style-image', 'List Style Image'),
('list-style-position', 'list-style-position', 'List Style Position'), ('list-style-position', 'list-style-position', 'List Style Position'),
('list-style-type', 'list-style-type', 'List Style Type'), ('list-style-type', 'list-style-type', 'List Style Type'),
('margin', 'margin', 'Margin'), ('margin', 'margin', 'Margin'),
('margin-bottom', 'margin-bottom', 'Margin Bottom'), ('margin-bottom', 'margin-bottom', 'Margin Bottom'),
('margin-left', 'margin-left', 'Margin Left'), ('margin-left', 'margin-left', 'Margin Left'),
('margin-right', 'margin-right', 'Margin Right'), ('margin-right', 'margin-right', 'Margin Right'),
('margin-top', 'margin-top', 'Margin Top'), ('margin-top', 'margin-top', 'Margin Top'),
('max-height', 'max-height', 'Max Height'), ('max-height', 'max-height', 'Max Height'),
('max-width', 'max-width', 'Max Width'), ('max-width', 'max-width', 'Max Width'),
('min-height', 'min-height', 'Min Height'), ('min-height', 'min-height', 'Min Height'),
('min-width', 'min-width', 'Min Width'), ('min-width', 'min-width', 'Min Width'),
('opacity', 'opacity', 'Opacity'), ('opacity', 'opacity', 'Opacity'),
('order', 'order', 'Order'), ('order', 'order', 'Order'),
('outline', 'outline', 'Outline'), ('outline', 'outline', 'Outline'),
('outline-color', 'outline-color', 'Outline Color'), ('outline-color', 'outline-color', 'Outline Color'),
('outline-offset', 'outline-offset', 'Outline Offset'), ('outline-offset', 'outline-offset', 'Outline Offset'),
('outline-style', 'outline-style', 'Outline Style'), ('outline-style', 'outline-style', 'Outline Style'),
('outline-width', 'outline-width', 'Outline Sidth'), ('outline-width', 'outline-width', 'Outline Sidth'),
('overflow', 'overflow', 'Overflow'), ('overflow', 'overflow', 'Overflow'),
('overflow-x', 'overflow-x', 'Overflow X'), ('overflow-x', 'overflow-x', 'Overflow X'),
('overflow-y', 'overflow-y', 'Overflow Y'), ('overflow-y', 'overflow-y', 'Overflow Y'),
('padding', 'padding', 'Padding'), ('padding', 'padding', 'Padding'),
('padding-bottom', 'padding-bottom', 'Padding Bottom'), ('padding-bottom', 'padding-bottom', 'Padding Bottom'),
('padding-left', 'padding-left', 'Padding Left'), ('padding-left', 'padding-left', 'Padding Left'),
('padding-right', 'padding-right', 'Padding Right'), ('padding-right', 'padding-right', 'Padding Right'),
('padding-top', 'padding-top', 'Padding Top'), ('padding-top', 'padding-top', 'Padding Top'),
('page-break-after', 'page-break-after', 'Page Break After'), ('page-break-after', 'page-break-after', 'Page Break After'),
('page-break-before', 'page-break-before', 'Page Break Before'), ('page-break-before', 'page-break-before', 'Page Break Before'),
('page-break-inside', 'page-break-inside', 'Page Break Inside'), ('page-break-inside', 'page-break-inside', 'Page Break Inside'),
('perspective', 'perspective', 'Perspective'), ('perspective', 'perspective', 'Perspective'),
('perspective-origin', 'perspective-origin', 'Perspective Origin'), ('perspective-origin', 'perspective-origin', 'Perspective Origin'),
('position', 'position', 'Position'), ('position', 'position', 'Position'),
('quotes', 'quotes', 'Quotes'), ('quotes', 'quotes', 'Quotes'),
('resize', 'resize', 'Resize'), ('resize', 'resize', 'Resize'),
('right', 'right', 'Right'), ('right', 'right', 'Right'),
('tab-size', 'tab-size', 'Tab Size'), ('tab-size', 'tab-size', 'Tab Size'),
('table-layout', 'table-layout', 'Table Layout'), ('table-layout', 'table-layout', 'Table Layout'),
('text-align', 'text-align', 'Text Align'), ('text-align', 'text-align', 'Text Align'),
('text-align-last', 'text-align-last', 'Text Align Last'), ('text-align-last', 'text-align-last', 'Text Align Last'),
('text-decoration', 'text-decoration', 'Text Decoration'), ('text-decoration', 'text-decoration', 'Text Decoration'),
('text-decoration-color', 'text-decoration-color', 'Text Decoration Color'), ('text-decoration-color', 'text-decoration-color', 'Text Decoration Color'),
('text-decoration-line', 'text-decoration-line', 'Text Decoration Line'), ('text-decoration-line', 'text-decoration-line', 'Text Decoration Line'),
('text-decoration-style', 'text-decoration-style', 'Text Decoration Style'), ('text-decoration-style', 'text-decoration-style', 'Text Decoration Style'),
('text-indent', 'text-indent', 'Text Indent'), ('text-indent', 'text-indent', 'Text Indent'),
('text-justify', 'text-justify', 'Text Justify'), ('text-justify', 'text-justify', 'Text Justify'),
('text-overflow', 'text-overflow', 'Text Overflow'), ('text-overflow', 'text-overflow', 'Text Overflow'),
('text-shadow', 'text-shadow', 'Text Shadow'), ('text-shadow', 'text-shadow', 'Text Shadow'),
('text-transform', 'text-transform', 'Text Transform'), ('text-transform', 'text-transform', 'Text Transform'),
('top', 'top', 'Top'), ('top', 'top', 'Top'),
('transform', 'transform', 'Transform'), ('transform', 'transform', 'Transform'),
('transform-origin', 'transform-origin', 'Transform Origin'), ('transform-origin', 'transform-origin', 'Transform Origin'),
('transform-style', 'transform-style', 'Transform Style'), ('transform-style', 'transform-style', 'Transform Style'),
('transition', 'transition', 'Transition'), ('transition', 'transition', 'Transition'),
('transition-delay', 'transition-delay', 'Transition Delay'), ('transition-delay', 'transition-delay', 'Transition Delay'),
('transition-duration', 'transition-duration', 'Transition Duration'), ('transition-duration', 'transition-duration', 'Transition Duration'),
('transition-property', 'transition-property', 'Transition Property'), ('transition-property', 'transition-property', 'Transition Property'),
('transition-timing-function', 'transition-timing-function', 'Transition Timing Function'), ('transition-timing-function', 'transition-timing-function', 'Transition Timing Function'),
('vertical-align', 'vertical-align', 'Vertical Align'), ('vertical-align', 'vertical-align', 'Vertical Align'),
('visibility', 'visibility', 'Visibility'), ('visibility', 'visibility', 'Visibility'),
('white-space', 'white-space', 'White Space'), ('white-space', 'white-space', 'White Space'),
('width', 'width', 'Width'), ('width', 'width', 'Width'),
('word-break', 'word-break', 'Word Break'), ('word-break', 'word-break', 'Word Break'),
('word-spacing', 'word-spacing', 'Word Spacing'), ('word-spacing', 'word-spacing', 'Word Spacing'),
('word-wrap', 'word-wrap', 'Word Wrap'), ('word-wrap', 'word-wrap', 'Word Wrap'),
('z-index', 'z-index', 'Z Index')], ('z-index', 'z-index', 'Z Index')],
name='', name='',
default='color', default='color',
#update=set_properties, #update=set_properties,
set=set_enum, set=set_enum,
get=get_enum) get=get_enum)
property1: HaxeStringProperty( property1: HaxeStringProperty(
'property1', 'property1',
name='', name='',
default='') default='')
property2: HaxeBoolProperty( property2: HaxeBoolProperty(
'property2', 'property2',
name='Append CSS', name='Append CSS',
default=False) default=False)
def __init__(self): def __init__(self, *args, **kwargs):
super(CreateStyleNode, self).__init__() super(CreateStyleNode, self).__init__(*args, **kwargs)
array_nodes[str(id(self))] = self array_nodes[str(id(self))] = self
def lnx_init(self, context): def lnx_init(self, context):
self.add_input('LnxStringSocket', 'Class Name') self.add_input('LnxStringSocket', 'Class Name')
self.add_output('LnxStringSocket', 'Class') self.add_output('LnxStringSocket', 'Class')
self.add_output('LnxStringSocket', 'Inline Style') self.add_output('LnxStringSocket', 'Inline Style')
self.add_output('LnxStringSocket', 'CSS') self.add_output('LnxStringSocket', 'CSS')
ind = 0 ind = 0
properties = '' properties = ''
for i in self.inputs: for i in self.inputs:
if ind != 0: if ind != 0:
properties += self.inputs[ind].name + ':' properties += self.inputs[ind].name + ':'
ind += 1 ind += 1
self['property1'] = properties self['property1'] = properties
def draw_buttons(self, context, layout): def draw_buttons(self, context, layout):
layout.prop(self, 'property0') layout.prop(self, 'property0')
row = layout.row(align=True) row = layout.row(align=True)
column = row.column(align=True) column = row.column(align=True)
op = column.operator('lnx.node_remove_input', text='Remove', icon='X', emboss=True) op = column.operator('lnx.node_remove_input', text='Remove', icon='X', emboss=True)
op.node_index = str(id(self)) op.node_index = str(id(self))
if len(self.inputs) == self.min_inputs: if len(self.inputs) == self.min_inputs:
column.enabled = False column.enabled = False
layout.prop(self, 'property2') layout.prop(self, 'property2')
def get_replacement_node(self, node_tree: bpy.types.NodeTree): def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1): if self.lnx_version not in (0, 1):
raise LookupError() raise LookupError()
return NodeReplacement.Identity(self) return NodeReplacement.Identity(self)
def register(): def register():
add_category('HTML', icon='SEQ_STRIP_META') add_category('HTML', icon='SEQ_STRIP_META')
CreateStyleNode.on_register() CreateStyleNode.on_register()