@wordpress-flow/cli 1.1.2 → 1.1.3

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 (2) hide show
  1. package/dist/index.js +9 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -115862,8 +115862,15 @@ export {};
115862
115862
  return result2;
115863
115863
  }
115864
115864
  convertSingleAttribute(attr) {
115865
- const type = attr.type || "any";
115866
115865
  const optional = attr.default !== undefined;
115866
+ if (attr.__tsType) {
115867
+ return {
115868
+ type: attr.__tsType,
115869
+ description: attr.__tsDescription,
115870
+ optional
115871
+ };
115872
+ }
115873
+ const type = attr.type || "any";
115867
115874
  switch (type) {
115868
115875
  case "string":
115869
115876
  return { type: "string", optional };
@@ -115874,21 +115881,11 @@ export {};
115874
115881
  case "array":
115875
115882
  return { type: "any[]", optional };
115876
115883
  case "object":
115877
- if (this.isMediaObject(attr)) {
115878
- return {
115879
- type: "{ id?: number; url: string; alt?: string; width?: number; height?: number }",
115880
- description: "Media object with image details",
115881
- optional
115882
- };
115883
- }
115884
115884
  return { type: "{ [key: string]: any }", optional };
115885
115885
  default:
115886
115886
  return { type: "any", optional };
115887
115887
  }
115888
115888
  }
115889
- isMediaObject(attr) {
115890
- return attr.default && (typeof attr.default === "object" && Object.keys(attr.default).length === 0);
115891
- }
115892
115889
  async extractBlocksFromDist(distDir) {
115893
115890
  const blocks = [];
115894
115891
  if (!fs12.existsSync(distDir)) {
@@ -116012,7 +116009,7 @@ add_action('enqueue_block_assets', 'wordpress_flow_enqueue_block_scripts');
116012
116009
  // package.json
116013
116010
  var package_default = {
116014
116011
  name: "@wordpress-flow/cli",
116015
- version: "1.1.2",
116012
+ version: "1.1.3",
116016
116013
  type: "module",
116017
116014
  description: "TypeScript-based WordPress block creation system",
116018
116015
  main: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress-flow/cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "description": "TypeScript-based WordPress block creation system",
6
6
  "main": "dist/index.js",