@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.
Files changed (24) hide show
  1. package/README.md +6 -0
  2. package/dist/runtime/cli-help.js +1 -1
  3. package/dist/runtime/package-versions.js +7 -2
  4. package/dist/runtime/scaffold.js +21 -13
  5. package/dist/runtime/schema-core.d.ts +5 -266
  6. package/dist/runtime/schema-core.js +5 -775
  7. package/package.json +56 -3
  8. package/templates/_shared/compound/core/scripts/add-compound-child.ts.mustache +42 -28
  9. package/templates/_shared/compound/persistence/src/blocks/{{slugKebabCase}}/interactivity.ts.mustache +8 -0
  10. package/templates/_shared/compound/persistence-auth/{{slugKebabCase}}.php.mustache +5 -5
  11. package/templates/_shared/compound/persistence-public/{{slugKebabCase}}.php.mustache +5 -5
  12. package/templates/_shared/persistence/auth/{{slugKebabCase}}.php.mustache +5 -5
  13. package/templates/_shared/persistence/core/src/interactivity.ts.mustache +5 -0
  14. package/templates/_shared/persistence/core/{{slugKebabCase}}.php.mustache +5 -5
  15. package/templates/_shared/persistence/public/{{slugKebabCase}}.php.mustache +5 -5
  16. package/templates/_shared/workspace/persistence-auth/server.php.mustache +7 -5
  17. package/templates/_shared/workspace/persistence-public/server.php.mustache +7 -5
  18. package/templates/compound/src/blocks/{{slugKebabCase}}/types.ts.mustache +5 -0
  19. package/templates/compound/src/blocks/{{slugKebabCase}}/validators.ts.mustache +10 -3
  20. package/templates/compound/src/blocks/{{slugKebabCase}}-item/types.ts.mustache +5 -0
  21. package/templates/compound/src/blocks/{{slugKebabCase}}-item/validators.ts.mustache +10 -3
  22. package/templates/interactivity/src/edit.tsx.mustache +1 -1
  23. package/templates/interactivity/src/save.tsx.mustache +1 -1
  24. 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 { {{pascalCase}}ItemAttributes } from './types';
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="is-active"
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="is-active"
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 as unknown as Record< string, unknown >,
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 as unknown as Record< string, unknown > }
94
+ attributes={ attributes }
95
95
  fieldLookup={ editorFields }
96
96
  onChange={ updateField }
97
97
  paths={ [ 'alignment', 'isVisible', 'showCount', 'buttonLabel' ] }