@ankhorage/zora 21.1.4 → 22.0.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/CHANGELOG.md +6 -0
- package/README.md +4 -1
- package/dist/features/authoring/index.d.ts +0 -4
- package/dist/features/authoring/index.d.ts.map +1 -1
- package/dist/features/authoring/index.js +0 -3
- package/dist/features/authoring/index.js.map +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.d.ts +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.d.ts.map +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.js +23 -7
- package/dist/features/chess/adapters/inbound/ChessBoard.js.map +1 -1
- package/dist/features/chess/meta.d.ts +68 -0
- package/dist/features/chess/meta.d.ts.map +1 -1
- package/dist/features/chess/meta.js +36 -1
- package/dist/features/chess/meta.js.map +1 -1
- package/dist/features/chess/public.d.ts +3 -1
- package/dist/features/chess/public.d.ts.map +1 -1
- package/dist/features/chess/public.js +2 -0
- package/dist/features/chess/public.js.map +1 -1
- package/dist/features/chess/utils/chessEngine.d.ts +8 -0
- package/dist/features/chess/utils/chessEngine.d.ts.map +1 -0
- package/dist/features/chess/utils/chessEngine.js +71 -0
- package/dist/features/chess/utils/chessEngine.js.map +1 -0
- package/dist/features/tabletop/meta.d.ts +32 -0
- package/dist/features/tabletop/meta.d.ts.map +1 -1
- package/dist/features/tabletop/meta.js +24 -0
- package/dist/features/tabletop/meta.js.map +1 -1
- package/dist/features/tabletop/public.d.ts +1 -0
- package/dist/features/tabletop/public.d.ts.map +1 -1
- package/dist/features/tabletop/public.js +1 -0
- package/dist/features/tabletop/public.js.map +1 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/types/chess.d.ts +10 -0
- package/dist/types/chess.d.ts.map +1 -1
- package/dist/types/chess.js.map +1 -1
- package/package.json +4 -3
- package/src/features/authoring/featureManifest.test.ts +46 -10
- package/src/features/authoring/index.ts +0 -8
- package/src/features/chess/adapters/inbound/ChessBoard.tsx +34 -11
- package/src/features/chess/meta.ts +36 -1
- package/src/features/chess/public.test.tsx +83 -0
- package/src/features/chess/public.ts +3 -0
- package/src/features/chess/utils/chessEngine.test.ts +35 -0
- package/src/features/chess/utils/chessEngine.ts +83 -0
- package/src/features/chessTabletopOwnership.test.ts +8 -4
- package/src/features/tabletop/meta.ts +24 -0
- package/src/features/tabletop/public.test.tsx +12 -0
- package/src/features/tabletop/public.ts +1 -0
- package/src/index.ts +7 -15
- package/src/structureOwnership.test.ts +2 -7
- package/src/types/chess.ts +11 -0
- package/web-dist/chunks/Accordion-784f23tq.js +3813 -0
- package/web-dist/components/card-back/CardBack.js +1 -1
- package/web-dist/components/card-hand/CardHand.js +1 -1
- package/web-dist/components/chess-board/ChessBoard.js +1 -1
- package/web-dist/components/opening-book/OpeningBook.js +1 -1
- package/web-dist/components/playing-card/PlayingCard.js +1 -1
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +1 -1
- package/web-dist/components/tabletop-table/TabletopTable.js +1 -1
- package/web-dist/manifest.json +12 -24
- package/dist/features/plugin/ZORA_CORE_PLUGIN.d.ts +0 -4
- package/dist/features/plugin/ZORA_CORE_PLUGIN.d.ts.map +0 -1
- package/dist/features/plugin/ZORA_CORE_PLUGIN.js +0 -8
- package/dist/features/plugin/ZORA_CORE_PLUGIN.js.map +0 -1
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.d.ts +0 -3
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.d.ts.map +0 -1
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.js +0 -36
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.js.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.d.ts +0 -4
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.d.ts.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.js +0 -106
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.js.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.d.ts +0 -4
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.d.ts.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.js +0 -41
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.js.map +0 -1
- package/dist/features/plugin/domain/ZoraPluginCompositionError.d.ts +0 -14
- package/dist/features/plugin/domain/ZoraPluginCompositionError.d.ts.map +0 -1
- package/dist/features/plugin/domain/ZoraPluginCompositionError.js +0 -14
- package/dist/features/plugin/domain/ZoraPluginCompositionError.js.map +0 -1
- package/dist/features/plugin/public.d.ts +0 -4
- package/dist/features/plugin/public.d.ts.map +0 -1
- package/dist/features/plugin/public.js +0 -4
- package/dist/features/plugin/public.js.map +0 -1
- package/dist/features/plugin/runtime.d.ts +0 -3
- package/dist/features/plugin/runtime.d.ts.map +0 -1
- package/dist/features/plugin/runtime.js +0 -3
- package/dist/features/plugin/runtime.js.map +0 -1
- package/dist/types/plugin.d.ts +0 -29
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/plugin.js +0 -2
- package/dist/types/plugin.js.map +0 -1
- package/src/features/plugin/ZORA_CORE_PLUGIN.ts +0 -9
- package/src/features/plugin/ZORA_CORE_PLUGIN_METADATA.ts +0 -49
- package/src/features/plugin/application/use-cases/composeZoraPluginMetadata.ts +0 -166
- package/src/features/plugin/application/use-cases/composeZoraPlugins.ts +0 -76
- package/src/features/plugin/domain/ZoraPluginCompositionError.ts +0 -21
- package/src/features/plugin/pluginComposition.test.ts +0 -139
- package/src/features/plugin/public.ts +0 -3
- package/src/features/plugin/runtime.ts +0 -2
- package/src/types/plugin.ts +0 -43
- package/web-dist/chunks/Accordion-86z2tvvz.js +0 -321
- package/web-dist/components/zora-plugin-composition-error/ZoraPluginCompositionError.d.ts +0 -3
- package/web-dist/components/zora-plugin-composition-error/ZoraPluginCompositionError.js +0 -17
- package/web-dist/components/zora-plugin-composition-error/index.d.ts +0 -1
- package/web-dist/components/zora-plugin-composition-error/index.js +0 -2
- /package/web-dist/chunks/{Accordion-57mn1j9e.js → Accordion-z585n0mr.js} +0 -0
|
@@ -5,7 +5,7 @@ import"../../chunks/Accordion-k3bc4kad.js";
|
|
|
5
5
|
import {
|
|
6
6
|
ChessBoard2,
|
|
7
7
|
OpeningBook2
|
|
8
|
-
} from "../../chunks/Accordion-
|
|
8
|
+
} from "../../chunks/Accordion-784f23tq.js";
|
|
9
9
|
import"../../chunks/Accordion-7zfskq1s.js";
|
|
10
10
|
export {
|
|
11
11
|
ChessBoard2 as ChessBoard,
|
|
@@ -5,7 +5,7 @@ import"../../chunks/Accordion-k3bc4kad.js";
|
|
|
5
5
|
import {
|
|
6
6
|
ChessBoard2,
|
|
7
7
|
OpeningBook2
|
|
8
|
-
} from "../../chunks/Accordion-
|
|
8
|
+
} from "../../chunks/Accordion-784f23tq.js";
|
|
9
9
|
import"../../chunks/Accordion-7zfskq1s.js";
|
|
10
10
|
export {
|
|
11
11
|
ChessBoard2 as ChessBoard,
|
package/web-dist/manifest.json
CHANGED
|
@@ -615,13 +615,13 @@
|
|
|
615
615
|
"components/card-back/CardBack.d.ts",
|
|
616
616
|
"components/card-back/index.js",
|
|
617
617
|
"components/card-back/index.d.ts",
|
|
618
|
-
"chunks/Accordion-57mn1j9e.js",
|
|
619
618
|
"chunks/Accordion-59pa0677.js",
|
|
620
619
|
"chunks/Accordion-7hn324r1.js",
|
|
621
620
|
"chunks/Accordion-7zfskq1s.js",
|
|
622
621
|
"chunks/Accordion-9qvmwkxe.js",
|
|
623
622
|
"chunks/Accordion-k3bc4kad.js",
|
|
624
|
-
"chunks/Accordion-kcx57mk5.js"
|
|
623
|
+
"chunks/Accordion-kcx57mk5.js",
|
|
624
|
+
"chunks/Accordion-z585n0mr.js"
|
|
625
625
|
],
|
|
626
626
|
"sourceKind": "public"
|
|
627
627
|
},
|
|
@@ -634,13 +634,13 @@
|
|
|
634
634
|
"components/card-hand/CardHand.d.ts",
|
|
635
635
|
"components/card-hand/index.js",
|
|
636
636
|
"components/card-hand/index.d.ts",
|
|
637
|
-
"chunks/Accordion-57mn1j9e.js",
|
|
638
637
|
"chunks/Accordion-59pa0677.js",
|
|
639
638
|
"chunks/Accordion-7hn324r1.js",
|
|
640
639
|
"chunks/Accordion-7zfskq1s.js",
|
|
641
640
|
"chunks/Accordion-9qvmwkxe.js",
|
|
642
641
|
"chunks/Accordion-k3bc4kad.js",
|
|
643
|
-
"chunks/Accordion-kcx57mk5.js"
|
|
642
|
+
"chunks/Accordion-kcx57mk5.js",
|
|
643
|
+
"chunks/Accordion-z585n0mr.js"
|
|
644
644
|
],
|
|
645
645
|
"sourceKind": "public"
|
|
646
646
|
},
|
|
@@ -752,9 +752,9 @@
|
|
|
752
752
|
"components/chess-board/index.js",
|
|
753
753
|
"components/chess-board/index.d.ts",
|
|
754
754
|
"chunks/Accordion-59pa0677.js",
|
|
755
|
+
"chunks/Accordion-784f23tq.js",
|
|
755
756
|
"chunks/Accordion-7hn324r1.js",
|
|
756
757
|
"chunks/Accordion-7zfskq1s.js",
|
|
757
|
-
"chunks/Accordion-86z2tvvz.js",
|
|
758
758
|
"chunks/Accordion-9qvmwkxe.js",
|
|
759
759
|
"chunks/Accordion-k3bc4kad.js",
|
|
760
760
|
"chunks/Accordion-kcx57mk5.js"
|
|
@@ -1984,9 +1984,9 @@
|
|
|
1984
1984
|
"components/opening-book/index.js",
|
|
1985
1985
|
"components/opening-book/index.d.ts",
|
|
1986
1986
|
"chunks/Accordion-59pa0677.js",
|
|
1987
|
+
"chunks/Accordion-784f23tq.js",
|
|
1987
1988
|
"chunks/Accordion-7hn324r1.js",
|
|
1988
1989
|
"chunks/Accordion-7zfskq1s.js",
|
|
1989
|
-
"chunks/Accordion-86z2tvvz.js",
|
|
1990
1990
|
"chunks/Accordion-9qvmwkxe.js",
|
|
1991
1991
|
"chunks/Accordion-k3bc4kad.js",
|
|
1992
1992
|
"chunks/Accordion-kcx57mk5.js"
|
|
@@ -2112,13 +2112,13 @@
|
|
|
2112
2112
|
"components/playing-card/PlayingCard.d.ts",
|
|
2113
2113
|
"components/playing-card/index.js",
|
|
2114
2114
|
"components/playing-card/index.d.ts",
|
|
2115
|
-
"chunks/Accordion-57mn1j9e.js",
|
|
2116
2115
|
"chunks/Accordion-59pa0677.js",
|
|
2117
2116
|
"chunks/Accordion-7hn324r1.js",
|
|
2118
2117
|
"chunks/Accordion-7zfskq1s.js",
|
|
2119
2118
|
"chunks/Accordion-9qvmwkxe.js",
|
|
2120
2119
|
"chunks/Accordion-k3bc4kad.js",
|
|
2121
|
-
"chunks/Accordion-kcx57mk5.js"
|
|
2120
|
+
"chunks/Accordion-kcx57mk5.js",
|
|
2121
|
+
"chunks/Accordion-z585n0mr.js"
|
|
2122
2122
|
],
|
|
2123
2123
|
"sourceKind": "public"
|
|
2124
2124
|
},
|
|
@@ -2131,13 +2131,13 @@
|
|
|
2131
2131
|
"components/poker-training-table/PokerTrainingTable.d.ts",
|
|
2132
2132
|
"components/poker-training-table/index.js",
|
|
2133
2133
|
"components/poker-training-table/index.d.ts",
|
|
2134
|
-
"chunks/Accordion-57mn1j9e.js",
|
|
2135
2134
|
"chunks/Accordion-59pa0677.js",
|
|
2136
2135
|
"chunks/Accordion-7hn324r1.js",
|
|
2137
2136
|
"chunks/Accordion-7zfskq1s.js",
|
|
2138
2137
|
"chunks/Accordion-9qvmwkxe.js",
|
|
2139
2138
|
"chunks/Accordion-k3bc4kad.js",
|
|
2140
|
-
"chunks/Accordion-kcx57mk5.js"
|
|
2139
|
+
"chunks/Accordion-kcx57mk5.js",
|
|
2140
|
+
"chunks/Accordion-z585n0mr.js"
|
|
2141
2141
|
],
|
|
2142
2142
|
"sourceKind": "public"
|
|
2143
2143
|
},
|
|
@@ -3117,13 +3117,13 @@
|
|
|
3117
3117
|
"components/tabletop-table/TabletopTable.d.ts",
|
|
3118
3118
|
"components/tabletop-table/index.js",
|
|
3119
3119
|
"components/tabletop-table/index.d.ts",
|
|
3120
|
-
"chunks/Accordion-57mn1j9e.js",
|
|
3121
3120
|
"chunks/Accordion-59pa0677.js",
|
|
3122
3121
|
"chunks/Accordion-7hn324r1.js",
|
|
3123
3122
|
"chunks/Accordion-7zfskq1s.js",
|
|
3124
3123
|
"chunks/Accordion-9qvmwkxe.js",
|
|
3125
3124
|
"chunks/Accordion-k3bc4kad.js",
|
|
3126
|
-
"chunks/Accordion-kcx57mk5.js"
|
|
3125
|
+
"chunks/Accordion-kcx57mk5.js",
|
|
3126
|
+
"chunks/Accordion-z585n0mr.js"
|
|
3127
3127
|
],
|
|
3128
3128
|
"sourceKind": "public"
|
|
3129
3129
|
},
|
|
@@ -3486,18 +3486,6 @@
|
|
|
3486
3486
|
"chunks/Accordion-ye97yam9.js"
|
|
3487
3487
|
],
|
|
3488
3488
|
"sourceKind": "public"
|
|
3489
|
-
},
|
|
3490
|
-
{
|
|
3491
|
-
"component": "zora-plugin-composition-error",
|
|
3492
|
-
"exportName": "ZoraPluginCompositionError",
|
|
3493
|
-
"featurePath": "plugin",
|
|
3494
|
-
"files": [
|
|
3495
|
-
"components/zora-plugin-composition-error/ZoraPluginCompositionError.js",
|
|
3496
|
-
"components/zora-plugin-composition-error/ZoraPluginCompositionError.d.ts",
|
|
3497
|
-
"components/zora-plugin-composition-error/index.js",
|
|
3498
|
-
"components/zora-plugin-composition-error/index.d.ts"
|
|
3499
|
-
],
|
|
3500
|
-
"sourceKind": "public"
|
|
3501
3489
|
}
|
|
3502
3490
|
]
|
|
3503
3491
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ZoraPluginDescriptor } from '../../types/plugin';
|
|
2
|
-
/*** Describe the complete ZORA core runtime and authoring surface through the public plugin contract. */
|
|
3
|
-
export declare const ZORA_CORE_PLUGIN: ZoraPluginDescriptor;
|
|
4
|
-
//# sourceMappingURL=ZORA_CORE_PLUGIN.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZORA_CORE_PLUGIN.d.ts","sourceRoot":"","sources":["../../../src/features/plugin/ZORA_CORE_PLUGIN.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAI/D,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,EAAE,oBAG9B,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ZORA_COMPONENT_REGISTRY } from '../registry/ZORA_COMPONENT_REGISTRY';
|
|
2
|
-
import { ZORA_CORE_PLUGIN_METADATA } from './ZORA_CORE_PLUGIN_METADATA';
|
|
3
|
-
/*** Describe the complete ZORA core runtime and authoring surface through the public plugin contract. */
|
|
4
|
-
export const ZORA_CORE_PLUGIN = {
|
|
5
|
-
...ZORA_CORE_PLUGIN_METADATA,
|
|
6
|
-
componentRegistry: ZORA_COMPONENT_REGISTRY,
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=ZORA_CORE_PLUGIN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZORA_CORE_PLUGIN.js","sourceRoot":"","sources":["../../../src/features/plugin/ZORA_CORE_PLUGIN.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,yGAAyG;AACzG,MAAM,CAAC,MAAM,gBAAgB,GAAyB;IACpD,GAAG,yBAAyB;IAC5B,iBAAiB,EAAE,uBAAuB;CAC3C,CAAC","sourcesContent":["import type { ZoraPluginDescriptor } from '../../types/plugin';\nimport { ZORA_COMPONENT_REGISTRY } from '../registry/ZORA_COMPONENT_REGISTRY';\nimport { ZORA_CORE_PLUGIN_METADATA } from './ZORA_CORE_PLUGIN_METADATA';\n\n/*** Describe the complete ZORA core runtime and authoring surface through the public plugin contract. */\nexport const ZORA_CORE_PLUGIN: ZoraPluginDescriptor = {\n ...ZORA_CORE_PLUGIN_METADATA,\n componentRegistry: ZORA_COMPONENT_REGISTRY,\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZORA_CORE_PLUGIN_METADATA.d.ts","sourceRoot":"","sources":["../../../src/features/plugin/ZORA_CORE_PLUGIN_METADATA.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAc7D,eAAO,MAAM,yBAAyB,EAAE,kBAKvC,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ZORA_BINDABLE_COMPONENT_META } from '../authoring/bindableComponentMeta';
|
|
2
|
-
import { ZORA_COMPONENT_META } from '../authoring/componentMeta';
|
|
3
|
-
const CORE_EXTENSION_HOSTS = [
|
|
4
|
-
'Card',
|
|
5
|
-
'Grid',
|
|
6
|
-
'MessageBubble',
|
|
7
|
-
'PostCard',
|
|
8
|
-
'Screen',
|
|
9
|
-
'ScreenSection',
|
|
10
|
-
'View',
|
|
11
|
-
];
|
|
12
|
-
export const ZORA_CORE_PLUGIN_METADATA = {
|
|
13
|
-
packageName: '@ankhorage/zora',
|
|
14
|
-
displayName: 'ZORA',
|
|
15
|
-
componentMeta: mergeBindableMeta(ZORA_COMPONENT_META, ZORA_BINDABLE_COMPONENT_META),
|
|
16
|
-
extensionHosts: CORE_EXTENSION_HOSTS,
|
|
17
|
-
};
|
|
18
|
-
function mergeBindableMeta(componentMeta, bindableMeta) {
|
|
19
|
-
const bindingsByComponent = new Map(Object.entries(bindableMeta).map(([componentName, meta]) => [componentName, meta.bindings]));
|
|
20
|
-
return Object.fromEntries(Object.entries(componentMeta).map(([componentName, meta]) => [
|
|
21
|
-
componentName,
|
|
22
|
-
bindingsByComponent.get(componentName)
|
|
23
|
-
? {
|
|
24
|
-
...meta,
|
|
25
|
-
bindings: {
|
|
26
|
-
props: { ...bindingsByComponent.get(componentName)?.props, ...meta.bindings?.props },
|
|
27
|
-
events: {
|
|
28
|
-
...bindingsByComponent.get(componentName)?.events,
|
|
29
|
-
...meta.bindings?.events,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
: meta,
|
|
34
|
-
]));
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=ZORA_CORE_PLUGIN_METADATA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZORA_CORE_PLUGIN_METADATA.js","sourceRoot":"","sources":["../../../src/features/plugin/ZORA_CORE_PLUGIN_METADATA.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,oBAAoB,GAAG;IAC3B,MAAM;IACN,MAAM;IACN,eAAe;IACf,UAAU;IACV,QAAQ;IACR,eAAe;IACf,MAAM;CACE,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAuB;IAC3D,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,4BAA4B,CAAC;IACnF,cAAc,EAAE,oBAAoB;CACrC,CAAC;AAEF,SAAS,iBAAiB,CACxB,aAAwC,EACxC,YAAqC;IAErC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAC5F,CAAC;IACF,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;QAC3D,aAAa;QACb,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC;YACpC,CAAC,CAAC;gBACE,GAAG,IAAI;gBACP,QAAQ,EAAE;oBACR,KAAK,EAAE,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE;oBACpF,MAAM,EAAE;wBACN,GAAG,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,MAAM;wBACjD,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM;qBACzB;iBACF;aACF;YACH,CAAC,CAAC,IAAI;KACT,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { UiComponentMetaRegistry } from '@ankhorage/contracts';\n\nimport type { ZoraComponentMetaRegistry } from '../../types/authoring';\nimport type { ZoraPluginMetadata } from '../../types/plugin';\nimport { ZORA_BINDABLE_COMPONENT_META } from '../authoring/bindableComponentMeta';\nimport { ZORA_COMPONENT_META } from '../authoring/componentMeta';\n\nconst CORE_EXTENSION_HOSTS = [\n 'Card',\n 'Grid',\n 'MessageBubble',\n 'PostCard',\n 'Screen',\n 'ScreenSection',\n 'View',\n] as const;\n\nexport const ZORA_CORE_PLUGIN_METADATA: ZoraPluginMetadata = {\n packageName: '@ankhorage/zora',\n displayName: 'ZORA',\n componentMeta: mergeBindableMeta(ZORA_COMPONENT_META, ZORA_BINDABLE_COMPONENT_META),\n extensionHosts: CORE_EXTENSION_HOSTS,\n};\n\nfunction mergeBindableMeta(\n componentMeta: ZoraComponentMetaRegistry,\n bindableMeta: UiComponentMetaRegistry,\n): ZoraComponentMetaRegistry {\n const bindingsByComponent = new Map(\n Object.entries(bindableMeta).map(([componentName, meta]) => [componentName, meta.bindings]),\n );\n return Object.fromEntries(\n Object.entries(componentMeta).map(([componentName, meta]) => [\n componentName,\n bindingsByComponent.get(componentName)\n ? {\n ...meta,\n bindings: {\n props: { ...bindingsByComponent.get(componentName)?.props, ...meta.bindings?.props },\n events: {\n ...bindingsByComponent.get(componentName)?.events,\n ...meta.bindings?.events,\n },\n },\n }\n : meta,\n ]),\n );\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ComposedZoraPluginMetadataCatalog, ZoraPluginMetadata } from '../../../../types/plugin';
|
|
2
|
-
/*** Compose a selected ZORA metadata set for authoring tools that must not load React Native runtime modules. */
|
|
3
|
-
export declare function composeZoraPluginMetadata(plugins: readonly ZoraPluginMetadata[]): ComposedZoraPluginMetadataCatalog;
|
|
4
|
-
//# sourceMappingURL=composeZoraPluginMetadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composeZoraPluginMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/features/plugin/application/use-cases/composeZoraPluginMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iCAAiC,EAEjC,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAGlC,iHAAiH;AACjH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,iCAAiC,CAyCnC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { ZoraPluginCompositionError } from '../../domain/ZoraPluginCompositionError';
|
|
2
|
-
/*** Compose a selected ZORA metadata set for authoring tools that must not load React Native runtime modules. */
|
|
3
|
-
export function composeZoraPluginMetadata(plugins) {
|
|
4
|
-
const descriptors = sortPlugins(plugins);
|
|
5
|
-
const packages = new Set();
|
|
6
|
-
const componentOwners = new Map();
|
|
7
|
-
const componentMeta = new Map();
|
|
8
|
-
const extensionHosts = new Set();
|
|
9
|
-
const interactionPolicySupportedComponents = new Set();
|
|
10
|
-
for (const descriptor of descriptors) {
|
|
11
|
-
validateUniquePackage(descriptor, packages);
|
|
12
|
-
validateMetadata(descriptor);
|
|
13
|
-
for (const [componentName, meta] of sortedEntries(descriptor.componentMeta)) {
|
|
14
|
-
claimComponent(componentName, descriptor.packageName, componentOwners);
|
|
15
|
-
componentMeta.set(componentName, meta);
|
|
16
|
-
}
|
|
17
|
-
for (const componentName of descriptor.extensionHosts ?? [])
|
|
18
|
-
extensionHosts.add(componentName);
|
|
19
|
-
for (const componentName of descriptor.interactionPolicySupportedComponents ?? []) {
|
|
20
|
-
interactionPolicySupportedComponents.add(componentName);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
for (const descriptor of descriptors) {
|
|
24
|
-
for (const placement of descriptor.placements ?? []) {
|
|
25
|
-
applyPlacement({ descriptor, placement, componentMeta, extensionHosts });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
componentMeta: Object.fromEntries(componentMeta),
|
|
30
|
-
bindableComponentMeta: Object.fromEntries(componentMeta),
|
|
31
|
-
packageManifests: descriptors.map(({ packageName, displayName, componentMeta: meta }) => ({
|
|
32
|
-
packageName,
|
|
33
|
-
...(displayName === undefined ? {} : { displayName }),
|
|
34
|
-
components: meta,
|
|
35
|
-
})),
|
|
36
|
-
interactionPolicySupportedComponents: Object.fromEntries([...interactionPolicySupportedComponents]
|
|
37
|
-
.sort()
|
|
38
|
-
.map((componentName) => [componentName, true])),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function validateUniquePackage(descriptor, packages) {
|
|
42
|
-
if (packages.has(descriptor.packageName)) {
|
|
43
|
-
throw compositionError('duplicate-package', descriptor.packageName, `Duplicate ZORA plugin package '${descriptor.packageName}'.`);
|
|
44
|
-
}
|
|
45
|
-
packages.add(descriptor.packageName);
|
|
46
|
-
}
|
|
47
|
-
function validateMetadata(descriptor) {
|
|
48
|
-
for (const [componentName, meta] of sortedEntries(descriptor.componentMeta)) {
|
|
49
|
-
if (meta.name !== componentName) {
|
|
50
|
-
throw compositionError('invalid-component-meta', descriptor.packageName, `ZORA plugin '${descriptor.packageName}' metadata key '${componentName}' does not match meta.name '${meta.name}'.`, componentName);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function claimComponent(componentName, packageName, owners) {
|
|
55
|
-
const existingOwner = owners.get(componentName);
|
|
56
|
-
if (existingOwner) {
|
|
57
|
-
throw compositionError('duplicate-component', packageName, `ZORA component '${componentName}' is owned by both '${existingOwner}' and '${packageName}'.`, componentName);
|
|
58
|
-
}
|
|
59
|
-
owners.set(componentName, packageName);
|
|
60
|
-
}
|
|
61
|
-
function applyPlacement(args) {
|
|
62
|
-
const { descriptor, placement, componentMeta, extensionHosts } = args;
|
|
63
|
-
const childMeta = descriptor.componentMeta[placement.child];
|
|
64
|
-
if (!childMeta?.directManifestNode) {
|
|
65
|
-
throw compositionError('invalid-placement-child', descriptor.packageName, `ZORA plugin '${descriptor.packageName}' placement child '${placement.child}' is not an owned direct manifest node.`, placement.child);
|
|
66
|
-
}
|
|
67
|
-
for (const parentName of [...placement.parents].sort()) {
|
|
68
|
-
const parentMeta = componentMeta.get(parentName);
|
|
69
|
-
if (!parentMeta || !extensionHosts.has(parentName)) {
|
|
70
|
-
throw compositionError('invalid-placement-parent', descriptor.packageName, `ZORA plugin '${descriptor.packageName}' placement parent '${parentName}' is not a declared extension host.`, placement.child);
|
|
71
|
-
}
|
|
72
|
-
componentMeta.set(parentName, addAllowedChild(parentMeta, placement.child));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function addAllowedChild(meta, child) {
|
|
76
|
-
const allowedChildren = appendUnique(meta.allowedChildren, child);
|
|
77
|
-
const childrenSlot = meta.slots?.children;
|
|
78
|
-
return {
|
|
79
|
-
...meta,
|
|
80
|
-
allowedChildren,
|
|
81
|
-
...(childrenSlot
|
|
82
|
-
? {
|
|
83
|
-
slots: {
|
|
84
|
-
...meta.slots,
|
|
85
|
-
children: {
|
|
86
|
-
...childrenSlot,
|
|
87
|
-
allowedChildren: appendUnique(childrenSlot.allowedChildren ?? [], child),
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
}
|
|
91
|
-
: {}),
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function appendUnique(values, value) {
|
|
95
|
-
return values.includes(value) ? values : [...values, value];
|
|
96
|
-
}
|
|
97
|
-
function sortedEntries(value) {
|
|
98
|
-
return Object.entries(value).sort(([left], [right]) => left.localeCompare(right));
|
|
99
|
-
}
|
|
100
|
-
function sortPlugins(plugins) {
|
|
101
|
-
return [...plugins].sort((left, right) => left.packageName.localeCompare(right.packageName));
|
|
102
|
-
}
|
|
103
|
-
function compositionError(code, packageName, message, componentName) {
|
|
104
|
-
return new ZoraPluginCompositionError({ code, packageName, message, componentName });
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=composeZoraPluginMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composeZoraPluginMetadata.js","sourceRoot":"","sources":["../../../../../src/features/plugin/application/use-cases/composeZoraPluginMetadata.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,iHAAiH;AACjH,MAAM,UAAU,yBAAyB,CACvC,OAAsC;IAEtC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAClD,MAAM,aAAa,GAAG,IAAI,GAAG,EAA6B,CAAC;IAC3D,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IACzC,MAAM,oCAAoC,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/D,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,qBAAqB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC5C,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7B,KAAK,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAC5E,cAAc,CAAC,aAAa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KACR,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,MAAyB,EAAE,KAAa;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,aAAa,CAAI,KAAkC;IAC1D,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAS,WAAW,CAA+B,OAAqB;IACtE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,gBAAgB,CACvB,IAAoC,EACpC,WAAmB,EACnB,OAAe,EACf,aAAsB;IAEtB,OAAO,IAAI,0BAA0B,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;AACvF,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../../../types/authoring';\nimport type {\n ComposedZoraPluginMetadataCatalog,\n ZoraPluginCompositionErrorCode,\n ZoraPluginMetadata,\n ZoraPluginPlacement,\n} from '../../../../types/plugin';\nimport { ZoraPluginCompositionError } from '../../domain/ZoraPluginCompositionError';\n\n/*** Compose a selected ZORA metadata set for authoring tools that must not load React Native runtime modules. */\nexport function composeZoraPluginMetadata(\n plugins: readonly ZoraPluginMetadata[],\n): ComposedZoraPluginMetadataCatalog {\n const descriptors = sortPlugins(plugins);\n const packages = new Set<string>();\n const componentOwners = new Map<string, string>();\n const componentMeta = new Map<string, ZoraComponentMeta>();\n const extensionHosts = new Set<string>();\n const interactionPolicySupportedComponents = new Set<string>();\n\n for (const descriptor of descriptors) {\n validateUniquePackage(descriptor, packages);\n validateMetadata(descriptor);\n for (const [componentName, meta] of sortedEntries(descriptor.componentMeta)) {\n claimComponent(componentName, descriptor.packageName, componentOwners);\n componentMeta.set(componentName, meta);\n }\n for (const componentName of descriptor.extensionHosts ?? []) extensionHosts.add(componentName);\n for (const componentName of descriptor.interactionPolicySupportedComponents ?? []) {\n interactionPolicySupportedComponents.add(componentName);\n }\n }\n\n for (const descriptor of descriptors) {\n for (const placement of descriptor.placements ?? []) {\n applyPlacement({ descriptor, placement, componentMeta, extensionHosts });\n }\n }\n\n return {\n componentMeta: Object.fromEntries(componentMeta),\n bindableComponentMeta: Object.fromEntries(componentMeta),\n packageManifests: descriptors.map(({ packageName, displayName, componentMeta: meta }) => ({\n packageName,\n ...(displayName === undefined ? {} : { displayName }),\n components: meta,\n })),\n interactionPolicySupportedComponents: Object.fromEntries(\n [...interactionPolicySupportedComponents]\n .sort()\n .map((componentName) => [componentName, true]),\n ),\n };\n}\n\nfunction validateUniquePackage(descriptor: ZoraPluginMetadata, packages: Set<string>): void {\n if (packages.has(descriptor.packageName)) {\n throw compositionError(\n 'duplicate-package',\n descriptor.packageName,\n `Duplicate ZORA plugin package '${descriptor.packageName}'.`,\n );\n }\n packages.add(descriptor.packageName);\n}\n\nfunction validateMetadata(descriptor: ZoraPluginMetadata): void {\n for (const [componentName, meta] of sortedEntries(descriptor.componentMeta)) {\n if (meta.name !== componentName) {\n throw compositionError(\n 'invalid-component-meta',\n descriptor.packageName,\n `ZORA plugin '${descriptor.packageName}' metadata key '${componentName}' does not match meta.name '${meta.name}'.`,\n componentName,\n );\n }\n }\n}\n\nfunction claimComponent(\n componentName: string,\n packageName: string,\n owners: Map<string, string>,\n): void {\n const existingOwner = owners.get(componentName);\n if (existingOwner) {\n throw compositionError(\n 'duplicate-component',\n packageName,\n `ZORA component '${componentName}' is owned by both '${existingOwner}' and '${packageName}'.`,\n componentName,\n );\n }\n owners.set(componentName, packageName);\n}\n\nfunction applyPlacement(args: {\n descriptor: ZoraPluginMetadata;\n placement: ZoraPluginPlacement;\n componentMeta: Map<string, ZoraComponentMeta>;\n extensionHosts: ReadonlySet<string>;\n}): void {\n const { descriptor, placement, componentMeta, extensionHosts } = args;\n const childMeta = descriptor.componentMeta[placement.child];\n if (!childMeta?.directManifestNode) {\n throw compositionError(\n 'invalid-placement-child',\n descriptor.packageName,\n `ZORA plugin '${descriptor.packageName}' placement child '${placement.child}' is not an owned direct manifest node.`,\n placement.child,\n );\n }\n for (const parentName of [...placement.parents].sort()) {\n const parentMeta = componentMeta.get(parentName);\n if (!parentMeta || !extensionHosts.has(parentName)) {\n throw compositionError(\n 'invalid-placement-parent',\n descriptor.packageName,\n `ZORA plugin '${descriptor.packageName}' placement parent '${parentName}' is not a declared extension host.`,\n placement.child,\n );\n }\n componentMeta.set(parentName, addAllowedChild(parentMeta, placement.child));\n }\n}\n\nfunction addAllowedChild(meta: ZoraComponentMeta, child: string): ZoraComponentMeta {\n const allowedChildren = appendUnique(meta.allowedChildren, child);\n const childrenSlot = meta.slots?.children;\n return {\n ...meta,\n allowedChildren,\n ...(childrenSlot\n ? {\n slots: {\n ...meta.slots,\n children: {\n ...childrenSlot,\n allowedChildren: appendUnique(childrenSlot.allowedChildren ?? [], child),\n },\n },\n }\n : {}),\n };\n}\n\nfunction appendUnique(values: readonly string[], value: string): readonly string[] {\n return values.includes(value) ? values : [...values, value];\n}\n\nfunction sortedEntries<T>(value: Readonly<Record<string, T>>): [string, T][] {\n return Object.entries(value).sort(([left], [right]) => left.localeCompare(right));\n}\n\nfunction sortPlugins<T extends ZoraPluginMetadata>(plugins: readonly T[]): T[] {\n return [...plugins].sort((left, right) => left.packageName.localeCompare(right.packageName));\n}\n\nfunction compositionError(\n code: ZoraPluginCompositionErrorCode,\n packageName: string,\n message: string,\n componentName?: string,\n): ZoraPluginCompositionError {\n return new ZoraPluginCompositionError({ code, packageName, message, componentName });\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ComposedZoraPluginCatalog, ZoraPluginDescriptor } from '../../../../types/plugin';
|
|
2
|
-
/*** Compose a selected ZORA core/plugin descriptor set into one validated authoring/runtime catalog. */
|
|
3
|
-
export declare function composeZoraPlugins(plugins: readonly ZoraPluginDescriptor[]): ComposedZoraPluginCatalog;
|
|
4
|
-
//# sourceMappingURL=composeZoraPlugins.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composeZoraPlugins.d.ts","sourceRoot":"","sources":["../../../../../src/features/plugin/application/use-cases/composeZoraPlugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EAEzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAKlC,wGAAwG;AACxG,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,yBAAyB,CAe3B"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ZoraPluginCompositionError } from '../../domain/ZoraPluginCompositionError';
|
|
2
|
-
import { composeZoraPluginMetadata } from './composeZoraPluginMetadata';
|
|
3
|
-
/*** Compose a selected ZORA core/plugin descriptor set into one validated authoring/runtime catalog. */
|
|
4
|
-
export function composeZoraPlugins(plugins) {
|
|
5
|
-
const descriptors = [...plugins].sort((left, right) => left.packageName.localeCompare(right.packageName));
|
|
6
|
-
const componentRegistry = new Map();
|
|
7
|
-
for (const descriptor of descriptors) {
|
|
8
|
-
validateRuntime(descriptor);
|
|
9
|
-
for (const [componentName, component] of sortedEntries(descriptor.componentRegistry)) {
|
|
10
|
-
componentRegistry.set(componentName, component);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
const metadataCatalog = composeZoraPluginMetadata(descriptors);
|
|
14
|
-
return { ...metadataCatalog, componentRegistry: Object.fromEntries(componentRegistry) };
|
|
15
|
-
}
|
|
16
|
-
function validateRuntime(descriptor) {
|
|
17
|
-
const componentMetaNames = new Set(Object.keys(descriptor.componentMeta));
|
|
18
|
-
const runtimeComponentNames = new Set(Object.keys(descriptor.componentRegistry));
|
|
19
|
-
for (const componentName of Object.keys(descriptor.componentRegistry).sort()) {
|
|
20
|
-
if (!componentMetaNames.has(componentName)) {
|
|
21
|
-
throw compositionError('missing-component-meta', descriptor.packageName, `ZORA plugin '${descriptor.packageName}' registers runtime component '${componentName}' without component metadata.`, componentName);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
for (const [componentName, meta] of sortedEntries(descriptor.componentMeta)) {
|
|
25
|
-
if (meta.directManifestNode && !runtimeComponentNames.has(componentName)) {
|
|
26
|
-
throw compositionError('missing-runtime-component', descriptor.packageName, `ZORA plugin '${descriptor.packageName}' exposes direct manifest node '${componentName}' without a runtime component.`, componentName);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
for (const componentName of descriptor.interactionPolicySupportedComponents ?? []) {
|
|
30
|
-
if (!runtimeComponentNames.has(componentName)) {
|
|
31
|
-
throw compositionError('invalid-interaction-policy-component', descriptor.packageName, `ZORA plugin '${descriptor.packageName}' declares interaction-policy support for unregistered component '${componentName}'.`, componentName);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function sortedEntries(value) {
|
|
36
|
-
return Object.entries(value).sort(([left], [right]) => left.localeCompare(right));
|
|
37
|
-
}
|
|
38
|
-
function compositionError(code, packageName, message, componentName) {
|
|
39
|
-
return new ZoraPluginCompositionError({ code, packageName, message, componentName });
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=composeZoraPlugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composeZoraPlugins.js","sourceRoot":"","sources":["../../../../../src/features/plugin/application/use-cases/composeZoraPlugins.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,E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alog,\n ZoraPluginCompositionErrorCode,\n ZoraPluginDescriptor,\n} from '../../../../types/plugin';\nimport type { ZoraComponentRegistry } from '../../../../types/registry';\nimport { ZoraPluginCompositionError } from '../../domain/ZoraPluginCompositionError';\nimport { composeZoraPluginMetadata } from './composeZoraPluginMetadata';\n\n/*** Compose a selected ZORA core/plugin descriptor set into one validated authoring/runtime catalog. */\nexport function composeZoraPlugins(\n plugins: readonly ZoraPluginDescriptor[],\n): ComposedZoraPluginCatalog {\n const descriptors = [...plugins].sort((left, right) =>\n left.packageName.localeCompare(right.packageName),\n );\n const componentRegistry = new Map<string, ZoraComponentRegistry[string]>();\n\n for (const descriptor of descriptors) {\n validateRuntime(descriptor);\n for (const [componentName, component] of sortedEntries(descriptor.componentRegistry)) {\n componentRegistry.set(componentName, component);\n }\n }\n const metadataCatalog = composeZoraPluginMetadata(descriptors);\n\n return { ...metadataCatalog, componentRegistry: Object.fromEntries(componentRegistry) };\n}\n\nfunction validateRuntime(descriptor: ZoraPluginDescriptor): void {\n const componentMetaNames = new Set(Object.keys(descriptor.componentMeta));\n const runtimeComponentNames = new Set(Object.keys(descriptor.componentRegistry));\n for (const componentName of Object.keys(descriptor.componentRegistry).sort()) {\n if (!componentMetaNames.has(componentName)) {\n throw compositionError(\n 'missing-component-meta',\n descriptor.packageName,\n `ZORA plugin '${descriptor.packageName}' registers runtime component '${componentName}' without component metadata.`,\n componentName,\n );\n }\n }\n for (const [componentName, meta] of sortedEntries(descriptor.componentMeta)) {\n if (meta.directManifestNode && !runtimeComponentNames.has(componentName)) {\n throw compositionError(\n 'missing-runtime-component',\n descriptor.packageName,\n `ZORA plugin '${descriptor.packageName}' exposes direct manifest node '${componentName}' without a runtime component.`,\n componentName,\n );\n }\n }\n for (const componentName of descriptor.interactionPolicySupportedComponents ?? []) {\n if (!runtimeComponentNames.has(componentName)) {\n throw compositionError(\n 'invalid-interaction-policy-component',\n descriptor.packageName,\n `ZORA plugin '${descriptor.packageName}' declares interaction-policy support for unregistered component '${componentName}'.`,\n componentName,\n );\n }\n }\n}\n\nfunction sortedEntries<T>(value: Readonly<Record<string, T>>): [string, T][] {\n return Object.entries(value).sort(([left], [right]) => left.localeCompare(right));\n}\n\nfunction compositionError(\n code: ZoraPluginCompositionErrorCode,\n packageName: string,\n message: string,\n componentName?: string,\n): ZoraPluginCompositionError {\n return new ZoraPluginCompositionError({ code, packageName, message, componentName });\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ZoraPluginCompositionErrorCode } from '../../../types/plugin';
|
|
2
|
-
/*** Report one deterministic plugin composition contract violation. */
|
|
3
|
-
export declare class ZoraPluginCompositionError extends Error {
|
|
4
|
-
readonly code: ZoraPluginCompositionErrorCode;
|
|
5
|
-
readonly packageName: string;
|
|
6
|
-
readonly componentName?: string;
|
|
7
|
-
constructor(args: {
|
|
8
|
-
readonly code: ZoraPluginCompositionErrorCode;
|
|
9
|
-
readonly packageName: string;
|
|
10
|
-
readonly message: string;
|
|
11
|
-
readonly componentName?: string;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ZoraPluginCompositionError.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZoraPluginCompositionError.d.ts","sourceRoot":"","sources":["../../../../src/features/plugin/domain/ZoraPluginCompositionError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5E,uEAAuE;AACvE,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,8BAA8B,CAAC;IAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;gBAEpB,IAAI,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,8BAA8B,CAAC;QAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;KACjC;CAOF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*** Report one deterministic plugin composition contract violation. */
|
|
2
|
-
export class ZoraPluginCompositionError extends Error {
|
|
3
|
-
code;
|
|
4
|
-
packageName;
|
|
5
|
-
componentName;
|
|
6
|
-
constructor(args) {
|
|
7
|
-
super(args.message);
|
|
8
|
-
this.name = 'ZoraPluginCompositionError';
|
|
9
|
-
this.code = args.code;
|
|
10
|
-
this.packageName = args.packageName;
|
|
11
|
-
this.componentName = args.componentName;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ZoraPluginCompositionError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZoraPluginCompositionError.js","sourceRoot":"","sources":["../../../../src/features/plugin/domain/ZoraPluginCompositionError.ts"],"names":[],"mappings":"AAEA,uEAAuE;AACvE,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC1C,IAAI,CAAiC;IACrC,WAAW,CAAS;IACpB,aAAa,CAAU;IAEhC,YAAY,IAKX;QACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IAC1C,CAAC;CACF","sourcesContent":["import type { ZoraPluginCompositionErrorCode } from '../../../types/plugin';\n\n/*** Report one deterministic plugin composition contract violation. */\nexport class ZoraPluginCompositionError extends Error {\n readonly code: ZoraPluginCompositionErrorCode;\n readonly packageName: string;\n readonly componentName?: string;\n\n constructor(args: {\n readonly code: ZoraPluginCompositionErrorCode;\n readonly packageName: string;\n readonly message: string;\n readonly componentName?: string;\n }) {\n super(args.message);\n this.name = 'ZoraPluginCompositionError';\n this.code = args.code;\n this.packageName = args.packageName;\n this.componentName = args.componentName;\n }\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { composeZoraPluginMetadata } from './application/use-cases/composeZoraPluginMetadata';
|
|
2
|
-
export { ZoraPluginCompositionError } from './domain/ZoraPluginCompositionError';
|
|
3
|
-
export { ZORA_CORE_PLUGIN_METADATA } from './ZORA_CORE_PLUGIN_METADATA';
|
|
4
|
-
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/plugin/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { composeZoraPluginMetadata } from './application/use-cases/composeZoraPluginMetadata';
|
|
2
|
-
export { ZoraPluginCompositionError } from './domain/ZoraPluginCompositionError';
|
|
3
|
-
export { ZORA_CORE_PLUGIN_METADATA } from './ZORA_CORE_PLUGIN_METADATA';
|
|
4
|
-
//# sourceMappingURL=public.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/plugin/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { composeZoraPluginMetadata } from './application/use-cases/composeZoraPluginMetadata';\nexport { ZoraPluginCompositionError } from './domain/ZoraPluginCompositionError';\nexport { ZORA_CORE_PLUGIN_METADATA } from './ZORA_CORE_PLUGIN_METADATA';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/features/plugin/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/features/plugin/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { composeZoraPlugins } from './application/use-cases/composeZoraPlugins';\nexport { ZORA_CORE_PLUGIN } from './ZORA_CORE_PLUGIN';\n"]}
|
package/dist/types/plugin.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { UiComponentMetaRegistry, UiComponentPackageManifest } from '@ankhorage/contracts';
|
|
2
|
-
import type { ZoraComponentMetaRegistry } from './authoring';
|
|
3
|
-
import type { ZoraComponentRegistry } from './registry';
|
|
4
|
-
export type ZoraPluginCompositionErrorCode = 'duplicate-component' | 'duplicate-package' | 'invalid-component-meta' | 'invalid-interaction-policy-component' | 'invalid-placement-child' | 'invalid-placement-parent' | 'missing-component-meta' | 'missing-runtime-component';
|
|
5
|
-
export interface ZoraPluginPlacement {
|
|
6
|
-
readonly child: string;
|
|
7
|
-
readonly parents: readonly string[];
|
|
8
|
-
}
|
|
9
|
-
export interface ZoraPluginMetadata {
|
|
10
|
-
readonly packageName: string;
|
|
11
|
-
readonly displayName?: string;
|
|
12
|
-
readonly componentMeta: ZoraComponentMetaRegistry;
|
|
13
|
-
readonly extensionHosts?: readonly string[];
|
|
14
|
-
readonly placements?: readonly ZoraPluginPlacement[];
|
|
15
|
-
readonly interactionPolicySupportedComponents?: readonly string[];
|
|
16
|
-
}
|
|
17
|
-
export interface ZoraPluginDescriptor extends ZoraPluginMetadata {
|
|
18
|
-
readonly componentRegistry: ZoraComponentRegistry;
|
|
19
|
-
}
|
|
20
|
-
export interface ComposedZoraPluginMetadataCatalog {
|
|
21
|
-
readonly componentMeta: ZoraComponentMetaRegistry;
|
|
22
|
-
readonly bindableComponentMeta: UiComponentMetaRegistry;
|
|
23
|
-
readonly packageManifests: readonly UiComponentPackageManifest[];
|
|
24
|
-
readonly interactionPolicySupportedComponents: Readonly<Record<string, true>>;
|
|
25
|
-
}
|
|
26
|
-
export interface ComposedZoraPluginCatalog extends ComposedZoraPluginMetadataCatalog {
|
|
27
|
-
readonly componentRegistry: ZoraComponentRegistry;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,MAAM,8BAA8B,GACtC,qBAAqB,GACrB,mBAAmB,GACnB,wBAAwB,GACxB,sCAAsC,GACtC,yBAAyB,GACzB,0BAA0B,GAC1B,wBAAwB,GACxB,2BAA2B,CAAC;AAEhC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,yBAAyB,CAAC;IAClD,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,oCAAoC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnE;AAED,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;CACnD;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,aAAa,EAAE,yBAAyB,CAAC;IAClD,QAAQ,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;IACxD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACjE,QAAQ,CAAC,oCAAoC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;CAC/E;AAED,MAAM,WAAW,yBAA0B,SAAQ,iCAAiC;IAClF,QAAQ,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;CACnD"}
|
package/dist/types/plugin.js
DELETED
package/dist/types/plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"","sourcesContent":["import type { UiComponentMetaRegistry, UiComponentPackageManifest } from '@ankhorage/contracts';\n\nimport type { ZoraComponentMetaRegistry } from './authoring';\nimport type { ZoraComponentRegistry } from './registry';\n\nexport type ZoraPluginCompositionErrorCode =\n | 'duplicate-component'\n | 'duplicate-package'\n | 'invalid-component-meta'\n | 'invalid-interaction-policy-component'\n | 'invalid-placement-child'\n | 'invalid-placement-parent'\n | 'missing-component-meta'\n | 'missing-runtime-component';\n\nexport interface ZoraPluginPlacement {\n readonly child: string;\n readonly parents: readonly string[];\n}\n\nexport interface ZoraPluginMetadata {\n readonly packageName: string;\n readonly displayName?: string;\n readonly componentMeta: ZoraComponentMetaRegistry;\n readonly extensionHosts?: readonly string[];\n readonly placements?: readonly ZoraPluginPlacement[];\n readonly interactionPolicySupportedComponents?: readonly string[];\n}\n\nexport interface ZoraPluginDescriptor extends ZoraPluginMetadata {\n readonly componentRegistry: ZoraComponentRegistry;\n}\n\nexport interface ComposedZoraPluginMetadataCatalog {\n readonly componentMeta: ZoraComponentMetaRegistry;\n readonly bindableComponentMeta: UiComponentMetaRegistry;\n readonly packageManifests: readonly UiComponentPackageManifest[];\n readonly interactionPolicySupportedComponents: Readonly<Record<string, true>>;\n}\n\nexport interface ComposedZoraPluginCatalog extends ComposedZoraPluginMetadataCatalog {\n readonly componentRegistry: ZoraComponentRegistry;\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ZoraPluginDescriptor } from '../../types/plugin';
|
|
2
|
-
import { ZORA_COMPONENT_REGISTRY } from '../registry/ZORA_COMPONENT_REGISTRY';
|
|
3
|
-
import { ZORA_CORE_PLUGIN_METADATA } from './ZORA_CORE_PLUGIN_METADATA';
|
|
4
|
-
|
|
5
|
-
/*** Describe the complete ZORA core runtime and authoring surface through the public plugin contract. */
|
|
6
|
-
export const ZORA_CORE_PLUGIN: ZoraPluginDescriptor = {
|
|
7
|
-
...ZORA_CORE_PLUGIN_METADATA,
|
|
8
|
-
componentRegistry: ZORA_COMPONENT_REGISTRY,
|
|
9
|
-
};
|