@fayz-ai/core 0.9.0 → 0.10.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 +2 -2
- package/dist/access/index.js.map +1 -1
- package/dist/{chunk-L4TLMYGC.js → chunk-6RBW2Y5K.js} +3 -3
- package/dist/chunk-6RBW2Y5K.js.map +1 -0
- package/dist/chunk-732GZEUI.js +1592 -0
- package/dist/chunk-732GZEUI.js.map +1 -0
- package/dist/{chunk-X5THHG6T.js → chunk-CPMHCTX3.js} +3 -3
- package/dist/chunk-CPMHCTX3.js.map +1 -0
- package/dist/{chunk-V2MSAUHO.js → chunk-JO7Z2AOE.js} +2 -2
- package/dist/chunk-JO7Z2AOE.js.map +1 -0
- package/dist/{chunk-5RJVUC6J.js → chunk-M27JPX3K.js} +12 -3
- package/dist/chunk-M27JPX3K.js.map +1 -0
- package/dist/chunk-OXQGRJZT.js +125 -0
- package/dist/chunk-OXQGRJZT.js.map +1 -0
- package/dist/data/backend-env.d.ts +38 -0
- package/dist/data/backend-env.d.ts.map +1 -0
- package/dist/data/index.js +1 -1
- package/dist/entity/events.d.ts +14 -0
- package/dist/entity/events.d.ts.map +1 -0
- package/dist/events/envelope.d.ts +31 -0
- package/dist/events/envelope.d.ts.map +1 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/log.d.ts +44 -0
- package/dist/events/log.d.ts.map +1 -0
- package/dist/events/types.d.ts +40 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +10 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +27 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +388 -52
- package/dist/index.js.map +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/{integrations/index.d.ts → integrations.d.ts} +2 -2
- package/dist/integrations.d.ts.map +1 -0
- package/dist/{address/index.d.ts → lib/address.d.ts} +1 -1
- package/dist/{address/index.d.ts.map → lib/address.d.ts.map} +1 -1
- package/dist/{phone/index.d.ts → lib/phone.d.ts} +1 -1
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/{seo/index.d.ts → lib/seo.d.ts} +18 -1
- package/dist/lib/seo.d.ts.map +1 -0
- package/dist/{tenant/index.d.ts → lib/tenant.d.ts} +1 -1
- package/dist/lib/tenant.d.ts.map +1 -0
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/messaging/index.d.ts +3 -0
- package/dist/messaging/index.d.ts.map +1 -0
- package/dist/messaging/registry.d.ts +35 -0
- package/dist/messaging/registry.d.ts.map +1 -0
- package/dist/messaging/types.d.ts +67 -0
- package/dist/messaging/types.d.ts.map +1 -0
- package/dist/plugin/index.js +2 -1
- package/dist/plugin/runtime.d.ts +17 -0
- package/dist/plugin/runtime.d.ts.map +1 -1
- package/dist/registry/block-catalog.d.ts +78 -0
- package/dist/registry/block-catalog.d.ts.map +1 -0
- package/dist/registry/block-constraints.d.ts +64 -0
- package/dist/registry/block-constraints.d.ts.map +1 -0
- package/dist/registry/block-schema.d.ts +69 -0
- package/dist/registry/block-schema.d.ts.map +1 -0
- package/dist/registry/blocks.d.ts +84 -0
- package/dist/registry/blocks.d.ts.map +1 -0
- package/dist/registry/entities.d.ts +153 -0
- package/dist/registry/entities.d.ts.map +1 -0
- package/dist/registry/extension-points.d.ts +117 -0
- package/dist/registry/extension-points.d.ts.map +1 -0
- package/dist/registry/handles.d.ts +41 -0
- package/dist/registry/handles.d.ts.map +1 -0
- package/dist/registry/index.d.ts +41 -41
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/loaders.d.ts +55 -0
- package/dist/registry/loaders.d.ts.map +1 -0
- package/dist/registry/registry-class.d.ts +157 -0
- package/dist/registry/registry-class.d.ts.map +1 -0
- package/dist/registry/schema-check.d.ts +14 -0
- package/dist/registry/schema-check.d.ts.map +1 -0
- package/dist/router/index.d.ts +78 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/{testing/index.d.ts → testing.d.ts} +3 -3
- package/dist/testing.d.ts.map +1 -0
- package/dist/types/analytics.d.ts +196 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/crud.d.ts +22 -2
- package/dist/types/crud.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +55 -1
- package/dist/types/plugins.d.ts.map +1 -1
- package/package.json +6 -18
- package/dist/blocks/index.d.ts +0 -25
- package/dist/blocks/index.d.ts.map +0 -1
- package/dist/chunk-5RJVUC6J.js.map +0 -1
- package/dist/chunk-L4TLMYGC.js.map +0 -1
- package/dist/chunk-V2MSAUHO.js.map +0 -1
- package/dist/chunk-X5THHG6T.js.map +0 -1
- package/dist/chunk-Y2C2FBQP.js +0 -35
- package/dist/chunk-Y2C2FBQP.js.map +0 -1
- package/dist/chunk-YH25Y4FW.js +0 -311
- package/dist/chunk-YH25Y4FW.js.map +0 -1
- package/dist/integrations/index.d.ts.map +0 -1
- package/dist/phone/index.d.ts.map +0 -1
- package/dist/seo/index.d.ts.map +0 -1
- package/dist/tenant/index.d.ts.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/src/access/denial.ts +0 -33
- package/src/access/engine.test.ts +0 -48
- package/src/access/engine.ts +0 -136
- package/src/access/index.ts +0 -14
- package/src/access/limits.ts +0 -18
- package/src/address/index.ts +0 -188
- package/src/app/render.tsx +0 -69
- package/src/blocks/index.tsx +0 -68
- package/src/data/archetype.ts +0 -255
- package/src/data/bulk.ts +0 -35
- package/src/data/cached.ts +0 -55
- package/src/data/count.test.ts +0 -152
- package/src/data/count.ts +0 -131
- package/src/data/filters.test.ts +0 -70
- package/src/data/filters.ts +0 -90
- package/src/data/index.ts +0 -11
- package/src/data/mock.ts +0 -90
- package/src/data/platform-api.ts +0 -209
- package/src/data/refresh.ts +0 -115
- package/src/data/resolve.ts +0 -126
- package/src/data/supabase.ts +0 -230
- package/src/data/types.ts +0 -50
- package/src/entity/index.ts +0 -2
- package/src/entity/registry.ts +0 -49
- package/src/events/index.tsx +0 -82
- package/src/i18n/index.ts +0 -476
- package/src/i18n/shell-translations.en.ts +0 -875
- package/src/i18n/shell-translations.pt-br.ts +0 -873
- package/src/index.ts +0 -217
- package/src/integrations/index.ts +0 -237
- package/src/lib/cache.ts +0 -118
- package/src/lib/csv.ts +0 -54
- package/src/lib/format.ts +0 -58
- package/src/manifest/app-manifest.schema.json +0 -676
- package/src/manifest/index.ts +0 -518
- package/src/manifest/serialize.ts +0 -52
- package/src/phone/index.ts +0 -85
- package/src/plugin/createSafeDataProvider.ts +0 -30
- package/src/plugin/index.ts +0 -1
- package/src/plugin/runtime.ts +0 -331
- package/src/registry/index.ts +0 -163
- package/src/router/history.ts +0 -86
- package/src/router/index.ts +0 -29
- package/src/runtime/index.ts +0 -15
- package/src/runtime/oauth.ts +0 -219
- package/src/search/engine.ts +0 -559
- package/src/search/index.ts +0 -25
- package/src/search/text.ts +0 -206
- package/src/search/types.ts +0 -75
- package/src/seo/index.ts +0 -128
- package/src/tenant/index.ts +0 -38
- package/src/testing/index.ts +0 -116
- package/src/types/auth.ts +0 -41
- package/src/types/billing.ts +0 -39
- package/src/types/crud.ts +0 -184
- package/src/types/entities.ts +0 -142
- package/src/types/entitlements.ts +0 -45
- package/src/types/i18n.ts +0 -7
- package/src/types/index.ts +0 -11
- package/src/types/org.ts +0 -137
- package/src/types/payment.ts +0 -44
- package/src/types/permissions.ts +0 -32
- package/src/types/plugins.ts +0 -480
- package/src/types/theme.ts +0 -8
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { connectorDirection, connectorPlanes, preferredPlane, withAfterHooks } from '../chunk-
|
|
1
|
+
export { connectorDirection, connectorPlanes, preferredPlane, withAfterHooks } from '../chunk-6RBW2Y5K.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -91,7 +91,7 @@ export interface ConnectorStatus {
|
|
|
91
91
|
* UI-facing connector descriptor. Built on the data-plane `Connector` concept
|
|
92
92
|
* (`pluginId` → `hostPluginId`), plus the control-plane hooks the unified
|
|
93
93
|
* Integrations hub calls. Lives in core so `PluginManifest.connectors` can type
|
|
94
|
-
* it; the rendering hub lives in `@fayz-ai/
|
|
94
|
+
* it; the rendering hub lives in `@fayz-ai/admin`.
|
|
95
95
|
*/
|
|
96
96
|
export interface ConnectorDefinition {
|
|
97
97
|
/** Stable connector id, e.g. 'google-calendar', 'plugbank'. */
|
|
@@ -156,4 +156,4 @@ export declare function connectorDirection(def: Pick<ConnectorDefinition, 'direc
|
|
|
156
156
|
* updated. The handler runs fire-and-forget; its failures never break the call.
|
|
157
157
|
*/
|
|
158
158
|
export declare function withAfterHooks<T extends object>(target: T, methods: Partial<Record<keyof T, (args: unknown[], result: unknown) => void | Promise<void>>>): T;
|
|
159
|
-
//# sourceMappingURL=
|
|
159
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAiB9D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,CAAA;AAE/C,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,CAAA;AAEvD,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,CAAA;AAEpE,iCAAiC;AACjC,MAAM,MAAM,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C7C,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAC5F,CAAC,CAmBH"}
|
|
@@ -49,4 +49,4 @@ export declare function getPostalLookupProvider(): PostalLookupProvider;
|
|
|
49
49
|
* "no such CEP" from "we could not check right now" and say the right thing.
|
|
50
50
|
*/
|
|
51
51
|
export declare function lookupPostalCode(postalCode: string): Promise<PostalAddress | null>;
|
|
52
|
-
//# sourceMappingURL=
|
|
52
|
+
//# sourceMappingURL=address.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/lib/address.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;kFACkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;CAC1D;AAED,wBAAwB;AACxB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,+CAA+C;AAC/C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AA2CD,iFAAiF;AACjF,wBAAgB,gBAAgB,IAAI,IAAI,CAOvC;AAgBD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CAAE,GAAG,oBAAoB,CAwB/F;AAUD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAEnF;AAED,wBAAgB,uBAAuB,IAAI,oBAAoB,CAG9D;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAUxF"}
|
|
@@ -25,4 +25,4 @@ export declare function unmaskPhone(value: string): string;
|
|
|
25
25
|
export declare function maskPhone(value: string, mask: string): string;
|
|
26
26
|
/** Count how many digits a mask expects. */
|
|
27
27
|
export declare function maskDigitCount(mask: string): number;
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=phone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../../src/lib/phone.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAA;IACZ,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAA;CACb;AAyBD,eAAO,MAAM,SAAS,EAAE,UAAU,EAAqD,CAAA;AAEvF,eAAO,MAAM,eAAe,OAAO,CAAA;AAInC,6DAA6D;AAC7D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAE/D;AAED,kCAAkC;AAClC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAa7D;AAED,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAInD"}
|
|
@@ -12,6 +12,23 @@ export interface SeoConfig {
|
|
|
12
12
|
export declare function seoOrigin(): string;
|
|
13
13
|
/** Build an absolute URL from a path, using the current origin. */
|
|
14
14
|
export declare function absoluteUrl(path: string): string;
|
|
15
|
+
export interface SeoMetaTag {
|
|
16
|
+
name?: string;
|
|
17
|
+
property?: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SeoLinkTag {
|
|
21
|
+
rel: string;
|
|
22
|
+
href: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SeoTags {
|
|
25
|
+
title: string;
|
|
26
|
+
meta: SeoMetaTag[];
|
|
27
|
+
links: SeoLinkTag[];
|
|
28
|
+
jsonLd: Array<Record<string, unknown>>;
|
|
29
|
+
}
|
|
30
|
+
/** Pure: turn an SeoConfig into the exact tag set a page should carry. */
|
|
31
|
+
export declare function buildSeoTags(config: SeoConfig): SeoTags;
|
|
15
32
|
/** Imperatively apply SEO tags (used by useSeo; exported for non-React callers). */
|
|
16
33
|
export declare function applySeo(config: SeoConfig): void;
|
|
17
34
|
/** Apply SEO head tags for the current route; cleans up on unmount. */
|
|
@@ -24,4 +41,4 @@ export interface BreadcrumbItem {
|
|
|
24
41
|
export declare function breadcrumbJsonLd(items: BreadcrumbItem[]): Record<string, unknown>;
|
|
25
42
|
/** schema.org Organization publisher block. */
|
|
26
43
|
export declare function organizationJsonLd(name: string, extra?: Record<string, unknown>): Record<string, unknown>;
|
|
27
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=seo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo.d.ts","sourceRoot":"","sources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AAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWjF;AAED,+CAA+C;AAC/C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzG"}
|
|
@@ -10,4 +10,4 @@ export declare function subscribeActiveTenant(listener: () => void): () => void;
|
|
|
10
10
|
/** The active tenant, re-rendering when it resolves or changes. Use this to key
|
|
11
11
|
* effects that fetch tenant-scoped data. */
|
|
12
12
|
export declare function useActiveTenantId(): string | undefined;
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=tenant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../src/lib/tenant.ts"],"names":[],"mappings":"AAUA,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAM9D;AAED,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGtE;AAED;6CAC6C;AAC7C,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAEtD"}
|
package/dist/manifest/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { PermissionsConfig, FeatureDeclaration } from '../types/permissions
|
|
|
4
4
|
import type { BillingConfig } from '../types/billing';
|
|
5
5
|
import type { LimitDeclaration } from '../types/entitlements';
|
|
6
6
|
import type { AIToolParameters, AIToolExecution, AgentRpcDeclaration } from '../types/plugins';
|
|
7
|
-
import type { BlockNode } from '../blocks';
|
|
7
|
+
import type { BlockNode } from '../registry/blocks';
|
|
8
8
|
export declare const CURRENT_MANIFEST_VERSION = 3;
|
|
9
9
|
export type BackendProvider = 'supabase' | 'fayz-api' | 'fayz-shop' | 'mock' | 'custom';
|
|
10
10
|
export interface BackendRef {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,KAAK,EAAE,SAAS,EAAE,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,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAE1F;AAQD;qDACqD;AACrD,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAkB/D;AAED;iEACiE;AACjE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CA2EzD"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { MessageChannel, MessageKind, MessageDefault, MessageDefaultsDef, MessageTemplate, UpsertMessageTemplateInput, ResolvedMessage, } from './types';
|
|
2
|
+
export { registerMessageDefaults, getMessageDefaults, clearMessageDefaults, renderMessageTemplate, resolveMessages, resolveMessage, getEventsWithoutMessages, loadMessageOverrides, MESSAGE_TEMPLATES_TABLE, } from './registry';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messaging/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAC/D,eAAe,EAAE,0BAA0B,EAAE,eAAe,GAC7D,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EAAE,kBAAkB,EAAE,oBAAoB,EACjE,qBAAqB,EAAE,eAAe,EAAE,cAAc,EACtD,wBAAwB,EAAE,oBAAoB,EAAE,uBAAuB,GACxE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { MessageChannel, MessageDefaultsDef, MessageTemplate, ResolvedMessage } from './types';
|
|
2
|
+
import type { ResolvedDomainEvent } from '../types/plugins';
|
|
3
|
+
export declare function registerMessageDefaults(defs: MessageDefaultsDef[]): void;
|
|
4
|
+
export declare function getMessageDefaults(): MessageDefaultsDef[];
|
|
5
|
+
export declare function clearMessageDefaults(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Substitutes the merge fields. Lives beside the catalog because PREVIEW and
|
|
8
|
+
* SEND must agree: a screen doing its own `replace` approves one text and
|
|
9
|
+
* delivers another.
|
|
10
|
+
*
|
|
11
|
+
* An unknown field stays visible as `{{foo}}` on purpose — in the preview that
|
|
12
|
+
* exposes the typo; hiding it would hide the gap until the message had gone out.
|
|
13
|
+
*/
|
|
14
|
+
export declare function renderMessageTemplate(text: string, values: Record<string, string>): string;
|
|
15
|
+
/**
|
|
16
|
+
* Joins event (code) + default text (code) + customisation (database).
|
|
17
|
+
*
|
|
18
|
+
* A function and not a query: the merge must give the same answer in the list,
|
|
19
|
+
* the editor and the send, and three places doing the same `??` is how they
|
|
20
|
+
* start to disagree.
|
|
21
|
+
*
|
|
22
|
+
* One row per (event × offered channel). A channel with no default text is left
|
|
23
|
+
* out — there is nothing to switch on.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveMessages(overrides: MessageTemplate[], events: ResolvedDomainEvent[]): ResolvedMessage[];
|
|
26
|
+
/** A single resolved event×channel pair — what the detail screen opens. */
|
|
27
|
+
export declare function resolveMessage(eventKey: string, channel: MessageChannel, overrides: MessageTemplate[], events: ResolvedDomainEvent[]): ResolvedMessage | null;
|
|
28
|
+
/** Events that exist with no text written for them — what webhooks and audit
|
|
29
|
+
* can see and the message list cannot. */
|
|
30
|
+
export declare function getEventsWithoutMessages(events: ResolvedDomainEvent[]): ResolvedDomainEvent[];
|
|
31
|
+
export declare const MESSAGE_TEMPLATES_TABLE = "plg_automations_templates";
|
|
32
|
+
/** Never throws: with no client, no table or no permission the whole catalog
|
|
33
|
+
* still holds on its defaults — a complete state, not an error. */
|
|
34
|
+
export declare function loadMessageOverrides(tenantId?: string): Promise<MessageTemplate[]>;
|
|
35
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/messaging/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EACrE,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAY3D,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAExE;AAED,wBAAgB,kBAAkB,IAAI,kBAAkB,EAAE,CAEzD;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAE1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,eAAe,EAAE,EAC5B,MAAM,EAAE,mBAAmB,EAAE,GAC5B,eAAe,EAAE,CAiCnB;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,eAAe,EAAE,EAC5B,MAAM,EAAE,mBAAmB,EAAE,GAC5B,eAAe,GAAG,IAAI,CAGxB;AAED;2CAC2C;AAC3C,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAE7F;AAUD,eAAO,MAAM,uBAAuB,8BAA8B,CAAA;AAElE;oEACoE;AACpE,wBAAsB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAwBxF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ResolvedDomainEvent } from '../types/plugins';
|
|
2
|
+
/** The same set the inbox uses (plugin-conversations). */
|
|
3
|
+
export type MessageChannel = 'email' | 'whatsapp' | 'sms' | 'push' | 'webchat';
|
|
4
|
+
/**
|
|
5
|
+
* Transactional answers something the person did; marketing is the company's
|
|
6
|
+
* initiative — the distinction that decides whether sending needs consent.
|
|
7
|
+
*/
|
|
8
|
+
export type MessageKind = 'transactional' | 'marketing';
|
|
9
|
+
export interface MessageDefault {
|
|
10
|
+
/** Only meaningful on channels with a subject (email). */
|
|
11
|
+
subject?: string;
|
|
12
|
+
body: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The default text a module suggests for an event. Registered separately from
|
|
16
|
+
* the event on purpose: a module may emit facts with nothing to say about them,
|
|
17
|
+
* and whoever writes the webhook should not trip over email copy.
|
|
18
|
+
*/
|
|
19
|
+
export interface MessageDefaultsDef {
|
|
20
|
+
/** The domain event this text reacts to. */
|
|
21
|
+
eventKey: string;
|
|
22
|
+
kind: MessageKind;
|
|
23
|
+
/** Channels this event MAY go out on. */
|
|
24
|
+
channels: MessageChannel[];
|
|
25
|
+
/** Default text per channel. A channel with no default cannot be switched on. */
|
|
26
|
+
defaults: Partial<Record<MessageChannel, MessageDefault>>;
|
|
27
|
+
/** On in a new account, per channel. Absent = off. */
|
|
28
|
+
defaultEnabled?: Partial<Record<MessageChannel, boolean>>;
|
|
29
|
+
}
|
|
30
|
+
/** What the customer customised. No row = use the default. */
|
|
31
|
+
export interface MessageTemplate {
|
|
32
|
+
id: string;
|
|
33
|
+
tenantId: string;
|
|
34
|
+
eventKey: string;
|
|
35
|
+
channel: MessageChannel;
|
|
36
|
+
/** Null = use the catalog's `defaultEnabled`. */
|
|
37
|
+
enabled: boolean | null;
|
|
38
|
+
/** Null = use the catalog default. */
|
|
39
|
+
subject: string | null;
|
|
40
|
+
body: string | null;
|
|
41
|
+
/** Name given when duplicating. Null = the event's title. */
|
|
42
|
+
name: string | null;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
}
|
|
45
|
+
export interface UpsertMessageTemplateInput {
|
|
46
|
+
eventKey: string;
|
|
47
|
+
channel: MessageChannel;
|
|
48
|
+
enabled?: boolean | null;
|
|
49
|
+
subject?: string | null;
|
|
50
|
+
body?: string | null;
|
|
51
|
+
name?: string | null;
|
|
52
|
+
}
|
|
53
|
+
/** Event + channel + text, resolved — what the screen shows. */
|
|
54
|
+
export interface ResolvedMessage {
|
|
55
|
+
event: ResolvedDomainEvent;
|
|
56
|
+
kind: MessageKind;
|
|
57
|
+
channel: MessageChannel;
|
|
58
|
+
override: MessageTemplate | null;
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
subject: string;
|
|
61
|
+
body: string;
|
|
62
|
+
/** true when the text was rewritten — the list flags it. */
|
|
63
|
+
customized: boolean;
|
|
64
|
+
/** Merge fields, derived from the event payload. */
|
|
65
|
+
placeholders: string[];
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/messaging/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAc3D,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;AAE9E;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,WAAW,CAAA;AAEvD,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,WAAW,CAAA;IACjB,yCAAyC;IACzC,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAA;IACzD,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAA;CAC1D;AAED,8DAA8D;AAC9D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,cAAc,CAAA;IACvB,iDAAiD;IACjD,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,sCAAsC;IACtC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,cAAc,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,cAAc,CAAA;IACvB,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAA;IACnB,oDAAoD;IACpD,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB"}
|
package/dist/plugin/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { PluginRuntimeProvider, definePlugin, getWidgetsForZone, resolvePluginRuntime, usePluginRuntime, usePluginRuntimeOptional } from '../chunk-
|
|
1
|
+
export { PluginRuntimeProvider, definePlugin, getWidgetsForZone, resolvePluginRuntime, usePluginRuntime, usePluginRuntimeOptional } from '../chunk-732GZEUI.js';
|
|
2
|
+
import '../chunk-CU64QI4A.js';
|
|
2
3
|
//# sourceMappingURL=index.js.map
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/dist/plugin/runtime.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PluginManifest, PluginRuntime, PluginRuntimeContext, PluginWidgetZone, ResolvedPluginWidget, TenantPluginBinding, ResolvedDashboardWidget, DashboardSurface } from '../types/plugins';
|
|
3
|
+
import type { ResolvedAnalyticsCard } from '../types/analytics';
|
|
3
4
|
import type { ConnectorDefinition } from '../integrations';
|
|
4
5
|
/** The plugin contract version this runtime understands. A plugin declaring a
|
|
5
6
|
* higher apiVersion is rejected rather than mis-rendered. */
|
|
@@ -19,6 +20,22 @@ interface ResolvePluginRuntimeOptions {
|
|
|
19
20
|
export declare function definePlugin<T extends PluginManifest>(plugin: T): T;
|
|
20
21
|
export declare function resolvePluginRuntime({ plugins, tenantPlugins, hasTenantBindings, context, }: ResolvePluginRuntimeOptions): PluginRuntime;
|
|
21
22
|
export declare function getWidgetsForZone(runtime: PluginRuntime, zone: PluginWidgetZone, contextOverrides?: Partial<PluginRuntimeContext>): ResolvedPluginWidget[];
|
|
23
|
+
/**
|
|
24
|
+
* Analytics cards visible to the current tenant/user.
|
|
25
|
+
*
|
|
26
|
+
* The report LIST wants every card the user may read; the overview wants only
|
|
27
|
+
* the ones a pack placed on the grid — hence `placedOnly`, rather than two
|
|
28
|
+
* registries that could drift apart.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAnalyticsCards(runtime: PluginRuntime, options?: {
|
|
31
|
+
domain?: string;
|
|
32
|
+
category?: string;
|
|
33
|
+
/** Only cards with a `dashboard` placement (the overview grid). */
|
|
34
|
+
placedOnly?: boolean;
|
|
35
|
+
/** Restrict placement to one surface. Implies `placedOnly`. */
|
|
36
|
+
surface?: DashboardSurface;
|
|
37
|
+
contextOverrides?: Partial<PluginRuntimeContext>;
|
|
38
|
+
}): ResolvedAnalyticsCard[];
|
|
22
39
|
export declare function getDashboardWidgets(runtime: PluginRuntime, options: {
|
|
23
40
|
surface: DashboardSurface;
|
|
24
41
|
domain?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/plugin/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,oBAAoB,EAKpB,gBAAgB,EAEhB,oBAAoB,EACpB,mBAAmB,EAMnB,uBAAuB,EACvB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/plugin/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,oBAAoB,EAKpB,gBAAgB,EAEhB,oBAAoB,EACpB,mBAAmB,EAMnB,uBAAuB,EACvB,gBAAgB,EAEjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAI/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAI1D;8DAC8D;AAC9D,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;+EAC+E;AAC/E,wBAAgB,sBAAsB,CACpC,GAAG,EAAE;IAAE,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACtE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAI1C;AAED,UAAU,2BAA2B;IACnC,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,aA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AED,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAElF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { JsonSchema, RegistrySource, RequiredBlockChild } from './index';
|
|
2
|
+
import type { BlockPreset, BlockSetting, BlockStability } from './block-schema';
|
|
3
|
+
/** A block, described well enough to configure it without reading its source. */
|
|
4
|
+
export interface BlockDescriptor {
|
|
5
|
+
id: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
source?: RegistrySource;
|
|
9
|
+
pluginId?: string;
|
|
10
|
+
settings: readonly BlockSetting[];
|
|
11
|
+
presets: readonly BlockPreset[];
|
|
12
|
+
/** Surfaces this block may be placed on. Empty means "anywhere". */
|
|
13
|
+
enabledOn: readonly string[];
|
|
14
|
+
stability: BlockStability;
|
|
15
|
+
/** The machine contract, compiled from `settings`. Absent if never described. */
|
|
16
|
+
propsSchema?: JsonSchema;
|
|
17
|
+
/** Props a freshly inserted instance starts with, when no preset is chosen. */
|
|
18
|
+
defaults: Record<string, unknown>;
|
|
19
|
+
parent: readonly string[];
|
|
20
|
+
ancestor: readonly string[];
|
|
21
|
+
usesContext: readonly string[];
|
|
22
|
+
providesContext: readonly string[];
|
|
23
|
+
allowMultiple: boolean;
|
|
24
|
+
requiredChildren: readonly RequiredBlockChild[];
|
|
25
|
+
}
|
|
26
|
+
export interface BlockCatalogOptions {
|
|
27
|
+
/** Keep only blocks placeable on this surface (`home`, `product`, …). */
|
|
28
|
+
enabledOn?: string;
|
|
29
|
+
/** Keep only blocks from these origins. */
|
|
30
|
+
source?: readonly RegistrySource[];
|
|
31
|
+
/** Include `experimental` blocks. Default false — an agent should reach for a
|
|
32
|
+
* stable block unless something explicitly asks it not to. */
|
|
33
|
+
includeExperimental?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Describe one registered block. Undefined if the id is not registered. */
|
|
36
|
+
export declare function describeBlock(id: string): BlockDescriptor | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The whole registry as descriptors, filtered and sorted by id.
|
|
39
|
+
*
|
|
40
|
+
* Sorted because this feeds prompts and generated documentation: registration
|
|
41
|
+
* order is an implementation detail, and letting it leak makes every diff of a
|
|
42
|
+
* generated artifact noisy for no reason.
|
|
43
|
+
*/
|
|
44
|
+
export declare function describeBlocks(options?: BlockCatalogOptions): BlockDescriptor[];
|
|
45
|
+
/** True when `block` may be placed on `surface`. */
|
|
46
|
+
export declare function isBlockEnabledOn(block: Pick<BlockDescriptor, 'enabledOn'>, surface: string): boolean;
|
|
47
|
+
export type BlockAuditLevel = 'error' | 'warning';
|
|
48
|
+
export interface BlockAudit {
|
|
49
|
+
level: BlockAuditLevel;
|
|
50
|
+
/** Stable machine-readable rule id, so tooling can filter or waive one rule. */
|
|
51
|
+
rule: string;
|
|
52
|
+
blockId: string;
|
|
53
|
+
detail: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Conformance findings for the registered blocks.
|
|
57
|
+
*
|
|
58
|
+
* Errors mean the schema misdescribes the block — that is worth failing a build
|
|
59
|
+
* over, because an editor and an agent both act on it. Warnings mean the block
|
|
60
|
+
* is under-described: it works, but it cannot be configured well by anything
|
|
61
|
+
* that did not read its source.
|
|
62
|
+
*
|
|
63
|
+
* `requirePresets`/`requireEnabledOn` are opt-in because they are a standard the
|
|
64
|
+
* SDK holds itself to, not a rule an app's one-off block should fail. An app
|
|
65
|
+
* block that only ever appears in one store needs no preset.
|
|
66
|
+
*/
|
|
67
|
+
export declare function auditBlocks(options?: {
|
|
68
|
+
source?: readonly RegistrySource[];
|
|
69
|
+
requirePresets?: boolean;
|
|
70
|
+
requireEnabledOn?: boolean;
|
|
71
|
+
}): BlockAudit[];
|
|
72
|
+
/** Convenience: the audit reduced to a pass/fail plus its counts. */
|
|
73
|
+
export declare function summarizeBlockAudit(findings: readonly BlockAudit[]): {
|
|
74
|
+
ok: boolean;
|
|
75
|
+
errors: number;
|
|
76
|
+
warnings: number;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=block-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-catalog.d.ts","sourceRoot":"","sources":["../../src/registry/block-catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAA+B,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE1G,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAwB/E,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;IACjC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,oEAAoE;IACpE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,SAAS,EAAE,cAAc,CAAA;IACzB,iFAAiF;IACjF,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAIjC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IAClC;mEAC+D;IAC/D,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AA0BD,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAGrE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,mBAAwB,GAAG,eAAe,EAAE,CAenF;AAED,oDAAoD;AACpD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpG;AAID,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,CAAA;AAEjD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,eAAe,CAAA;IACtB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AA4HD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE;IACnC,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IAClC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CACtB,GAAG,UAAU,EAAE,CAyFpB;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG;IACpE,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAGA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Structural view of a block tree node — matches `BlockNode` without importing it. */
|
|
2
|
+
export interface BlockTreeNode {
|
|
3
|
+
type: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
props?: Record<string, unknown>;
|
|
6
|
+
children?: BlockTreeNode[];
|
|
7
|
+
}
|
|
8
|
+
export type BlockConstraintRule = 'constraint-parent' | 'constraint-ancestor' | 'constraint-multiple';
|
|
9
|
+
export interface BlockConstraintViolation {
|
|
10
|
+
/** Path relative to the checked list, e.g. '[2].children[0]'. */
|
|
11
|
+
path: string;
|
|
12
|
+
/** The violating block's type. */
|
|
13
|
+
type: string;
|
|
14
|
+
rule: BlockConstraintRule;
|
|
15
|
+
detail: string;
|
|
16
|
+
/** The valid set (I2): the declared parent/ancestor ids, or for
|
|
17
|
+
* constraint-multiple the path of the instance that is allowed to stay. */
|
|
18
|
+
valid?: string[];
|
|
19
|
+
}
|
|
20
|
+
/** One node's parent/ancestor verdicts — shared by the validator and the renderer. */
|
|
21
|
+
export declare function checkNodePlacement(type: string, ancestors: readonly string[]): BlockConstraintViolation[];
|
|
22
|
+
/**
|
|
23
|
+
* Structural constraint violations in one block tree: `parent` (direct child
|
|
24
|
+
* only), `ancestor` (any depth), `allowMultiple` (per tree). Unregistered
|
|
25
|
+
* types are skipped — they are a different error (`unknown-block`) with its
|
|
26
|
+
* own reporter.
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkBlockConstraints(nodes: readonly BlockTreeNode[]): BlockConstraintViolation[];
|
|
29
|
+
export interface BlockContextFinding {
|
|
30
|
+
path: string;
|
|
31
|
+
type: string;
|
|
32
|
+
/** Context keys the block declares in `usesContext` that nothing provides. */
|
|
33
|
+
missing: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Placements where a block's `usesContext` keys are satisfied neither by an
|
|
37
|
+
* ancestor's `providesContext` nor by the surface itself (`provided` — e.g. a
|
|
38
|
+
* slot area's context keys).
|
|
39
|
+
*
|
|
40
|
+
* Advisory, not an error: context also arrives through runtime channels a
|
|
41
|
+
* static tree cannot see, so the honest verdict is "nothing declares this",
|
|
42
|
+
* not "this is broken". `checkPageBlocks` maps these to warnings.
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkBlockContext(nodes: readonly BlockTreeNode[], provided?: readonly string[]): BlockContextFinding[];
|
|
45
|
+
export interface BlockTreeRepair {
|
|
46
|
+
/** Path of the PARENT whose child list was repaired ('' for a root-level list). */
|
|
47
|
+
path: string;
|
|
48
|
+
/** Type of the block that was re-inserted. */
|
|
49
|
+
inserted: string;
|
|
50
|
+
/** Index it was re-inserted at. */
|
|
51
|
+
index: number;
|
|
52
|
+
}
|
|
53
|
+
export interface RepairBlockTreeResult {
|
|
54
|
+
nodes: BlockTreeNode[];
|
|
55
|
+
repairs: BlockTreeRepair[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Re-insert required children that went missing, at the index the declaring
|
|
59
|
+
* block's template gives them (use-forced-layout). Returns the INPUT array
|
|
60
|
+
* untouched when nothing was repaired, so memoized consumers can keep
|
|
61
|
+
* reference equality.
|
|
62
|
+
*/
|
|
63
|
+
export declare function repairBlockTree(nodes: readonly BlockTreeNode[]): RepairBlockTreeResult;
|
|
64
|
+
//# sourceMappingURL=block-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-constraints.d.ts","sourceRoot":"","sources":["../../src/registry/block-constraints.ts"],"names":[],"mappings":"AAuBA,uFAAuF;AACvF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,qBAAqB,CAAA;AAErG,MAAM,WAAW,wBAAwB;IACvC,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,mBAAmB,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;IACd;gFAC4E;IAC5E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB;AA6BD,sFAAsF;AACtF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,wBAAwB,EAAE,CA2B5B;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,wBAAwB,EAAE,CA2BjG;AAID,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,8EAA8E;IAC9E,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,QAAQ,GAAE,SAAS,MAAM,EAAO,GAC/B,mBAAmB,EAAE,CAavB;AAID,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAA;IACZ,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;CACd;AAmDD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,OAAO,EAAE,eAAe,EAAE,CAAA;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,qBAAqB,CAatF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { JsonSchema } from './registry-class';
|
|
2
|
+
/**
|
|
3
|
+
* The control a setting is edited with — and, by implication, the shape of the
|
|
4
|
+
* prop. Semantic types (`product`, `category`, `collection`) serialize as
|
|
5
|
+
* strings but must not degrade to a free-text input: the editor owes the author
|
|
6
|
+
* a picker, and an AI generating a block needs to know the value is an id it has
|
|
7
|
+
* to resolve rather than copy invent. `entity` names a DECLARED entity
|
|
8
|
+
* (defineEntity key) — validators check it against the declared set (I2).
|
|
9
|
+
*/
|
|
10
|
+
export type BlockSettingType = 'text' | 'richtext' | 'number' | 'boolean' | 'color' | 'image' | 'url' | 'select' | 'product' | 'category' | 'collection' | 'entity' | 'list';
|
|
11
|
+
/**
|
|
12
|
+
* The setting-type vocabulary as a runtime value, for catalogs (`describeStore`)
|
|
13
|
+
* and validators. The `satisfies` + exhaustiveness pair keeps it impossible to
|
|
14
|
+
* add a type to the union without it appearing here.
|
|
15
|
+
*/
|
|
16
|
+
export declare const BLOCK_SETTING_TYPES: readonly ["text", "richtext", "number", "boolean", "color", "image", "url", "select", "product", "category", "collection", "entity", "list"];
|
|
17
|
+
export interface BlockSettingOption {
|
|
18
|
+
value: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BlockSetting {
|
|
22
|
+
/** Prop name this setting writes to. */
|
|
23
|
+
id: string;
|
|
24
|
+
type: BlockSettingType;
|
|
25
|
+
label: string;
|
|
26
|
+
/** Shown under the field in the editor; also the best hint an AI gets. */
|
|
27
|
+
help?: string;
|
|
28
|
+
default?: unknown;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
/** `select` only. */
|
|
31
|
+
options?: readonly BlockSettingOption[];
|
|
32
|
+
/**
|
|
33
|
+
* `list` only — the shape of each item. This is what makes a block accept
|
|
34
|
+
* repeatable children (slides, FAQ rows, testimonials) without every such
|
|
35
|
+
* block inventing its own array format.
|
|
36
|
+
*/
|
|
37
|
+
of?: readonly BlockSetting[];
|
|
38
|
+
/** `number` only. */
|
|
39
|
+
min?: number;
|
|
40
|
+
max?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A named starting point for the block.
|
|
44
|
+
*
|
|
45
|
+
* The reason this exists: adding a section that lands as an empty skeleton reads
|
|
46
|
+
* as work to do, while one that lands already populated reads as progress. The
|
|
47
|
+
* preset is what the editor (and the AI) inserts, not the bare component.
|
|
48
|
+
*/
|
|
49
|
+
export interface BlockPreset {
|
|
50
|
+
name: string;
|
|
51
|
+
props?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
/** Contract stability. Absent means `stable`. */
|
|
54
|
+
export type BlockStability = 'stable' | 'experimental';
|
|
55
|
+
/**
|
|
56
|
+
* Compile authoring `settings` into the `propsSchema` JSON Schema that the
|
|
57
|
+
* editor, `fayz doctor` and AI generation already expect.
|
|
58
|
+
*
|
|
59
|
+
* Returns a schema with no properties for an empty list rather than `undefined`,
|
|
60
|
+
* so "this block was authored and declares no props" stays distinguishable from
|
|
61
|
+
* "this block was never authored" (which is `propsSchema` absent entirely).
|
|
62
|
+
*/
|
|
63
|
+
export declare function settingsToJsonSchema(settings?: readonly BlockSetting[]): JsonSchema;
|
|
64
|
+
/**
|
|
65
|
+
* Default props implied by a block's settings — every setting that declares
|
|
66
|
+
* one. Used to seed a freshly inserted block when no preset is chosen.
|
|
67
|
+
*/
|
|
68
|
+
export declare function defaultPropsFromSettings(settings?: readonly BlockSetting[]): Record<string, unknown>;
|
|
69
|
+
//# sourceMappingURL=block-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-schema.d.ts","sourceRoot":"","sources":["../../src/registry/block-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAoBlD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,UAAU,GACV,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,KAAK,GACL,QAAQ,GACR,SAAS,GACT,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,MAAM,CAAA;AAEV;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,8IAcgB,CAAA;AAKhD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,gBAAgB,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB;IACrB,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACvC;;;;OAIG;IACH,EAAE,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC5B,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AAED,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,cAAc,CAAA;AA0EtD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,SAAS,YAAY,EAAO,GAAG,UAAU,CAYvF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,GAAE,SAAS,YAAY,EAAO,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { BlockDataNeeds } from './index';
|
|
3
|
+
export interface BlockNode {
|
|
4
|
+
/** Registered block id, e.g. 'hero', 'products', 'kpi-grid', 'custom:foo'. */
|
|
5
|
+
type: string;
|
|
6
|
+
/** Stable id for keys / editing; optional. */
|
|
7
|
+
id?: string;
|
|
8
|
+
props?: Record<string, unknown>;
|
|
9
|
+
children?: BlockNode[];
|
|
10
|
+
/**
|
|
11
|
+
* Instance-level data needs, same shape as the block meta's `data`
|
|
12
|
+
* declaration. Merged over the meta declaration by need name — how a
|
|
13
|
+
* document rebinds a loader param (e.g. to a route param) without a new
|
|
14
|
+
* block type. Resolved by the page-level resolver, never by the block.
|
|
15
|
+
*/
|
|
16
|
+
data?: BlockDataNeeds;
|
|
17
|
+
}
|
|
18
|
+
/** A block component receives its declared props plus the raw node (so a block
|
|
19
|
+
* can render its own children via <BlockChildren>). */
|
|
20
|
+
export type BlockComponentProps = Record<string, unknown> & {
|
|
21
|
+
node?: BlockNode;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
export type BlockErrorVisibility = 'visible' | 'silent';
|
|
25
|
+
/**
|
|
26
|
+
* Who sees block failures. 'visible' renders an error card in place of a
|
|
27
|
+
* broken/misplaced block (dev, admin, the visual editor); 'silent' renders
|
|
28
|
+
* nothing there (shoppers). Defaults to 'visible' outside production builds.
|
|
29
|
+
* Pass null to restore the default.
|
|
30
|
+
*/
|
|
31
|
+
export declare function setBlockErrorVisibility(visibility: BlockErrorVisibility | null): void;
|
|
32
|
+
/** Whether renders stamp each block with its document path. Editor only. */
|
|
33
|
+
export declare function setBlockEditorMode(enabled: boolean): void;
|
|
34
|
+
export declare function blockEditorMode(): boolean;
|
|
35
|
+
/** The attribute a picker walks the DOM looking for. */
|
|
36
|
+
export declare const BLOCK_PATH_ATTRIBUTE = "data-fayz-block";
|
|
37
|
+
export declare const BLOCK_TYPE_ATTRIBUTE = "data-fayz-block-type";
|
|
38
|
+
export declare function useBlockPath(): string;
|
|
39
|
+
export declare function getBlockErrorVisibility(): BlockErrorVisibility;
|
|
40
|
+
interface BlockErrorBoundaryProps {
|
|
41
|
+
blockType: string;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
interface BlockErrorBoundaryState {
|
|
45
|
+
error: Error | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Isolates one block: a throw during its render removes THAT block, never the
|
|
49
|
+
* page. Always logs (a store hitting this in production is better off with the
|
|
50
|
+
* reason in the console); shows the card only per {@link getBlockErrorVisibility}.
|
|
51
|
+
*/
|
|
52
|
+
export declare class BlockErrorBoundary extends React.Component<BlockErrorBoundaryProps, BlockErrorBoundaryState> {
|
|
53
|
+
state: BlockErrorBoundaryState;
|
|
54
|
+
static getDerivedStateFromError(error: Error): BlockErrorBoundaryState;
|
|
55
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
56
|
+
render(): React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export declare function BlockRenderer({ node, path }: {
|
|
59
|
+
node: BlockNode;
|
|
60
|
+
path?: string;
|
|
61
|
+
}): React.ReactElement | null;
|
|
62
|
+
/**
|
|
63
|
+
* Render an ordered list of blocks (a page body).
|
|
64
|
+
*
|
|
65
|
+
* `basePath` is the document path of the ARRAY these nodes came from, e.g.
|
|
66
|
+
* `presentation.pages.home.blocks`. Pages pass it so each block can carry the
|
|
67
|
+
* path back to the document node that produced it; callers that have no
|
|
68
|
+
* document (a preview, a test) pass nothing and get today's behaviour exactly.
|
|
69
|
+
*/
|
|
70
|
+
export declare function renderBlocks(nodes: BlockNode[], basePath?: string): React.ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* Convenience for block components that render their own children.
|
|
73
|
+
*
|
|
74
|
+
* Reads its own path from context rather than taking one: a block that renders
|
|
75
|
+
* <BlockChildren> does not know where in the document it sits, and threading a
|
|
76
|
+
* path through every such block would be the signature change the wrapper
|
|
77
|
+
* design exists to avoid. Without this, nested blocks rendered this way carry
|
|
78
|
+
* no identity and are invisible to the editor.
|
|
79
|
+
*/
|
|
80
|
+
export declare function BlockChildren({ node }: {
|
|
81
|
+
node?: BlockNode;
|
|
82
|
+
}): React.ReactNode;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=blocks.d.ts.map
|