@wp-typia/project-tools 0.16.8 → 0.16.9
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/README.md +14 -4
- package/dist/runtime/block-generator-service.d.ts +5 -1
- package/dist/runtime/block-generator-service.js +7 -3
- package/dist/runtime/built-in-block-artifacts.js +171 -423
- package/dist/runtime/built-in-block-code-artifacts.js +96 -46
- package/dist/runtime/built-in-block-code-templates.d.ts +36 -0
- package/dist/runtime/built-in-block-code-templates.js +2233 -0
- package/dist/runtime/cli-add-block.d.ts +2 -1
- package/dist/runtime/cli-add-block.js +163 -25
- package/dist/runtime/cli-add-shared.d.ts +7 -0
- package/dist/runtime/cli-add-shared.js +4 -6
- package/dist/runtime/cli-add-workspace.js +56 -17
- package/dist/runtime/cli-core.d.ts +4 -0
- package/dist/runtime/cli-core.js +3 -0
- package/dist/runtime/cli-diagnostics.d.ts +58 -0
- package/dist/runtime/cli-diagnostics.js +101 -0
- package/dist/runtime/cli-doctor.d.ts +2 -1
- package/dist/runtime/cli-doctor.js +16 -5
- package/dist/runtime/cli-help.js +4 -4
- package/dist/runtime/cli-scaffold.d.ts +5 -1
- package/dist/runtime/cli-scaffold.js +138 -111
- package/dist/runtime/external-layer-selection.d.ts +14 -0
- package/dist/runtime/external-layer-selection.js +35 -0
- package/dist/runtime/index.d.ts +2 -2
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/migration-render.d.ts +23 -1
- package/dist/runtime/migration-render.js +58 -10
- package/dist/runtime/migration-ui-capability.js +17 -8
- package/dist/runtime/migration-utils.d.ts +7 -6
- package/dist/runtime/migration-utils.js +76 -73
- package/dist/runtime/migrations.js +2 -2
- package/dist/runtime/object-utils.d.ts +8 -1
- package/dist/runtime/object-utils.js +21 -1
- package/dist/runtime/scaffold-apply-utils.d.ts +14 -2
- package/dist/runtime/scaffold-apply-utils.js +19 -6
- package/dist/runtime/scaffold-repository-reference.d.ts +22 -0
- package/dist/runtime/scaffold-repository-reference.js +119 -0
- package/dist/runtime/scaffold.d.ts +5 -1
- package/dist/runtime/scaffold.js +15 -37
- package/dist/runtime/template-layers.d.ts +6 -0
- package/dist/runtime/template-layers.js +20 -7
- package/dist/runtime/template-render.d.ts +13 -2
- package/dist/runtime/template-render.js +102 -71
- package/dist/runtime/template-source.d.ts +6 -5
- package/dist/runtime/template-source.js +284 -217
- package/package.json +8 -3
- package/templates/_shared/base/src/validator-toolkit.ts.mustache +2 -2
- package/templates/_shared/compound/core/scripts/add-compound-child.ts.mustache +58 -12
- package/templates/_shared/migration-ui/common/src/migrations/helpers.ts +19 -47
- package/templates/_shared/migration-ui/common/src/migrations/index.ts +40 -11
|
@@ -63,16 +63,59 @@ function createBlockJsonAttribute({ defaultValue, enumValues = null, selector, s
|
|
|
63
63
|
}
|
|
64
64
|
return attribute;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function describe(...lines) {
|
|
67
67
|
return {
|
|
68
|
-
|
|
68
|
+
lines,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function defineAttribute({ blockJsonDefaultValue, constraints, defaultValue, description, enumValues = null, kind, manifestDefaultValue, name, optional, selector = null, source = null, sourceType, typeExpression, }) {
|
|
72
|
+
const resolvedBlockJsonDefaultValue = blockJsonDefaultValue !== undefined ? blockJsonDefaultValue : defaultValue;
|
|
73
|
+
const resolvedManifestDefaultValue = manifestDefaultValue !== undefined ? manifestDefaultValue : defaultValue;
|
|
74
|
+
return {
|
|
75
|
+
blockJson: {
|
|
76
|
+
defaultValue: resolvedBlockJsonDefaultValue,
|
|
77
|
+
enumValues,
|
|
78
|
+
...(selector ? { selector } : {}),
|
|
79
|
+
...(source ? { source } : {}),
|
|
80
|
+
type: sourceType,
|
|
81
|
+
},
|
|
69
82
|
description,
|
|
70
|
-
manifest
|
|
83
|
+
manifest: {
|
|
84
|
+
constraints,
|
|
85
|
+
defaultValue: resolvedManifestDefaultValue,
|
|
86
|
+
enumValues,
|
|
87
|
+
kind,
|
|
88
|
+
required: !optional,
|
|
89
|
+
selector,
|
|
90
|
+
source,
|
|
91
|
+
sourceType,
|
|
92
|
+
},
|
|
71
93
|
name,
|
|
72
94
|
optional,
|
|
73
95
|
typeExpression,
|
|
74
96
|
};
|
|
75
97
|
}
|
|
98
|
+
function defineStringAttribute(spec) {
|
|
99
|
+
return defineAttribute({
|
|
100
|
+
...spec,
|
|
101
|
+
kind: "string",
|
|
102
|
+
sourceType: "string",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function defineBooleanAttribute(spec) {
|
|
106
|
+
return defineAttribute({
|
|
107
|
+
...spec,
|
|
108
|
+
kind: "boolean",
|
|
109
|
+
sourceType: "boolean",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function defineNumberAttribute(spec) {
|
|
113
|
+
return defineAttribute({
|
|
114
|
+
...spec,
|
|
115
|
+
kind: "number",
|
|
116
|
+
sourceType: "number",
|
|
117
|
+
});
|
|
118
|
+
}
|
|
76
119
|
function buildManifestDocument(sourceType, attributes) {
|
|
77
120
|
return {
|
|
78
121
|
attributes: Object.fromEntries(attributes.map((attribute) => [
|
|
@@ -134,122 +177,56 @@ function stringifyBlockJsonDocument(document) {
|
|
|
134
177
|
}
|
|
135
178
|
function buildBasicAttributes() {
|
|
136
179
|
return [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
type: "string",
|
|
141
|
-
},
|
|
142
|
-
description: {
|
|
143
|
-
lines: ["Main block content"],
|
|
144
|
-
},
|
|
145
|
-
manifest: {
|
|
146
|
-
constraints: {
|
|
147
|
-
maxLength: 1000,
|
|
148
|
-
},
|
|
149
|
-
defaultValue: "",
|
|
150
|
-
kind: "string",
|
|
151
|
-
required: true,
|
|
152
|
-
sourceType: "string",
|
|
180
|
+
defineStringAttribute({
|
|
181
|
+
constraints: {
|
|
182
|
+
maxLength: 1000,
|
|
153
183
|
},
|
|
184
|
+
defaultValue: "",
|
|
185
|
+
description: describe("Main block content"),
|
|
154
186
|
name: "content",
|
|
155
187
|
optional: false,
|
|
156
188
|
typeExpression: 'string & tags.MaxLength<1000> & tags.Default<"">',
|
|
157
189
|
}),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
type: "string",
|
|
163
|
-
},
|
|
164
|
-
description: {
|
|
165
|
-
lines: ["Alignment"],
|
|
166
|
-
},
|
|
167
|
-
manifest: {
|
|
168
|
-
defaultValue: "left",
|
|
169
|
-
enumValues: [...BASIC_ALIGNMENT_VALUES],
|
|
170
|
-
kind: "string",
|
|
171
|
-
required: false,
|
|
172
|
-
sourceType: "string",
|
|
173
|
-
},
|
|
190
|
+
defineStringAttribute({
|
|
191
|
+
defaultValue: "left",
|
|
192
|
+
description: describe("Alignment"),
|
|
193
|
+
enumValues: [...BASIC_ALIGNMENT_VALUES],
|
|
174
194
|
name: "alignment",
|
|
175
195
|
optional: true,
|
|
176
196
|
typeExpression: 'TextAlignment & tags.Default<"left">',
|
|
177
197
|
}),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
type: "boolean",
|
|
182
|
-
},
|
|
183
|
-
description: {
|
|
184
|
-
lines: ["Visibility toggle"],
|
|
185
|
-
},
|
|
186
|
-
manifest: {
|
|
187
|
-
defaultValue: true,
|
|
188
|
-
kind: "boolean",
|
|
189
|
-
required: false,
|
|
190
|
-
sourceType: "boolean",
|
|
191
|
-
},
|
|
198
|
+
defineBooleanAttribute({
|
|
199
|
+
defaultValue: true,
|
|
200
|
+
description: describe("Visibility toggle"),
|
|
192
201
|
name: "isVisible",
|
|
193
202
|
optional: true,
|
|
194
203
|
typeExpression: "boolean & tags.Default<true>",
|
|
195
204
|
}),
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
type: "string",
|
|
200
|
-
},
|
|
201
|
-
description: {
|
|
202
|
-
lines: ["Custom CSS class"],
|
|
203
|
-
},
|
|
204
|
-
manifest: {
|
|
205
|
-
constraints: {
|
|
206
|
-
maxLength: 100,
|
|
207
|
-
},
|
|
208
|
-
defaultValue: "",
|
|
209
|
-
kind: "string",
|
|
210
|
-
required: false,
|
|
211
|
-
sourceType: "string",
|
|
205
|
+
defineStringAttribute({
|
|
206
|
+
constraints: {
|
|
207
|
+
maxLength: 100,
|
|
212
208
|
},
|
|
209
|
+
defaultValue: "",
|
|
210
|
+
description: describe("Custom CSS class"),
|
|
213
211
|
name: "className",
|
|
214
212
|
optional: true,
|
|
215
213
|
typeExpression: 'string & tags.MaxLength<100> & tags.Default<"">',
|
|
216
214
|
}),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
description: {
|
|
222
|
-
lines: ["Generated runtime ID"],
|
|
223
|
-
},
|
|
224
|
-
manifest: {
|
|
225
|
-
constraints: {
|
|
226
|
-
format: "uuid",
|
|
227
|
-
},
|
|
228
|
-
kind: "string",
|
|
229
|
-
required: false,
|
|
230
|
-
sourceType: "string",
|
|
215
|
+
defineStringAttribute({
|
|
216
|
+
constraints: {
|
|
217
|
+
format: "uuid",
|
|
231
218
|
},
|
|
219
|
+
description: describe("Generated runtime ID"),
|
|
232
220
|
name: "id",
|
|
233
221
|
optional: true,
|
|
234
222
|
typeExpression: 'string & tags.Format<"uuid">',
|
|
235
223
|
}),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
type: "number",
|
|
240
|
-
},
|
|
241
|
-
description: {
|
|
242
|
-
lines: ["Block version for migrations"],
|
|
243
|
-
},
|
|
244
|
-
manifest: {
|
|
245
|
-
constraints: {
|
|
246
|
-
typeTag: "uint32",
|
|
247
|
-
},
|
|
248
|
-
defaultValue: 1,
|
|
249
|
-
kind: "number",
|
|
250
|
-
required: false,
|
|
251
|
-
sourceType: "number",
|
|
224
|
+
defineNumberAttribute({
|
|
225
|
+
constraints: {
|
|
226
|
+
typeTag: "uint32",
|
|
252
227
|
},
|
|
228
|
+
defaultValue: 1,
|
|
229
|
+
description: describe("Block version for migrations"),
|
|
253
230
|
name: "schemaVersion",
|
|
254
231
|
optional: true,
|
|
255
232
|
typeExpression: 'number & tags.Type<"uint32"> & tags.Default<1>',
|
|
@@ -258,158 +235,72 @@ function buildBasicAttributes() {
|
|
|
258
235
|
}
|
|
259
236
|
function buildInteractivityAttributes(variables) {
|
|
260
237
|
return [
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
selector: `.${variables.cssClassName}__content`,
|
|
265
|
-
source: "html",
|
|
266
|
-
type: "string",
|
|
267
|
-
},
|
|
268
|
-
manifest: {
|
|
269
|
-
constraints: {
|
|
270
|
-
maxLength: 1000,
|
|
271
|
-
},
|
|
272
|
-
defaultValue: "",
|
|
273
|
-
kind: "string",
|
|
274
|
-
required: true,
|
|
275
|
-
selector: `.${variables.cssClassName}__content`,
|
|
276
|
-
source: "html",
|
|
277
|
-
sourceType: "string",
|
|
238
|
+
defineStringAttribute({
|
|
239
|
+
constraints: {
|
|
240
|
+
maxLength: 1000,
|
|
278
241
|
},
|
|
242
|
+
defaultValue: "",
|
|
279
243
|
name: "content",
|
|
280
244
|
optional: false,
|
|
245
|
+
selector: `.${variables.cssClassName}__content`,
|
|
246
|
+
source: "html",
|
|
281
247
|
typeExpression: 'string & tags.MaxLength<1000> & tags.Default<"">',
|
|
282
248
|
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
enumValues: [...ALIGNMENT_VALUES],
|
|
287
|
-
type: "string",
|
|
288
|
-
},
|
|
289
|
-
manifest: {
|
|
290
|
-
defaultValue: "left",
|
|
291
|
-
enumValues: [...ALIGNMENT_VALUES],
|
|
292
|
-
kind: "string",
|
|
293
|
-
required: false,
|
|
294
|
-
sourceType: "string",
|
|
295
|
-
},
|
|
249
|
+
defineStringAttribute({
|
|
250
|
+
defaultValue: "left",
|
|
251
|
+
enumValues: [...ALIGNMENT_VALUES],
|
|
296
252
|
name: "alignment",
|
|
297
253
|
optional: true,
|
|
298
254
|
typeExpression: 'TextAlignment & tags.Default<"left">',
|
|
299
255
|
}),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
defaultValue: true,
|
|
303
|
-
type: "boolean",
|
|
304
|
-
},
|
|
305
|
-
manifest: {
|
|
306
|
-
defaultValue: true,
|
|
307
|
-
kind: "boolean",
|
|
308
|
-
required: false,
|
|
309
|
-
sourceType: "boolean",
|
|
310
|
-
},
|
|
256
|
+
defineBooleanAttribute({
|
|
257
|
+
defaultValue: true,
|
|
311
258
|
name: "isVisible",
|
|
312
259
|
optional: true,
|
|
313
260
|
typeExpression: "boolean & tags.Default<true>",
|
|
314
261
|
}),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
enumValues: [...INTERACTIVE_MODE_VALUES],
|
|
319
|
-
type: "string",
|
|
320
|
-
},
|
|
321
|
-
manifest: {
|
|
322
|
-
defaultValue: "click",
|
|
323
|
-
enumValues: [...INTERACTIVE_MODE_VALUES],
|
|
324
|
-
kind: "string",
|
|
325
|
-
required: false,
|
|
326
|
-
sourceType: "string",
|
|
327
|
-
},
|
|
262
|
+
defineStringAttribute({
|
|
263
|
+
defaultValue: "click",
|
|
264
|
+
enumValues: [...INTERACTIVE_MODE_VALUES],
|
|
328
265
|
name: "interactiveMode",
|
|
329
266
|
optional: true,
|
|
330
267
|
typeExpression: '("click" | "hover") & tags.Default<"click">',
|
|
331
268
|
}),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
enumValues: [...ANIMATION_VALUES],
|
|
336
|
-
type: "string",
|
|
337
|
-
},
|
|
338
|
-
manifest: {
|
|
339
|
-
defaultValue: "none",
|
|
340
|
-
enumValues: [...ANIMATION_VALUES],
|
|
341
|
-
kind: "string",
|
|
342
|
-
required: false,
|
|
343
|
-
sourceType: "string",
|
|
344
|
-
},
|
|
269
|
+
defineStringAttribute({
|
|
270
|
+
defaultValue: "none",
|
|
271
|
+
enumValues: [...ANIMATION_VALUES],
|
|
345
272
|
name: "animation",
|
|
346
273
|
optional: true,
|
|
347
274
|
typeExpression: '("none" | "bounce" | "pulse" | "shake" | "flip") & tags.Default<"none">',
|
|
348
275
|
}),
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
},
|
|
354
|
-
manifest: {
|
|
355
|
-
constraints: {
|
|
356
|
-
minimum: 0,
|
|
357
|
-
typeTag: "uint32",
|
|
358
|
-
},
|
|
359
|
-
defaultValue: 0,
|
|
360
|
-
kind: "number",
|
|
361
|
-
required: false,
|
|
362
|
-
sourceType: "number",
|
|
276
|
+
defineNumberAttribute({
|
|
277
|
+
constraints: {
|
|
278
|
+
minimum: 0,
|
|
279
|
+
typeTag: "uint32",
|
|
363
280
|
},
|
|
281
|
+
defaultValue: 0,
|
|
364
282
|
name: "clickCount",
|
|
365
283
|
optional: true,
|
|
366
284
|
typeExpression: 'number & tags.Minimum<0> & tags.Type<"uint32"> & tags.Default<0>',
|
|
367
285
|
}),
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
defaultValue: false,
|
|
371
|
-
type: "boolean",
|
|
372
|
-
},
|
|
373
|
-
manifest: {
|
|
374
|
-
defaultValue: false,
|
|
375
|
-
kind: "boolean",
|
|
376
|
-
required: false,
|
|
377
|
-
sourceType: "boolean",
|
|
378
|
-
},
|
|
286
|
+
defineBooleanAttribute({
|
|
287
|
+
defaultValue: false,
|
|
379
288
|
name: "isAnimating",
|
|
380
289
|
optional: true,
|
|
381
290
|
typeExpression: "boolean & tags.Default<false>",
|
|
382
291
|
}),
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
defaultValue: true,
|
|
386
|
-
type: "boolean",
|
|
387
|
-
},
|
|
388
|
-
manifest: {
|
|
389
|
-
defaultValue: true,
|
|
390
|
-
kind: "boolean",
|
|
391
|
-
required: false,
|
|
392
|
-
sourceType: "boolean",
|
|
393
|
-
},
|
|
292
|
+
defineBooleanAttribute({
|
|
293
|
+
defaultValue: true,
|
|
394
294
|
name: "showCounter",
|
|
395
295
|
optional: true,
|
|
396
296
|
typeExpression: "boolean & tags.Default<true>",
|
|
397
297
|
}),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
manifest: {
|
|
404
|
-
constraints: {
|
|
405
|
-
minimum: 0,
|
|
406
|
-
typeTag: "uint32",
|
|
407
|
-
},
|
|
408
|
-
defaultValue: 10,
|
|
409
|
-
kind: "number",
|
|
410
|
-
required: false,
|
|
411
|
-
sourceType: "number",
|
|
298
|
+
defineNumberAttribute({
|
|
299
|
+
constraints: {
|
|
300
|
+
minimum: 0,
|
|
301
|
+
typeTag: "uint32",
|
|
412
302
|
},
|
|
303
|
+
defaultValue: 10,
|
|
413
304
|
name: "maxClicks",
|
|
414
305
|
optional: true,
|
|
415
306
|
typeExpression: 'number & tags.Minimum<0> & tags.Type<"uint32"> & tags.Default<10>',
|
|
@@ -418,110 +309,54 @@ function buildInteractivityAttributes(variables) {
|
|
|
418
309
|
}
|
|
419
310
|
function buildPersistenceAttributes(variables) {
|
|
420
311
|
return [
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
source: "html",
|
|
426
|
-
type: "string",
|
|
427
|
-
},
|
|
428
|
-
manifest: {
|
|
429
|
-
constraints: {
|
|
430
|
-
maxLength: 250,
|
|
431
|
-
minLength: 1,
|
|
432
|
-
},
|
|
433
|
-
defaultValue: `${variables.title} persistence block`,
|
|
434
|
-
kind: "string",
|
|
435
|
-
required: true,
|
|
436
|
-
selector: `.${variables.cssClassName}__content`,
|
|
437
|
-
source: "html",
|
|
438
|
-
sourceType: "string",
|
|
312
|
+
defineStringAttribute({
|
|
313
|
+
constraints: {
|
|
314
|
+
maxLength: 250,
|
|
315
|
+
minLength: 1,
|
|
439
316
|
},
|
|
317
|
+
defaultValue: `${variables.title} persistence block`,
|
|
440
318
|
name: "content",
|
|
441
319
|
optional: false,
|
|
320
|
+
selector: `.${variables.cssClassName}__content`,
|
|
321
|
+
source: "html",
|
|
442
322
|
typeExpression: `string & tags.MinLength<1> & tags.MaxLength<250> & tags.Default<${quote(`${variables.title} persistence block`)}>`,
|
|
443
323
|
}),
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
enumValues: [...ALIGNMENT_VALUES],
|
|
448
|
-
type: "string",
|
|
449
|
-
},
|
|
450
|
-
manifest: {
|
|
451
|
-
defaultValue: "left",
|
|
452
|
-
enumValues: [...ALIGNMENT_VALUES],
|
|
453
|
-
kind: "string",
|
|
454
|
-
required: false,
|
|
455
|
-
sourceType: "string",
|
|
456
|
-
},
|
|
324
|
+
defineStringAttribute({
|
|
325
|
+
defaultValue: "left",
|
|
326
|
+
enumValues: [...ALIGNMENT_VALUES],
|
|
457
327
|
name: "alignment",
|
|
458
328
|
optional: true,
|
|
459
329
|
typeExpression: 'TextAlignment & tags.Default<"left">',
|
|
460
330
|
}),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
defaultValue: true,
|
|
464
|
-
type: "boolean",
|
|
465
|
-
},
|
|
466
|
-
manifest: {
|
|
467
|
-
defaultValue: true,
|
|
468
|
-
kind: "boolean",
|
|
469
|
-
required: false,
|
|
470
|
-
sourceType: "boolean",
|
|
471
|
-
},
|
|
331
|
+
defineBooleanAttribute({
|
|
332
|
+
defaultValue: true,
|
|
472
333
|
name: "isVisible",
|
|
473
334
|
optional: true,
|
|
474
335
|
typeExpression: "boolean & tags.Default<true>",
|
|
475
336
|
}),
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
defaultValue: true,
|
|
479
|
-
type: "boolean",
|
|
480
|
-
},
|
|
481
|
-
manifest: {
|
|
482
|
-
defaultValue: true,
|
|
483
|
-
kind: "boolean",
|
|
484
|
-
required: false,
|
|
485
|
-
sourceType: "boolean",
|
|
486
|
-
},
|
|
337
|
+
defineBooleanAttribute({
|
|
338
|
+
defaultValue: true,
|
|
487
339
|
name: "showCount",
|
|
488
340
|
optional: true,
|
|
489
341
|
typeExpression: "boolean & tags.Default<true>",
|
|
490
342
|
}),
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
},
|
|
496
|
-
manifest: {
|
|
497
|
-
constraints: {
|
|
498
|
-
maxLength: 40,
|
|
499
|
-
minLength: 1,
|
|
500
|
-
},
|
|
501
|
-
defaultValue: "Persist Count",
|
|
502
|
-
kind: "string",
|
|
503
|
-
required: false,
|
|
504
|
-
sourceType: "string",
|
|
343
|
+
defineStringAttribute({
|
|
344
|
+
constraints: {
|
|
345
|
+
maxLength: 40,
|
|
346
|
+
minLength: 1,
|
|
505
347
|
},
|
|
348
|
+
defaultValue: "Persist Count",
|
|
506
349
|
name: "buttonLabel",
|
|
507
350
|
optional: true,
|
|
508
351
|
typeExpression: 'string & tags.MinLength<1> & tags.MaxLength<40> & tags.Default<"Persist Count">',
|
|
509
352
|
}),
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
manifest: {
|
|
516
|
-
constraints: {
|
|
517
|
-
maxLength: 100,
|
|
518
|
-
minLength: 1,
|
|
519
|
-
},
|
|
520
|
-
defaultValue: "primary",
|
|
521
|
-
kind: "string",
|
|
522
|
-
required: false,
|
|
523
|
-
sourceType: "string",
|
|
353
|
+
defineStringAttribute({
|
|
354
|
+
blockJsonDefaultValue: "",
|
|
355
|
+
constraints: {
|
|
356
|
+
maxLength: 100,
|
|
357
|
+
minLength: 1,
|
|
524
358
|
},
|
|
359
|
+
manifestDefaultValue: "primary",
|
|
525
360
|
name: "resourceKey",
|
|
526
361
|
optional: true,
|
|
527
362
|
typeExpression: 'string & tags.MinLength<1> & tags.MaxLength<100> & tags.Default<"primary">',
|
|
@@ -530,116 +365,59 @@ function buildPersistenceAttributes(variables) {
|
|
|
530
365
|
}
|
|
531
366
|
function buildCompoundParentAttributes(variables) {
|
|
532
367
|
const attributes = [
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
source: "html",
|
|
538
|
-
type: "string",
|
|
539
|
-
},
|
|
540
|
-
manifest: {
|
|
541
|
-
constraints: {
|
|
542
|
-
maxLength: 80,
|
|
543
|
-
minLength: 1,
|
|
544
|
-
},
|
|
545
|
-
defaultValue: variables.title,
|
|
546
|
-
kind: "string",
|
|
547
|
-
required: true,
|
|
548
|
-
selector: `.${variables.cssClassName}__heading`,
|
|
549
|
-
source: "html",
|
|
550
|
-
sourceType: "string",
|
|
368
|
+
defineStringAttribute({
|
|
369
|
+
constraints: {
|
|
370
|
+
maxLength: 80,
|
|
371
|
+
minLength: 1,
|
|
551
372
|
},
|
|
373
|
+
defaultValue: variables.title,
|
|
552
374
|
name: "heading",
|
|
553
375
|
optional: false,
|
|
376
|
+
selector: `.${variables.cssClassName}__heading`,
|
|
377
|
+
source: "html",
|
|
554
378
|
typeExpression: `string & tags.MinLength<1> & tags.MaxLength<80> & tags.Default<${quote(variables.title)}>`,
|
|
555
379
|
}),
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
source: "html",
|
|
561
|
-
type: "string",
|
|
562
|
-
},
|
|
563
|
-
manifest: {
|
|
564
|
-
constraints: {
|
|
565
|
-
maxLength: 180,
|
|
566
|
-
minLength: 1,
|
|
567
|
-
},
|
|
568
|
-
defaultValue: "Add and reorder internal items inside this compound block.",
|
|
569
|
-
kind: "string",
|
|
570
|
-
required: false,
|
|
571
|
-
selector: `.${variables.cssClassName}__intro`,
|
|
572
|
-
source: "html",
|
|
573
|
-
sourceType: "string",
|
|
380
|
+
defineStringAttribute({
|
|
381
|
+
constraints: {
|
|
382
|
+
maxLength: 180,
|
|
383
|
+
minLength: 1,
|
|
574
384
|
},
|
|
385
|
+
defaultValue: "Add and reorder internal items inside this compound block.",
|
|
575
386
|
name: "intro",
|
|
576
387
|
optional: true,
|
|
388
|
+
selector: `.${variables.cssClassName}__intro`,
|
|
389
|
+
source: "html",
|
|
577
390
|
typeExpression: 'string & tags.MinLength<1> & tags.MaxLength<180> & tags.Default<"Add and reorder internal items inside this compound block.">',
|
|
578
391
|
}),
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
defaultValue: true,
|
|
582
|
-
type: "boolean",
|
|
583
|
-
},
|
|
584
|
-
manifest: {
|
|
585
|
-
defaultValue: true,
|
|
586
|
-
kind: "boolean",
|
|
587
|
-
required: false,
|
|
588
|
-
sourceType: "boolean",
|
|
589
|
-
},
|
|
392
|
+
defineBooleanAttribute({
|
|
393
|
+
defaultValue: true,
|
|
590
394
|
name: "showDividers",
|
|
591
395
|
optional: true,
|
|
592
396
|
typeExpression: "boolean & tags.Default<true>",
|
|
593
397
|
}),
|
|
594
398
|
];
|
|
595
399
|
if (variables.compoundPersistenceEnabled === "true") {
|
|
596
|
-
attributes.push(
|
|
597
|
-
|
|
598
|
-
defaultValue: true,
|
|
599
|
-
type: "boolean",
|
|
600
|
-
},
|
|
601
|
-
manifest: {
|
|
602
|
-
defaultValue: true,
|
|
603
|
-
kind: "boolean",
|
|
604
|
-
required: false,
|
|
605
|
-
sourceType: "boolean",
|
|
606
|
-
},
|
|
400
|
+
attributes.push(defineBooleanAttribute({
|
|
401
|
+
defaultValue: true,
|
|
607
402
|
name: "showCount",
|
|
608
403
|
optional: true,
|
|
609
404
|
typeExpression: "boolean & tags.Default<true>",
|
|
610
|
-
}),
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
manifest: {
|
|
616
|
-
constraints: {
|
|
617
|
-
maxLength: 40,
|
|
618
|
-
minLength: 1,
|
|
619
|
-
},
|
|
620
|
-
defaultValue: "Persist Count",
|
|
621
|
-
kind: "string",
|
|
622
|
-
required: false,
|
|
623
|
-
sourceType: "string",
|
|
405
|
+
}), defineStringAttribute({
|
|
406
|
+
constraints: {
|
|
407
|
+
maxLength: 40,
|
|
408
|
+
minLength: 1,
|
|
624
409
|
},
|
|
410
|
+
defaultValue: "Persist Count",
|
|
625
411
|
name: "buttonLabel",
|
|
626
412
|
optional: true,
|
|
627
413
|
typeExpression: 'string & tags.MinLength<1> & tags.MaxLength<40> & tags.Default<"Persist Count">',
|
|
628
|
-
}),
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
manifest: {
|
|
634
|
-
constraints: {
|
|
635
|
-
maxLength: 100,
|
|
636
|
-
minLength: 1,
|
|
637
|
-
},
|
|
638
|
-
defaultValue: "primary",
|
|
639
|
-
kind: "string",
|
|
640
|
-
required: false,
|
|
641
|
-
sourceType: "string",
|
|
414
|
+
}), defineStringAttribute({
|
|
415
|
+
blockJsonDefaultValue: "",
|
|
416
|
+
constraints: {
|
|
417
|
+
maxLength: 100,
|
|
418
|
+
minLength: 1,
|
|
642
419
|
},
|
|
420
|
+
manifestDefaultValue: "primary",
|
|
643
421
|
name: "resourceKey",
|
|
644
422
|
optional: true,
|
|
645
423
|
typeExpression: 'string & tags.MinLength<1> & tags.MaxLength<100> & tags.Default<"primary">',
|
|
@@ -655,58 +433,28 @@ function buildCompoundChildAttributes(bodyPlaceholder = DEFAULT_COMPOUND_CHILD_B
|
|
|
655
433
|
? `.${childCssClassName}__body`
|
|
656
434
|
: null;
|
|
657
435
|
return [
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
? {
|
|
663
|
-
selector: titleSelector,
|
|
664
|
-
source: "html",
|
|
665
|
-
}
|
|
666
|
-
: {}),
|
|
667
|
-
type: "string",
|
|
668
|
-
},
|
|
669
|
-
manifest: {
|
|
670
|
-
constraints: {
|
|
671
|
-
maxLength: 80,
|
|
672
|
-
minLength: 1,
|
|
673
|
-
},
|
|
674
|
-
defaultValue: childTitle,
|
|
675
|
-
kind: "string",
|
|
676
|
-
required: true,
|
|
677
|
-
selector: titleSelector,
|
|
678
|
-
source: titleSelector ? "html" : null,
|
|
679
|
-
sourceType: "string",
|
|
436
|
+
defineStringAttribute({
|
|
437
|
+
constraints: {
|
|
438
|
+
maxLength: 80,
|
|
439
|
+
minLength: 1,
|
|
680
440
|
},
|
|
441
|
+
defaultValue: childTitle,
|
|
681
442
|
name: "title",
|
|
682
443
|
optional: false,
|
|
444
|
+
selector: titleSelector,
|
|
445
|
+
source: titleSelector ? "html" : null,
|
|
683
446
|
typeExpression: `string & tags.MinLength<1> & tags.MaxLength<80> & tags.Default<${quote(childTitle)}>`,
|
|
684
447
|
}),
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
? {
|
|
690
|
-
selector: bodySelector,
|
|
691
|
-
source: "html",
|
|
692
|
-
}
|
|
693
|
-
: {}),
|
|
694
|
-
type: "string",
|
|
695
|
-
},
|
|
696
|
-
manifest: {
|
|
697
|
-
constraints: {
|
|
698
|
-
maxLength: 280,
|
|
699
|
-
minLength: 1,
|
|
700
|
-
},
|
|
701
|
-
defaultValue: bodyPlaceholder,
|
|
702
|
-
kind: "string",
|
|
703
|
-
required: true,
|
|
704
|
-
selector: bodySelector,
|
|
705
|
-
source: bodySelector ? "html" : null,
|
|
706
|
-
sourceType: "string",
|
|
448
|
+
defineStringAttribute({
|
|
449
|
+
constraints: {
|
|
450
|
+
maxLength: 280,
|
|
451
|
+
minLength: 1,
|
|
707
452
|
},
|
|
453
|
+
defaultValue: bodyPlaceholder,
|
|
708
454
|
name: "body",
|
|
709
455
|
optional: false,
|
|
456
|
+
selector: bodySelector,
|
|
457
|
+
source: bodySelector ? "html" : null,
|
|
710
458
|
typeExpression: `string & tags.MinLength<1> & tags.MaxLength<280> & tags.Default<${quote(bodyPlaceholder)}>`,
|
|
711
459
|
}),
|
|
712
460
|
];
|