juo 0.3.0-alpha.2 → 0.3.0-alpha.4

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
@@ -20,7 +20,7 @@ $ npm install -g juo
20
20
  $ juo COMMAND
21
21
  running command...
22
22
  $ juo (--version)
23
- juo/0.3.0-alpha.2 linux-x64 node-v22.21.0
23
+ juo/0.3.0-alpha.4 linux-x64 node-v22.21.0
24
24
  $ juo --help [COMMAND]
25
25
  USAGE
26
26
  $ juo COMMAND
@@ -1,12 +1,12 @@
1
1
  import { t as BaseCommand } from "../../base-command-BQVnm_gK.js";
2
- import * as _oclif_core_interfaces0 from "@oclif/core/interfaces";
2
+ import * as _oclif_core_interfaces4 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/commands/blocks/dev.d.ts
5
5
  declare class Dev extends BaseCommand<typeof Dev> {
6
6
  static description: string;
7
7
  static examples: string[];
8
8
  static flags: {
9
- port: _oclif_core_interfaces0.OptionFlag<number, _oclif_core_interfaces0.CustomOptions>;
9
+ port: _oclif_core_interfaces4.OptionFlag<number, _oclif_core_interfaces4.CustomOptions>;
10
10
  };
11
11
  run(): Promise<void>;
12
12
  private resolvePackageJsonPath;
@@ -1,13 +1,13 @@
1
1
  import { Command } from "@oclif/core";
2
- import * as _oclif_core_interfaces1 from "@oclif/core/interfaces";
2
+ import * as _oclif_core_interfaces0 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/commands/create.d.ts
5
5
  declare class Create extends Command {
6
6
  static description: string;
7
7
  static flags: {
8
- quickstart: _oclif_core_interfaces1.BooleanFlag<boolean>;
9
- storybook: _oclif_core_interfaces1.BooleanFlag<boolean>;
10
- verbose: _oclif_core_interfaces1.BooleanFlag<boolean>;
8
+ quickstart: _oclif_core_interfaces0.BooleanFlag<boolean>;
9
+ storybook: _oclif_core_interfaces0.BooleanFlag<boolean>;
10
+ verbose: _oclif_core_interfaces0.BooleanFlag<boolean>;
11
11
  };
12
12
  run(): Promise<void>;
13
13
  private getProjectConfig;
@@ -1,5 +1,5 @@
1
1
  import { r as BaseTemplateGenerator } from "../juoTemplateGenerator-RkinYN2l.js";
2
- import { t as PackageGenerator } from "../packageGenerator-BToocy-h.js";
2
+ import { t as PackageGenerator } from "../packageGenerator-CE68rONC.js";
3
3
  import { t as Generate } from "../generate-BiHo2p9_.js";
4
4
  import { Command, Flags } from "@oclif/core";
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -21,9 +21,9 @@ var ConfigFilesGenerator = class extends BaseTemplateGenerator {
21
21
  var DevHarnessGenerator = class extends BaseTemplateGenerator {
22
22
  generate(destDir, options) {
23
23
  this.renderTemplate("dev", destDir, {
24
- devtoolsVersion: "0.1.0-alpha.2",
25
- editorVersion: "0.25.0-alpha.3",
26
- extensionsVersion: "1.12.0-alpha.2",
24
+ devtoolsVersion: "0.1.0-alpha.3",
25
+ editorVersion: "0.25.0-alpha.4",
26
+ extensionsVersion: "1.12.0-alpha.3",
27
27
  tailwind: options.tailwind
28
28
  });
29
29
  }
@@ -1,15 +1,15 @@
1
1
  import { Command } from "@oclif/core";
2
- import * as _oclif_core_interfaces4 from "@oclif/core/interfaces";
2
+ import * as _oclif_core_interfaces6 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/commands/generate.d.ts
5
5
  declare class Generate extends Command {
6
6
  static description: string;
7
7
  static examples: string[];
8
8
  static flags: {
9
- name: _oclif_core_interfaces4.OptionFlag<string | undefined, _oclif_core_interfaces4.CustomOptions>;
10
- tailwind: _oclif_core_interfaces4.BooleanFlag<boolean>;
11
- type: _oclif_core_interfaces4.OptionFlag<string, _oclif_core_interfaces4.CustomOptions>;
12
- verbose: _oclif_core_interfaces4.BooleanFlag<boolean>;
9
+ name: _oclif_core_interfaces6.OptionFlag<string | undefined, _oclif_core_interfaces6.CustomOptions>;
10
+ tailwind: _oclif_core_interfaces6.BooleanFlag<boolean>;
11
+ type: _oclif_core_interfaces6.OptionFlag<string, _oclif_core_interfaces6.CustomOptions>;
12
+ verbose: _oclif_core_interfaces6.BooleanFlag<boolean>;
13
13
  };
14
14
  static id: string;
15
15
  run(): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { t as BaseCommand } from "../../base-command-BQVnm_gK.js";
2
- import * as _oclif_core_interfaces10 from "@oclif/core/interfaces";
2
+ import * as _oclif_core_interfaces2 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/commands/publish/index.d.ts
5
5
  declare class Publish extends BaseCommand<typeof Publish> {
@@ -7,7 +7,7 @@ declare class Publish extends BaseCommand<typeof Publish> {
7
7
  static description: string;
8
8
  static examples: string[];
9
9
  static flags: {
10
- theme: _oclif_core_interfaces10.OptionFlag<string, _oclif_core_interfaces10.CustomOptions>;
10
+ theme: _oclif_core_interfaces2.OptionFlag<string, _oclif_core_interfaces2.CustomOptions>;
11
11
  };
12
12
  getAllFiles(dirPath: string, basePath: string): string[];
13
13
  run(): Promise<void>;
package/dist/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { n as StoryGenerator, r as BaseTemplateGenerator, t as JuoTemplateGenerator } from "../juoTemplateGenerator-RkinYN2l.js";
2
- import { t as PackageGenerator } from "../packageGenerator-BToocy-h.js";
2
+ import { t as PackageGenerator } from "../packageGenerator-CE68rONC.js";
3
3
 
4
4
  export { BaseTemplateGenerator, JuoTemplateGenerator, PackageGenerator, StoryGenerator };
@@ -80,8 +80,8 @@ var PackageGenerator = class {
80
80
  });
81
81
  const frameworkConfig = FRAMEWORK_CONFIGS[options.framework];
82
82
  baseConfig.dependencies = {
83
- "@juo/blocks": "^1.12.0-alpha.2",
84
- "@juo/customer-ui": "^0.5.0-alpha.5",
83
+ "@juo/blocks": "^1.12.0-alpha.3",
84
+ "@juo/customer-ui": "^0.5.0-alpha.6",
85
85
  ...baseConfig.dependencies,
86
86
  ...frameworkConfig.dependencies
87
87
  };
@@ -179,5 +179,5 @@
179
179
  ]
180
180
  }
181
181
  },
182
- "version": "0.3.0-alpha.2"
182
+ "version": "0.3.0-alpha.4"
183
183
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "juo",
3
3
  "description": "A CLI tool for the Juo platform",
4
- "version": "0.3.0-alpha.2",
4
+ "version": "0.3.0-alpha.4",
5
5
  "author": "Juo (https://juo.io)",
6
6
  "bin": {
7
7
  "juo": "./bin/run.js"
@@ -16,7 +16,7 @@
16
16
  align-items: center;
17
17
  justify-content: space-between;
18
18
  gap: var(--space-32);
19
- padding: var(--space-36);
19
+ padding: var(--space-32);
20
20
  }
21
21
 
22
22
  .starter-block__info {
@@ -34,8 +34,8 @@
34
34
  }
35
35
 
36
36
  .starter-block__icon {
37
- width: var(--space-36);
38
- height: var(--space-36);
37
+ width: var(--space-32);
38
+ height: var(--space-32);
39
39
  }
40
40
 
41
41
  .starter-block__text {
@@ -52,10 +52,14 @@ import { createWorkflowOverlay } from "./workflowOverlay";
52
52
  * dev preview's context root, and mount the workflow overlay.
53
53
  */
54
54
  export function provideMockServices(root: HTMLElement, themeState: ThemeState) {
55
+ // One product adapter instance, shared with the subscription mock so that
56
+ // items added to a subscription resolve a real title/price from the same
57
+ // product catalog the picker reads from.
58
+ const productAdapter = createMockProductAdapter();
55
59
  provideContext(
56
60
  root,
57
61
  ProductServiceContext,
58
- createProductService(createMockProductAdapter())
62
+ createProductService(productAdapter)
59
63
  );
60
64
 
61
65
  const customerService = createCustomerService({
@@ -75,15 +79,19 @@ export function provideMockServices(root: HTMLElement, themeState: ThemeState) {
75
79
  createOrdersService(createMockOrdersAdapter())
76
80
  );
77
81
 
78
- const subscriptionService = createSubscriptionService(
79
- createMockSubscriptionAdapter()
80
- );
82
+ // One subscription adapter instance, shared with the schedules mock so that
83
+ // item add/remove/update mutations are reflected in the projected schedule.
84
+ const subscriptionAdapter = createMockSubscriptionAdapter({ productAdapter });
85
+ const subscriptionService = createSubscriptionService(subscriptionAdapter);
81
86
  provideContext(root, SubscriptionServiceContext, subscriptionService);
82
87
 
83
- const schedulesService = createSchedulesService(createMockSchedulesAdapter(), {
84
- // Share the billing-attempt signal so schedule-aware blocks stay in sync.
85
- hasPendingBilling: subscriptionService.hasPendingBilling,
86
- });
88
+ const schedulesService = createSchedulesService(
89
+ createMockSchedulesAdapter(subscriptionAdapter),
90
+ {
91
+ // Share the billing-attempt signal so schedule-aware blocks stay in sync.
92
+ hasPendingBilling: subscriptionService.hasPendingBilling,
93
+ }
94
+ );
87
95
  provideContext(root, SchedulesServiceContext, schedulesService);
88
96
 
89
97
  provideContext(root, RouterServiceContext, createMockRouterService());
@@ -137,4 +145,15 @@ export function provideMockServices(root: HTMLElement, themeState: ThemeState) {
137
145
  void schedulesService.reloadCurrent(id);
138
146
  });
139
147
  });
148
+
149
+ // Re-project the schedule after any item add/remove/update. The focused
150
+ // subscription id is unchanged by an item mutation, so the id-based watcher
151
+ // above does not fire — `itemsChangedAt` bumps on every successful change.
152
+ effect(() => {
153
+ subscriptionService.itemsChangedAt.value; // subscribe
154
+ untracked(() => {
155
+ const id = subscriptionService.current.value?.id ?? null;
156
+ if (id) void schedulesService.reloadCurrent(id);
157
+ });
158
+ });
140
159
  }
@@ -2,7 +2,6 @@
2
2
  // source tree contains only their blocks. Vite serves this file directly (see
3
3
  // the <script> + import map injected in index.html); it never enters the built
4
4
  // blocks bundle (whose entry is `src/blocks/register.ts`).
5
- import "@juo/blocks/web-components/editor";
6
5
  {% if tailwind %}import "../src/tailwind.css";
7
6
  {% else %}import "../src/styles.css";
8
7
  {% endif %}
@@ -138,6 +137,12 @@ function setupViewMode(root: HTMLElement) {
138
137
  async function initializeTheme() {
139
138
  const root = document.querySelector("juo-context-root") as HTMLElement;
140
139
 
140
+ if (isEditorPreview()) {
141
+ await import("@juo/blocks/web-components/editor");
142
+ } else {
143
+ await import("@juo/blocks/web-components/runtime");
144
+ }
145
+
141
146
  registerBlocks();
142
147
 
143
148
  if (isEditorPreview()) {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-require-imports */
2
2
  /** @type {import('tailwindcss').Config} */
3
3
  module.exports = {
4
- presets: [{ theme: { extend: require("@juo/customer-ui/tailwind-v3").theme } }],
4
+ presets: [require("@juo/customer-ui/tailwind-v3")],
5
5
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx,vue}"],
6
6
  theme: {
7
7
  extend: {