@times-design-system/components-wordpress 0.4.0 → 0.7.2-alpha.2
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/BLOCK_CREATION_CHECKLIST.md +160 -0
- package/BUILD.md +411 -0
- package/CHANGELOG.md +22 -0
- package/LICENSE +29 -0
- package/README.md +972 -5
- package/TRANSFORMATION_GUIDE.md +635 -0
- package/block.json +10 -0
- package/dist/block.json +10 -0
- package/dist/blocks/ad-container/block.json +28 -0
- package/dist/blocks/ad-container/edit.js +42 -0
- package/dist/blocks/ad-container/index.js +10 -0
- package/dist/blocks/ad-container/save.js +16 -0
- package/dist/blocks/ad-container/style-editor.css +4 -0
- package/dist/blocks/ad-container/style.css +27 -0
- package/dist/blocks/button/block.json +89 -0
- package/dist/blocks/button/edit.js +187 -0
- package/dist/blocks/button/index.js +11 -0
- package/dist/blocks/button/save.js +52 -0
- package/dist/blocks/button/style-editor.css +15 -0
- package/dist/blocks/button/style.css +37 -0
- package/dist/blocks/chip/block.json +57 -0
- package/dist/blocks/chip/edit.js +113 -0
- package/dist/blocks/chip/index.js +10 -0
- package/dist/blocks/chip/save.js +36 -0
- package/dist/blocks/chip/style-editor.css +5 -0
- package/dist/blocks/chip/style.css +48 -0
- package/dist/blocks/divider/block.json +31 -0
- package/dist/blocks/divider/edit.js +42 -0
- package/dist/blocks/divider/index.js +10 -0
- package/dist/blocks/divider/save.js +18 -0
- package/dist/blocks/divider/style-editor.css +4 -0
- package/dist/blocks/divider/style.css +25 -0
- package/dist/blocks/flag/block.json +48 -0
- package/dist/blocks/flag/edit.js +82 -0
- package/dist/blocks/flag/index.js +10 -0
- package/dist/blocks/flag/save.js +25 -0
- package/dist/blocks/flag/style-editor.css +5 -0
- package/dist/blocks/flag/style.css +45 -0
- package/dist/blocks/icon-button/block.json +43 -0
- package/dist/blocks/icon-button/edit.js +82 -0
- package/dist/blocks/icon-button/index.js +10 -0
- package/dist/blocks/icon-button/save.js +29 -0
- package/dist/blocks/icon-button/style-editor.css +5 -0
- package/dist/blocks/icon-button/style.css +32 -0
- package/dist/blocks/input/block.json +47 -0
- package/dist/blocks/input/edit.js +78 -0
- package/dist/blocks/input/index.js +10 -0
- package/dist/blocks/input/save.js +27 -0
- package/dist/blocks/input/style-editor.css +8 -0
- package/dist/blocks/input/style.css +30 -0
- package/dist/blocks/link/block.json +71 -0
- package/dist/blocks/link/edit.js +151 -0
- package/dist/blocks/link/index.js +10 -0
- package/dist/blocks/link/save.js +46 -0
- package/dist/blocks/link/style-editor.css +5 -0
- package/dist/blocks/link/style.css +66 -0
- package/dist/blocks/text/block.json +32 -0
- package/dist/blocks/text/edit.js +56 -0
- package/dist/blocks/text/index.js +10 -0
- package/dist/blocks/text/save.js +18 -0
- package/dist/blocks/text/style-editor.css +4 -0
- package/dist/blocks/text/style.css +20 -0
- package/dist/blocks/toast/block.json +39 -0
- package/dist/blocks/toast/edit.js +85 -0
- package/dist/blocks/toast/index.js +10 -0
- package/dist/blocks/toast/save.js +29 -0
- package/dist/blocks/toast/style-editor.css +4 -0
- package/dist/blocks/toast/style.css +51 -0
- package/dist/index.cjs +2232 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +2196 -255
- package/dist/index.js.map +1 -1
- package/dist/plugin.php +79 -0
- package/dist/utils/classBuilder.js +53 -0
- package/package.json +39 -7
- package/plugin.php +79 -0
- package/rollup.config.js +39 -22
- package/scripts/build-plugin.cjs +121 -0
- package/scripts/create-block.sh +141 -0
- package/src/blocks/ad-container/block.json +28 -0
- package/src/blocks/ad-container/edit.js +42 -0
- package/src/blocks/ad-container/index.js +10 -0
- package/src/blocks/ad-container/save.js +16 -0
- package/src/blocks/ad-container/style-editor.css +4 -0
- package/src/blocks/ad-container/style.css +27 -0
- package/src/blocks/button/block.json +89 -0
- package/src/blocks/button/edit.js +187 -0
- package/src/blocks/button/index.js +11 -0
- package/src/blocks/button/save.js +52 -0
- package/src/blocks/button/style-editor.css +15 -0
- package/src/blocks/button/style.css +37 -0
- package/src/blocks/chip/block.json +57 -0
- package/src/blocks/chip/edit.js +113 -0
- package/src/blocks/chip/index.js +10 -0
- package/src/blocks/chip/save.js +36 -0
- package/src/blocks/chip/style-editor.css +5 -0
- package/src/blocks/chip/style.css +48 -0
- package/src/blocks/divider/block.json +31 -0
- package/src/blocks/divider/edit.js +42 -0
- package/src/blocks/divider/index.js +10 -0
- package/src/blocks/divider/save.js +18 -0
- package/src/blocks/divider/style-editor.css +4 -0
- package/src/blocks/divider/style.css +25 -0
- package/src/blocks/flag/block.json +48 -0
- package/src/blocks/flag/edit.js +82 -0
- package/src/blocks/flag/index.js +10 -0
- package/src/blocks/flag/save.js +25 -0
- package/src/blocks/flag/style-editor.css +5 -0
- package/src/blocks/flag/style.css +45 -0
- package/src/blocks/icon-button/block.json +43 -0
- package/src/blocks/icon-button/edit.js +82 -0
- package/src/blocks/icon-button/index.js +10 -0
- package/src/blocks/icon-button/save.js +29 -0
- package/src/blocks/icon-button/style-editor.css +5 -0
- package/src/blocks/icon-button/style.css +32 -0
- package/src/blocks/input/block.json +47 -0
- package/src/blocks/input/edit.js +78 -0
- package/src/blocks/input/index.js +10 -0
- package/src/blocks/input/save.js +27 -0
- package/src/blocks/input/style-editor.css +8 -0
- package/src/blocks/input/style.css +30 -0
- package/src/blocks/link/block.json +71 -0
- package/src/blocks/link/edit.js +151 -0
- package/src/blocks/link/index.js +10 -0
- package/src/blocks/link/save.js +46 -0
- package/src/blocks/link/style-editor.css +5 -0
- package/src/blocks/link/style.css +66 -0
- package/src/blocks/text/block.json +32 -0
- package/src/blocks/text/edit.js +56 -0
- package/src/blocks/text/index.js +10 -0
- package/src/blocks/text/save.js +18 -0
- package/src/blocks/text/style-editor.css +4 -0
- package/src/blocks/text/style.css +20 -0
- package/src/blocks/toast/block.json +39 -0
- package/src/blocks/toast/edit.js +85 -0
- package/src/blocks/toast/index.js +10 -0
- package/src/blocks/toast/save.js +29 -0
- package/src/blocks/toast/style-editor.css +4 -0
- package/src/blocks/toast/style.css +51 -0
- package/src/index.js +15 -12
- package/src/utils/classBuilder.js +53 -0
- package/tsconfig.json +4 -4
- package/__tests__/wordpress.test.js +0 -0
- package/dist/AdContainer/AdContainer.d.ts +0 -9
- package/dist/Article/ArticleMetaContainer/ArticleMetaContainer.d.ts +0 -8
- package/dist/Article/UpNextArticles/UpNextArticles.d.ts +0 -13
- package/dist/Button/Button.d.ts +0 -15
- package/dist/CommentsDisabled/CommentsDisabled.d.ts +0 -10
- package/dist/CommentsDisabled/CommentsDisabled.stories.d.ts +0 -44
- package/dist/CommentsDisabled/index.d.ts +0 -2
- package/dist/Divider/Divider.d.ts +0 -15
- package/dist/Input/Input.d.ts +0 -25
- package/dist/Link/Link.d.ts +0 -18
- package/dist/Text/Text.d.ts +0 -14
- package/dist/index.cjs.js +0 -299
- package/dist/index.cjs.js.map +0 -1
- package/dist/styles.css +0 -151
- package/dist/typographyStyles.css +0 -30
- package/dist/utils/cn.d.ts +0 -1
- package/dist/utils/hooks.d.ts +0 -8
- package/src/AdContainer/AdContainer.tsx +0 -31
- package/src/AdContainer/styles.css +0 -58
- package/src/Article/ArticleMetaContainer/ArticleMetaContainer.tsx +0 -14
- package/src/Article/ArticleMetaContainer/styles.css +0 -151
- package/src/Article/UpNextArticles/UpNextArticles.tsx +0 -69
- package/src/Article/UpNextArticles/styles.css +0 -151
- package/src/Button/Button.tsx +0 -36
- package/src/Button/styles.css +0 -30
- package/src/CommentsDisabled/CommentsDisabled.stories.tsx +0 -178
- package/src/CommentsDisabled/CommentsDisabled.tsx +0 -63
- package/src/CommentsDisabled/IMPLEMENTATION_SUMMARY.md +0 -305
- package/src/CommentsDisabled/README.md +0 -284
- package/src/CommentsDisabled/TOKEN_MAPPING.md +0 -269
- package/src/CommentsDisabled/index.ts +0 -2
- package/src/CommentsDisabled/styles.css +0 -82
- package/src/Divider/Divider.tsx +0 -41
- package/src/Divider/styles.css +0 -80
- package/src/Input/Input.tsx +0 -62
- package/src/Input/styles.css +0 -69
- package/src/Link/Link.tsx +0 -49
- package/src/Link/styles.css +0 -111
- package/src/Text/Text.tsx +0 -38
- package/src/Text/styles.css +0 -30
- package/src/Text/typographyStyles.css +0 -30
- package/src/utils/cn.js +0 -3
- package/src/utils/cn.tsx +0 -3
- package/src/utils/hooks.ts +0 -34
package/dist/index.js
CHANGED
|
@@ -1,289 +1,2230 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { registerBlockType } from '@wordpress/blocks';
|
|
2
|
+
import { useBlockProps, InspectorControls, RichText } from '@wordpress/block-editor';
|
|
3
|
+
import { PanelBody, TextControl, SelectControl, ToggleControl, NumberControl } from '@wordpress/components';
|
|
2
4
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _defineProperty(e, r, t) {
|
|
6
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
7
|
+
value: t,
|
|
8
|
+
enumerable: !0,
|
|
9
|
+
configurable: !0,
|
|
10
|
+
writable: !0
|
|
11
|
+
}) : e[r] = t, e;
|
|
12
|
+
}
|
|
13
|
+
function _extends() {
|
|
14
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
15
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
16
|
+
var t = arguments[e];
|
|
17
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}, _extends.apply(null, arguments);
|
|
21
|
+
}
|
|
22
|
+
function ownKeys(e, r) {
|
|
23
|
+
var t = Object.keys(e);
|
|
24
|
+
if (Object.getOwnPropertySymbols) {
|
|
25
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
26
|
+
r && (o = o.filter(function (r) {
|
|
27
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
28
|
+
})), t.push.apply(t, o);
|
|
8
29
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
head.appendChild(style);
|
|
30
|
+
return t;
|
|
31
|
+
}
|
|
32
|
+
function _objectSpread2(e) {
|
|
33
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
34
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
35
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
36
|
+
_defineProperty(e, r, t[r]);
|
|
37
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
38
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
39
|
+
});
|
|
20
40
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
function _toPrimitive(t, r) {
|
|
44
|
+
if ("object" != typeof t || !t) return t;
|
|
45
|
+
var e = t[Symbol.toPrimitive];
|
|
46
|
+
if (void 0 !== e) {
|
|
47
|
+
var i = e.call(t, r || "default");
|
|
48
|
+
if ("object" != typeof i) return i;
|
|
49
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
25
50
|
}
|
|
51
|
+
return ("string" === r ? String : Number)(t);
|
|
52
|
+
}
|
|
53
|
+
function _toPropertyKey(t) {
|
|
54
|
+
var i = _toPrimitive(t, "string");
|
|
55
|
+
return "symbol" == typeof i ? i : i + "";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Build className string for Button component based on attributes.
|
|
60
|
+
* Maps component properties to TDS (Times Design System) SCSS classes.
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} options - Button configuration options
|
|
63
|
+
* @param {string} options.intent - Visual style variant (primary, secondary, negative)
|
|
64
|
+
* @param {string} options.size - Button size (small, medium, large)
|
|
65
|
+
* @param {string} options.behaviour - Width behaviour (hug, full)
|
|
66
|
+
* @param {string} options.state - Interaction state (base, hover, pressed, loading, disabled, focus)
|
|
67
|
+
* @param {boolean} options.disabled - Whether button is disabled
|
|
68
|
+
* @returns {string} Complete className string
|
|
69
|
+
*/
|
|
70
|
+
function buildButtonClass(_ref) {
|
|
71
|
+
var _ref$intent = _ref.intent,
|
|
72
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
73
|
+
_ref$size = _ref.size,
|
|
74
|
+
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
75
|
+
_ref$behaviour = _ref.behaviour,
|
|
76
|
+
behaviour = _ref$behaviour === void 0 ? 'hug' : _ref$behaviour,
|
|
77
|
+
_ref$state = _ref.state,
|
|
78
|
+
state = _ref$state === void 0 ? 'base' : _ref$state,
|
|
79
|
+
_ref$disabled = _ref.disabled,
|
|
80
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
81
|
+
var classes = ['tds-button', "tds-button--intent-".concat(intent), "tds-button--size-".concat(size), "tds-button--behaviour-".concat(behaviour), "tds-button--state-".concat(state)];
|
|
82
|
+
if (disabled) {
|
|
83
|
+
classes.push('tds-button--disabled');
|
|
84
|
+
}
|
|
85
|
+
return classes.join(' ');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function Edit(_ref) {
|
|
89
|
+
var attributes = _ref.attributes,
|
|
90
|
+
setAttributes = _ref.setAttributes;
|
|
91
|
+
var label = attributes.label,
|
|
92
|
+
intent = attributes.intent,
|
|
93
|
+
size = attributes.size,
|
|
94
|
+
behaviour = attributes.behaviour,
|
|
95
|
+
state = attributes.state,
|
|
96
|
+
disabled = attributes.disabled,
|
|
97
|
+
href = attributes.href,
|
|
98
|
+
target = attributes.target,
|
|
99
|
+
rel = attributes.rel,
|
|
100
|
+
type = attributes.type,
|
|
101
|
+
iconLeft = attributes.iconLeft,
|
|
102
|
+
iconRight = attributes.iconRight,
|
|
103
|
+
ariaLabel = attributes.ariaLabel;
|
|
104
|
+
var blockProps = useBlockProps({
|
|
105
|
+
className: 'tds-button-wrapper'
|
|
106
|
+
});
|
|
107
|
+
var buttonClass = buildButtonClass({
|
|
108
|
+
intent: intent,
|
|
109
|
+
size: size,
|
|
110
|
+
behaviour: behaviour,
|
|
111
|
+
state: state,
|
|
112
|
+
disabled: disabled
|
|
113
|
+
});
|
|
114
|
+
var Element = href ? 'a' : 'button';
|
|
115
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", blockProps, /*#__PURE__*/React.createElement(Element, {
|
|
116
|
+
className: buttonClass,
|
|
117
|
+
disabled: !href && disabled,
|
|
118
|
+
href: href,
|
|
119
|
+
target: target,
|
|
120
|
+
rel: rel,
|
|
121
|
+
type: !href ? type : undefined,
|
|
122
|
+
"aria-label": ariaLabel
|
|
123
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
124
|
+
className: "tds-button__label-container"
|
|
125
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
126
|
+
className: "tds-button__label"
|
|
127
|
+
}, label)))), /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
128
|
+
title: "Button Settings"
|
|
129
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
130
|
+
label: "Label",
|
|
131
|
+
value: label,
|
|
132
|
+
onChange: function onChange(value) {
|
|
133
|
+
return setAttributes({
|
|
134
|
+
label: value
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
help: "The text displayed inside the button"
|
|
138
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
139
|
+
label: "Intent (Style)",
|
|
140
|
+
value: intent,
|
|
141
|
+
options: [{
|
|
142
|
+
label: 'Primary',
|
|
143
|
+
value: 'primary'
|
|
144
|
+
}, {
|
|
145
|
+
label: 'Secondary',
|
|
146
|
+
value: 'secondary'
|
|
147
|
+
}, {
|
|
148
|
+
label: 'Negative',
|
|
149
|
+
value: 'negative'
|
|
150
|
+
}],
|
|
151
|
+
onChange: function onChange(value) {
|
|
152
|
+
return setAttributes({
|
|
153
|
+
intent: value
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
157
|
+
label: "Size",
|
|
158
|
+
value: size,
|
|
159
|
+
options: [{
|
|
160
|
+
label: 'Small',
|
|
161
|
+
value: 'small'
|
|
162
|
+
}, {
|
|
163
|
+
label: 'Medium',
|
|
164
|
+
value: 'medium'
|
|
165
|
+
}, {
|
|
166
|
+
label: 'Large',
|
|
167
|
+
value: 'large'
|
|
168
|
+
}],
|
|
169
|
+
onChange: function onChange(value) {
|
|
170
|
+
return setAttributes({
|
|
171
|
+
size: value
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
175
|
+
label: "Behaviour",
|
|
176
|
+
value: behaviour,
|
|
177
|
+
options: [{
|
|
178
|
+
label: 'Hug Content',
|
|
179
|
+
value: 'hug'
|
|
180
|
+
}, {
|
|
181
|
+
label: 'Full Width',
|
|
182
|
+
value: 'full'
|
|
183
|
+
}],
|
|
184
|
+
onChange: function onChange(value) {
|
|
185
|
+
return setAttributes({
|
|
186
|
+
behaviour: value
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
190
|
+
label: "State",
|
|
191
|
+
value: state,
|
|
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
|
+
}],
|
|
211
|
+
onChange: function onChange(value) {
|
|
212
|
+
return setAttributes({
|
|
213
|
+
state: value
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
217
|
+
label: "Disabled",
|
|
218
|
+
checked: disabled,
|
|
219
|
+
onChange: function onChange(value) {
|
|
220
|
+
return setAttributes({
|
|
221
|
+
disabled: value
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
225
|
+
title: "Link Settings",
|
|
226
|
+
initialOpen: false
|
|
227
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
228
|
+
label: "URL",
|
|
229
|
+
value: href,
|
|
230
|
+
onChange: function onChange(value) {
|
|
231
|
+
return setAttributes({
|
|
232
|
+
href: value
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
placeholder: "https://example.com"
|
|
236
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
237
|
+
label: "Link Target",
|
|
238
|
+
value: target,
|
|
239
|
+
options: [{
|
|
240
|
+
label: 'Same Window',
|
|
241
|
+
value: '_self'
|
|
242
|
+
}, {
|
|
243
|
+
label: 'New Window',
|
|
244
|
+
value: '_blank'
|
|
245
|
+
}, {
|
|
246
|
+
label: 'Parent Window',
|
|
247
|
+
value: '_parent'
|
|
248
|
+
}, {
|
|
249
|
+
label: 'Top Window',
|
|
250
|
+
value: '_top'
|
|
251
|
+
}],
|
|
252
|
+
onChange: function onChange(value) {
|
|
253
|
+
return setAttributes({
|
|
254
|
+
target: value
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
258
|
+
label: "Link Rel",
|
|
259
|
+
value: rel,
|
|
260
|
+
onChange: function onChange(value) {
|
|
261
|
+
return setAttributes({
|
|
262
|
+
rel: value
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
placeholder: "noopener noreferrer"
|
|
266
|
+
})), /*#__PURE__*/React.createElement(PanelBody, {
|
|
267
|
+
title: "Advanced",
|
|
268
|
+
initialOpen: false
|
|
269
|
+
}, /*#__PURE__*/React.createElement(SelectControl, {
|
|
270
|
+
label: "Button Type",
|
|
271
|
+
value: type,
|
|
272
|
+
options: [{
|
|
273
|
+
label: 'Button',
|
|
274
|
+
value: 'button'
|
|
275
|
+
}, {
|
|
276
|
+
label: 'Submit',
|
|
277
|
+
value: 'submit'
|
|
278
|
+
}, {
|
|
279
|
+
label: 'Reset',
|
|
280
|
+
value: 'reset'
|
|
281
|
+
}],
|
|
282
|
+
onChange: function onChange(value) {
|
|
283
|
+
return setAttributes({
|
|
284
|
+
type: value
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
288
|
+
label: "Aria Label",
|
|
289
|
+
value: ariaLabel,
|
|
290
|
+
onChange: function onChange(value) {
|
|
291
|
+
return setAttributes({
|
|
292
|
+
ariaLabel: value
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
help: "Accessible name for icon-only buttons"
|
|
296
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
297
|
+
label: "Icon Left",
|
|
298
|
+
value: iconLeft,
|
|
299
|
+
onChange: function onChange(value) {
|
|
300
|
+
return setAttributes({
|
|
301
|
+
iconLeft: value
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
placeholder: "Icon name"
|
|
305
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
306
|
+
label: "Icon Right",
|
|
307
|
+
value: iconRight,
|
|
308
|
+
onChange: function onChange(value) {
|
|
309
|
+
return setAttributes({
|
|
310
|
+
iconRight: value
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
placeholder: "Icon name"
|
|
314
|
+
}))));
|
|
26
315
|
}
|
|
27
316
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
317
|
+
function Save(_ref) {
|
|
318
|
+
var attributes = _ref.attributes;
|
|
319
|
+
var label = attributes.label,
|
|
320
|
+
intent = attributes.intent,
|
|
321
|
+
size = attributes.size,
|
|
322
|
+
behaviour = attributes.behaviour,
|
|
323
|
+
state = attributes.state,
|
|
324
|
+
disabled = attributes.disabled,
|
|
325
|
+
href = attributes.href,
|
|
326
|
+
target = attributes.target,
|
|
327
|
+
rel = attributes.rel,
|
|
328
|
+
type = attributes.type;
|
|
329
|
+
attributes.iconLeft;
|
|
330
|
+
attributes.iconRight;
|
|
331
|
+
var ariaLabel = attributes.ariaLabel;
|
|
332
|
+
var blockProps = useBlockProps.save({
|
|
333
|
+
className: 'tds-button-wrapper'
|
|
334
|
+
});
|
|
335
|
+
var buttonClass = buildButtonClass({
|
|
336
|
+
intent: intent,
|
|
337
|
+
size: size,
|
|
338
|
+
behaviour: behaviour,
|
|
339
|
+
state: state,
|
|
340
|
+
disabled: disabled
|
|
341
|
+
});
|
|
342
|
+
var Element = href ? 'a' : 'button';
|
|
343
|
+
return /*#__PURE__*/React.createElement("div", blockProps, /*#__PURE__*/React.createElement(Element, {
|
|
344
|
+
className: buttonClass,
|
|
345
|
+
disabled: !href && disabled,
|
|
346
|
+
href: href,
|
|
347
|
+
target: target,
|
|
348
|
+
rel: rel,
|
|
349
|
+
type: !href ? type : undefined,
|
|
350
|
+
"aria-label": ariaLabel
|
|
351
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
352
|
+
className: "tds-button__label-container"
|
|
353
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
354
|
+
className: "tds-button__label"
|
|
355
|
+
}, label))));
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
var $schema$9 = "https://schemas.wp.org/trunk/block.json";
|
|
359
|
+
var apiVersion$9 = 3;
|
|
360
|
+
var name$9 = "times/button";
|
|
361
|
+
var title$9 = "Button";
|
|
362
|
+
var category$9 = "common";
|
|
363
|
+
var description$9 = "A customizable button component for user interactions";
|
|
364
|
+
var icon$9 = "admin-generic";
|
|
365
|
+
var supports$9 = {
|
|
366
|
+
html: false,
|
|
367
|
+
spacing: {
|
|
368
|
+
margin: true,
|
|
369
|
+
padding: false
|
|
370
|
+
},
|
|
371
|
+
align: true,
|
|
372
|
+
customClassName: true
|
|
373
|
+
};
|
|
374
|
+
var textdomain = "times-design-system";
|
|
375
|
+
var attributes$9 = {
|
|
376
|
+
label: {
|
|
377
|
+
type: "string",
|
|
378
|
+
"default": "Button label",
|
|
379
|
+
description: "The text label displayed inside the button"
|
|
380
|
+
},
|
|
381
|
+
intent: {
|
|
382
|
+
type: "string",
|
|
383
|
+
"enum": [
|
|
384
|
+
"primary",
|
|
385
|
+
"secondary",
|
|
386
|
+
"negative"
|
|
387
|
+
],
|
|
388
|
+
"default": "primary",
|
|
389
|
+
description: "Visual style variant"
|
|
390
|
+
},
|
|
391
|
+
size: {
|
|
392
|
+
type: "string",
|
|
393
|
+
"enum": [
|
|
394
|
+
"small",
|
|
395
|
+
"medium",
|
|
396
|
+
"large"
|
|
397
|
+
],
|
|
398
|
+
"default": "large",
|
|
399
|
+
description: "Controls the overall dimensions of the button"
|
|
400
|
+
},
|
|
401
|
+
behaviour: {
|
|
402
|
+
type: "string",
|
|
403
|
+
"enum": [
|
|
404
|
+
"hug",
|
|
405
|
+
"full"
|
|
406
|
+
],
|
|
407
|
+
"default": "hug",
|
|
408
|
+
description: "Controls the width behaviour"
|
|
409
|
+
},
|
|
410
|
+
state: {
|
|
411
|
+
type: "string",
|
|
412
|
+
"enum": [
|
|
413
|
+
"base",
|
|
414
|
+
"hover",
|
|
415
|
+
"pressed",
|
|
416
|
+
"loading",
|
|
417
|
+
"disabled",
|
|
418
|
+
"focus"
|
|
419
|
+
],
|
|
420
|
+
"default": "base",
|
|
421
|
+
description: "The interaction state"
|
|
422
|
+
},
|
|
423
|
+
disabled: {
|
|
424
|
+
type: "boolean",
|
|
425
|
+
"default": false,
|
|
426
|
+
description: "Whether the button is disabled"
|
|
427
|
+
},
|
|
428
|
+
href: {
|
|
429
|
+
type: "string",
|
|
430
|
+
description: "Optional href to render as a link"
|
|
431
|
+
},
|
|
432
|
+
target: {
|
|
433
|
+
type: "string",
|
|
434
|
+
"enum": [
|
|
435
|
+
"_blank",
|
|
436
|
+
"_self",
|
|
437
|
+
"_parent",
|
|
438
|
+
"_top"
|
|
439
|
+
],
|
|
440
|
+
description: "Optional target attribute for links"
|
|
441
|
+
},
|
|
442
|
+
rel: {
|
|
443
|
+
type: "string",
|
|
444
|
+
description: "Optional rel attribute for links"
|
|
445
|
+
},
|
|
446
|
+
type: {
|
|
447
|
+
type: "string",
|
|
448
|
+
"enum": [
|
|
449
|
+
"button",
|
|
450
|
+
"submit",
|
|
451
|
+
"reset"
|
|
452
|
+
],
|
|
453
|
+
"default": "button",
|
|
454
|
+
description: "Button type"
|
|
455
|
+
},
|
|
456
|
+
iconLeft: {
|
|
457
|
+
type: "string",
|
|
458
|
+
description: "Icon name to display on the left side of the label"
|
|
459
|
+
},
|
|
460
|
+
iconRight: {
|
|
461
|
+
type: "string",
|
|
462
|
+
description: "Icon name to display on the right side of the label"
|
|
463
|
+
},
|
|
464
|
+
ariaLabel: {
|
|
465
|
+
type: "string",
|
|
466
|
+
description: "Accessible name for icon-only buttons"
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
var editorScript = "file:./index.js";
|
|
470
|
+
var editorStyle = "file:./style-editor.css";
|
|
471
|
+
var style = "file:./style.css";
|
|
472
|
+
var metadata$9 = {
|
|
473
|
+
$schema: $schema$9,
|
|
474
|
+
apiVersion: apiVersion$9,
|
|
475
|
+
name: name$9,
|
|
476
|
+
title: title$9,
|
|
477
|
+
category: category$9,
|
|
478
|
+
description: description$9,
|
|
479
|
+
icon: icon$9,
|
|
480
|
+
supports: supports$9,
|
|
481
|
+
textdomain: textdomain,
|
|
482
|
+
attributes: attributes$9,
|
|
483
|
+
editorScript: editorScript,
|
|
484
|
+
editorStyle: editorStyle,
|
|
485
|
+
style: style
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
registerBlockType(metadata$9.name, _objectSpread2(_objectSpread2({}, metadata$9), {}, {
|
|
489
|
+
edit: Edit,
|
|
490
|
+
save: Save
|
|
491
|
+
}));
|
|
492
|
+
|
|
493
|
+
var $schema$8 = "https://schemas.wp.org/trunk/block.json";
|
|
494
|
+
var apiVersion$8 = 3;
|
|
495
|
+
var name$8 = "times/divider";
|
|
496
|
+
var title$8 = "Divider";
|
|
497
|
+
var category$8 = "common";
|
|
498
|
+
var description$8 = "A horizontal line divider component";
|
|
499
|
+
var icon$8 = "minus";
|
|
500
|
+
var supports$8 = {
|
|
501
|
+
html: false,
|
|
502
|
+
spacing: {
|
|
503
|
+
margin: true
|
|
504
|
+
},
|
|
505
|
+
align: [
|
|
506
|
+
"wide",
|
|
507
|
+
"full"
|
|
508
|
+
]
|
|
509
|
+
};
|
|
510
|
+
var attributes$8 = {
|
|
511
|
+
isDashed: {
|
|
512
|
+
type: "boolean",
|
|
513
|
+
"default": false
|
|
514
|
+
},
|
|
515
|
+
isVertical: {
|
|
516
|
+
type: "boolean",
|
|
517
|
+
"default": false
|
|
518
|
+
},
|
|
519
|
+
padding: {
|
|
520
|
+
type: "boolean",
|
|
521
|
+
"default": false
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
var example$8 = {
|
|
525
|
+
};
|
|
526
|
+
var metadata$8 = {
|
|
527
|
+
$schema: $schema$8,
|
|
528
|
+
apiVersion: apiVersion$8,
|
|
529
|
+
name: name$8,
|
|
530
|
+
title: title$8,
|
|
531
|
+
category: category$8,
|
|
532
|
+
description: description$8,
|
|
533
|
+
icon: icon$8,
|
|
534
|
+
supports: supports$8,
|
|
535
|
+
attributes: attributes$8,
|
|
536
|
+
example: example$8
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
var edit$8 = function edit(_ref) {
|
|
540
|
+
var attributes = _ref.attributes,
|
|
541
|
+
setAttributes = _ref.setAttributes;
|
|
542
|
+
var isDashed = attributes.isDashed,
|
|
543
|
+
isVertical = attributes.isVertical,
|
|
544
|
+
padding = attributes.padding;
|
|
545
|
+
var blockProps = useBlockProps();
|
|
546
|
+
var buildDividerClass = function buildDividerClass() {
|
|
547
|
+
var classes = ['tds-divider'];
|
|
548
|
+
if (isDashed) classes.push('tds-divider--dashed');
|
|
549
|
+
if (isVertical) classes.push('tds-divider--vertical');
|
|
550
|
+
if (padding) classes.push('tds-divider--padding');
|
|
551
|
+
return classes.join(' ');
|
|
552
|
+
};
|
|
553
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
554
|
+
title: "Divider Settings"
|
|
555
|
+
}, /*#__PURE__*/React.createElement(ToggleControl, {
|
|
556
|
+
label: "Dashed",
|
|
557
|
+
checked: isDashed,
|
|
558
|
+
onChange: function onChange(val) {
|
|
559
|
+
return setAttributes({
|
|
560
|
+
isDashed: val
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
564
|
+
label: "Vertical",
|
|
565
|
+
checked: isVertical,
|
|
566
|
+
onChange: function onChange(val) {
|
|
567
|
+
return setAttributes({
|
|
568
|
+
isVertical: val
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
572
|
+
label: "Padding",
|
|
573
|
+
checked: padding,
|
|
574
|
+
onChange: function onChange(val) {
|
|
575
|
+
return setAttributes({
|
|
576
|
+
padding: val
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
}))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
580
|
+
className: buildDividerClass()
|
|
89
581
|
})));
|
|
90
582
|
};
|
|
91
583
|
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
584
|
+
var save$8 = function save(_ref) {
|
|
585
|
+
var attributes = _ref.attributes;
|
|
586
|
+
var isDashed = attributes.isDashed,
|
|
587
|
+
isVertical = attributes.isVertical,
|
|
588
|
+
padding = attributes.padding;
|
|
589
|
+
var blockProps = useBlockProps.save();
|
|
590
|
+
var buildDividerClass = function buildDividerClass() {
|
|
591
|
+
var classes = ['tds-divider'];
|
|
592
|
+
if (isDashed) classes.push('tds-divider--dashed');
|
|
593
|
+
if (isVertical) classes.push('tds-divider--vertical');
|
|
594
|
+
if (padding) classes.push('tds-divider--padding');
|
|
595
|
+
return classes.join(' ');
|
|
596
|
+
};
|
|
597
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
598
|
+
className: buildDividerClass()
|
|
599
|
+
}));
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
registerBlockType(metadata$8.name, _objectSpread2(_objectSpread2({}, metadata$8), {}, {
|
|
603
|
+
edit: edit$8,
|
|
604
|
+
save: save$8
|
|
605
|
+
}));
|
|
606
|
+
|
|
607
|
+
var $schema$7 = "https://schemas.wp.org/trunk/block.json";
|
|
608
|
+
var apiVersion$7 = 3;
|
|
609
|
+
var name$7 = "times/text";
|
|
610
|
+
var title$7 = "Text";
|
|
611
|
+
var category$7 = "common";
|
|
612
|
+
var description$7 = "Typography component for displaying text with style variants";
|
|
613
|
+
var icon$7 = "editor-paragraph";
|
|
614
|
+
var supports$7 = {
|
|
615
|
+
html: false,
|
|
616
|
+
spacing: {
|
|
617
|
+
margin: true,
|
|
618
|
+
padding: false
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
var attributes$7 = {
|
|
622
|
+
as: {
|
|
623
|
+
type: "string",
|
|
624
|
+
"default": "p",
|
|
625
|
+
"enum": [
|
|
626
|
+
"p",
|
|
627
|
+
"span",
|
|
628
|
+
"h1",
|
|
629
|
+
"h2",
|
|
630
|
+
"h3",
|
|
631
|
+
"h4",
|
|
632
|
+
"h5"
|
|
633
|
+
]
|
|
634
|
+
},
|
|
635
|
+
typographyStyle: {
|
|
636
|
+
type: "string",
|
|
637
|
+
"default": "body-standard"
|
|
638
|
+
},
|
|
639
|
+
content: {
|
|
640
|
+
type: "string",
|
|
641
|
+
"default": ""
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
var example$7 = {
|
|
645
|
+
};
|
|
646
|
+
var metadata$7 = {
|
|
647
|
+
$schema: $schema$7,
|
|
648
|
+
apiVersion: apiVersion$7,
|
|
649
|
+
name: name$7,
|
|
650
|
+
title: title$7,
|
|
651
|
+
category: category$7,
|
|
652
|
+
description: description$7,
|
|
653
|
+
icon: icon$7,
|
|
654
|
+
supports: supports$7,
|
|
655
|
+
attributes: attributes$7,
|
|
656
|
+
example: example$7
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
var edit$7 = function edit(_ref) {
|
|
660
|
+
var attributes = _ref.attributes,
|
|
661
|
+
setAttributes = _ref.setAttributes;
|
|
662
|
+
var as = attributes.as,
|
|
663
|
+
typographyStyle = attributes.typographyStyle,
|
|
664
|
+
content = attributes.content;
|
|
665
|
+
var blockProps = useBlockProps();
|
|
666
|
+
var tagName = as || 'p';
|
|
667
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
668
|
+
title: "Text Settings"
|
|
669
|
+
}, /*#__PURE__*/React.createElement(SelectControl, {
|
|
670
|
+
label: "Tag",
|
|
671
|
+
value: as,
|
|
672
|
+
options: [{
|
|
673
|
+
label: 'Paragraph',
|
|
674
|
+
value: 'p'
|
|
675
|
+
}, {
|
|
676
|
+
label: 'Span',
|
|
677
|
+
value: 'span'
|
|
678
|
+
}, {
|
|
679
|
+
label: 'Heading 1',
|
|
680
|
+
value: 'h1'
|
|
681
|
+
}, {
|
|
682
|
+
label: 'Heading 2',
|
|
683
|
+
value: 'h2'
|
|
684
|
+
}, {
|
|
685
|
+
label: 'Heading 3',
|
|
686
|
+
value: 'h3'
|
|
687
|
+
}, {
|
|
688
|
+
label: 'Heading 4',
|
|
689
|
+
value: 'h4'
|
|
690
|
+
}, {
|
|
691
|
+
label: 'Heading 5',
|
|
692
|
+
value: 'h5'
|
|
693
|
+
}],
|
|
694
|
+
onChange: function onChange(val) {
|
|
695
|
+
return setAttributes({
|
|
696
|
+
as: val
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
700
|
+
label: "Typography Style",
|
|
701
|
+
value: typographyStyle,
|
|
702
|
+
options: [{
|
|
703
|
+
label: 'Body Standard',
|
|
704
|
+
value: 'body-standard'
|
|
705
|
+
}, {
|
|
706
|
+
label: 'Body Small',
|
|
707
|
+
value: 'body-small'
|
|
708
|
+
}, {
|
|
709
|
+
label: 'Headline',
|
|
710
|
+
value: 'headline'
|
|
711
|
+
}],
|
|
712
|
+
onChange: function onChange(val) {
|
|
713
|
+
return setAttributes({
|
|
714
|
+
typographyStyle: val
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
}))), /*#__PURE__*/React.createElement(RichText, _extends({}, blockProps, {
|
|
718
|
+
tagName: tagName,
|
|
719
|
+
value: content,
|
|
720
|
+
onChange: function onChange(val) {
|
|
721
|
+
return setAttributes({
|
|
722
|
+
content: val
|
|
723
|
+
});
|
|
724
|
+
},
|
|
725
|
+
className: "tds-text tds-text--".concat(typographyStyle),
|
|
726
|
+
placeholder: "Enter text..."
|
|
727
|
+
})));
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
var save$7 = function save(_ref) {
|
|
731
|
+
var attributes = _ref.attributes;
|
|
732
|
+
var as = attributes.as,
|
|
733
|
+
typographyStyle = attributes.typographyStyle,
|
|
734
|
+
content = attributes.content;
|
|
735
|
+
var blockProps = useBlockProps.save();
|
|
736
|
+
var tagName = as || 'p';
|
|
737
|
+
return /*#__PURE__*/React.createElement(RichText.Content, _extends({}, blockProps, {
|
|
738
|
+
tagName: tagName,
|
|
739
|
+
value: content,
|
|
740
|
+
className: "tds-text tds-text--".concat(typographyStyle)
|
|
741
|
+
}));
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
registerBlockType(metadata$7.name, _objectSpread2(_objectSpread2({}, metadata$7), {}, {
|
|
745
|
+
edit: edit$7,
|
|
746
|
+
save: save$7
|
|
747
|
+
}));
|
|
748
|
+
|
|
749
|
+
var $schema$6 = "https://schemas.wp.org/trunk/block.json";
|
|
750
|
+
var apiVersion$6 = 3;
|
|
751
|
+
var name$6 = "times/input";
|
|
752
|
+
var title$6 = "Input";
|
|
753
|
+
var category$6 = "common";
|
|
754
|
+
var description$6 = "Form input field component";
|
|
755
|
+
var icon$6 = "text";
|
|
756
|
+
var supports$6 = {
|
|
757
|
+
html: false,
|
|
758
|
+
spacing: {
|
|
759
|
+
margin: true
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
var attributes$6 = {
|
|
763
|
+
label: {
|
|
764
|
+
type: "string",
|
|
765
|
+
"default": ""
|
|
766
|
+
},
|
|
767
|
+
placeholder: {
|
|
768
|
+
type: "string",
|
|
769
|
+
"default": ""
|
|
770
|
+
},
|
|
771
|
+
type: {
|
|
772
|
+
type: "string",
|
|
773
|
+
"default": "text",
|
|
774
|
+
"enum": [
|
|
775
|
+
"text",
|
|
776
|
+
"email",
|
|
777
|
+
"password",
|
|
778
|
+
"number",
|
|
779
|
+
"tel",
|
|
780
|
+
"url"
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
disabled: {
|
|
784
|
+
type: "boolean",
|
|
785
|
+
"default": false
|
|
786
|
+
},
|
|
787
|
+
required: {
|
|
788
|
+
type: "boolean",
|
|
789
|
+
"default": false
|
|
790
|
+
},
|
|
791
|
+
name: {
|
|
792
|
+
type: "string",
|
|
793
|
+
"default": ""
|
|
794
|
+
},
|
|
795
|
+
id: {
|
|
796
|
+
type: "string",
|
|
797
|
+
"default": ""
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
var example$6 = {
|
|
801
|
+
};
|
|
802
|
+
var metadata$6 = {
|
|
803
|
+
$schema: $schema$6,
|
|
804
|
+
apiVersion: apiVersion$6,
|
|
805
|
+
name: name$6,
|
|
806
|
+
title: title$6,
|
|
807
|
+
category: category$6,
|
|
808
|
+
description: description$6,
|
|
809
|
+
icon: icon$6,
|
|
810
|
+
supports: supports$6,
|
|
811
|
+
attributes: attributes$6,
|
|
812
|
+
example: example$6
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
var edit$6 = function edit(_ref) {
|
|
816
|
+
var attributes = _ref.attributes,
|
|
817
|
+
setAttributes = _ref.setAttributes;
|
|
818
|
+
var label = attributes.label,
|
|
819
|
+
placeholder = attributes.placeholder,
|
|
820
|
+
type = attributes.type,
|
|
821
|
+
disabled = attributes.disabled,
|
|
822
|
+
required = attributes.required,
|
|
823
|
+
name = attributes.name,
|
|
824
|
+
id = attributes.id;
|
|
825
|
+
var blockProps = useBlockProps();
|
|
826
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
827
|
+
title: "Input Settings"
|
|
828
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
829
|
+
label: "Label",
|
|
830
|
+
value: label,
|
|
831
|
+
onChange: function onChange(val) {
|
|
832
|
+
return setAttributes({
|
|
833
|
+
label: val
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
837
|
+
label: "Placeholder",
|
|
838
|
+
value: placeholder,
|
|
839
|
+
onChange: function onChange(val) {
|
|
840
|
+
return setAttributes({
|
|
841
|
+
placeholder: val
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
845
|
+
label: "Type",
|
|
846
|
+
value: type,
|
|
847
|
+
options: [{
|
|
848
|
+
label: 'Text',
|
|
849
|
+
value: 'text'
|
|
850
|
+
}, {
|
|
851
|
+
label: 'Email',
|
|
852
|
+
value: 'email'
|
|
853
|
+
}, {
|
|
854
|
+
label: 'Password',
|
|
855
|
+
value: 'password'
|
|
856
|
+
}, {
|
|
857
|
+
label: 'Number',
|
|
858
|
+
value: 'number'
|
|
859
|
+
}, {
|
|
860
|
+
label: 'Tel',
|
|
861
|
+
value: 'tel'
|
|
862
|
+
}, {
|
|
863
|
+
label: 'URL',
|
|
864
|
+
value: 'url'
|
|
865
|
+
}],
|
|
866
|
+
onChange: function onChange(val) {
|
|
867
|
+
return setAttributes({
|
|
868
|
+
type: val
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
872
|
+
label: "Name",
|
|
873
|
+
value: name,
|
|
874
|
+
onChange: function onChange(val) {
|
|
875
|
+
return setAttributes({
|
|
876
|
+
name: val
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
880
|
+
label: "ID",
|
|
881
|
+
value: id,
|
|
882
|
+
onChange: function onChange(val) {
|
|
883
|
+
return setAttributes({
|
|
884
|
+
id: val
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
888
|
+
label: "Required",
|
|
889
|
+
checked: required,
|
|
890
|
+
onChange: function onChange(val) {
|
|
891
|
+
return setAttributes({
|
|
892
|
+
required: val
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
896
|
+
label: "Disabled",
|
|
897
|
+
checked: disabled,
|
|
898
|
+
onChange: function onChange(val) {
|
|
899
|
+
return setAttributes({
|
|
900
|
+
disabled: val
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
}))), /*#__PURE__*/React.createElement("div", blockProps, label && /*#__PURE__*/React.createElement("label", {
|
|
904
|
+
className: "tds-input__label"
|
|
905
|
+
}, label), /*#__PURE__*/React.createElement("input", {
|
|
151
906
|
type: type,
|
|
907
|
+
placeholder: placeholder,
|
|
908
|
+
disabled: disabled,
|
|
909
|
+
required: required,
|
|
152
910
|
name: name,
|
|
153
|
-
|
|
911
|
+
id: id,
|
|
912
|
+
className: "tds-input"
|
|
913
|
+
})));
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
var save$6 = function save(_ref) {
|
|
917
|
+
var attributes = _ref.attributes;
|
|
918
|
+
var label = attributes.label,
|
|
919
|
+
placeholder = attributes.placeholder,
|
|
920
|
+
type = attributes.type,
|
|
921
|
+
disabled = attributes.disabled,
|
|
922
|
+
required = attributes.required,
|
|
923
|
+
name = attributes.name,
|
|
924
|
+
id = attributes.id;
|
|
925
|
+
var blockProps = useBlockProps.save();
|
|
926
|
+
return /*#__PURE__*/React.createElement("div", blockProps, label && /*#__PURE__*/React.createElement("label", {
|
|
927
|
+
htmlFor: id,
|
|
928
|
+
className: "tds-input__label"
|
|
929
|
+
}, label), /*#__PURE__*/React.createElement("input", {
|
|
930
|
+
type: type,
|
|
154
931
|
placeholder: placeholder,
|
|
155
|
-
value: value,
|
|
156
|
-
onChange: onChange,
|
|
157
932
|
disabled: disabled,
|
|
158
933
|
required: required,
|
|
159
|
-
|
|
934
|
+
name: name,
|
|
935
|
+
id: id,
|
|
936
|
+
className: "tds-input"
|
|
160
937
|
}));
|
|
161
938
|
};
|
|
162
939
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
940
|
+
registerBlockType(metadata$6.name, _objectSpread2(_objectSpread2({}, metadata$6), {}, {
|
|
941
|
+
edit: edit$6,
|
|
942
|
+
save: save$6
|
|
943
|
+
}));
|
|
944
|
+
|
|
945
|
+
var $schema$5 = "https://schemas.wp.org/trunk/block.json";
|
|
946
|
+
var apiVersion$5 = 3;
|
|
947
|
+
var name$5 = "times/icon-button";
|
|
948
|
+
var title$5 = "Icon Button";
|
|
949
|
+
var category$5 = "common";
|
|
950
|
+
var description$5 = "Button component displaying only an icon";
|
|
951
|
+
var icon$5 = "button";
|
|
952
|
+
var supports$5 = {
|
|
953
|
+
html: false,
|
|
954
|
+
spacing: {
|
|
955
|
+
margin: true
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
var attributes$5 = {
|
|
959
|
+
iconName: {
|
|
960
|
+
type: "string",
|
|
961
|
+
"default": ""
|
|
962
|
+
},
|
|
963
|
+
round: {
|
|
964
|
+
type: "boolean",
|
|
965
|
+
"default": false
|
|
966
|
+
},
|
|
967
|
+
href: {
|
|
968
|
+
type: "string",
|
|
969
|
+
"default": ""
|
|
970
|
+
},
|
|
971
|
+
target: {
|
|
972
|
+
type: "string",
|
|
973
|
+
"default": "_self",
|
|
974
|
+
"enum": [
|
|
975
|
+
"_self",
|
|
976
|
+
"_blank",
|
|
977
|
+
"_parent",
|
|
978
|
+
"_top"
|
|
979
|
+
]
|
|
980
|
+
},
|
|
981
|
+
rel: {
|
|
982
|
+
type: "string",
|
|
983
|
+
"default": ""
|
|
984
|
+
},
|
|
985
|
+
ariaLabel: {
|
|
986
|
+
type: "string",
|
|
987
|
+
"default": ""
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
var example$5 = {
|
|
991
|
+
};
|
|
992
|
+
var metadata$5 = {
|
|
993
|
+
$schema: $schema$5,
|
|
994
|
+
apiVersion: apiVersion$5,
|
|
995
|
+
name: name$5,
|
|
996
|
+
title: title$5,
|
|
997
|
+
category: category$5,
|
|
998
|
+
description: description$5,
|
|
999
|
+
icon: icon$5,
|
|
1000
|
+
supports: supports$5,
|
|
1001
|
+
attributes: attributes$5,
|
|
1002
|
+
example: example$5
|
|
184
1003
|
};
|
|
185
1004
|
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
1005
|
+
var edit$5 = function edit(_ref) {
|
|
1006
|
+
var attributes = _ref.attributes,
|
|
1007
|
+
setAttributes = _ref.setAttributes;
|
|
1008
|
+
var iconName = attributes.iconName,
|
|
1009
|
+
round = attributes.round,
|
|
1010
|
+
href = attributes.href,
|
|
1011
|
+
target = attributes.target,
|
|
1012
|
+
rel = attributes.rel,
|
|
1013
|
+
ariaLabel = attributes.ariaLabel;
|
|
1014
|
+
var blockProps = useBlockProps();
|
|
1015
|
+
var buildClass = function buildClass() {
|
|
1016
|
+
var classes = ['tds-icon-button'];
|
|
1017
|
+
if (round) classes.push('tds-icon-button--round');
|
|
1018
|
+
return classes.join(' ');
|
|
1019
|
+
};
|
|
1020
|
+
var Element = href ? 'a' : 'button';
|
|
1021
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
1022
|
+
title: "Icon Button Settings"
|
|
1023
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1024
|
+
label: "Icon Name",
|
|
1025
|
+
value: iconName,
|
|
1026
|
+
onChange: function onChange(val) {
|
|
1027
|
+
return setAttributes({
|
|
1028
|
+
iconName: val
|
|
1029
|
+
});
|
|
1030
|
+
},
|
|
1031
|
+
placeholder: "e.g., arrow-right"
|
|
1032
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
1033
|
+
label: "Round",
|
|
1034
|
+
checked: round,
|
|
1035
|
+
onChange: function onChange(val) {
|
|
1036
|
+
return setAttributes({
|
|
1037
|
+
round: val
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1041
|
+
label: "URL (Leave empty for button)",
|
|
1042
|
+
value: href,
|
|
1043
|
+
onChange: function onChange(val) {
|
|
1044
|
+
return setAttributes({
|
|
1045
|
+
href: val
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
}), href && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SelectControl, {
|
|
1049
|
+
label: "Target",
|
|
1050
|
+
value: target,
|
|
1051
|
+
options: [{
|
|
1052
|
+
label: 'Same window',
|
|
1053
|
+
value: '_self'
|
|
1054
|
+
}, {
|
|
1055
|
+
label: 'New window',
|
|
1056
|
+
value: '_blank'
|
|
1057
|
+
}, {
|
|
1058
|
+
label: 'Parent',
|
|
1059
|
+
value: '_parent'
|
|
1060
|
+
}, {
|
|
1061
|
+
label: 'Top',
|
|
1062
|
+
value: '_top'
|
|
1063
|
+
}],
|
|
1064
|
+
onChange: function onChange(val) {
|
|
1065
|
+
return setAttributes({
|
|
1066
|
+
target: val
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1070
|
+
label: "Rel",
|
|
1071
|
+
value: rel,
|
|
1072
|
+
onChange: function onChange(val) {
|
|
1073
|
+
return setAttributes({
|
|
1074
|
+
rel: val
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
})), /*#__PURE__*/React.createElement(TextControl, {
|
|
1078
|
+
label: "Aria Label",
|
|
1079
|
+
value: ariaLabel,
|
|
1080
|
+
onChange: function onChange(val) {
|
|
1081
|
+
return setAttributes({
|
|
1082
|
+
ariaLabel: val
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
}))), /*#__PURE__*/React.createElement(Element, _extends({}, blockProps, {
|
|
1086
|
+
className: buildClass(),
|
|
1087
|
+
href: href || undefined,
|
|
1088
|
+
target: href ? target : undefined,
|
|
1089
|
+
rel: href && rel ? rel : undefined,
|
|
1090
|
+
"aria-label": ariaLabel
|
|
1091
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1092
|
+
className: "tds-icon-button__icon"
|
|
1093
|
+
}, iconName)));
|
|
211
1094
|
};
|
|
212
1095
|
|
|
213
|
-
var css_248z = ".video-article-container .video-article-up-next{background-color:#1d1d1b;position:relative;width:100%}.video-article-container .video-article-up-next *{width:100%}@media (min-width:1024px){.video-article-container .video-article-up-next{background-color:unset;flex-shrink:0;order:0;width:220px}}@media (min-width:1320px){.video-article-container .video-article-up-next{width:270px}}.video-article-container .video-article-up-next .vertical-divider{display:none}@media (min-width:768px){.video-article-container .video-article-up-next .vertical-divider{background-color:#222;display:block;height:100%;left:-48px;margin:0 32px;position:absolute;width:1px}}.up-next-articles-container{padding:20px;position:relative}@media (min-width:768px){.up-next-articles-container{padding:24px}}@media (min-width:1024px){.up-next-articles-container{padding:0}}.up-next-articles-container .up-next-article-image{background-color:#333;overflow:hidden;padding-bottom:56.25%;position:relative}.up-next-articles-container .up-next-article-image picture{display:block;left:0;position:absolute;top:0;width:100%}.up-next-articles-container .up-next-article-image img{max-width:100%}.up-next-articles-container .up-next-articles-overlay{display:none}@media (max-width:1023px){.up-next-articles-container .up-next-articles-overlay{height:100%;position:absolute;right:0;top:0;width:75px;z-index:1}}.up-next-articles-container .up-next-articles-overlay.up-next-articles-overlay-left{background-image:linear-gradient(90deg,#1d1d1b,transparent);left:0}.up-next-articles-container .up-next-articles-overlay.up-next-articles-overlay-right{background-image:linear-gradient(270deg,#1d1d1b,transparent);right:0}.up-next-articles-container.show-left-overlay .up-next-articles-overlay-left,.up-next-articles-container.show-right-overlay .up-next-articles-overlay-right{display:flex}.up-next-articles-container .up-next-articles-scroll{overflow-x:auto;position:relative;scrollbar-width:none}.up-next-articles-container .up-next-articles{-moz-column-gap:24px;column-gap:24px;display:grid;grid-template-columns:repeat(4,minmax(156px,1fr))}@media (min-width:1024px){.up-next-articles-container .up-next-articles{gap:24px 0;grid-template-columns:1fr}}.up-next-articles-container .up-next-articles .up-next-article{display:flex;flex-direction:column;gap:8px;position:relative}.up-next-articles-container .up-next-articles .up-next-article:not(:last-child):after{background-color:#222;content:\"\";height:100%;position:absolute;right:-12px;width:1px;z-index:1}@media (min-width:1024px){.up-next-articles-container .up-next-articles .up-next-article:not(:last-child):after{bottom:-12px;height:1px;left:0;width:100%}}.up-next-articles-container .up-next-articles .up-next-article .up-next-article-image-container{margin-bottom:12px;position:relative}.up-next-articles-container .up-next-articles .up-next-article .up-next-article-image-container .up-next-article-duration{bottom:0;left:10px;position:absolute;z-index:2}.up-next-articles-container .up-next-articles .up-next-article .up-next-article-image-container .up-next-article-image-overlay{background:linear-gradient(0deg,rgba(0,0,0,.5) 0,transparent);bottom:0;height:50%;position:absolute;width:100%;z-index:1}.up-next-articles-container .up-next-articles .up-next-article .up-next-article-image-container .up-next-article-image-container:hover .up-next-article-image-overlay{opacity:1}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBRUUsd0JBQWlDLENBQ2pDLGlCQUFrQixDQUZsQixVQUdGLENBQ0Esa0RBQ0UsVUFDRixDQUNBLDBCQUNFLGdEQUNFLHNCQUF1QixDQUN2QixhQUFjLENBRWQsT0FBUSxDQURSLFdBRUYsQ0FDRixDQUNBLDBCQUNFLGdEQUNFLFdBQ0YsQ0FDRixDQUNBLGtFQU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0ZTtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogNTAlO1xuICBiYWNrZ3JvdW5kOiBsaW5lYXItZ3JhZGllbnQodG8gdG9wLCByZ2JhKDAsIDAsIDAsIDAuNSkgMCUsIHJnYmEoMCwgMCwgMCwgMCkgMTAwJSk7XG4gIHotaW5kZXg6IDE7XG59XG4udXAtbmV4dC1hcnRpY2xlcy1jb250YWluZXIgLnVwLW5leHQtYXJ0aWNsZXMgLnVwLW5leHQtYXJ0aWNsZSAudXAtbmV4dC1hcnRpY2xlLWltYWdlLWNvbnRhaW5lciAudXAtbmV4dC1hcnRpY2xlLWltYWdlLWNvbnRhaW5lcjpob3ZlciAudXAtbmV4dC1hcnRpY2xlLWltYWdlLW92ZXJsYXkge1xuICBvcGFjaXR5OiAxO1xufVxuIl19 */";
|
|
214
|
-
|
|
1096
|
+
var save$5 = function save(_ref) {
|
|
1097
|
+
var attributes = _ref.attributes;
|
|
1098
|
+
var iconName = attributes.iconName,
|
|
1099
|
+
round = attributes.round,
|
|
1100
|
+
href = attributes.href,
|
|
1101
|
+
target = attributes.target,
|
|
1102
|
+
rel = attributes.rel,
|
|
1103
|
+
ariaLabel = attributes.ariaLabel;
|
|
1104
|
+
var blockProps = useBlockProps.save();
|
|
1105
|
+
var buildClass = function buildClass() {
|
|
1106
|
+
var classes = ['tds-icon-button'];
|
|
1107
|
+
if (round) classes.push('tds-icon-button--round');
|
|
1108
|
+
return classes.join(' ');
|
|
1109
|
+
};
|
|
1110
|
+
var Element = href ? 'a' : 'button';
|
|
1111
|
+
return /*#__PURE__*/React.createElement(Element, _extends({}, blockProps, {
|
|
1112
|
+
className: buildClass(),
|
|
1113
|
+
href: href || undefined,
|
|
1114
|
+
target: href ? target : undefined,
|
|
1115
|
+
rel: href && rel ? rel : undefined,
|
|
1116
|
+
"aria-label": ariaLabel
|
|
1117
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1118
|
+
className: "tds-icon-button__icon"
|
|
1119
|
+
}, iconName));
|
|
1120
|
+
};
|
|
215
1121
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
1122
|
+
registerBlockType(metadata$5.name, _objectSpread2(_objectSpread2({}, metadata$5), {}, {
|
|
1123
|
+
edit: edit$5,
|
|
1124
|
+
save: save$5
|
|
1125
|
+
}));
|
|
1126
|
+
|
|
1127
|
+
var $schema$4 = "https://schemas.wp.org/trunk/block.json";
|
|
1128
|
+
var apiVersion$4 = 3;
|
|
1129
|
+
var name$4 = "times/chip";
|
|
1130
|
+
var title$4 = "Chip";
|
|
1131
|
+
var category$4 = "common";
|
|
1132
|
+
var description$4 = "Small component for displaying labels, tags, or filter options";
|
|
1133
|
+
var icon$4 = "tag";
|
|
1134
|
+
var supports$4 = {
|
|
1135
|
+
html: false,
|
|
1136
|
+
spacing: {
|
|
1137
|
+
margin: true
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
var attributes$4 = {
|
|
1141
|
+
content: {
|
|
1142
|
+
type: "string",
|
|
1143
|
+
"default": ""
|
|
1144
|
+
},
|
|
1145
|
+
intent: {
|
|
1146
|
+
type: "string",
|
|
1147
|
+
"default": "secondary",
|
|
1148
|
+
"enum": [
|
|
1149
|
+
"primary",
|
|
1150
|
+
"secondary",
|
|
1151
|
+
"negative"
|
|
1152
|
+
]
|
|
1153
|
+
},
|
|
1154
|
+
size: {
|
|
1155
|
+
type: "string",
|
|
1156
|
+
"default": "medium",
|
|
1157
|
+
"enum": [
|
|
1158
|
+
"small",
|
|
1159
|
+
"medium",
|
|
1160
|
+
"large"
|
|
1161
|
+
]
|
|
1162
|
+
},
|
|
1163
|
+
state: {
|
|
1164
|
+
type: "string",
|
|
1165
|
+
"default": "base",
|
|
1166
|
+
"enum": [
|
|
1167
|
+
"base",
|
|
1168
|
+
"hover",
|
|
1169
|
+
"pressed",
|
|
1170
|
+
"disabled"
|
|
1171
|
+
]
|
|
1172
|
+
},
|
|
1173
|
+
channel: {
|
|
1174
|
+
type: "boolean",
|
|
1175
|
+
"default": false
|
|
1176
|
+
},
|
|
1177
|
+
toggle: {
|
|
1178
|
+
type: "boolean",
|
|
1179
|
+
"default": false
|
|
1180
|
+
},
|
|
1181
|
+
iconLeft: {
|
|
1182
|
+
type: "string",
|
|
1183
|
+
"default": ""
|
|
1184
|
+
},
|
|
1185
|
+
iconRight: {
|
|
1186
|
+
type: "string",
|
|
1187
|
+
"default": ""
|
|
1188
|
+
},
|
|
1189
|
+
ariaLabel: {
|
|
1190
|
+
type: "string",
|
|
1191
|
+
"default": ""
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
var example$4 = {
|
|
1195
|
+
};
|
|
1196
|
+
var metadata$4 = {
|
|
1197
|
+
$schema: $schema$4,
|
|
1198
|
+
apiVersion: apiVersion$4,
|
|
1199
|
+
name: name$4,
|
|
1200
|
+
title: title$4,
|
|
1201
|
+
category: category$4,
|
|
1202
|
+
description: description$4,
|
|
1203
|
+
icon: icon$4,
|
|
1204
|
+
supports: supports$4,
|
|
1205
|
+
attributes: attributes$4,
|
|
1206
|
+
example: example$4
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
var edit$4 = function edit(_ref) {
|
|
1210
|
+
var attributes = _ref.attributes,
|
|
1211
|
+
setAttributes = _ref.setAttributes;
|
|
1212
|
+
var content = attributes.content,
|
|
1213
|
+
intent = attributes.intent,
|
|
1214
|
+
size = attributes.size,
|
|
1215
|
+
state = attributes.state,
|
|
1216
|
+
channel = attributes.channel,
|
|
1217
|
+
toggle = attributes.toggle,
|
|
1218
|
+
iconLeft = attributes.iconLeft,
|
|
1219
|
+
iconRight = attributes.iconRight,
|
|
1220
|
+
ariaLabel = attributes.ariaLabel;
|
|
1221
|
+
var blockProps = useBlockProps();
|
|
1222
|
+
var buildClass = function buildClass() {
|
|
1223
|
+
var classes = ['tds-chip'];
|
|
1224
|
+
classes.push("tds-chip--intent-".concat(intent));
|
|
1225
|
+
classes.push("tds-chip--size-".concat(size));
|
|
1226
|
+
classes.push("tds-chip--state-".concat(state));
|
|
1227
|
+
if (channel) classes.push('tds-chip--channel');
|
|
1228
|
+
if (toggle) classes.push('tds-chip--toggle');
|
|
1229
|
+
return classes.join(' ');
|
|
1230
|
+
};
|
|
1231
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
1232
|
+
title: "Chip Settings"
|
|
1233
|
+
}, /*#__PURE__*/React.createElement(SelectControl, {
|
|
1234
|
+
label: "Intent",
|
|
1235
|
+
value: intent,
|
|
1236
|
+
options: [{
|
|
1237
|
+
label: 'Primary',
|
|
1238
|
+
value: 'primary'
|
|
1239
|
+
}, {
|
|
1240
|
+
label: 'Secondary',
|
|
1241
|
+
value: 'secondary'
|
|
1242
|
+
}, {
|
|
1243
|
+
label: 'Negative',
|
|
1244
|
+
value: 'negative'
|
|
1245
|
+
}],
|
|
1246
|
+
onChange: function onChange(val) {
|
|
1247
|
+
return setAttributes({
|
|
1248
|
+
intent: val
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1252
|
+
label: "Size",
|
|
1253
|
+
value: size,
|
|
1254
|
+
options: [{
|
|
1255
|
+
label: 'Small',
|
|
1256
|
+
value: 'small'
|
|
1257
|
+
}, {
|
|
1258
|
+
label: 'Medium',
|
|
1259
|
+
value: 'medium'
|
|
1260
|
+
}, {
|
|
1261
|
+
label: 'Large',
|
|
1262
|
+
value: 'large'
|
|
1263
|
+
}],
|
|
1264
|
+
onChange: function onChange(val) {
|
|
1265
|
+
return setAttributes({
|
|
1266
|
+
size: val
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1270
|
+
label: "State",
|
|
1271
|
+
value: state,
|
|
1272
|
+
options: [{
|
|
1273
|
+
label: 'Base',
|
|
1274
|
+
value: 'base'
|
|
1275
|
+
}, {
|
|
1276
|
+
label: 'Hover',
|
|
1277
|
+
value: 'hover'
|
|
1278
|
+
}, {
|
|
1279
|
+
label: 'Pressed',
|
|
1280
|
+
value: 'pressed'
|
|
1281
|
+
}, {
|
|
1282
|
+
label: 'Disabled',
|
|
1283
|
+
value: 'disabled'
|
|
1284
|
+
}],
|
|
1285
|
+
onChange: function onChange(val) {
|
|
1286
|
+
return setAttributes({
|
|
1287
|
+
state: val
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
1291
|
+
label: "Channel",
|
|
1292
|
+
checked: channel,
|
|
1293
|
+
onChange: function onChange(val) {
|
|
1294
|
+
return setAttributes({
|
|
1295
|
+
channel: val
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
1299
|
+
label: "Toggle",
|
|
1300
|
+
checked: toggle,
|
|
1301
|
+
onChange: function onChange(val) {
|
|
1302
|
+
return setAttributes({
|
|
1303
|
+
toggle: val
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1307
|
+
label: "Left Icon",
|
|
1308
|
+
value: iconLeft,
|
|
1309
|
+
onChange: function onChange(val) {
|
|
1310
|
+
return setAttributes({
|
|
1311
|
+
iconLeft: val
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1315
|
+
label: "Right Icon",
|
|
1316
|
+
value: iconRight,
|
|
1317
|
+
onChange: function onChange(val) {
|
|
1318
|
+
return setAttributes({
|
|
1319
|
+
iconRight: val
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1323
|
+
label: "Aria Label",
|
|
1324
|
+
value: ariaLabel,
|
|
1325
|
+
onChange: function onChange(val) {
|
|
1326
|
+
return setAttributes({
|
|
1327
|
+
ariaLabel: val
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
}))), /*#__PURE__*/React.createElement("button", _extends({}, blockProps, {
|
|
1331
|
+
className: buildClass(),
|
|
1332
|
+
"aria-label": ariaLabel
|
|
1333
|
+
}), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
1334
|
+
className: "tds-chip__icon-left"
|
|
1335
|
+
}, iconLeft), /*#__PURE__*/React.createElement(RichText, {
|
|
1336
|
+
value: content,
|
|
1337
|
+
onChange: function onChange(val) {
|
|
1338
|
+
return setAttributes({
|
|
1339
|
+
content: val
|
|
1340
|
+
});
|
|
1341
|
+
},
|
|
1342
|
+
placeholder: "Chip text",
|
|
1343
|
+
className: "tds-chip__content"
|
|
1344
|
+
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
1345
|
+
className: "tds-chip__icon-right"
|
|
1346
|
+
}, iconRight)));
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
var save$4 = function save(_ref) {
|
|
1350
|
+
var attributes = _ref.attributes;
|
|
1351
|
+
var content = attributes.content,
|
|
1352
|
+
intent = attributes.intent,
|
|
1353
|
+
size = attributes.size,
|
|
1354
|
+
state = attributes.state,
|
|
1355
|
+
channel = attributes.channel,
|
|
1356
|
+
toggle = attributes.toggle,
|
|
1357
|
+
iconLeft = attributes.iconLeft,
|
|
1358
|
+
iconRight = attributes.iconRight,
|
|
1359
|
+
ariaLabel = attributes.ariaLabel;
|
|
1360
|
+
var blockProps = useBlockProps.save();
|
|
1361
|
+
var buildClass = function buildClass() {
|
|
1362
|
+
var classes = ['tds-chip'];
|
|
1363
|
+
classes.push("tds-chip--intent-".concat(intent));
|
|
1364
|
+
classes.push("tds-chip--size-".concat(size));
|
|
1365
|
+
classes.push("tds-chip--state-".concat(state));
|
|
1366
|
+
if (channel) classes.push('tds-chip--channel');
|
|
1367
|
+
if (toggle) classes.push('tds-chip--toggle');
|
|
1368
|
+
return classes.join(' ');
|
|
1369
|
+
};
|
|
1370
|
+
return /*#__PURE__*/React.createElement("button", _extends({}, blockProps, {
|
|
1371
|
+
className: buildClass(),
|
|
1372
|
+
"aria-label": ariaLabel
|
|
1373
|
+
}), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
1374
|
+
className: "tds-chip__icon-left"
|
|
1375
|
+
}, iconLeft), /*#__PURE__*/React.createElement(RichText.Content, {
|
|
1376
|
+
value: content,
|
|
1377
|
+
className: "tds-chip__content"
|
|
1378
|
+
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
1379
|
+
className: "tds-chip__icon-right"
|
|
1380
|
+
}, iconRight));
|
|
264
1381
|
};
|
|
265
1382
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
1383
|
+
registerBlockType(metadata$4.name, _objectSpread2(_objectSpread2({}, metadata$4), {}, {
|
|
1384
|
+
edit: edit$4,
|
|
1385
|
+
save: save$4
|
|
1386
|
+
}));
|
|
1387
|
+
|
|
1388
|
+
var $schema$3 = "https://schemas.wp.org/trunk/block.json";
|
|
1389
|
+
var apiVersion$3 = 3;
|
|
1390
|
+
var name$3 = "times/flag";
|
|
1391
|
+
var title$3 = "Flag";
|
|
1392
|
+
var category$3 = "common";
|
|
1393
|
+
var description$3 = "Badge or status indicator component";
|
|
1394
|
+
var icon$3 = "flag";
|
|
1395
|
+
var supports$3 = {
|
|
1396
|
+
html: false,
|
|
1397
|
+
spacing: {
|
|
1398
|
+
margin: true
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
1401
|
+
var attributes$3 = {
|
|
1402
|
+
label: {
|
|
1403
|
+
type: "string",
|
|
1404
|
+
"default": ""
|
|
1405
|
+
},
|
|
1406
|
+
content: {
|
|
1407
|
+
type: "string",
|
|
1408
|
+
"default": ""
|
|
1409
|
+
},
|
|
1410
|
+
intent: {
|
|
1411
|
+
type: "string",
|
|
1412
|
+
"default": "secondary",
|
|
1413
|
+
"enum": [
|
|
1414
|
+
"primary",
|
|
1415
|
+
"secondary",
|
|
1416
|
+
"negative",
|
|
1417
|
+
"positive"
|
|
1418
|
+
]
|
|
1419
|
+
},
|
|
1420
|
+
size: {
|
|
1421
|
+
type: "string",
|
|
1422
|
+
"default": "medium",
|
|
1423
|
+
"enum": [
|
|
1424
|
+
"small",
|
|
1425
|
+
"medium",
|
|
1426
|
+
"large"
|
|
1427
|
+
]
|
|
1428
|
+
},
|
|
1429
|
+
iconLeft: {
|
|
1430
|
+
type: "string",
|
|
1431
|
+
"default": ""
|
|
1432
|
+
},
|
|
1433
|
+
iconRight: {
|
|
1434
|
+
type: "string",
|
|
1435
|
+
"default": ""
|
|
1436
|
+
},
|
|
1437
|
+
ariaLabel: {
|
|
1438
|
+
type: "string",
|
|
1439
|
+
"default": ""
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
var example$3 = {
|
|
1443
|
+
};
|
|
1444
|
+
var metadata$3 = {
|
|
1445
|
+
$schema: $schema$3,
|
|
1446
|
+
apiVersion: apiVersion$3,
|
|
1447
|
+
name: name$3,
|
|
1448
|
+
title: title$3,
|
|
1449
|
+
category: category$3,
|
|
1450
|
+
description: description$3,
|
|
1451
|
+
icon: icon$3,
|
|
1452
|
+
supports: supports$3,
|
|
1453
|
+
attributes: attributes$3,
|
|
1454
|
+
example: example$3
|
|
1455
|
+
};
|
|
269
1456
|
|
|
270
|
-
|
|
271
|
-
|
|
1457
|
+
var edit$3 = function edit(_ref) {
|
|
1458
|
+
var attributes = _ref.attributes,
|
|
1459
|
+
setAttributes = _ref.setAttributes;
|
|
1460
|
+
var label = attributes.label,
|
|
1461
|
+
content = attributes.content,
|
|
1462
|
+
intent = attributes.intent,
|
|
1463
|
+
size = attributes.size,
|
|
1464
|
+
iconLeft = attributes.iconLeft,
|
|
1465
|
+
iconRight = attributes.iconRight,
|
|
1466
|
+
ariaLabel = attributes.ariaLabel;
|
|
1467
|
+
var blockProps = useBlockProps();
|
|
1468
|
+
var buildClass = function buildClass() {
|
|
1469
|
+
var classes = ['tds-flag'];
|
|
1470
|
+
classes.push("tds-flag--intent-".concat(intent));
|
|
1471
|
+
classes.push("tds-flag--size-".concat(size));
|
|
1472
|
+
return classes.join(' ');
|
|
1473
|
+
};
|
|
1474
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
1475
|
+
title: "Flag Settings"
|
|
1476
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1477
|
+
label: "Label",
|
|
1478
|
+
value: label,
|
|
1479
|
+
onChange: function onChange(val) {
|
|
1480
|
+
return setAttributes({
|
|
1481
|
+
label: val
|
|
1482
|
+
});
|
|
272
1483
|
}
|
|
1484
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1485
|
+
label: "Intent",
|
|
1486
|
+
value: intent,
|
|
1487
|
+
options: [{
|
|
1488
|
+
label: 'Primary',
|
|
1489
|
+
value: 'primary'
|
|
1490
|
+
}, {
|
|
1491
|
+
label: 'Secondary',
|
|
1492
|
+
value: 'secondary'
|
|
1493
|
+
}, {
|
|
1494
|
+
label: 'Negative',
|
|
1495
|
+
value: 'negative'
|
|
1496
|
+
}, {
|
|
1497
|
+
label: 'Positive',
|
|
1498
|
+
value: 'positive'
|
|
1499
|
+
}],
|
|
1500
|
+
onChange: function onChange(val) {
|
|
1501
|
+
return setAttributes({
|
|
1502
|
+
intent: val
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1506
|
+
label: "Size",
|
|
1507
|
+
value: size,
|
|
1508
|
+
options: [{
|
|
1509
|
+
label: 'Small',
|
|
1510
|
+
value: 'small'
|
|
1511
|
+
}, {
|
|
1512
|
+
label: 'Medium',
|
|
1513
|
+
value: 'medium'
|
|
1514
|
+
}, {
|
|
1515
|
+
label: 'Large',
|
|
1516
|
+
value: 'large'
|
|
1517
|
+
}],
|
|
1518
|
+
onChange: function onChange(val) {
|
|
1519
|
+
return setAttributes({
|
|
1520
|
+
size: val
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1524
|
+
label: "Left Icon",
|
|
1525
|
+
value: iconLeft,
|
|
1526
|
+
onChange: function onChange(val) {
|
|
1527
|
+
return setAttributes({
|
|
1528
|
+
iconLeft: val
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1532
|
+
label: "Right Icon",
|
|
1533
|
+
value: iconRight,
|
|
1534
|
+
onChange: function onChange(val) {
|
|
1535
|
+
return setAttributes({
|
|
1536
|
+
iconRight: val
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
1540
|
+
label: "Aria Label",
|
|
1541
|
+
value: ariaLabel,
|
|
1542
|
+
onChange: function onChange(val) {
|
|
1543
|
+
return setAttributes({
|
|
1544
|
+
ariaLabel: val
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
}))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1548
|
+
className: buildClass(),
|
|
1549
|
+
"aria-label": ariaLabel
|
|
1550
|
+
}), label && /*#__PURE__*/React.createElement("div", {
|
|
1551
|
+
className: "tds-flag__label"
|
|
1552
|
+
}, label), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
1553
|
+
className: "tds-flag__icon-left"
|
|
1554
|
+
}, iconLeft), /*#__PURE__*/React.createElement(RichText, {
|
|
1555
|
+
value: content,
|
|
1556
|
+
onChange: function onChange(val) {
|
|
1557
|
+
return setAttributes({
|
|
1558
|
+
content: val
|
|
1559
|
+
});
|
|
1560
|
+
},
|
|
1561
|
+
placeholder: "Flag content",
|
|
1562
|
+
className: "tds-flag__content"
|
|
1563
|
+
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
1564
|
+
className: "tds-flag__icon-right"
|
|
1565
|
+
}, iconRight)));
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
var save$3 = function save(_ref) {
|
|
1569
|
+
var attributes = _ref.attributes;
|
|
1570
|
+
var label = attributes.label,
|
|
1571
|
+
content = attributes.content,
|
|
1572
|
+
intent = attributes.intent,
|
|
1573
|
+
size = attributes.size,
|
|
1574
|
+
iconLeft = attributes.iconLeft,
|
|
1575
|
+
iconRight = attributes.iconRight,
|
|
1576
|
+
ariaLabel = attributes.ariaLabel;
|
|
1577
|
+
var blockProps = useBlockProps.save();
|
|
1578
|
+
var buildClass = function buildClass() {
|
|
1579
|
+
var classes = ['tds-flag'];
|
|
1580
|
+
classes.push("tds-flag--intent-".concat(intent));
|
|
1581
|
+
classes.push("tds-flag--size-".concat(size));
|
|
1582
|
+
return classes.join(' ');
|
|
1583
|
+
};
|
|
1584
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1585
|
+
className: buildClass(),
|
|
1586
|
+
"aria-label": ariaLabel
|
|
1587
|
+
}), label && /*#__PURE__*/React.createElement("div", {
|
|
1588
|
+
className: "tds-flag__label"
|
|
1589
|
+
}, label), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
1590
|
+
className: "tds-flag__icon-left"
|
|
1591
|
+
}, iconLeft), /*#__PURE__*/React.createElement(RichText.Content, {
|
|
1592
|
+
value: content,
|
|
1593
|
+
className: "tds-flag__content"
|
|
1594
|
+
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
1595
|
+
className: "tds-flag__icon-right"
|
|
1596
|
+
}, iconRight));
|
|
1597
|
+
};
|
|
273
1598
|
|
|
274
|
-
|
|
275
|
-
|
|
1599
|
+
registerBlockType(metadata$3.name, _objectSpread2(_objectSpread2({}, metadata$3), {}, {
|
|
1600
|
+
edit: edit$3,
|
|
1601
|
+
save: save$3
|
|
1602
|
+
}));
|
|
1603
|
+
|
|
1604
|
+
var $schema$2 = "https://schemas.wp.org/trunk/block.json";
|
|
1605
|
+
var apiVersion$2 = 3;
|
|
1606
|
+
var name$2 = "times/toast";
|
|
1607
|
+
var title$2 = "Toast";
|
|
1608
|
+
var category$2 = "common";
|
|
1609
|
+
var description$2 = "Notification toast component";
|
|
1610
|
+
var icon$2 = "bell";
|
|
1611
|
+
var supports$2 = {
|
|
1612
|
+
html: false,
|
|
1613
|
+
spacing: {
|
|
1614
|
+
margin: true
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
var attributes$2 = {
|
|
1618
|
+
label: {
|
|
1619
|
+
type: "string",
|
|
1620
|
+
"default": ""
|
|
1621
|
+
},
|
|
1622
|
+
intent: {
|
|
1623
|
+
type: "string",
|
|
1624
|
+
"default": "info",
|
|
1625
|
+
"enum": [
|
|
1626
|
+
"info",
|
|
1627
|
+
"success",
|
|
1628
|
+
"warning",
|
|
1629
|
+
"error"
|
|
1630
|
+
]
|
|
1631
|
+
},
|
|
1632
|
+
link: {
|
|
1633
|
+
type: "boolean",
|
|
1634
|
+
"default": false
|
|
1635
|
+
},
|
|
1636
|
+
linkLabel: {
|
|
1637
|
+
type: "string",
|
|
1638
|
+
"default": ""
|
|
1639
|
+
},
|
|
1640
|
+
timeout: {
|
|
1641
|
+
type: "number",
|
|
1642
|
+
"default": 5000
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
var example$2 = {
|
|
1646
|
+
};
|
|
1647
|
+
var metadata$2 = {
|
|
1648
|
+
$schema: $schema$2,
|
|
1649
|
+
apiVersion: apiVersion$2,
|
|
1650
|
+
name: name$2,
|
|
1651
|
+
title: title$2,
|
|
1652
|
+
category: category$2,
|
|
1653
|
+
description: description$2,
|
|
1654
|
+
icon: icon$2,
|
|
1655
|
+
supports: supports$2,
|
|
1656
|
+
attributes: attributes$2,
|
|
1657
|
+
example: example$2
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
var edit$2 = function edit(_ref) {
|
|
1661
|
+
var attributes = _ref.attributes,
|
|
1662
|
+
setAttributes = _ref.setAttributes;
|
|
1663
|
+
var label = attributes.label,
|
|
1664
|
+
intent = attributes.intent,
|
|
1665
|
+
link = attributes.link,
|
|
1666
|
+
linkLabel = attributes.linkLabel,
|
|
1667
|
+
timeout = attributes.timeout;
|
|
1668
|
+
var blockProps = useBlockProps();
|
|
1669
|
+
var buildClass = function buildClass() {
|
|
1670
|
+
var classes = ['tds-toast'];
|
|
1671
|
+
classes.push("tds-toast--intent-".concat(intent));
|
|
1672
|
+
return classes.join(' ');
|
|
1673
|
+
};
|
|
1674
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
1675
|
+
title: "Toast Settings"
|
|
1676
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1677
|
+
label: "Label",
|
|
1678
|
+
value: label,
|
|
1679
|
+
onChange: function onChange(val) {
|
|
1680
|
+
return setAttributes({
|
|
1681
|
+
label: val
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1685
|
+
label: "Intent",
|
|
1686
|
+
value: intent,
|
|
1687
|
+
options: [{
|
|
1688
|
+
label: 'Info',
|
|
1689
|
+
value: 'info'
|
|
1690
|
+
}, {
|
|
1691
|
+
label: 'Success',
|
|
1692
|
+
value: 'success'
|
|
1693
|
+
}, {
|
|
1694
|
+
label: 'Warning',
|
|
1695
|
+
value: 'warning'
|
|
1696
|
+
}, {
|
|
1697
|
+
label: 'Error',
|
|
1698
|
+
value: 'error'
|
|
1699
|
+
}],
|
|
1700
|
+
onChange: function onChange(val) {
|
|
1701
|
+
return setAttributes({
|
|
1702
|
+
intent: val
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
1706
|
+
label: "Show Link",
|
|
1707
|
+
checked: link,
|
|
1708
|
+
onChange: function onChange(val) {
|
|
1709
|
+
return setAttributes({
|
|
1710
|
+
link: val
|
|
1711
|
+
});
|
|
276
1712
|
}
|
|
1713
|
+
}), link && /*#__PURE__*/React.createElement(TextControl, {
|
|
1714
|
+
label: "Link Label",
|
|
1715
|
+
value: linkLabel,
|
|
1716
|
+
onChange: function onChange(val) {
|
|
1717
|
+
return setAttributes({
|
|
1718
|
+
linkLabel: val
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
}), /*#__PURE__*/React.createElement(NumberControl, {
|
|
1722
|
+
label: "Timeout (ms)",
|
|
1723
|
+
value: timeout,
|
|
1724
|
+
onChange: function onChange(val) {
|
|
1725
|
+
return setAttributes({
|
|
1726
|
+
timeout: val || 0
|
|
1727
|
+
});
|
|
1728
|
+
},
|
|
1729
|
+
min: 0,
|
|
1730
|
+
step: 1000
|
|
1731
|
+
}))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1732
|
+
className: buildClass(),
|
|
1733
|
+
role: "status",
|
|
1734
|
+
"aria-live": "polite"
|
|
1735
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1736
|
+
className: "tds-toast__content"
|
|
1737
|
+
}, /*#__PURE__*/React.createElement(RichText, {
|
|
1738
|
+
value: label,
|
|
1739
|
+
onChange: function onChange(val) {
|
|
1740
|
+
return setAttributes({
|
|
1741
|
+
label: val
|
|
1742
|
+
});
|
|
1743
|
+
},
|
|
1744
|
+
placeholder: "Toast message",
|
|
1745
|
+
className: "tds-toast__label"
|
|
1746
|
+
})), link && /*#__PURE__*/React.createElement("button", {
|
|
1747
|
+
className: "tds-toast__link"
|
|
1748
|
+
}, linkLabel)));
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
var save$2 = function save(_ref) {
|
|
1752
|
+
var attributes = _ref.attributes;
|
|
1753
|
+
var label = attributes.label,
|
|
1754
|
+
intent = attributes.intent,
|
|
1755
|
+
link = attributes.link,
|
|
1756
|
+
linkLabel = attributes.linkLabel,
|
|
1757
|
+
timeout = attributes.timeout;
|
|
1758
|
+
var blockProps = useBlockProps.save();
|
|
1759
|
+
var buildClass = function buildClass() {
|
|
1760
|
+
var classes = ['tds-toast'];
|
|
1761
|
+
classes.push("tds-toast--intent-".concat(intent));
|
|
1762
|
+
return classes.join(' ');
|
|
1763
|
+
};
|
|
1764
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
1765
|
+
className: buildClass(),
|
|
1766
|
+
role: "status",
|
|
1767
|
+
"aria-live": "polite",
|
|
1768
|
+
"data-timeout": timeout
|
|
1769
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1770
|
+
className: "tds-toast__content"
|
|
1771
|
+
}, /*#__PURE__*/React.createElement(RichText.Content, {
|
|
1772
|
+
value: label,
|
|
1773
|
+
className: "tds-toast__label"
|
|
1774
|
+
})), link && /*#__PURE__*/React.createElement("button", {
|
|
1775
|
+
className: "tds-toast__link"
|
|
1776
|
+
}, linkLabel));
|
|
1777
|
+
};
|
|
1778
|
+
|
|
1779
|
+
registerBlockType(metadata$2.name, _objectSpread2(_objectSpread2({}, metadata$2), {}, {
|
|
1780
|
+
edit: edit$2,
|
|
1781
|
+
save: save$2
|
|
1782
|
+
}));
|
|
277
1783
|
|
|
278
|
-
|
|
279
|
-
|
|
1784
|
+
var $schema$1 = "https://schemas.wp.org/trunk/block.json";
|
|
1785
|
+
var apiVersion$1 = 3;
|
|
1786
|
+
var name$1 = "times/link";
|
|
1787
|
+
var title$1 = "Link";
|
|
1788
|
+
var category$1 = "common";
|
|
1789
|
+
var description$1 = "Styled link component with variants and states";
|
|
1790
|
+
var icon$1 = "link";
|
|
1791
|
+
var supports$1 = {
|
|
1792
|
+
html: false,
|
|
1793
|
+
spacing: {
|
|
1794
|
+
margin: true
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
var attributes$1 = {
|
|
1798
|
+
href: {
|
|
1799
|
+
type: "string",
|
|
1800
|
+
"default": ""
|
|
1801
|
+
},
|
|
1802
|
+
content: {
|
|
1803
|
+
type: "string",
|
|
1804
|
+
"default": ""
|
|
1805
|
+
},
|
|
1806
|
+
intent: {
|
|
1807
|
+
type: "string",
|
|
1808
|
+
"default": "primary",
|
|
1809
|
+
"enum": [
|
|
1810
|
+
"primary",
|
|
1811
|
+
"secondary",
|
|
1812
|
+
"negative"
|
|
1813
|
+
]
|
|
1814
|
+
},
|
|
1815
|
+
sentiment: {
|
|
1816
|
+
type: "string",
|
|
1817
|
+
"default": "neutral",
|
|
1818
|
+
"enum": [
|
|
1819
|
+
"neutral",
|
|
1820
|
+
"positive",
|
|
1821
|
+
"negative"
|
|
1822
|
+
]
|
|
1823
|
+
},
|
|
1824
|
+
size: {
|
|
1825
|
+
type: "string",
|
|
1826
|
+
"default": "medium",
|
|
1827
|
+
"enum": [
|
|
1828
|
+
"small",
|
|
1829
|
+
"medium",
|
|
1830
|
+
"large"
|
|
1831
|
+
]
|
|
1832
|
+
},
|
|
1833
|
+
state: {
|
|
1834
|
+
type: "string",
|
|
1835
|
+
"default": "base",
|
|
1836
|
+
"enum": [
|
|
1837
|
+
"base",
|
|
1838
|
+
"hover",
|
|
1839
|
+
"visited",
|
|
1840
|
+
"focus",
|
|
1841
|
+
"disabled"
|
|
1842
|
+
]
|
|
1843
|
+
},
|
|
1844
|
+
iconLeft: {
|
|
1845
|
+
type: "string",
|
|
1846
|
+
"default": ""
|
|
1847
|
+
},
|
|
1848
|
+
iconRight: {
|
|
1849
|
+
type: "string",
|
|
1850
|
+
"default": ""
|
|
1851
|
+
},
|
|
1852
|
+
inline: {
|
|
1853
|
+
type: "boolean",
|
|
1854
|
+
"default": true
|
|
1855
|
+
},
|
|
1856
|
+
ariaLabel: {
|
|
1857
|
+
type: "string",
|
|
1858
|
+
"default": ""
|
|
1859
|
+
},
|
|
1860
|
+
target: {
|
|
1861
|
+
type: "string",
|
|
1862
|
+
"default": "_self",
|
|
1863
|
+
"enum": [
|
|
1864
|
+
"_self",
|
|
1865
|
+
"_blank",
|
|
1866
|
+
"_parent",
|
|
1867
|
+
"_top"
|
|
1868
|
+
]
|
|
1869
|
+
},
|
|
1870
|
+
rel: {
|
|
1871
|
+
type: "string",
|
|
1872
|
+
"default": ""
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
var example$1 = {
|
|
1876
|
+
};
|
|
1877
|
+
var metadata$1 = {
|
|
1878
|
+
$schema: $schema$1,
|
|
1879
|
+
apiVersion: apiVersion$1,
|
|
1880
|
+
name: name$1,
|
|
1881
|
+
title: title$1,
|
|
1882
|
+
category: category$1,
|
|
1883
|
+
description: description$1,
|
|
1884
|
+
icon: icon$1,
|
|
1885
|
+
supports: supports$1,
|
|
1886
|
+
attributes: attributes$1,
|
|
1887
|
+
example: example$1
|
|
1888
|
+
};
|
|
1889
|
+
|
|
1890
|
+
var edit$1 = function edit(_ref) {
|
|
1891
|
+
var attributes = _ref.attributes,
|
|
1892
|
+
setAttributes = _ref.setAttributes;
|
|
1893
|
+
var href = attributes.href,
|
|
1894
|
+
content = attributes.content,
|
|
1895
|
+
intent = attributes.intent,
|
|
1896
|
+
sentiment = attributes.sentiment,
|
|
1897
|
+
size = attributes.size,
|
|
1898
|
+
state = attributes.state,
|
|
1899
|
+
iconLeft = attributes.iconLeft,
|
|
1900
|
+
iconRight = attributes.iconRight,
|
|
1901
|
+
inline = attributes.inline,
|
|
1902
|
+
ariaLabel = attributes.ariaLabel,
|
|
1903
|
+
target = attributes.target,
|
|
1904
|
+
rel = attributes.rel;
|
|
1905
|
+
var blockProps = useBlockProps();
|
|
1906
|
+
var buildClass = function buildClass() {
|
|
1907
|
+
var classes = ['tds-link'];
|
|
1908
|
+
classes.push("tds-link--intent-".concat(intent));
|
|
1909
|
+
classes.push("tds-link--sentiment-".concat(sentiment));
|
|
1910
|
+
classes.push("tds-link--size-".concat(size));
|
|
1911
|
+
classes.push("tds-link--state-".concat(state));
|
|
1912
|
+
if (!inline) classes.push('tds-link--block');
|
|
1913
|
+
return classes.join(' ');
|
|
1914
|
+
};
|
|
1915
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
1916
|
+
title: "Link Settings"
|
|
1917
|
+
}, /*#__PURE__*/React.createElement(TextControl, {
|
|
1918
|
+
label: "URL",
|
|
1919
|
+
value: href,
|
|
1920
|
+
onChange: function onChange(val) {
|
|
1921
|
+
return setAttributes({
|
|
1922
|
+
href: val
|
|
1923
|
+
});
|
|
1924
|
+
},
|
|
1925
|
+
type: "url"
|
|
1926
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1927
|
+
label: "Intent",
|
|
1928
|
+
value: intent,
|
|
1929
|
+
options: [{
|
|
1930
|
+
label: 'Primary',
|
|
1931
|
+
value: 'primary'
|
|
1932
|
+
}, {
|
|
1933
|
+
label: 'Secondary',
|
|
1934
|
+
value: 'secondary'
|
|
1935
|
+
}, {
|
|
1936
|
+
label: 'Negative',
|
|
1937
|
+
value: 'negative'
|
|
1938
|
+
}],
|
|
1939
|
+
onChange: function onChange(val) {
|
|
1940
|
+
return setAttributes({
|
|
1941
|
+
intent: val
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1945
|
+
label: "Sentiment",
|
|
1946
|
+
value: sentiment,
|
|
1947
|
+
options: [{
|
|
1948
|
+
label: 'Neutral',
|
|
1949
|
+
value: 'neutral'
|
|
1950
|
+
}, {
|
|
1951
|
+
label: 'Positive',
|
|
1952
|
+
value: 'positive'
|
|
1953
|
+
}, {
|
|
1954
|
+
label: 'Negative',
|
|
1955
|
+
value: 'negative'
|
|
1956
|
+
}],
|
|
1957
|
+
onChange: function onChange(val) {
|
|
1958
|
+
return setAttributes({
|
|
1959
|
+
sentiment: val
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1963
|
+
label: "Size",
|
|
1964
|
+
value: size,
|
|
1965
|
+
options: [{
|
|
1966
|
+
label: 'Small',
|
|
1967
|
+
value: 'small'
|
|
1968
|
+
}, {
|
|
1969
|
+
label: 'Medium',
|
|
1970
|
+
value: 'medium'
|
|
1971
|
+
}, {
|
|
1972
|
+
label: 'Large',
|
|
1973
|
+
value: 'large'
|
|
1974
|
+
}],
|
|
1975
|
+
onChange: function onChange(val) {
|
|
1976
|
+
return setAttributes({
|
|
1977
|
+
size: val
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
1981
|
+
label: "State",
|
|
1982
|
+
value: state,
|
|
1983
|
+
options: [{
|
|
1984
|
+
label: 'Base',
|
|
1985
|
+
value: 'base'
|
|
1986
|
+
}, {
|
|
1987
|
+
label: 'Hover',
|
|
1988
|
+
value: 'hover'
|
|
1989
|
+
}, {
|
|
1990
|
+
label: 'Visited',
|
|
1991
|
+
value: 'visited'
|
|
1992
|
+
}, {
|
|
1993
|
+
label: 'Focus',
|
|
1994
|
+
value: 'focus'
|
|
1995
|
+
}, {
|
|
1996
|
+
label: 'Disabled',
|
|
1997
|
+
value: 'disabled'
|
|
1998
|
+
}],
|
|
1999
|
+
onChange: function onChange(val) {
|
|
2000
|
+
return setAttributes({
|
|
2001
|
+
state: val
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
2005
|
+
label: "Left Icon",
|
|
2006
|
+
value: iconLeft,
|
|
2007
|
+
onChange: function onChange(val) {
|
|
2008
|
+
return setAttributes({
|
|
2009
|
+
iconLeft: val
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
2013
|
+
label: "Right Icon",
|
|
2014
|
+
value: iconRight,
|
|
2015
|
+
onChange: function onChange(val) {
|
|
2016
|
+
return setAttributes({
|
|
2017
|
+
iconRight: val
|
|
2018
|
+
});
|
|
280
2019
|
}
|
|
2020
|
+
}), /*#__PURE__*/React.createElement(ToggleControl, {
|
|
2021
|
+
label: "Inline",
|
|
2022
|
+
checked: inline,
|
|
2023
|
+
onChange: function onChange(val) {
|
|
2024
|
+
return setAttributes({
|
|
2025
|
+
inline: val
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
}), /*#__PURE__*/React.createElement(SelectControl, {
|
|
2029
|
+
label: "Target",
|
|
2030
|
+
value: target,
|
|
2031
|
+
options: [{
|
|
2032
|
+
label: 'Same window',
|
|
2033
|
+
value: '_self'
|
|
2034
|
+
}, {
|
|
2035
|
+
label: 'New window',
|
|
2036
|
+
value: '_blank'
|
|
2037
|
+
}, {
|
|
2038
|
+
label: 'Parent',
|
|
2039
|
+
value: '_parent'
|
|
2040
|
+
}, {
|
|
2041
|
+
label: 'Top',
|
|
2042
|
+
value: '_top'
|
|
2043
|
+
}],
|
|
2044
|
+
onChange: function onChange(val) {
|
|
2045
|
+
return setAttributes({
|
|
2046
|
+
target: val
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
2050
|
+
label: "Rel",
|
|
2051
|
+
value: rel,
|
|
2052
|
+
onChange: function onChange(val) {
|
|
2053
|
+
return setAttributes({
|
|
2054
|
+
rel: val
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
2058
|
+
label: "Aria Label",
|
|
2059
|
+
value: ariaLabel,
|
|
2060
|
+
onChange: function onChange(val) {
|
|
2061
|
+
return setAttributes({
|
|
2062
|
+
ariaLabel: val
|
|
2063
|
+
});
|
|
2064
|
+
}
|
|
2065
|
+
}))), /*#__PURE__*/React.createElement("a", _extends({}, blockProps, {
|
|
2066
|
+
href: href || '#',
|
|
2067
|
+
className: buildClass(),
|
|
2068
|
+
"aria-label": ariaLabel,
|
|
2069
|
+
target: target,
|
|
2070
|
+
rel: rel
|
|
2071
|
+
}), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
2072
|
+
className: "tds-link__icon-left"
|
|
2073
|
+
}, iconLeft), /*#__PURE__*/React.createElement(RichText, {
|
|
2074
|
+
value: content,
|
|
2075
|
+
onChange: function onChange(val) {
|
|
2076
|
+
return setAttributes({
|
|
2077
|
+
content: val
|
|
2078
|
+
});
|
|
2079
|
+
},
|
|
2080
|
+
placeholder: "Link text",
|
|
2081
|
+
className: "tds-link__content"
|
|
2082
|
+
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
2083
|
+
className: "tds-link__icon-right"
|
|
2084
|
+
}, iconRight)));
|
|
2085
|
+
};
|
|
2086
|
+
|
|
2087
|
+
var save$1 = function save(_ref) {
|
|
2088
|
+
var attributes = _ref.attributes;
|
|
2089
|
+
var href = attributes.href,
|
|
2090
|
+
content = attributes.content,
|
|
2091
|
+
intent = attributes.intent,
|
|
2092
|
+
sentiment = attributes.sentiment,
|
|
2093
|
+
size = attributes.size,
|
|
2094
|
+
state = attributes.state,
|
|
2095
|
+
iconLeft = attributes.iconLeft,
|
|
2096
|
+
iconRight = attributes.iconRight,
|
|
2097
|
+
inline = attributes.inline,
|
|
2098
|
+
ariaLabel = attributes.ariaLabel,
|
|
2099
|
+
target = attributes.target,
|
|
2100
|
+
rel = attributes.rel;
|
|
2101
|
+
var blockProps = useBlockProps.save();
|
|
2102
|
+
var buildClass = function buildClass() {
|
|
2103
|
+
var classes = ['tds-link'];
|
|
2104
|
+
classes.push("tds-link--intent-".concat(intent));
|
|
2105
|
+
classes.push("tds-link--sentiment-".concat(sentiment));
|
|
2106
|
+
classes.push("tds-link--size-".concat(size));
|
|
2107
|
+
classes.push("tds-link--state-".concat(state));
|
|
2108
|
+
if (!inline) classes.push('tds-link--block');
|
|
2109
|
+
return classes.join(' ');
|
|
2110
|
+
};
|
|
2111
|
+
return /*#__PURE__*/React.createElement("a", _extends({}, blockProps, {
|
|
2112
|
+
href: href,
|
|
2113
|
+
className: buildClass(),
|
|
2114
|
+
"aria-label": ariaLabel,
|
|
2115
|
+
target: target !== '_self' ? target : undefined,
|
|
2116
|
+
rel: rel || undefined
|
|
2117
|
+
}), iconLeft && /*#__PURE__*/React.createElement("span", {
|
|
2118
|
+
className: "tds-link__icon-left"
|
|
2119
|
+
}, iconLeft), /*#__PURE__*/React.createElement(RichText.Content, {
|
|
2120
|
+
value: content,
|
|
2121
|
+
className: "tds-link__content"
|
|
2122
|
+
}), iconRight && /*#__PURE__*/React.createElement("span", {
|
|
2123
|
+
className: "tds-link__icon-right"
|
|
2124
|
+
}, iconRight));
|
|
2125
|
+
};
|
|
2126
|
+
|
|
2127
|
+
registerBlockType(metadata$1.name, _objectSpread2(_objectSpread2({}, metadata$1), {}, {
|
|
2128
|
+
edit: edit$1,
|
|
2129
|
+
save: save$1
|
|
2130
|
+
}));
|
|
281
2131
|
|
|
282
|
-
|
|
283
|
-
|
|
2132
|
+
var $schema = "https://schemas.wp.org/trunk/block.json";
|
|
2133
|
+
var apiVersion = 3;
|
|
2134
|
+
var name = "times/ad-container";
|
|
2135
|
+
var title = "Ad Container";
|
|
2136
|
+
var category = "common";
|
|
2137
|
+
var description = "Advertising container placeholder";
|
|
2138
|
+
var icon = "image";
|
|
2139
|
+
var supports = {
|
|
2140
|
+
html: false,
|
|
2141
|
+
spacing: {
|
|
2142
|
+
margin: true,
|
|
2143
|
+
padding: true
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
var attributes = {
|
|
2147
|
+
type: {
|
|
2148
|
+
type: "string",
|
|
2149
|
+
"default": "inline",
|
|
2150
|
+
"enum": [
|
|
2151
|
+
"header",
|
|
2152
|
+
"inline"
|
|
2153
|
+
]
|
|
2154
|
+
},
|
|
2155
|
+
slotID: {
|
|
2156
|
+
type: "string",
|
|
2157
|
+
"default": ""
|
|
2158
|
+
}
|
|
2159
|
+
};
|
|
2160
|
+
var example = {
|
|
2161
|
+
};
|
|
2162
|
+
var metadata = {
|
|
2163
|
+
$schema: $schema,
|
|
2164
|
+
apiVersion: apiVersion,
|
|
2165
|
+
name: name,
|
|
2166
|
+
title: title,
|
|
2167
|
+
category: category,
|
|
2168
|
+
description: description,
|
|
2169
|
+
icon: icon,
|
|
2170
|
+
supports: supports,
|
|
2171
|
+
attributes: attributes,
|
|
2172
|
+
example: example
|
|
2173
|
+
};
|
|
2174
|
+
|
|
2175
|
+
var edit = function edit(_ref) {
|
|
2176
|
+
var attributes = _ref.attributes,
|
|
2177
|
+
setAttributes = _ref.setAttributes;
|
|
2178
|
+
var type = attributes.type,
|
|
2179
|
+
slotID = attributes.slotID;
|
|
2180
|
+
var blockProps = useBlockProps();
|
|
2181
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, {
|
|
2182
|
+
title: "Ad Container Settings"
|
|
2183
|
+
}, /*#__PURE__*/React.createElement(SelectControl, {
|
|
2184
|
+
label: "Type",
|
|
2185
|
+
value: type,
|
|
2186
|
+
options: [{
|
|
2187
|
+
label: 'Header',
|
|
2188
|
+
value: 'header'
|
|
2189
|
+
}, {
|
|
2190
|
+
label: 'Inline',
|
|
2191
|
+
value: 'inline'
|
|
2192
|
+
}],
|
|
2193
|
+
onChange: function onChange(val) {
|
|
2194
|
+
return setAttributes({
|
|
2195
|
+
type: val
|
|
2196
|
+
});
|
|
284
2197
|
}
|
|
285
|
-
}
|
|
286
|
-
|
|
2198
|
+
}), /*#__PURE__*/React.createElement(TextControl, {
|
|
2199
|
+
label: "Slot ID",
|
|
2200
|
+
value: slotID,
|
|
2201
|
+
onChange: function onChange(val) {
|
|
2202
|
+
return setAttributes({
|
|
2203
|
+
slotID: val
|
|
2204
|
+
});
|
|
2205
|
+
},
|
|
2206
|
+
placeholder: "e.g., /123456789/section/article-top"
|
|
2207
|
+
}))), /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
2208
|
+
className: "tds-ad-container tds-ad-container--".concat(type),
|
|
2209
|
+
"data-slot-id": slotID
|
|
2210
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
2211
|
+
className: "tds-ad-container__placeholder"
|
|
2212
|
+
}, /*#__PURE__*/React.createElement("p", null, "Ad Slot: ", slotID || '(not configured)'))));
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
var save = function save(_ref) {
|
|
2216
|
+
var attributes = _ref.attributes;
|
|
2217
|
+
var type = attributes.type,
|
|
2218
|
+
slotID = attributes.slotID;
|
|
2219
|
+
var blockProps = useBlockProps.save();
|
|
2220
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, blockProps, {
|
|
2221
|
+
className: "tds-ad-container tds-ad-container--".concat(type),
|
|
2222
|
+
"data-slot-id": slotID
|
|
2223
|
+
}));
|
|
2224
|
+
};
|
|
287
2225
|
|
|
288
|
-
|
|
2226
|
+
registerBlockType(metadata.name, _objectSpread2(_objectSpread2({}, metadata), {}, {
|
|
2227
|
+
edit: edit,
|
|
2228
|
+
save: save
|
|
2229
|
+
}));
|
|
289
2230
|
//# sourceMappingURL=index.js.map
|