@superblocksteam/cli 2.0.3-next.192 → 2.0.3-next.194

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 CHANGED
@@ -14,7 +14,7 @@ $ npm install -g @superblocksteam/cli
14
14
  $ superblocks COMMAND
15
15
  running command...
16
16
  $ superblocks (--version)
17
- @superblocksteam/cli/2.0.3-next.192 linux-x64 node-v20.19.0
17
+ @superblocksteam/cli/2.0.3-next.194 linux-x64 node-v20.19.0
18
18
  $ superblocks --help [COMMAND]
19
19
  USAGE
20
20
  $ superblocks COMMAND
@@ -40,7 +40,7 @@ var content3 = '### Rules for using Superblocks components:\n\n- ENSURE THAT ALL
40
40
 
41
41
  // ../../../vite-plugin-file-sync/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js
42
42
  init_cjs_shims();
43
- var content4 = '# Custom Components\n\n- ULTRA CRITICAL: NEVER use Superblocks components in a custom component.\n\n- CRITICAL: Use custom components sparingly.\n\n- CRITICAL: ONLY when all else fails and a component is not available in the Superblocks library, you may construct it out of external component libraries by installing them.\n\n- CRITICAL: ALWAYS import React using a namespace import: `import * as React from \'react\'`.\n\nIn order to hook it up correctly, the platform needs to know what props the component exposes, their types, default values, and how they should be displayed to users.\n\nTo do this, you use the **`Prop` API** and **`registerComponent`** function.\n\n## Key Concepts\n\n- All custom components should live within the `components/` folder.\n- **`Prop`**: Defines a single editable property for your component.\n - Can specify the data type (`string`, `number`, `boolean`, `event`, etc.).\n - Can define a **default value**, **label** for the properties panel, and other validations.\n- **`registerComponent`**: Connects your React component with its editable schema (`properties`) so it appears correctly in the visual editor.\n- **`useUpdateProperties`**: A hook that lets your component programmatically update its properties during runtime (e.g., when a user interacts with it).\n\n---\n\n## Basic Example\n\n```tsx\nimport { Rate } from "antd";\nimport {\n CustomComponentProps,\n Prop,\n registerComponent,\n useUpdateProperties,\n} from "@superblocksteam/library";\n\n// 1. Define editable properties\nconst properties = {\n value: Prop.number()\n .default(3) // Default to 3 stars\n .propertiesPanel({ label: "Default value" }), // Editor label\n onChange: Prop.event().propertiesPanel({ label: "On change" }), // Editor label for event\n};\n\n// 2. Create typed props for your component\ntype ComponentProps = CustomComponentProps<typeof properties>;\n\n// 3. Build your React component\nconst Rating = ({ value, onChange }: ComponentProps) => {\n const updateProperties = useUpdateProperties(); // Hook to update properties dynamically\n\n return (\n <div style={{ display: "flex" }}>\n <Rate\n value={value}\n defaultValue={value}\n onChange={(newValue) => {\n updateProperties({ value: newValue }); // Update visual editor\n onChange?.(); // Trigger custom event\n }}\n />\n </div>\n );\n};\n\n// 4. Register your component to make it available in the visual editor\nexport default registerComponent("Rating", properties, Rating);\n```\n\n---\n\n## How `Prop` Works\n\nYou can define different types of props:\n\n- **`string`**: `Prop.string()`\n- **`number`**: `Prop.number()`\n- **`boolean`**: `Prop.boolean()`\n- **`event`**: `Prop.event()` (for user interactions like clicks)\n- **`any`**: `Prop.any()` (for any type)\n- **`composite`**: `Prop.composite({ x: Prop.number(), y: Prop.number() })` (for nested objects)\n- **`record`**: `Prop.record({...})` (for key-value maps)\n- **`union`**: `Prop.union({...})` (for multiple variants)\n\nYou can chain additional methods:\n\n- `.default(value)` \u2014 Sets a default value.\n- `.propertiesPanel({ label: "Your Label" })` \u2014 Controls how the prop appears in the editor.\n- `.validate(fn)` \u2014 Adds custom validation logic.\n- `.readable()`, `.writable()` \u2014 Control read/write capabilities.\n\n---\n\n## Typical Flow\n\n1. **Define** the **editable schema** (`properties`) with `Prop`.\n2. **Type** your component\'s props using `CustomComponentProps`.\n3. **Use** `useUpdateProperties` to sync UI interactions back to the editor.\n4. **Register** the component using `registerComponent`.\n\n---# Tips\n\n- All `registeredComponent`s automatically support width and height using the `Dim` object.\n ```\n <CustomSlider\n width={Dim.fill(2)} // Fill available space with a weight of 2\n height={Dim.px(100)} // Fixed height of 100 pixels\n />\n ```\n\n## When not to use custom components\n\n- If a user asks for something by name, like showing "metrics", and you do not find a "metrics" component in the Superblocks library, do not immediately assume you need to use a custom component. Instead consider using one of the pre-designed templates built from existing Superblocks components.\n\n## Pre-designed templates to use instead of custom components\n\n### Rules for using pre-designed templates\n\n- Use the pre-designed templates as a base to work from. You can make changes to the content, but generally you do not need to change the layout or styling. Example: below there are width and height properties set on the icons and you should NOT change these or you will break the layout.\n\n### Metrics template\n\nThis template is a row of three large numerical metrics with icons and annotation text.\n\n**\u{1F6A8} IMPORTANT: When using this template, remember that sbComputed cannot be used as React children. All dynamic values must be in component properties like `text={}`, not as children like `{sbComputed(...)}`.**\n\nTemplate code below and a few notes to help explain usage:\n\n- We use the SbContainer component to layout the metrics in a row\n- We use the SbText component to show the numerical values and how we use the textStyle prop variant to make the text a big heading\n- We use the SbIcon component to show nice icons that make sense for the metric\n- We create a little "badge" using the SbContainer component to show small annotation text. Prefer this over using brackets in the main heading text. Example: Rather than "32 (2m)" we use "32" in the main heading text and then a badge with the "2m" text\n- Keep the icon sizing you see in this template unless you are explicitly asked to change it\n\n```tsx\nimport {\n SbIcon,\n SbText,\n SbContainer,\n sbComputed,\n Dim,\n Global,\n Theme,\n Embed,\n Env,\n} from "@superblocksteam/library";\n\n<SbContainer\n layout="horizontal"\n width={Dim.fill()}\n height={Dim.fit()}\n variant="none"\n spacing={Dim.px(12)}\n>\n {/* First card */}\n <SbContainer\n layout="vertical"\n width={Dim.fill()}\n height={Dim.fit()}\n variant="card"\n spacing={Dim.px(6)}\n >\n <SbContainer\n layout="horizontal"\n width={Dim.fill()}\n height={Dim.fit()}\n variant="none"\n horizontalAlign="space-between"\n spacing={Dim.px(6)}\n >\n <SbText\n text="Avg delivery time (min)"\n textStyle={{\n variant: "body2",\n textColor: {\n default: sbComputed(() => Theme.colors.neutral500),\n },\n }}\n />\n <SbIcon icon="route" height={Dim.px(24)} width={Dim.fit()} />\n </SbContainer>\n <SbContainer\n layout="horizontal"\n width={Dim.fill()}\n height={Dim.fit()}\n variant="none"\n horizontalAlign="left"\n spacing={Dim.px(6)}\n >\n <SbText\n text="32"\n textStyle={{\n variant: "heading1",\n }}\n />\n {/* Smaller annotation badge, showing change. Container background color is green because the value change is considered "good" (lower delivery time is better) */}\n <SbContainer\n layout="horizontal"\n width={Dim.fit()}\n height={Dim.fit()}\n variant="none"\n spacing={Dim.px(2)}\n horizontalAlign="center"\n verticalAlign="center"\n backgroundColor="#c4e1af"\n padding={{\n top: Dim.px(3),\n right: Dim.px(6),\n bottom: Dim.px(3),\n left: Dim.px(6),\n }}\n borderRadius={{\n topLeft: Dim.px(20),\n topRight: Dim.px(20),\n bottomRight: Dim.px(20),\n bottomLeft: Dim.px(20),\n }}\n >\n <SbIcon\n icon="arrow_downward_alt"\n height={Dim.px(24)}\n width={Dim.fit()}\n />\n <SbText\n text="2m"\n width={Dim.fit()}\n textStyle={{\n variant: "body2",\n }}\n />\n </SbContainer>\n </SbContainer>\n </SbContainer>\n</SbContainer>;\n```\n';
43
+ var content4 = '# Custom Components\n\n- ULTRA CRITICAL: NEVER use Superblocks components in a custom component.\n\n- CRITICAL: Use custom components sparingly.\n\n- CRITICAL: ONLY when all else fails and a component is not available in the Superblocks library, you may construct it out of external component libraries by installing them.\n\n- CRITICAL: ALWAYS import React using a namespace import: `import * as React from \'react\'`.\n\nIn order to hook it up correctly, the platform needs to know what props the component exposes, their types, default values, and how they should be displayed to users.\n\nTo do this, you use the **`Prop` API** and **`registerComponent`** function.\n\n## Key Concepts\n\n- All custom components should live within the `components/` folder.\n- **`Prop`**: Defines a single editable property for your component.\n - Can specify the data type (`string`, `number`, `boolean`, `event`, etc.).\n - Can define a **default value**, **label** for the properties panel, and other validations.\n- **`registerComponent`**: Connects your React component with its editable schema (`properties`) so it appears correctly in the visual editor.\n- **`useUpdateProperties`**: A hook that lets your component programmatically update its properties during runtime (e.g., when a user interacts with it).\n\n---\n\n## Basic Example\n\n```tsx\nimport { Rate } from "antd";\nimport {\n CustomComponentProps,\n Prop,\n registerComponent,\n useUpdateProperties,\n} from "@superblocksteam/library";\n\n// 1. Define editable properties\nconst properties = {\n value: Prop.number()\n .default(3) // Default to 3 stars\n .propertiesPanel({ label: "Default value" }), // Editor label\n onChange: Prop.event().propertiesPanel({ label: "On change" }), // Editor label for event\n};\n\n// 2. Create typed props for your component\ntype ComponentProps = CustomComponentProps<typeof properties>;\n\n// 3. Build your React component\nconst Rating = ({ value, onChange }: ComponentProps) => {\n const updateProperties = useUpdateProperties(); // Hook to update properties dynamically\n\n return (\n <div style={{ display: "flex" }}>\n <Rate\n value={value}\n defaultValue={value}\n onChange={(newValue) => {\n updateProperties({ value: newValue }); // Update visual editor\n onChange?.(); // Trigger custom event\n }}\n />\n </div>\n );\n};\n\n// 4. Register your component to make it available in the visual editor\nexport default registerComponent("Rating", properties, Rating);\n```\n\n---\n\n## How `Prop` Works\n\nYou can define different types of props:\n\n- **`string`**: `Prop.string()`\n- **`number`**: `Prop.number()`\n- **`boolean`**: `Prop.boolean()`\n- **`event`**: `Prop.event()` (for user interactions like clicks)\n- **`any`**: `Prop.any()` (for any type)\n- **`composite`**: `Prop.composite({ x: Prop.number(), y: Prop.number() })` (for nested objects)\n- **`record`**: `Prop.record({...})` (for key-value maps)\n- **`union`**: `Prop.union({...})` (for multiple variants)\n\nYou can chain additional methods:\n\n- `.default(value)` \u2014 Sets a default value.\n- `.propertiesPanel({ label: "Your Label" })` \u2014 Controls how the prop appears in the editor.\n- `.validate(fn)` \u2014 Adds custom validation logic.\n- `.readable()`, `.writable()` \u2014 Control read/write capabilities.\n\n---\n\n## Typical Flow\n\n1. **Define** the **editable schema** (`properties`) with `Prop`.\n2. **Type** your component\'s props using `CustomComponentProps`.\n3. **Use** `useUpdateProperties` to sync UI interactions back to the editor.\n4. **Register** the component using `registerComponent`.\n\n---# Tips\n\n- All `registeredComponent`s automatically support width and height using the `Dim` object.\n ```\n <CustomSlider\n width={Dim.fill(2)} // Fill available space with a weight of 2\n height={Dim.px(100)} // Fixed height of 100 pixels\n />\n ```\n\n## When not to create a net new custom component\n\n- If a user asks for something by name, like showing "metrics card", and you do not find a "metrics card" component in the Superblocks library, be sure to check if an existing custom component exists that you can use inside the `/components` directory of the project.\n';
44
44
 
