@shoplix-ai/block-kit 1.0.0 → 1.2.0
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 +50 -4
- package/dist/code-block.d.ts +8 -2
- package/dist/code-block.d.ts.map +1 -1
- package/dist/code-block.js +2 -0
- package/dist/code-block.js.map +1 -1
- package/dist/contract.d.ts +35 -3
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +1 -0
- package/dist/contract.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/navigation.d.ts +1 -0
- package/dist/navigation.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,8 +8,12 @@ written against this package and nothing else from the runtime. It holds:
|
|
|
8
8
|
shapes (`BindingData | null`), the envelope's asset display entries for the
|
|
9
9
|
screen in hand, the Shop's tokens and resolved theme style,
|
|
10
10
|
the buyer's language and text direction with the Shop's default language as
|
|
11
|
-
fallback, and
|
|
12
|
-
|
|
11
|
+
fallback, `navigate` (the document's action, and the implicit taps: a
|
|
12
|
+
product, a collection, search, the account), `cart` (how many items the
|
|
13
|
+
cart holds, for a badge, never the cart itself), and a capability object
|
|
14
|
+
holding only the capabilities the Block Type declared. A Block Type may also
|
|
15
|
+
declare `rows` beside `render` and hand its items to the host instead of
|
|
16
|
+
drawing them itself.
|
|
13
17
|
- **The registry.** `createBlockRegistry()` keyed by Block Type, one owner per
|
|
14
18
|
type. A second owner is refused; the same owner may register again. Packages
|
|
15
19
|
outside the app register through it. `defineBlock()` is the typed authoring
|
|
@@ -34,9 +38,51 @@ written against this package and nothing else from the runtime. It holds:
|
|
|
34
38
|
`localize` (one string out of a locale object), `textDirection`,
|
|
35
39
|
`imageSourceFor` (the rendition to paint at a given display width).
|
|
36
40
|
|
|
41
|
+
## Rows: what the host lays out
|
|
42
|
+
|
|
43
|
+
A Block Type may declare `rows` next to `render`:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
defineBlock({
|
|
47
|
+
type: 'product_grid',
|
|
48
|
+
owner: 'platform',
|
|
49
|
+
render: ProductGrid,
|
|
50
|
+
rows: {
|
|
51
|
+
columns: (props) => props.settings.per_row,
|
|
52
|
+
gap: (props) => props.theme.spacing,
|
|
53
|
+
header: ProductGridHeading,
|
|
54
|
+
item: ProductTile,
|
|
55
|
+
footer: ProductGridFooter,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`item` is the only part a row declaration must carry. It receives everything
|
|
61
|
+
`render` receives plus the one bound item it draws, the item's place in the
|
|
62
|
+
Binding's items and the width the host gives the cell. `columns` and `gap` are
|
|
63
|
+
read off the same render props: `columns` says how many items stand side by
|
|
64
|
+
side and defaults to 1, `gap` says how much space stands between them and
|
|
65
|
+
defaults to 0. `header` and `footer` are ordinary renderers.
|
|
66
|
+
|
|
67
|
+
On the phone a bound block that declares `rows` is not drawn whole. The host
|
|
68
|
+
takes it apart into one header row, one row per `columns` items and one footer
|
|
69
|
+
row, hands those rows to the screen's list, and never calls `render` for that
|
|
70
|
+
block. A block that declares no `rows`, or whose Binding resolved to a single
|
|
71
|
+
entity, stays one row drawn by `render`.
|
|
72
|
+
|
|
73
|
+
`render` therefore stays required. A host with no row layout of its own, the
|
|
74
|
+
dashboard's previewer canvas and the CLI's dev page, draws every block through
|
|
75
|
+
`render` and ignores the row declaration.
|
|
76
|
+
|
|
77
|
+
The host keys each item element by the item's own id. A cell that receives a
|
|
78
|
+
new product is a new element, so per-item state inside a Code Block, a quick
|
|
79
|
+
add that is waiting for the cart for example, never leaks from one product to
|
|
80
|
+
the next while the rows themselves recycle.
|
|
81
|
+
|
|
37
82
|
No renderers live here. The package depends on `@shoplix-ai/sdui-schema` and on
|
|
38
|
-
React types only. Its
|
|
39
|
-
code outside this repo, so growing it is
|
|
83
|
+
React types only. Its export list, the runtime names and the type names alike,
|
|
84
|
+
is pinned by a test; it is imported by code outside this repo, so growing it is
|
|
85
|
+
a reviewed change. The package follows
|
|
40
86
|
semver and is publishable: a change a Shop package would have to follow is a
|
|
41
87
|
major bump, announced with a migration note, and the runtime moves to the new
|
|
42
88
|
major before any Shop package may.
|
package/dist/code-block.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CapabilityName } from './capabilities.js';
|
|
2
|
-
import type { BlockRegistration, BlockRenderer, BlockSettings } from './contract.js';
|
|
2
|
+
import type { BlockRegistration, BlockRenderer, BlockRows, BlockSettings } from './contract.js';
|
|
3
3
|
/**
|
|
4
4
|
* What a Code Block's component file exports: the renderer, the capabilities
|
|
5
5
|
* it reaches for, the version of this renderer, and how tall the canvas card
|
|
@@ -11,13 +11,19 @@ export interface CodeBlockModule<TSettings extends BlockSettings = BlockSettings
|
|
|
11
11
|
readonly capabilities?: readonly K[];
|
|
12
12
|
readonly heightHint?: number;
|
|
13
13
|
readonly render: BlockRenderer<TSettings, K>;
|
|
14
|
+
readonly rows?: BlockRows<TSettings, K> | undefined;
|
|
14
15
|
}
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The stored shape: the renderer widened as `defineBlock` widens it. `rows`
|
|
18
|
+
* is the one optional field, so a Code Block written against 1.1 is still one
|
|
19
|
+
* here.
|
|
20
|
+
*/
|
|
16
21
|
export interface CodeBlock {
|
|
17
22
|
readonly rendererVersion: number;
|
|
18
23
|
readonly capabilities: readonly CapabilityName[];
|
|
19
24
|
readonly heightHint: number | undefined;
|
|
20
25
|
readonly render: BlockRenderer;
|
|
26
|
+
readonly rows?: BlockRows | undefined;
|
|
21
27
|
}
|
|
22
28
|
/** The typed authoring shape of a Code Block: settings and capabilities are inferred. */
|
|
23
29
|
export declare function defineCodeBlock<TSettings extends BlockSettings = BlockSettings, const K extends CapabilityName = never>(module: CodeBlockModule<TSettings, K>): CodeBlock;
|
package/dist/code-block.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../src/code-block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../src/code-block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAC9B,SAAS,SAAS,aAAa,GAAG,aAAa,EAC/C,CAAC,SAAS,cAAc,GAAG,KAAK;IAEhC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,SAAS,cAAc,EAAE,CAAC;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAC7B,SAAS,SAAS,aAAa,GAAG,aAAa,EAC/C,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,SAAS,CAQlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,GAC1C,SAAS,iBAAiB,EAAE,CAS9B"}
|
package/dist/code-block.js
CHANGED
|
@@ -6,6 +6,7 @@ export function defineCodeBlock(module) {
|
|
|
6
6
|
capabilities: module.capabilities ?? [],
|
|
7
7
|
heightHint: module.heightHint,
|
|
8
8
|
render: module.render,
|
|
9
|
+
rows: module.rows,
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
@@ -21,6 +22,7 @@ export function shopBlocks(shopSlug, blocks) {
|
|
|
21
22
|
capabilities: block.capabilities,
|
|
22
23
|
rendererVersion: block.rendererVersion,
|
|
23
24
|
render: block.render,
|
|
25
|
+
rows: block.rows,
|
|
24
26
|
}));
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=code-block.js.map
|
package/dist/code-block.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.js","sourceRoot":"","sources":["../src/code-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"code-block.js","sourceRoot":"","sources":["../src/code-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAkC7D,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAG7B,MAAqC;IACrC,OAAO;QACL,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,EAAE;QACvC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAkC;QACjD,IAAI,EAAE,MAAM,CAAC,IAAwC;KACtD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,MAA2C;IAE3C,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QACpD,IAAI,EAAE,kBAAkB,CAAC,QAAQ,EAAE,IAAI,CAAC;QACxC,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { BindingData, EnvelopeAssets, LocaleCode, ThemeStyle, ThemeTokens } from '@shoplix-ai/sdui-schema';
|
|
2
|
+
import type { BindingData, BoundItem, EnvelopeAssets, LocaleCode, ThemeStyle, ThemeTokens } from '@shoplix-ai/sdui-schema';
|
|
3
3
|
import type { CapabilityName, CapabilityObject } from './capabilities.js';
|
|
4
4
|
import type { BlockNavigation } from './navigation.js';
|
|
5
5
|
export type TextDirection = 'ltr' | 'rtl';
|
|
6
6
|
export type BlockSettings = Readonly<Record<string, unknown>>;
|
|
7
|
+
/** What a renderer may know of the cart without holding it: how many items it carries. */
|
|
8
|
+
export interface CartSummary {
|
|
9
|
+
readonly totalQuantity: number;
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* Everything a renderer receives, and all it may know. Settings are the
|
|
9
13
|
* block's props from the document; data is its Binding resolved into display
|
|
@@ -11,8 +15,8 @@ export type BlockSettings = Readonly<Record<string, unknown>>;
|
|
|
11
15
|
* display entries for the screen in hand, keyed by asset id; tokens and theme
|
|
12
16
|
* are the Shop's; language and direction are the buyer's, with the Shop's default
|
|
13
17
|
* language as the fallback every locale object resolves through; navigate is the
|
|
14
|
-
* closed way to move the buyer;
|
|
15
|
-
* declared.
|
|
18
|
+
* closed way to move the buyer; cart is the count a badge draws, never the
|
|
19
|
+
* cart itself; capabilities hold only what the Block Type declared.
|
|
16
20
|
*/
|
|
17
21
|
export interface BlockRenderProps<TSettings extends BlockSettings = BlockSettings, K extends CapabilityName = never> {
|
|
18
22
|
readonly blockId: string;
|
|
@@ -25,9 +29,34 @@ export interface BlockRenderProps<TSettings extends BlockSettings = BlockSetting
|
|
|
25
29
|
readonly defaultLanguage: LocaleCode;
|
|
26
30
|
readonly direction: TextDirection;
|
|
27
31
|
readonly navigate: BlockNavigation;
|
|
32
|
+
readonly cart: CartSummary;
|
|
28
33
|
readonly capabilities: CapabilityObject<K>;
|
|
29
34
|
}
|
|
30
35
|
export type BlockRenderer<TSettings extends BlockSettings = BlockSettings, K extends CapabilityName = never> = ComponentType<BlockRenderProps<TSettings, K>>;
|
|
36
|
+
/**
|
|
37
|
+
* What the item renderer of a row receives: everything the block receives,
|
|
38
|
+
* plus the one bound item this cell draws, its place in the Binding's items
|
|
39
|
+
* and the width the host gives the cell.
|
|
40
|
+
*/
|
|
41
|
+
export interface BlockItemRenderProps<TSettings extends BlockSettings = BlockSettings, K extends CapabilityName = never> extends BlockRenderProps<TSettings, K> {
|
|
42
|
+
readonly item: BoundItem;
|
|
43
|
+
readonly index: number;
|
|
44
|
+
readonly width: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* How a bound block hands its items to the host instead of drawing them
|
|
48
|
+
* itself: an optional header, one item renderer, an optional footer, and how
|
|
49
|
+
* many items stand side by side with how much space between them. `columns`
|
|
50
|
+
* defaults to 1 and `gap` to 0 where the host lays rows out. A host without
|
|
51
|
+
* the row layout ignores all of it and calls `render`.
|
|
52
|
+
*/
|
|
53
|
+
export interface BlockRows<TSettings extends BlockSettings = BlockSettings, K extends CapabilityName = never> {
|
|
54
|
+
readonly columns?: (props: BlockRenderProps<TSettings, K>) => number;
|
|
55
|
+
readonly gap?: (props: BlockRenderProps<TSettings, K>) => number;
|
|
56
|
+
readonly header?: BlockRenderer<TSettings, K>;
|
|
57
|
+
readonly item: ComponentType<BlockItemRenderProps<TSettings, K>>;
|
|
58
|
+
readonly footer?: BlockRenderer<TSettings, K>;
|
|
59
|
+
}
|
|
31
60
|
/** Who answers for a Block Type: the platform, or the Shop whose package registered it. */
|
|
32
61
|
export type BlockOwner = string;
|
|
33
62
|
/** The typed authoring shape: settings and capabilities are inferred from the definition. */
|
|
@@ -36,6 +65,7 @@ export interface BlockDefinition<TSettings extends BlockSettings = BlockSettings
|
|
|
36
65
|
readonly owner: BlockOwner;
|
|
37
66
|
readonly capabilities?: readonly K[];
|
|
38
67
|
readonly render: BlockRenderer<TSettings, K>;
|
|
68
|
+
readonly rows?: BlockRows<TSettings, K> | undefined;
|
|
39
69
|
}
|
|
40
70
|
/**
|
|
41
71
|
* The shape a registry stores and a host renders: one entry per Block Type.
|
|
@@ -50,6 +80,8 @@ export interface BlockRegistration {
|
|
|
50
80
|
/** A Code Block's renderer version, the one its Block Definition names; a platform block has none. */
|
|
51
81
|
readonly rendererVersion?: number;
|
|
52
82
|
readonly render: BlockRenderer;
|
|
83
|
+
/** The row declaration, for a host that lays rows out itself; absent when the block draws whole. */
|
|
84
|
+
readonly rows?: BlockRows | undefined;
|
|
53
85
|
}
|
|
54
86
|
/**
|
|
55
87
|
* Turns a typed definition into a registration. The settings a renderer
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OA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K,EACtC,UAAU,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAQ9D"}
|
package/dist/contract.js
CHANGED
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAsHA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAGzB,UAAyC;IACzC,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,YAAY,EAAE,UAAU,CAAC,YAAY,IAAI,EAAE;QAC3C,MAAM,EAAE,UAAU,CAAC,MAAkC;QACrD,IAAI,EAAE,UAAU,CAAC,IAAwC;KAC1D,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CAPABILITY_NAMES } from './capabilities.js';
|
|
2
2
|
export type { Capabilities, CapabilityName, CapabilityObject, CartLineInput, } from './capabilities.js';
|
|
3
3
|
export { defineBlock } from './contract.js';
|
|
4
|
-
export type { BlockDefinition, BlockOwner, BlockRegistration, BlockRenderProps, BlockRenderer, BlockSettings, TextDirection, } from './contract.js';
|
|
4
|
+
export type { BlockDefinition, BlockItemRenderProps, BlockOwner, BlockRegistration, BlockRenderProps, BlockRenderer, BlockRows, BlockSettings, CartSummary, TextDirection, } from './contract.js';
|
|
5
5
|
export type { BlockNavigation } from './navigation.js';
|
|
6
6
|
export { createBlockRegistry } from './registry.js';
|
|
7
7
|
export type { BlockRegistry } from './registry.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,m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AAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgB5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/navigation.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export interface BlockNavigation {
|
|
|
11
11
|
readonly openProduct: (productId: string) => void;
|
|
12
12
|
readonly openCollection: (collectionId: string) => void;
|
|
13
13
|
readonly openSearch: () => void;
|
|
14
|
+
readonly openAccount: () => void;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=navigation.d.ts.map
|
package/dist/navigation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;CAClC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* The major is the compatibility line: a Shop package built against another
|
|
5
5
|
* major never meets this runtime, and a major bump is an announced event.
|
|
6
6
|
*/
|
|
7
|
-
export declare const CONTRACT_VERSION = "1.
|
|
7
|
+
export declare const CONTRACT_VERSION = "1.2.0";
|
|
8
8
|
export declare const CONTRACT_MAJOR = 1;
|
|
9
9
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* The major is the compatibility line: a Shop package built against another
|
|
5
5
|
* major never meets this runtime, and a major bump is an announced event.
|
|
6
6
|
*/
|
|
7
|
-
export const CONTRACT_VERSION = '1.
|
|
7
|
+
export const CONTRACT_VERSION = '1.2.0';
|
|
8
8
|
export const CONTRACT_MAJOR = 1;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplix-ai/block-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "The renderer contract every Block Type renderer is written against: what a renderer receives, how a Block Type is registered with its owner, the closed capability set, and the small helpers renderers share. Contract only, no renderers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@shoplix-ai/sdui-schema": "1.
|
|
29
|
+
"@shoplix-ai/sdui-schema": "1.3.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=19.0.0"
|