@bagelink/blox 1.10.39 → 1.10.42

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/dist/core.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import { App } from 'vue';
2
2
  import { Router } from 'vue-router';
3
3
  import { StrategyOptions } from './localeStrategy';
4
- import { BlockDefinition } from './schema';
4
+ import { BlockComponent, BlockDefinition } from './schema';
5
+ /** Either a full `{ component, schema }` definition or a self-defining component (used `defineBlock()`). */
6
+ export type BloxComponent = BlockDefinition | BlockComponent;
5
7
  export interface BloxOptions extends StrategyOptions {
6
- /** Block definitions to register, keyed by block type. */
7
- components?: Record<string, BlockDefinition>;
8
+ /** Block components or definitions to register. Self-defining components (those that called `defineBlock()`) are auto-discovered. */
9
+ components?: Record<string, BloxComponent>;
8
10
  /** Vue Router instance — adds the CMS catch-all and preview routes. */
9
11
  router?: Router;
10
12
  /** CMS website name (must match the `name` field on the Website record). */
@@ -18,7 +20,7 @@ export declare class BloxInstance {
18
20
  private _config;
19
21
  private _strategy;
20
22
  constructor(options?: BloxOptions);
21
- registerComponents(components: Record<string, BlockDefinition>): this;
23
+ registerComponents(components: Record<string, BloxComponent>): this;
22
24
  registerRoutes(router: Router): this;
23
25
  install(app: App, options?: BloxOptions): void;
24
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/C,MAAM,WAAW,WAAY,SAAQ,eAAe;IACnD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,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AM,CAAA;IACpB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,YAAY;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAChE,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,SAAS,CAAgB;gBAErB,OAAO,CAAC,EAAE,WAAW;IAQjC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI;IAqBnE,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAyBpC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI;CA+B9C;AAMD,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,YAAY,CAQ9D"}
@@ -0,0 +1,27 @@
1
+ import { SchemaDefinition } from '../../vue/src/index.ts';
2
+ export interface BlockMeta {
3
+ /** Block type key — must be unique across the app. */
4
+ name: string;
5
+ /** Human-readable label shown in the editor block picker. */
6
+ label: string;
7
+ /** Material icon name. */
8
+ icon?: string;
9
+ /** FormFlow schema for editable props. */
10
+ schema: SchemaDefinition;
11
+ description?: string;
12
+ }
13
+ /**
14
+ * Declare the current component as a blox block.
15
+ * Call this inside `<script setup>` — it stamps the component definition
16
+ * so that `createBlox({ components })` can auto-discover it without
17
+ * needing a manual `{ component, schema }` wrapper.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const schema = defineSchema<MyProps>({ ... })
22
+ * defineProps<MyProps>()
23
+ * defineBlock({ name: 'my-block', label: 'My Block', icon: 'star', schema })
24
+ * ```
25
+ */
26
+ export declare function defineBlock(meta: BlockMeta): void;
27
+ //# sourceMappingURL=defineBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineBlock.d.ts","sourceRoot":"","sources":["../src/defineBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGrD,MAAM,WAAW,SAAS;IACzB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,MAAM,EAAE,gBAAgB,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAYjD"}