@wp-typia/project-tools 0.16.0 → 0.16.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/README.md +6 -0
- package/dist/runtime/cli-help.js +1 -1
- package/dist/runtime/package-versions.js +7 -2
- package/dist/runtime/scaffold.js +21 -13
- package/dist/runtime/schema-core.d.ts +5 -266
- package/dist/runtime/schema-core.js +5 -775
- package/package.json +56 -3
- package/templates/_shared/compound/core/scripts/add-compound-child.ts.mustache +42 -28
- package/templates/_shared/compound/persistence/src/blocks/{{slugKebabCase}}/interactivity.ts.mustache +8 -0
- package/templates/_shared/compound/persistence-auth/{{slugKebabCase}}.php.mustache +5 -5
- package/templates/_shared/compound/persistence-public/{{slugKebabCase}}.php.mustache +5 -5
- package/templates/_shared/persistence/auth/{{slugKebabCase}}.php.mustache +5 -5
- package/templates/_shared/persistence/core/src/interactivity.ts.mustache +5 -0
- package/templates/_shared/persistence/core/{{slugKebabCase}}.php.mustache +5 -5
- package/templates/_shared/persistence/public/{{slugKebabCase}}.php.mustache +5 -5
- package/templates/_shared/workspace/persistence-auth/server.php.mustache +7 -5
- package/templates/_shared/workspace/persistence-public/server.php.mustache +7 -5
- package/templates/compound/src/blocks/{{slugKebabCase}}/types.ts.mustache +5 -0
- package/templates/compound/src/blocks/{{slugKebabCase}}/validators.ts.mustache +10 -3
- package/templates/compound/src/blocks/{{slugKebabCase}}-item/types.ts.mustache +5 -0
- package/templates/compound/src/blocks/{{slugKebabCase}}-item/validators.ts.mustache +10 -3
- package/templates/interactivity/src/edit.tsx.mustache +1 -1
- package/templates/interactivity/src/save.tsx.mustache +1 -1
- package/templates/persistence/src/edit.tsx.mustache +2 -2
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import typia from 'typia';
|
|
2
2
|
import currentManifest from './typia.manifest.json';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
{{pascalCase}}ItemAttributes,
|
|
5
|
+
{{pascalCase}}ItemValidationResult,
|
|
6
|
+
} from './types';
|
|
4
7
|
import { createTemplateValidatorToolkit } from '../../validator-toolkit';
|
|
5
8
|
|
|
6
9
|
const scaffoldValidators = createTemplateValidatorToolkit< {{pascalCase}}ItemAttributes >( {
|
|
@@ -18,11 +21,15 @@ const scaffoldValidators = createTemplateValidatorToolkit< {{pascalCase}}ItemAtt
|
|
|
18
21
|
} );
|
|
19
22
|
|
|
20
23
|
export const validate{{pascalCase}}ItemAttributes =
|
|
21
|
-
scaffoldValidators.validateAttributes
|
|
24
|
+
scaffoldValidators.validateAttributes as (
|
|
25
|
+
attributes: unknown
|
|
26
|
+
) => {{pascalCase}}ItemValidationResult;
|
|
22
27
|
|
|
23
28
|
export const validators = scaffoldValidators.validators;
|
|
24
29
|
|
|
25
30
|
export const sanitize{{pascalCase}}ItemAttributes =
|
|
26
|
-
scaffoldValidators.sanitizeAttributes
|
|
31
|
+
scaffoldValidators.sanitizeAttributes as (
|
|
32
|
+
attributes: Partial< {{pascalCase}}ItemAttributes >
|
|
33
|
+
) => {{pascalCase}}ItemAttributes;
|
|
27
34
|
|
|
28
35
|
export const createAttributeUpdater = scaffoldValidators.createAttributeUpdater;
|
|
@@ -258,7 +258,7 @@ export default function Edit({ attributes, setAttributes, isSelected }: {
|
|
|
258
258
|
{animation !== 'none' && (
|
|
259
259
|
<div
|
|
260
260
|
className={`{{cssClassName}}__animation ${attributes.isAnimating ? 'is-active' : ''}`}
|
|
261
|
-
data-wp-class
|
|
261
|
+
data-wp-class--is-active="state.isAnimating"
|
|
262
262
|
>
|
|
263
263
|
{animation}
|
|
264
264
|
</div>
|
|
@@ -70,7 +70,7 @@ export default function Save({ attributes }: { attributes: {{pascalCase}}Attribu
|
|
|
70
70
|
<div
|
|
71
71
|
className={`{{cssClassName}}__animation ${attributes.animation}`}
|
|
72
72
|
aria-hidden="true"
|
|
73
|
-
data-wp-class
|
|
73
|
+
data-wp-class--is-active="state.isAnimating"
|
|
74
74
|
/>
|
|
75
75
|
|
|
76
76
|
{attributes.maxClicks > 0 && (
|
|
@@ -66,7 +66,7 @@ export default function Edit( {
|
|
|
66
66
|
validateEditorUpdate
|
|
67
67
|
);
|
|
68
68
|
const alignmentValue = editorFields.getStringValue(
|
|
69
|
-
attributes
|
|
69
|
+
attributes,
|
|
70
70
|
'alignment',
|
|
71
71
|
'left'
|
|
72
72
|
);
|
|
@@ -91,7 +91,7 @@ export default function Edit( {
|
|
|
91
91
|
</BlockControls>
|
|
92
92
|
<InspectorControls>
|
|
93
93
|
<InspectorFromManifest
|
|
94
|
-
attributes={ attributes
|
|
94
|
+
attributes={ attributes }
|
|
95
95
|
fieldLookup={ editorFields }
|
|
96
96
|
onChange={ updateField }
|
|
97
97
|
paths={ [ 'alignment', 'isVisible', 'showCount', 'buttonLabel' ] }
|