@times-design-system/components-wordpress 1.5.3 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/ad-container/block.json +10 -0
- package/dist/blocks/ad-container/edit.js +17 -1
- package/dist/blocks/ad-container/render.php +14 -0
- package/dist/blocks/button/block.json +19 -5
- package/dist/blocks/button/edit.js +33 -15
- package/dist/blocks/button/render.php +38 -2
- package/dist/blocks/button/style.css +63 -0
- package/dist/blocks/chip/block.json +12 -7
- package/dist/blocks/chip/edit.js +20 -17
- package/dist/blocks/chip/render.php +25 -3
- package/dist/blocks/dialog-box/block.json +10 -0
- package/dist/blocks/dialog-box/edit.js +17 -0
- package/dist/blocks/dialog-box/render.php +18 -7
- package/dist/blocks/divider/block.json +10 -0
- package/dist/blocks/divider/edit.js +18 -2
- package/dist/blocks/divider/render.php +14 -1
- package/dist/blocks/flag/block.json +10 -0
- package/dist/blocks/flag/edit.js +27 -2
- package/dist/blocks/flag/render.php +25 -1
- package/dist/blocks/icon/block.json +10 -0
- package/dist/blocks/icon/edit.js +17 -0
- package/dist/blocks/icon/render.php +19 -8
- package/dist/blocks/icon-button/block.json +15 -0
- package/dist/blocks/icon-button/edit.js +33 -1
- package/dist/blocks/icon-button/render.php +19 -0
- package/dist/blocks/icon-button/style.css +37 -3
- package/dist/blocks/input/block.json +10 -0
- package/dist/blocks/input/edit.js +27 -1
- package/dist/blocks/input/render.php +17 -1
- package/dist/blocks/input-helper-message/block.json +10 -0
- package/dist/blocks/input-helper-message/edit.js +17 -0
- package/dist/blocks/input-helper-message/render.php +18 -7
- package/dist/blocks/link/block.json +12 -7
- package/dist/blocks/link/edit.js +21 -18
- package/dist/blocks/link/render.php +25 -3
- package/dist/blocks/tab/block.json +10 -0
- package/dist/blocks/tab/edit.js +17 -0
- package/dist/blocks/tab/render.php +18 -7
- package/dist/blocks/tab-group/block.json +10 -0
- package/dist/blocks/tab-group/edit.js +17 -0
- package/dist/blocks/tab-group/render.php +18 -7
- package/dist/blocks/text/block.json +10 -0
- package/dist/blocks/text/edit.js +18 -2
- package/dist/blocks/text/render.php +14 -1
- package/dist/blocks/toast/block.json +10 -0
- package/dist/blocks/toast/edit.js +18 -1
- package/dist/blocks/toast/render.php +14 -0
- package/dist/index.cjs +389 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +389 -148
- package/dist/index.js.map +1 -1
- package/dist/utils/DATA_ATTRIBUTES_USAGE.md +377 -0
- package/dist/utils/sanitize-data-attributes.php +109 -0
- package/package.json +9 -3
- package/BLOCK_CREATION_CHECKLIST.md +0 -385
- package/BUILD.md +0 -411
- package/CHANGELOG.md +0 -85
- package/SCSS_VARIABLES_REFERENCE.md +0 -316
- package/STYLING_SYNC_GUIDE.md +0 -306
- package/TESTING.md +0 -152
- package/TRANSFORMATION_GUIDE.md +0 -908
- package/dist/blocks/button/style-resolved.css +0 -153
- package/lib/wordpress.js +0 -7
- package/rollup.config.js +0 -75
- package/scripts/build-plugin.cjs +0 -121
- package/scripts/create-block.sh +0 -141
- package/scripts/create-wordpress-block-tests.cjs +0 -438
- package/scripts/create-wordpress-block.cjs +0 -681
- package/src/blocks/ad-container/block.json +0 -29
- package/src/blocks/ad-container/edit.js +0 -42
- package/src/blocks/ad-container/index.js +0 -10
- package/src/blocks/ad-container/render.php +0 -27
- package/src/blocks/ad-container/save.js +0 -16
- package/src/blocks/ad-container/style-editor.css +0 -4
- package/src/blocks/ad-container/style.css +0 -30
- package/src/blocks/button/block.json +0 -90
- package/src/blocks/button/edit.js +0 -187
- package/src/blocks/button/index.js +0 -11
- package/src/blocks/button/render.php +0 -71
- package/src/blocks/button/save.js +0 -52
- package/src/blocks/button/style-editor.css +0 -15
- package/src/blocks/button/style-resolved.css +0 -153
- package/src/blocks/button/style.css +0 -157
- package/src/blocks/chip/block.json +0 -58
- package/src/blocks/chip/edit.js +0 -113
- package/src/blocks/chip/index.js +0 -10
- package/src/blocks/chip/render.php +0 -40
- package/src/blocks/chip/save.js +0 -36
- package/src/blocks/chip/style-editor.css +0 -5
- package/src/blocks/chip/style.css +0 -87
- package/src/blocks/dialog-box/block.json +0 -24
- package/src/blocks/dialog-box/edit.js +0 -41
- package/src/blocks/dialog-box/index.js +0 -17
- package/src/blocks/dialog-box/render.php +0 -24
- package/src/blocks/dialog-box/save.js +0 -23
- package/src/blocks/dialog-box/style.css +0 -23
- package/src/blocks/divider/block.json +0 -32
- package/src/blocks/divider/edit.js +0 -42
- package/src/blocks/divider/index.js +0 -10
- package/src/blocks/divider/render.php +0 -31
- package/src/blocks/divider/save.js +0 -18
- package/src/blocks/divider/style-editor.css +0 -4
- package/src/blocks/divider/style.css +0 -37
- package/src/blocks/flag/block.json +0 -49
- package/src/blocks/flag/edit.js +0 -82
- package/src/blocks/flag/index.js +0 -10
- package/src/blocks/flag/render.php +0 -34
- package/src/blocks/flag/save.js +0 -25
- package/src/blocks/flag/style-editor.css +0 -5
- package/src/blocks/flag/style.css +0 -54
- package/src/blocks/icon/block.json +0 -24
- package/src/blocks/icon/edit.js +0 -41
- package/src/blocks/icon/index.js +0 -17
- package/src/blocks/icon/render.php +0 -24
- package/src/blocks/icon/save.js +0 -23
- package/src/blocks/icon/style.css +0 -23
- package/src/blocks/icon-button/block.json +0 -44
- package/src/blocks/icon-button/edit.js +0 -82
- package/src/blocks/icon-button/index.js +0 -10
- package/src/blocks/icon-button/render.php +0 -46
- package/src/blocks/icon-button/save.js +0 -29
- package/src/blocks/icon-button/style-editor.css +0 -5
- package/src/blocks/icon-button/style.css +0 -31
- package/src/blocks/input/block.json +0 -48
- package/src/blocks/input/edit.js +0 -78
- package/src/blocks/input/index.js +0 -10
- package/src/blocks/input/render.php +0 -39
- package/src/blocks/input/save.js +0 -27
- package/src/blocks/input/style-editor.css +0 -8
- package/src/blocks/input/style.css +0 -53
- package/src/blocks/input-helper-message/block.json +0 -24
- package/src/blocks/input-helper-message/edit.js +0 -42
- package/src/blocks/input-helper-message/index.js +0 -17
- package/src/blocks/input-helper-message/render.php +0 -24
- package/src/blocks/input-helper-message/save.js +0 -23
- package/src/blocks/input-helper-message/style.css +0 -23
- package/src/blocks/link/block.json +0 -72
- package/src/blocks/link/edit.js +0 -151
- package/src/blocks/link/index.js +0 -10
- package/src/blocks/link/render.php +0 -44
- package/src/blocks/link/save.js +0 -46
- package/src/blocks/link/style-editor.css +0 -5
- package/src/blocks/link/style.css +0 -119
- package/src/blocks/tab/block.json +0 -24
- package/src/blocks/tab/edit.js +0 -41
- package/src/blocks/tab/index.js +0 -17
- package/src/blocks/tab/render.php +0 -24
- package/src/blocks/tab/save.js +0 -23
- package/src/blocks/tab/style.css +0 -23
- package/src/blocks/tab-group/block.json +0 -24
- package/src/blocks/tab-group/edit.js +0 -41
- package/src/blocks/tab-group/index.js +0 -17
- package/src/blocks/tab-group/render.php +0 -24
- package/src/blocks/tab-group/save.js +0 -23
- package/src/blocks/tab-group/style.css +0 -23
- package/src/blocks/text/block.json +0 -33
- package/src/blocks/text/edit.js +0 -56
- package/src/blocks/text/index.js +0 -10
- package/src/blocks/text/render.php +0 -26
- package/src/blocks/text/save.js +0 -18
- package/src/blocks/text/style-editor.css +0 -4
- package/src/blocks/text/style.css +0 -7
- package/src/blocks/toast/block.json +0 -40
- package/src/blocks/toast/edit.js +0 -85
- package/src/blocks/toast/index.js +0 -10
- package/src/blocks/toast/render.php +0 -37
- package/src/blocks/toast/save.js +0 -29
- package/src/blocks/toast/style-editor.css +0 -4
- package/src/blocks/toast/style.css +0 -67
- package/src/index.js +0 -16
- package/src/utils/classBuilder.js +0 -53
- package/tsconfig.json +0 -116
- package/vitest.config.js +0 -28
- package/vitest.config.ts +0 -28
- package/vitest.setup.ts +0 -129
package/dist/index.js
CHANGED
|
@@ -92,7 +92,8 @@ function Edit(_ref) {
|
|
|
92
92
|
intent = attributes.intent,
|
|
93
93
|
size = attributes.size,
|
|
94
94
|
behaviour = attributes.behaviour,
|
|
95
|
-
|
|
95
|
+
isRounded = attributes.isRounded,
|
|
96
|
+
isLoading = attributes.isLoading,
|
|
96
97
|
disabled = attributes.disabled,
|
|
97
98
|
href = attributes.href,
|
|
98
99
|
target = attributes.target,
|
|
@@ -100,7 +101,9 @@ function Edit(_ref) {
|
|
|
100
101
|
type = attributes.type,
|
|
101
102
|
iconLeft = attributes.iconLeft,
|
|
102
103
|
iconRight = attributes.iconRight,
|
|
103
|
-
ariaLabel = attributes.ariaLabel
|
|
104
|
+
ariaLabel = attributes.ariaLabel,
|
|
105
|
+
classes = attributes.classes;
|
|
106
|
+
attributes.dataAttributes;
|
|
104
107
|
var blockProps = useBlockProps({
|
|
105
108
|
className: 'tds-button-wrapper'
|
|
106
109
|
});
|
|
@@ -108,7 +111,6 @@ function Edit(_ref) {
|
|
|
108
111
|
intent: intent,
|
|
109
112
|
size: size,
|
|
110
113
|
behaviour: behaviour,
|
|
111
|
-
state: state,
|
|
112
114
|
disabled: disabled
|
|
113
115
|
});
|
|
114
116
|
var Element = href ? 'a' : 'button';
|
|
@@ -186,33 +188,24 @@ function Edit(_ref) {
|
|
|
186
188
|
behaviour: value
|
|
187
189
|
});
|
|
188
190
|
}
|
|
189
|
-
}), /*#__PURE__*/React.createElement(
|
|
190
|
-
label: "
|
|
191
|
-
|
|
192
|
-
options: [{
|
|
193
|
-
label: 'Base',
|
|
194
|
-
value: 'base'
|
|
195
|
-
}, {
|
|
196
|
-
label: 'Hover',
|
|
197
|
-
value: 'hover'
|
|
198
|
-
}, {
|
|
199
|
-
label: 'Pressed',
|
|
200
|
-
value: 'pressed'
|
|
201
|
-
}, {
|
|
202
|
-
label: 'Loading',
|
|
203
|
-
value: 'loading'
|
|
204
|
-
}, {
|
|
205
|
-
label: 'Disabled',
|
|
206
|
-
value: 'disabled'
|
|
207
|
-
}, {
|
|
208
|
-
label: 'Focus',
|
|
209
|
-
value: 'focus'
|
|
210
|
-
}],
|
|
191
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
192
|
+
label: "Rounded Corners",
|
|
193
|
+
checked: isRounded,
|
|
211
194
|
onChange: function onChange(value) {
|
|
212
195
|
return setAttributes({
|
|
213
|
-
|
|
196
|
+
isRounded: value
|
|
214
197
|
});
|
|
215
|
-
}
|
|
198
|
+
},
|
|
199
|
+
help: "Apply rounded corner styling"
|
|
200
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
201
|
+
label: "Loading",
|
|
202
|
+
checked: isLoading,
|
|
203
|
+
onChange: function onChange(value) {
|
|
204
|
+
return setAttributes({
|
|
205
|
+
isLoading: value
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
help: "Show loading state with spinner"
|
|
216
209
|
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
217
210
|
label: "Disabled",
|
|
218
211
|
checked: disabled,
|
|
@@ -311,7 +304,26 @@ function Edit(_ref) {
|
|
|
311
304
|
});
|
|
312
305
|
},
|
|
313
306
|
placeholder: "Icon name"
|
|
314
|
-
}))
|
|
307
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
308
|
+
title: "Extensibility",
|
|
309
|
+
initialOpen: false
|
|
310
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
311
|
+
label: "Custom Classes",
|
|
312
|
+
value: classes,
|
|
313
|
+
onChange: function onChange(value) {
|
|
314
|
+
return setAttributes({
|
|
315
|
+
classes: value
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
placeholder: "class-name-1 class-name-2",
|
|
319
|
+
help: "Space-separated CSS classes added to the button element"
|
|
320
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
321
|
+
style: {
|
|
322
|
+
fontSize: '12px',
|
|
323
|
+
color: '#666',
|
|
324
|
+
marginTop: '8px'
|
|
325
|
+
}
|
|
326
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))));
|
|
315
327
|
}
|
|
316
328
|
|
|
317
329
|
function Save(_ref) {
|
|
@@ -408,18 +420,15 @@ var attributes$9 = {
|
|
|
408
420
|
"default": "hug",
|
|
409
421
|
description: "Controls the width behaviour"
|
|
410
422
|
},
|
|
411
|
-
|
|
412
|
-
type: "
|
|
413
|
-
"
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
],
|
|
421
|
-
"default": "base",
|
|
422
|
-
description: "The interaction state"
|
|
423
|
+
isRounded: {
|
|
424
|
+
type: "boolean",
|
|
425
|
+
"default": false,
|
|
426
|
+
description: "Applies rounded corner styling to the button"
|
|
427
|
+
},
|
|
428
|
+
isLoading: {
|
|
429
|
+
type: "boolean",
|
|
430
|
+
"default": false,
|
|
431
|
+
description: "Show loading state with spinner and disable interaction"
|
|
423
432
|
},
|
|
424
433
|
disabled: {
|
|
425
434
|
type: "boolean",
|
|
@@ -465,6 +474,17 @@ var attributes$9 = {
|
|
|
465
474
|
ariaLabel: {
|
|
466
475
|
type: "string",
|
|
467
476
|
description: "Accessible name for icon-only buttons"
|
|
477
|
+
},
|
|
478
|
+
classes: {
|
|
479
|
+
type: "string",
|
|
480
|
+
"default": "",
|
|
481
|
+
description: "Additional CSS classes applied to the rendered button/link element"
|
|
482
|
+
},
|
|
483
|
+
dataAttributes: {
|
|
484
|
+
type: "object",
|
|
485
|
+
"default": {
|
|
486
|
+
},
|
|
487
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
468
488
|
}
|
|
469
489
|
};
|
|
470
490
|
var editorScript = "file:./index.js";
|
|
@@ -522,6 +542,17 @@ var attributes$8 = {
|
|
|
522
542
|
padding: {
|
|
523
543
|
type: "boolean",
|
|
524
544
|
"default": false
|
|
545
|
+
},
|
|
546
|
+
classes: {
|
|
547
|
+
type: "string",
|
|
548
|
+
"default": "",
|
|
549
|
+
description: "Additional CSS classes applied to the rendered divider element"
|
|
550
|
+
},
|
|
551
|
+
dataAttributes: {
|
|
552
|
+
type: "object",
|
|
553
|
+
"default": {
|
|
554
|
+
},
|
|
555
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
525
556
|
}
|
|
526
557
|
};
|
|
527
558
|
var example$8 = {
|
|
@@ -545,7 +576,9 @@ var edit$8 = function edit(_ref) {
|
|
|
545
576
|
setAttributes = _ref.setAttributes;
|
|
546
577
|
var isDashed = attributes.isDashed,
|
|
547
578
|
isVertical = attributes.isVertical,
|
|
548
|
-
padding = attributes.padding
|
|
579
|
+
padding = attributes.padding,
|
|
580
|
+
classes = attributes.classes;
|
|
581
|
+
attributes.dataAttributes;
|
|
549
582
|
var blockProps = useBlockProps();
|
|
550
583
|
var buildDividerClass = function buildDividerClass() {
|
|
551
584
|
var classes = ['tds-divider'];
|
|
@@ -580,7 +613,26 @@ var edit$8 = function edit(_ref) {
|
|
|
580
613
|
padding: val
|
|
581
614
|
});
|
|
582
615
|
}
|
|
583
|
-
}))
|
|
616
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
617
|
+
title: "Extensibility",
|
|
618
|
+
initialOpen: false
|
|
619
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
620
|
+
label: "Custom Classes",
|
|
621
|
+
value: classes,
|
|
622
|
+
onChange: function onChange(val) {
|
|
623
|
+
return setAttributes({
|
|
624
|
+
classes: val
|
|
625
|
+
});
|
|
626
|
+
},
|
|
627
|
+
placeholder: "class-name-1 class-name-2",
|
|
628
|
+
help: "Space-separated CSS classes added to the divider element"
|
|
629
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
630
|
+
style: {
|
|
631
|
+
fontSize: '12px',
|
|
632
|
+
color: '#666',
|
|
633
|
+
marginTop: '8px'
|
|
634
|
+
}
|
|
635
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
584
636
|
className: buildDividerClass()
|
|
585
637
|
})));
|
|
586
638
|
};
|
|
@@ -644,6 +696,17 @@ var attributes$7 = {
|
|
|
644
696
|
content: {
|
|
645
697
|
type: "string",
|
|
646
698
|
"default": ""
|
|
699
|
+
},
|
|
700
|
+
classes: {
|
|
701
|
+
type: "string",
|
|
702
|
+
"default": "",
|
|
703
|
+
description: "Additional CSS classes applied to the rendered text element"
|
|
704
|
+
},
|
|
705
|
+
dataAttributes: {
|
|
706
|
+
type: "object",
|
|
707
|
+
"default": {
|
|
708
|
+
},
|
|
709
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
647
710
|
}
|
|
648
711
|
};
|
|
649
712
|
var example$7 = {
|
|
@@ -667,7 +730,9 @@ var edit$7 = function edit(_ref) {
|
|
|
667
730
|
setAttributes = _ref.setAttributes;
|
|
668
731
|
var as = attributes.as,
|
|
669
732
|
typographyStyle = attributes.typographyStyle,
|
|
670
|
-
content = attributes.content
|
|
733
|
+
content = attributes.content,
|
|
734
|
+
classes = attributes.classes;
|
|
735
|
+
attributes.dataAttributes;
|
|
671
736
|
var blockProps = useBlockProps();
|
|
672
737
|
var tagName = as || 'p';
|
|
673
738
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
@@ -720,7 +785,26 @@ var edit$7 = function edit(_ref) {
|
|
|
720
785
|
typographyStyle: val
|
|
721
786
|
});
|
|
722
787
|
}
|
|
723
|
-
}))
|
|
788
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
789
|
+
title: "Extensibility",
|
|
790
|
+
initialOpen: false
|
|
791
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
792
|
+
label: "Custom Classes",
|
|
793
|
+
value: classes,
|
|
794
|
+
onChange: function onChange(val) {
|
|
795
|
+
return setAttributes({
|
|
796
|
+
classes: val
|
|
797
|
+
});
|
|
798
|
+
},
|
|
799
|
+
placeholder: "class-name-1 class-name-2",
|
|
800
|
+
help: "Space-separated CSS classes added to the text element"
|
|
801
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
802
|
+
style: {
|
|
803
|
+
fontSize: '12px',
|
|
804
|
+
color: '#666',
|
|
805
|
+
marginTop: '8px'
|
|
806
|
+
}
|
|
807
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement(RichText, _extends({}, blockProps, {
|
|
724
808
|
tagName: tagName,
|
|
725
809
|
value: content,
|
|
726
810
|
onChange: function onChange(val) {
|
|
@@ -802,6 +886,17 @@ var attributes$6 = {
|
|
|
802
886
|
id: {
|
|
803
887
|
type: "string",
|
|
804
888
|
"default": ""
|
|
889
|
+
},
|
|
890
|
+
classes: {
|
|
891
|
+
type: "string",
|
|
892
|
+
"default": "",
|
|
893
|
+
description: "Additional CSS classes applied to the rendered input element"
|
|
894
|
+
},
|
|
895
|
+
dataAttributes: {
|
|
896
|
+
type: "object",
|
|
897
|
+
"default": {
|
|
898
|
+
},
|
|
899
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
805
900
|
}
|
|
806
901
|
};
|
|
807
902
|
var example$6 = {
|
|
@@ -829,7 +924,9 @@ var edit$6 = function edit(_ref) {
|
|
|
829
924
|
disabled = attributes.disabled,
|
|
830
925
|
required = attributes.required,
|
|
831
926
|
name = attributes.name,
|
|
832
|
-
id = attributes.id
|
|
927
|
+
id = attributes.id,
|
|
928
|
+
classes = attributes.classes;
|
|
929
|
+
attributes.dataAttributes;
|
|
833
930
|
var blockProps = useBlockProps();
|
|
834
931
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
835
932
|
title: "Input Settings"
|
|
@@ -908,7 +1005,26 @@ var edit$6 = function edit(_ref) {
|
|
|
908
1005
|
disabled: val
|
|
909
1006
|
});
|
|
910
1007
|
}
|
|
911
|
-
}))
|
|
1008
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
1009
|
+
title: "Extensibility",
|
|
1010
|
+
initialOpen: false
|
|
1011
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1012
|
+
label: "Custom Classes",
|
|
1013
|
+
value: classes,
|
|
1014
|
+
onChange: function onChange(val) {
|
|
1015
|
+
return setAttributes({
|
|
1016
|
+
classes: val
|
|
1017
|
+
});
|
|
1018
|
+
},
|
|
1019
|
+
placeholder: "class-name-1 class-name-2",
|
|
1020
|
+
help: "Space-separated CSS classes added to the input element"
|
|
1021
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
1022
|
+
style: {
|
|
1023
|
+
fontSize: '12px',
|
|
1024
|
+
color: '#666',
|
|
1025
|
+
marginTop: '8px'
|
|
1026
|
+
}
|
|
1027
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("div", blockProps, label && /*#__PURE__*/React.createElement("label", {
|
|
912
1028
|
className: "tds-input__label"
|
|
913
1029
|
}, label), /*#__PURE__*/React.createElement("input", {
|
|
914
1030
|
type: type,
|
|
@@ -973,6 +1089,11 @@ var attributes$5 = {
|
|
|
973
1089
|
type: "boolean",
|
|
974
1090
|
"default": false
|
|
975
1091
|
},
|
|
1092
|
+
isLoading: {
|
|
1093
|
+
type: "boolean",
|
|
1094
|
+
"default": false,
|
|
1095
|
+
description: "Show loading state with spinner and disable interaction"
|
|
1096
|
+
},
|
|
976
1097
|
href: {
|
|
977
1098
|
type: "string",
|
|
978
1099
|
"default": ""
|
|
@@ -994,6 +1115,17 @@ var attributes$5 = {
|
|
|
994
1115
|
ariaLabel: {
|
|
995
1116
|
type: "string",
|
|
996
1117
|
"default": ""
|
|
1118
|
+
},
|
|
1119
|
+
classes: {
|
|
1120
|
+
type: "string",
|
|
1121
|
+
"default": "",
|
|
1122
|
+
description: "Additional CSS classes applied to the rendered button/link element"
|
|
1123
|
+
},
|
|
1124
|
+
dataAttributes: {
|
|
1125
|
+
type: "object",
|
|
1126
|
+
"default": {
|
|
1127
|
+
},
|
|
1128
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
997
1129
|
}
|
|
998
1130
|
};
|
|
999
1131
|
var example$5 = {
|
|
@@ -1017,10 +1149,13 @@ var edit$5 = function edit(_ref) {
|
|
|
1017
1149
|
setAttributes = _ref.setAttributes;
|
|
1018
1150
|
var iconName = attributes.iconName,
|
|
1019
1151
|
round = attributes.round,
|
|
1152
|
+
isLoading = attributes.isLoading,
|
|
1020
1153
|
href = attributes.href,
|
|
1021
1154
|
target = attributes.target,
|
|
1022
1155
|
rel = attributes.rel,
|
|
1023
|
-
ariaLabel = attributes.ariaLabel
|
|
1156
|
+
ariaLabel = attributes.ariaLabel,
|
|
1157
|
+
classes = attributes.classes;
|
|
1158
|
+
attributes.dataAttributes;
|
|
1024
1159
|
var blockProps = useBlockProps();
|
|
1025
1160
|
var buildClass = function buildClass() {
|
|
1026
1161
|
var classes = ['tds-icon-button'];
|
|
@@ -1047,6 +1182,15 @@ var edit$5 = function edit(_ref) {
|
|
|
1047
1182
|
round: val
|
|
1048
1183
|
});
|
|
1049
1184
|
}
|
|
1185
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
1186
|
+
label: "Loading",
|
|
1187
|
+
checked: isLoading,
|
|
1188
|
+
onChange: function onChange(val) {
|
|
1189
|
+
return setAttributes({
|
|
1190
|
+
isLoading: val
|
|
1191
|
+
});
|
|
1192
|
+
},
|
|
1193
|
+
help: "Show loading state with spinner"
|
|
1050
1194
|
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1051
1195
|
label: "URL (Leave empty for button)",
|
|
1052
1196
|
value: href,
|
|
@@ -1092,7 +1236,26 @@ var edit$5 = function edit(_ref) {
|
|
|
1092
1236
|
ariaLabel: val
|
|
1093
1237
|
});
|
|
1094
1238
|
}
|
|
1095
|
-
}))
|
|
1239
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
1240
|
+
title: "Extensibility",
|
|
1241
|
+
initialOpen: false
|
|
1242
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1243
|
+
label: "Custom Classes",
|
|
1244
|
+
value: classes,
|
|
1245
|
+
onChange: function onChange(val) {
|
|
1246
|
+
return setAttributes({
|
|
1247
|
+
classes: val
|
|
1248
|
+
});
|
|
1249
|
+
},
|
|
1250
|
+
placeholder: "class-name-1 class-name-2",
|
|
1251
|
+
help: "Space-separated CSS classes added to the button/link element"
|
|
1252
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
1253
|
+
style: {
|
|
1254
|
+
fontSize: '12px',
|
|
1255
|
+
color: '#666',
|
|
1256
|
+
marginTop: '8px'
|
|
1257
|
+
}
|
|
1258
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement(Element, _extends({}, blockProps, {
|
|
1096
1259
|
className: buildClass(),
|
|
1097
1260
|
href: href || undefined,
|
|
1098
1261
|
target: href ? target : undefined,
|
|
@@ -1158,8 +1321,7 @@ var attributes$4 = {
|
|
|
1158
1321
|
"default": "secondary",
|
|
1159
1322
|
"enum": [
|
|
1160
1323
|
"primary",
|
|
1161
|
-
"secondary"
|
|
1162
|
-
"negative"
|
|
1324
|
+
"secondary"
|
|
1163
1325
|
]
|
|
1164
1326
|
},
|
|
1165
1327
|
size: {
|
|
@@ -1167,20 +1329,9 @@ var attributes$4 = {
|
|
|
1167
1329
|
"default": "medium",
|
|
1168
1330
|
"enum": [
|
|
1169
1331
|
"small",
|
|
1170
|
-
"medium",
|
|
1171
1332
|
"large"
|
|
1172
1333
|
]
|
|
1173
1334
|
},
|
|
1174
|
-
state: {
|
|
1175
|
-
type: "string",
|
|
1176
|
-
"default": "base",
|
|
1177
|
-
"enum": [
|
|
1178
|
-
"base",
|
|
1179
|
-
"hover",
|
|
1180
|
-
"pressed",
|
|
1181
|
-
"disabled"
|
|
1182
|
-
]
|
|
1183
|
-
},
|
|
1184
1335
|
channel: {
|
|
1185
1336
|
type: "boolean",
|
|
1186
1337
|
"default": false
|
|
@@ -1200,6 +1351,17 @@ var attributes$4 = {
|
|
|
1200
1351
|
ariaLabel: {
|
|
1201
1352
|
type: "string",
|
|
1202
1353
|
"default": ""
|
|
1354
|
+
},
|
|
1355
|
+
classes: {
|
|
1356
|
+
type: "string",
|
|
1357
|
+
"default": "",
|
|
1358
|
+
description: "Additional CSS classes applied to the rendered chip element"
|
|
1359
|
+
},
|
|
1360
|
+
dataAttributes: {
|
|
1361
|
+
type: "object",
|
|
1362
|
+
"default": {
|
|
1363
|
+
},
|
|
1364
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
1203
1365
|
}
|
|
1204
1366
|
};
|
|
1205
1367
|
var example$4 = {
|
|
@@ -1224,18 +1386,18 @@ var edit$4 = function edit(_ref) {
|
|
|
1224
1386
|
var content = attributes.content,
|
|
1225
1387
|
intent = attributes.intent,
|
|
1226
1388
|
size = attributes.size,
|
|
1227
|
-
state = attributes.state,
|
|
1228
1389
|
channel = attributes.channel,
|
|
1229
1390
|
toggle = attributes.toggle,
|
|
1230
1391
|
iconLeft = attributes.iconLeft,
|
|
1231
1392
|
iconRight = attributes.iconRight,
|
|
1232
|
-
ariaLabel = attributes.ariaLabel
|
|
1393
|
+
ariaLabel = attributes.ariaLabel,
|
|
1394
|
+
classes = attributes.classes;
|
|
1395
|
+
attributes.dataAttributes;
|
|
1233
1396
|
var blockProps = useBlockProps();
|
|
1234
1397
|
var buildClass = function buildClass() {
|
|
1235
1398
|
var classes = ['tds-chip'];
|
|
1236
1399
|
classes.push("tds-chip--intent-".concat(intent));
|
|
1237
1400
|
classes.push("tds-chip--size-".concat(size));
|
|
1238
|
-
classes.push("tds-chip--state-".concat(state));
|
|
1239
1401
|
if (channel) classes.push('tds-chip--channel');
|
|
1240
1402
|
if (toggle) classes.push('tds-chip--toggle');
|
|
1241
1403
|
return classes.join(' ');
|
|
@@ -1251,9 +1413,6 @@ var edit$4 = function edit(_ref) {
|
|
|
1251
1413
|
}, {
|
|
1252
1414
|
label: 'Secondary',
|
|
1253
1415
|
value: 'secondary'
|
|
1254
|
-
}, {
|
|
1255
|
-
label: 'Negative',
|
|
1256
|
-
value: 'negative'
|
|
1257
1416
|
}],
|
|
1258
1417
|
onChange: function onChange(val) {
|
|
1259
1418
|
return setAttributes({
|
|
@@ -1266,9 +1425,6 @@ var edit$4 = function edit(_ref) {
|
|
|
1266
1425
|
options: [{
|
|
1267
1426
|
label: 'Small',
|
|
1268
1427
|
value: 'small'
|
|
1269
|
-
}, {
|
|
1270
|
-
label: 'Medium',
|
|
1271
|
-
value: 'medium'
|
|
1272
1428
|
}, {
|
|
1273
1429
|
label: 'Large',
|
|
1274
1430
|
value: 'large'
|
|
@@ -1278,27 +1434,6 @@ var edit$4 = function edit(_ref) {
|
|
|
1278
1434
|
size: val
|
|
1279
1435
|
});
|
|
1280
1436
|
}
|
|
1281
|
-
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1282
|
-
label: "State",
|
|
1283
|
-
value: state,
|
|
1284
|
-
options: [{
|
|
1285
|
-
label: 'Base',
|
|
1286
|
-
value: 'base'
|
|
1287
|
-
}, {
|
|
1288
|
-
label: 'Hover',
|
|
1289
|
-
value: 'hover'
|
|
1290
|
-
}, {
|
|
1291
|
-
label: 'Pressed',
|
|
1292
|
-
value: 'pressed'
|
|
1293
|
-
}, {
|
|
1294
|
-
label: 'Disabled',
|
|
1295
|
-
value: 'disabled'
|
|
1296
|
-
}],
|
|
1297
|
-
onChange: function onChange(val) {
|
|
1298
|
-
return setAttributes({
|
|
1299
|
-
state: val
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
1437
|
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
1303
1438
|
label: "Channel",
|
|
1304
1439
|
checked: channel,
|
|
@@ -1339,7 +1474,26 @@ var edit$4 = function edit(_ref) {
|
|
|
1339
1474
|
ariaLabel: val
|
|
1340
1475
|
});
|
|
1341
1476
|
}
|
|
1342
|
-
}))
|
|
1477
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
1478
|
+
title: "Extensibility",
|
|
1479
|
+
initialOpen: false
|
|
1480
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1481
|
+
label: "Custom Classes",
|
|
1482
|
+
value: classes,
|
|
1483
|
+
onChange: function onChange(val) {
|
|
1484
|
+
return setAttributes({
|
|
1485
|
+
classes: val
|
|
1486
|
+
});
|
|
1487
|
+
},
|
|
1488
|
+
placeholder: "class-name-1 class-name-2",
|
|
1489
|
+
help: "Space-separated CSS classes added to the chip element"
|
|
1490
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
1491
|
+
style: {
|
|
1492
|
+
fontSize: '12px',
|
|
1493
|
+
color: '#666',
|
|
1494
|
+
marginTop: '8px'
|
|
1495
|
+
}
|
|
1496
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("button", _extends({}, blockProps, {
|
|
1343
1497
|
className: buildClass(),
|
|
1344
1498
|
"aria-label": ariaLabel
|
|
1345
1499
|
}), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
@@ -1450,6 +1604,17 @@ var attributes$3 = {
|
|
|
1450
1604
|
ariaLabel: {
|
|
1451
1605
|
type: "string",
|
|
1452
1606
|
"default": ""
|
|
1607
|
+
},
|
|
1608
|
+
classes: {
|
|
1609
|
+
type: "string",
|
|
1610
|
+
"default": "",
|
|
1611
|
+
description: "Additional CSS classes applied to the rendered flag element"
|
|
1612
|
+
},
|
|
1613
|
+
dataAttributes: {
|
|
1614
|
+
type: "object",
|
|
1615
|
+
"default": {
|
|
1616
|
+
},
|
|
1617
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
1453
1618
|
}
|
|
1454
1619
|
};
|
|
1455
1620
|
var example$3 = {
|
|
@@ -1477,7 +1642,9 @@ var edit$3 = function edit(_ref) {
|
|
|
1477
1642
|
size = attributes.size,
|
|
1478
1643
|
iconLeft = attributes.iconLeft,
|
|
1479
1644
|
iconRight = attributes.iconRight,
|
|
1480
|
-
ariaLabel = attributes.ariaLabel
|
|
1645
|
+
ariaLabel = attributes.ariaLabel,
|
|
1646
|
+
classes = attributes.classes;
|
|
1647
|
+
attributes.dataAttributes;
|
|
1481
1648
|
var blockProps = useBlockProps();
|
|
1482
1649
|
var buildClass = function buildClass() {
|
|
1483
1650
|
var classes = ['tds-flag'];
|
|
@@ -1558,7 +1725,26 @@ var edit$3 = function edit(_ref) {
|
|
|
1558
1725
|
ariaLabel: val
|
|
1559
1726
|
});
|
|
1560
1727
|
}
|
|
1561
|
-
}))
|
|
1728
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
1729
|
+
title: "Extensibility",
|
|
1730
|
+
initialOpen: false
|
|
1731
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1732
|
+
label: "Custom Classes",
|
|
1733
|
+
value: classes,
|
|
1734
|
+
onChange: function onChange(val) {
|
|
1735
|
+
return setAttributes({
|
|
1736
|
+
classes: val
|
|
1737
|
+
});
|
|
1738
|
+
},
|
|
1739
|
+
placeholder: "class-name-1 class-name-2",
|
|
1740
|
+
help: "Space-separated CSS classes added to the flag element"
|
|
1741
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
1742
|
+
style: {
|
|
1743
|
+
fontSize: '12px',
|
|
1744
|
+
color: '#666',
|
|
1745
|
+
marginTop: '8px'
|
|
1746
|
+
}
|
|
1747
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1562
1748
|
className: buildClass(),
|
|
1563
1749
|
"aria-label": ariaLabel
|
|
1564
1750
|
}), label && /*#__PURE__*/React.createElement("div", {
|
|
@@ -1655,6 +1841,17 @@ var attributes$2 = {
|
|
|
1655
1841
|
timeout: {
|
|
1656
1842
|
type: "number",
|
|
1657
1843
|
"default": 5000
|
|
1844
|
+
},
|
|
1845
|
+
classes: {
|
|
1846
|
+
type: "string",
|
|
1847
|
+
"default": "",
|
|
1848
|
+
description: "Additional CSS classes applied to the rendered toast element"
|
|
1849
|
+
},
|
|
1850
|
+
dataAttributes: {
|
|
1851
|
+
type: "object",
|
|
1852
|
+
"default": {
|
|
1853
|
+
},
|
|
1854
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
1658
1855
|
}
|
|
1659
1856
|
};
|
|
1660
1857
|
var example$2 = {
|
|
@@ -1680,7 +1877,9 @@ var edit$2 = function edit(_ref) {
|
|
|
1680
1877
|
intent = attributes.intent,
|
|
1681
1878
|
link = attributes.link,
|
|
1682
1879
|
linkLabel = attributes.linkLabel,
|
|
1683
|
-
timeout = attributes.timeout
|
|
1880
|
+
timeout = attributes.timeout,
|
|
1881
|
+
classes = attributes.classes;
|
|
1882
|
+
attributes.dataAttributes;
|
|
1684
1883
|
var blockProps = useBlockProps();
|
|
1685
1884
|
var buildClass = function buildClass() {
|
|
1686
1885
|
var classes = ['tds-toast'];
|
|
@@ -1744,7 +1943,26 @@ var edit$2 = function edit(_ref) {
|
|
|
1744
1943
|
},
|
|
1745
1944
|
min: 0,
|
|
1746
1945
|
step: 1000
|
|
1747
|
-
}))
|
|
1946
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
1947
|
+
title: "Extensibility",
|
|
1948
|
+
initialOpen: false
|
|
1949
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1950
|
+
label: "Custom Classes",
|
|
1951
|
+
value: classes,
|
|
1952
|
+
onChange: function onChange(val) {
|
|
1953
|
+
return setAttributes({
|
|
1954
|
+
classes: val
|
|
1955
|
+
});
|
|
1956
|
+
},
|
|
1957
|
+
placeholder: "class-name-1 class-name-2",
|
|
1958
|
+
help: "Space-separated CSS classes added to the toast element"
|
|
1959
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
1960
|
+
style: {
|
|
1961
|
+
fontSize: '12px',
|
|
1962
|
+
color: '#666',
|
|
1963
|
+
marginTop: '8px'
|
|
1964
|
+
}
|
|
1965
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1748
1966
|
className: buildClass(),
|
|
1749
1967
|
role: "status",
|
|
1750
1968
|
"aria-live": "polite"
|
|
@@ -1831,11 +2049,10 @@ var attributes$1 = {
|
|
|
1831
2049
|
},
|
|
1832
2050
|
sentiment: {
|
|
1833
2051
|
type: "string",
|
|
1834
|
-
"default": "
|
|
2052
|
+
"default": "brand",
|
|
1835
2053
|
"enum": [
|
|
1836
|
-
"
|
|
1837
|
-
"
|
|
1838
|
-
"negative"
|
|
2054
|
+
"brand",
|
|
2055
|
+
"utility"
|
|
1839
2056
|
]
|
|
1840
2057
|
},
|
|
1841
2058
|
size: {
|
|
@@ -1847,17 +2064,6 @@ var attributes$1 = {
|
|
|
1847
2064
|
"large"
|
|
1848
2065
|
]
|
|
1849
2066
|
},
|
|
1850
|
-
state: {
|
|
1851
|
-
type: "string",
|
|
1852
|
-
"default": "base",
|
|
1853
|
-
"enum": [
|
|
1854
|
-
"base",
|
|
1855
|
-
"hover",
|
|
1856
|
-
"visited",
|
|
1857
|
-
"focus",
|
|
1858
|
-
"disabled"
|
|
1859
|
-
]
|
|
1860
|
-
},
|
|
1861
2067
|
iconLeft: {
|
|
1862
2068
|
type: "string",
|
|
1863
2069
|
"default": ""
|
|
@@ -1887,6 +2093,17 @@ var attributes$1 = {
|
|
|
1887
2093
|
rel: {
|
|
1888
2094
|
type: "string",
|
|
1889
2095
|
"default": ""
|
|
2096
|
+
},
|
|
2097
|
+
classes: {
|
|
2098
|
+
type: "string",
|
|
2099
|
+
"default": "",
|
|
2100
|
+
description: "Additional CSS classes applied to the rendered link element"
|
|
2101
|
+
},
|
|
2102
|
+
dataAttributes: {
|
|
2103
|
+
type: "object",
|
|
2104
|
+
"default": {
|
|
2105
|
+
},
|
|
2106
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
1890
2107
|
}
|
|
1891
2108
|
};
|
|
1892
2109
|
var example$1 = {
|
|
@@ -1913,20 +2130,20 @@ var edit$1 = function edit(_ref) {
|
|
|
1913
2130
|
intent = attributes.intent,
|
|
1914
2131
|
sentiment = attributes.sentiment,
|
|
1915
2132
|
size = attributes.size,
|
|
1916
|
-
state = attributes.state,
|
|
1917
2133
|
iconLeft = attributes.iconLeft,
|
|
1918
2134
|
iconRight = attributes.iconRight,
|
|
1919
2135
|
inline = attributes.inline,
|
|
1920
2136
|
ariaLabel = attributes.ariaLabel,
|
|
1921
2137
|
target = attributes.target,
|
|
1922
|
-
rel = attributes.rel
|
|
2138
|
+
rel = attributes.rel,
|
|
2139
|
+
classes = attributes.classes;
|
|
2140
|
+
attributes.dataAttributes;
|
|
1923
2141
|
var blockProps = useBlockProps();
|
|
1924
2142
|
var buildClass = function buildClass() {
|
|
1925
2143
|
var classes = ['tds-link'];
|
|
1926
2144
|
classes.push("tds-link--intent-".concat(intent));
|
|
1927
2145
|
classes.push("tds-link--sentiment-".concat(sentiment));
|
|
1928
2146
|
classes.push("tds-link--size-".concat(size));
|
|
1929
|
-
classes.push("tds-link--state-".concat(state));
|
|
1930
2147
|
if (!inline) classes.push('tds-link--block');
|
|
1931
2148
|
return classes.join(' ');
|
|
1932
2149
|
};
|
|
@@ -1963,14 +2180,11 @@ var edit$1 = function edit(_ref) {
|
|
|
1963
2180
|
label: "Sentiment",
|
|
1964
2181
|
value: sentiment,
|
|
1965
2182
|
options: [{
|
|
1966
|
-
label: '
|
|
1967
|
-
value: '
|
|
2183
|
+
label: 'Brand',
|
|
2184
|
+
value: 'brand'
|
|
1968
2185
|
}, {
|
|
1969
|
-
label: '
|
|
1970
|
-
value: '
|
|
1971
|
-
}, {
|
|
1972
|
-
label: 'Negative',
|
|
1973
|
-
value: 'negative'
|
|
2186
|
+
label: 'Utility',
|
|
2187
|
+
value: 'utility'
|
|
1974
2188
|
}],
|
|
1975
2189
|
onChange: function onChange(val) {
|
|
1976
2190
|
return setAttributes({
|
|
@@ -1996,30 +2210,6 @@ var edit$1 = function edit(_ref) {
|
|
|
1996
2210
|
});
|
|
1997
2211
|
}
|
|
1998
2212
|
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1999
|
-
label: "State",
|
|
2000
|
-
value: state,
|
|
2001
|
-
options: [{
|
|
2002
|
-
label: 'Base',
|
|
2003
|
-
value: 'base'
|
|
2004
|
-
}, {
|
|
2005
|
-
label: 'Hover',
|
|
2006
|
-
value: 'hover'
|
|
2007
|
-
}, {
|
|
2008
|
-
label: 'Visited',
|
|
2009
|
-
value: 'visited'
|
|
2010
|
-
}, {
|
|
2011
|
-
label: 'Focus',
|
|
2012
|
-
value: 'focus'
|
|
2013
|
-
}, {
|
|
2014
|
-
label: 'Disabled',
|
|
2015
|
-
value: 'disabled'
|
|
2016
|
-
}],
|
|
2017
|
-
onChange: function onChange(val) {
|
|
2018
|
-
return setAttributes({
|
|
2019
|
-
state: val
|
|
2020
|
-
});
|
|
2021
|
-
}
|
|
2022
|
-
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
2023
2213
|
label: "Left Icon",
|
|
2024
2214
|
value: iconLeft,
|
|
2025
2215
|
onChange: function onChange(val) {
|
|
@@ -2080,7 +2270,26 @@ var edit$1 = function edit(_ref) {
|
|
|
2080
2270
|
ariaLabel: val
|
|
2081
2271
|
});
|
|
2082
2272
|
}
|
|
2083
|
-
}))
|
|
2273
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
2274
|
+
title: "Extensibility",
|
|
2275
|
+
initialOpen: false
|
|
2276
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
2277
|
+
label: "Custom Classes",
|
|
2278
|
+
value: classes,
|
|
2279
|
+
onChange: function onChange(val) {
|
|
2280
|
+
return setAttributes({
|
|
2281
|
+
classes: val
|
|
2282
|
+
});
|
|
2283
|
+
},
|
|
2284
|
+
placeholder: "class-name-1 class-name-2",
|
|
2285
|
+
help: "Space-separated CSS classes added to the link element"
|
|
2286
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
2287
|
+
style: {
|
|
2288
|
+
fontSize: '12px',
|
|
2289
|
+
color: '#666',
|
|
2290
|
+
marginTop: '8px'
|
|
2291
|
+
}
|
|
2292
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("a", _extends({}, blockProps, {
|
|
2084
2293
|
href: href || '#',
|
|
2085
2294
|
className: buildClass(),
|
|
2086
2295
|
"aria-label": ariaLabel,
|
|
@@ -2174,6 +2383,17 @@ var attributes = {
|
|
|
2174
2383
|
slotID: {
|
|
2175
2384
|
type: "string",
|
|
2176
2385
|
"default": ""
|
|
2386
|
+
},
|
|
2387
|
+
classes: {
|
|
2388
|
+
type: "string",
|
|
2389
|
+
"default": "",
|
|
2390
|
+
description: "Additional CSS classes applied to the rendered ad container element"
|
|
2391
|
+
},
|
|
2392
|
+
dataAttributes: {
|
|
2393
|
+
type: "object",
|
|
2394
|
+
"default": {
|
|
2395
|
+
},
|
|
2396
|
+
description: "Custom data-* attributes for extensibility (allowlisted server-side)"
|
|
2177
2397
|
}
|
|
2178
2398
|
};
|
|
2179
2399
|
var example = {
|
|
@@ -2196,7 +2416,9 @@ var edit = function edit(_ref) {
|
|
|
2196
2416
|
var attributes = _ref.attributes,
|
|
2197
2417
|
setAttributes = _ref.setAttributes;
|
|
2198
2418
|
var type = attributes.type,
|
|
2199
|
-
slotID = attributes.slotID
|
|
2419
|
+
slotID = attributes.slotID,
|
|
2420
|
+
classes = attributes.classes;
|
|
2421
|
+
attributes.dataAttributes;
|
|
2200
2422
|
var blockProps = useBlockProps();
|
|
2201
2423
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
2202
2424
|
title: "Ad Container Settings"
|
|
@@ -2224,7 +2446,26 @@ var edit = function edit(_ref) {
|
|
|
2224
2446
|
});
|
|
2225
2447
|
},
|
|
2226
2448
|
placeholder: "e.g., /123456789/section/article-top"
|
|
2227
|
-
}))
|
|
2449
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
2450
|
+
title: "Extensibility",
|
|
2451
|
+
initialOpen: false
|
|
2452
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
2453
|
+
label: "Custom Classes",
|
|
2454
|
+
value: classes,
|
|
2455
|
+
onChange: function onChange(val) {
|
|
2456
|
+
return setAttributes({
|
|
2457
|
+
classes: val
|
|
2458
|
+
});
|
|
2459
|
+
},
|
|
2460
|
+
placeholder: "class-name-1 class-name-2",
|
|
2461
|
+
help: "Space-separated CSS classes added to the ad-container element"
|
|
2462
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
2463
|
+
style: {
|
|
2464
|
+
fontSize: '12px',
|
|
2465
|
+
color: '#666',
|
|
2466
|
+
marginTop: '8px'
|
|
2467
|
+
}
|
|
2468
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Data Attributes:"), " Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
2228
2469
|
className: "tds-ad-container tds-ad-container--".concat(type),
|
|
2229
2470
|
"data-slot-id": slotID
|
|
2230
2471
|
}), /*#__PURE__*/React.createElement("div", {
|