45
45
  // ../../../vite-plugin-file-sync/dist/ai-service/prompts/generated/subprompts/superblocks-data-filtering.js
46
46
  init_cjs_shims();
package/dist/index.js CHANGED
@@ -296626,7 +296626,7 @@ init_cjs_shims();
296626
296626
  init_cjs_shims();
296627
296627
  var generated = {};
296628
296628
  try {
296629
- generated = await import("./generated-BOH37UWZ.js");
296629
+ generated = await import("./generated-C6SMCIBJ.js");
296630
296630
  } catch (_error) {
296631
296631
  getLogger().warn("[ai-service] Generated markdown modules not found. Run `pnpm generate:markdown` first.");
296632
296632
  }
@@ -322021,7 +322021,7 @@ var import_util28 = __toESM(require_dist3(), 1);
322021
322021
  // ../sdk/package.json
322022
322022
  var package_default = {
322023
322023
  name: "@superblocksteam/sdk",
322024
- version: "2.0.3-next.192",
322024
+ version: "2.0.3-next.194",
322025
322025
  type: "module",
322026
322026
  description: "Superblocks JS SDK",
322027
322027
  homepage: "https://www.superblocks.com",
@@ -322063,8 +322063,8 @@ var package_default = {
322063
322063
  "@rollup/wasm-node": "^4.35.0",
322064
322064
  "@superblocksteam/bucketeer-sdk": "0.5.0",
322065
322065
  "@superblocksteam/shared": "0.9160.0",
322066
- "@superblocksteam/util": "2.0.3-next.192",
322067
- "@superblocksteam/vite-plugin-file-sync": "2.0.3-next.192",
322066
+ "@superblocksteam/util": "2.0.3-next.194",
322067
+ "@superblocksteam/vite-plugin-file-sync": "2.0.3-next.194",
322068
322068
  "@vitejs/plugin-react": "^4.3.4",
322069
322069
  axios: "^1.4.0",
322070
322070
  chokidar: "^4.0.3",
@@ -329038,7 +329038,7 @@ async function startVite({ app, httpServer: httpServer2, root: root2, mode, port
329038
329038
  };
329039
329039
  const isCustomBuildEnabled2 = await isCustomComponentsEnabled();
329040
329040
  const customFolder = path34.join(root2, "custom");
329041
- const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.3-next.192";
329041
+ const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.3-next.194";
329042
329042
  const env3 = loadEnv(mode, root2, "");
329043
329043
  const hmrPort = await getFreePort();
329044
329044
  const hmrOptions = {
@@ -571,5 +571,5 @@
571
571
  "strict": true
572
572
  }
573
573
  },
574
- "version": "2.0.3-next.192"
574
+ "version": "2.0.3-next.194"
575
575
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superblocksteam/cli",
3
- "version": "2.0.3-next.192",
3
+ "version": "2.0.3-next.194",
4
4
  "type": "module",
5
5
  "description": "Official Superblocks CLI",
6
6
  "homepage": "https://www.superblocks.com",
@@ -42,9 +42,9 @@
42
42
  "devDependencies": {
43
43
  "@eslint/js": "^9.16.0",
44
44
  "@oclif/test": "^4.1.11",
45
- "@superblocksteam/sdk": "2.0.3-next.192",
45
+ "@superblocksteam/sdk": "2.0.3-next.194",
46
46
  "@superblocksteam/shared": "0.9160.0",
47
- "@superblocksteam/util": "2.0.3-next.192",
47
+ "@superblocksteam/util": "2.0.3-next.194",
48
48
  "@types/babel__core": "^7.20.0",
49
49
  "@types/chai": "^4",
50
50
  "@types/fs-extra": "^11.0.1",