@cratis/scene.react 0.1.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.
Files changed (175) hide show
  1. package/.storybook/main.ts +31 -0
  2. package/.storybook/preview.ts +12 -0
  3. package/NavBar/NavBar.tsx +53 -0
  4. package/NavBar/extractNavigationItem.ts +40 -0
  5. package/NavBar/for_NavBar/when_rendering_navigation_contributions.tsx +62 -0
  6. package/NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.ts +53 -0
  7. package/NavBar/index.ts +5 -0
  8. package/README.md +40 -0
  9. package/SceneElementView.stories.tsx +67 -0
  10. package/SceneElementView.tsx +22 -0
  11. package/core/CoreButton.tsx +17 -0
  12. package/core/CoreCard.tsx +15 -0
  13. package/core/CoreText.tsx +13 -0
  14. package/core/coreComponents.ts +18 -0
  15. package/core/corePackage.ts +36 -0
  16. package/core/index.ts +8 -0
  17. package/dist/cjs/NavBar/NavBar.js +47 -0
  18. package/dist/cjs/NavBar/NavBar.js.map +1 -0
  19. package/dist/cjs/NavBar/extractNavigationItem.js +38 -0
  20. package/dist/cjs/NavBar/extractNavigationItem.js.map +1 -0
  21. package/dist/cjs/SceneElementView.js +21 -0
  22. package/dist/cjs/SceneElementView.js.map +1 -0
  23. package/dist/cjs/core/CoreButton.js +22 -0
  24. package/dist/cjs/core/CoreButton.js.map +1 -0
  25. package/dist/cjs/core/CoreCard.js +22 -0
  26. package/dist/cjs/core/CoreCard.js.map +1 -0
  27. package/dist/cjs/core/CoreText.js +19 -0
  28. package/dist/cjs/core/CoreText.js.map +1 -0
  29. package/dist/cjs/core/coreComponents.js +20 -0
  30. package/dist/cjs/core/coreComponents.js.map +1 -0
  31. package/dist/cjs/core/corePackage.js +41 -0
  32. package/dist/cjs/core/corePackage.js.map +1 -0
  33. package/dist/cjs/index.js +38 -0
  34. package/dist/cjs/index.js.map +1 -0
  35. package/dist/cjs/package.json +3 -0
  36. package/dist/cjs/packages/ScenePackageBundle.js +76 -0
  37. package/dist/cjs/packages/ScenePackageBundle.js.map +1 -0
  38. package/dist/cjs/renderer/UnresolvedComponent.js +28 -0
  39. package/dist/cjs/renderer/UnresolvedComponent.js.map +1 -0
  40. package/dist/cjs/renderer/createReactRenderer.js +48 -0
  41. package/dist/cjs/renderer/createReactRenderer.js.map +1 -0
  42. package/dist/cjs/theme/SceneThemeProvider.js +44 -0
  43. package/dist/cjs/theme/SceneThemeProvider.js.map +1 -0
  44. package/dist/cjs/theme/themeTokens.js +52 -0
  45. package/dist/cjs/theme/themeTokens.js.map +1 -0
  46. package/dist/esm/NavBar/NavBar.d.ts +7 -0
  47. package/dist/esm/NavBar/NavBar.d.ts.map +1 -0
  48. package/dist/esm/NavBar/NavBar.js +45 -0
  49. package/dist/esm/NavBar/NavBar.js.map +1 -0
  50. package/dist/esm/NavBar/extractNavigationItem.d.ts +3 -0
  51. package/dist/esm/NavBar/extractNavigationItem.d.ts.map +1 -0
  52. package/dist/esm/NavBar/extractNavigationItem.js +36 -0
  53. package/dist/esm/NavBar/extractNavigationItem.js.map +1 -0
  54. package/dist/esm/NavBar/for_NavBar/when_rendering_navigation_contributions.d.ts +2 -0
  55. package/dist/esm/NavBar/for_NavBar/when_rendering_navigation_contributions.d.ts.map +1 -0
  56. package/dist/esm/NavBar/for_NavBar/when_rendering_navigation_contributions.js +53 -0
  57. package/dist/esm/NavBar/for_NavBar/when_rendering_navigation_contributions.js.map +1 -0
  58. package/dist/esm/NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.d.ts +2 -0
  59. package/dist/esm/NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.d.ts.map +1 -0
  60. package/dist/esm/NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.js +45 -0
  61. package/dist/esm/NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.js.map +1 -0
  62. package/dist/esm/NavBar/index.d.ts +3 -0
  63. package/dist/esm/NavBar/index.d.ts.map +1 -0
  64. package/dist/esm/NavBar/index.js +3 -0
  65. package/dist/esm/NavBar/index.js.map +1 -0
  66. package/dist/esm/SceneElementView.d.ts +10 -0
  67. package/dist/esm/SceneElementView.d.ts.map +1 -0
  68. package/dist/esm/SceneElementView.js +19 -0
  69. package/dist/esm/SceneElementView.js.map +1 -0
  70. package/dist/esm/SceneElementView.stories.d.ts +15 -0
  71. package/dist/esm/SceneElementView.stories.d.ts.map +1 -0
  72. package/dist/esm/SceneElementView.stories.js +54 -0
  73. package/dist/esm/SceneElementView.stories.js.map +1 -0
  74. package/dist/esm/core/CoreButton.d.ts +3 -0
  75. package/dist/esm/core/CoreButton.d.ts.map +1 -0
  76. package/dist/esm/core/CoreButton.js +20 -0
  77. package/dist/esm/core/CoreButton.js.map +1 -0
  78. package/dist/esm/core/CoreCard.d.ts +3 -0
  79. package/dist/esm/core/CoreCard.d.ts.map +1 -0
  80. package/dist/esm/core/CoreCard.js +20 -0
  81. package/dist/esm/core/CoreCard.js.map +1 -0
  82. package/dist/esm/core/CoreText.d.ts +3 -0
  83. package/dist/esm/core/CoreText.d.ts.map +1 -0
  84. package/dist/esm/core/CoreText.js +17 -0
  85. package/dist/esm/core/CoreText.js.map +1 -0
  86. package/dist/esm/core/coreComponents.d.ts +3 -0
  87. package/dist/esm/core/coreComponents.d.ts.map +1 -0
  88. package/dist/esm/core/coreComponents.js +18 -0
  89. package/dist/esm/core/coreComponents.js.map +1 -0
  90. package/dist/esm/core/corePackage.d.ts +5 -0
  91. package/dist/esm/core/corePackage.d.ts.map +1 -0
  92. package/dist/esm/core/corePackage.js +38 -0
  93. package/dist/esm/core/corePackage.js.map +1 -0
  94. package/dist/esm/core/index.d.ts +6 -0
  95. package/dist/esm/core/index.d.ts.map +1 -0
  96. package/dist/esm/core/index.js +6 -0
  97. package/dist/esm/core/index.js.map +1 -0
  98. package/dist/esm/for_SceneElementView/when_rendering_a_tree.d.ts +2 -0
  99. package/dist/esm/for_SceneElementView/when_rendering_a_tree.d.ts.map +1 -0
  100. package/dist/esm/for_SceneElementView/when_rendering_a_tree.js +44 -0
  101. package/dist/esm/for_SceneElementView/when_rendering_a_tree.js.map +1 -0
  102. package/dist/esm/for_applyThemeTokens/when_switching_themes.d.ts +2 -0
  103. package/dist/esm/for_applyThemeTokens/when_switching_themes.d.ts.map +1 -0
  104. package/dist/esm/for_applyThemeTokens/when_switching_themes.js +59 -0
  105. package/dist/esm/for_applyThemeTokens/when_switching_themes.js.map +1 -0
  106. package/dist/esm/for_themeTokens/when_converting_a_token_name.d.ts +2 -0
  107. package/dist/esm/for_themeTokens/when_converting_a_token_name.d.ts.map +1 -0
  108. package/dist/esm/for_themeTokens/when_converting_a_token_name.js +16 -0
  109. package/dist/esm/for_themeTokens/when_converting_a_token_name.js.map +1 -0
  110. package/dist/esm/for_validatePackageBundle/when_the_bundle_and_manifest_disagree.d.ts +2 -0
  111. package/dist/esm/for_validatePackageBundle/when_the_bundle_and_manifest_disagree.d.ts.map +1 -0
  112. package/dist/esm/for_validatePackageBundle/when_the_bundle_and_manifest_disagree.js +59 -0
  113. package/dist/esm/for_validatePackageBundle/when_the_bundle_and_manifest_disagree.js.map +1 -0
  114. package/dist/esm/for_validatePackageBundle/when_the_bundle_matches_its_manifest.d.ts +2 -0
  115. package/dist/esm/for_validatePackageBundle/when_the_bundle_matches_its_manifest.d.ts.map +1 -0
  116. package/dist/esm/for_validatePackageBundle/when_the_bundle_matches_its_manifest.js +8 -0
  117. package/dist/esm/for_validatePackageBundle/when_the_bundle_matches_its_manifest.js.map +1 -0
  118. package/dist/esm/index.d.ts +7 -0
  119. package/dist/esm/index.d.ts.map +1 -0
  120. package/dist/esm/index.js +14 -0
  121. package/dist/esm/index.js.map +1 -0
  122. package/dist/esm/package.json +3 -0
  123. package/dist/esm/packages/ScenePackageBundle.d.ts +15 -0
  124. package/dist/esm/packages/ScenePackageBundle.d.ts.map +1 -0
  125. package/dist/esm/packages/ScenePackageBundle.js +72 -0
  126. package/dist/esm/packages/ScenePackageBundle.js.map +1 -0
  127. package/dist/esm/packages/index.d.ts +2 -0
  128. package/dist/esm/packages/index.d.ts.map +1 -0
  129. package/dist/esm/packages/index.js +2 -0
  130. package/dist/esm/packages/index.js.map +1 -0
  131. package/dist/esm/renderer/ComponentRegistry.d.ts +8 -0
  132. package/dist/esm/renderer/ComponentRegistry.d.ts.map +1 -0
  133. package/dist/esm/renderer/ComponentRegistry.js +2 -0
  134. package/dist/esm/renderer/ComponentRegistry.js.map +1 -0
  135. package/dist/esm/renderer/UnresolvedComponent.d.ts +3 -0
  136. package/dist/esm/renderer/UnresolvedComponent.d.ts.map +1 -0
  137. package/dist/esm/renderer/UnresolvedComponent.js +26 -0
  138. package/dist/esm/renderer/UnresolvedComponent.js.map +1 -0
  139. package/dist/esm/renderer/createReactRenderer.d.ts +5 -0
  140. package/dist/esm/renderer/createReactRenderer.d.ts.map +1 -0
  141. package/dist/esm/renderer/createReactRenderer.js +46 -0
  142. package/dist/esm/renderer/createReactRenderer.js.map +1 -0
  143. package/dist/esm/renderer/index.d.ts +4 -0
  144. package/dist/esm/renderer/index.d.ts.map +1 -0
  145. package/dist/esm/renderer/index.js +4 -0
  146. package/dist/esm/renderer/index.js.map +1 -0
  147. package/dist/esm/theme/SceneThemeProvider.d.ts +10 -0
  148. package/dist/esm/theme/SceneThemeProvider.d.ts.map +1 -0
  149. package/dist/esm/theme/SceneThemeProvider.js +41 -0
  150. package/dist/esm/theme/SceneThemeProvider.js.map +1 -0
  151. package/dist/esm/theme/index.d.ts +3 -0
  152. package/dist/esm/theme/index.d.ts.map +1 -0
  153. package/dist/esm/theme/index.js +3 -0
  154. package/dist/esm/theme/index.js.map +1 -0
  155. package/dist/esm/theme/themeTokens.d.ts +5 -0
  156. package/dist/esm/theme/themeTokens.d.ts.map +1 -0
  157. package/dist/esm/theme/themeTokens.js +48 -0
  158. package/dist/esm/theme/themeTokens.js.map +1 -0
  159. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  160. package/for_SceneElementView/when_rendering_a_tree.tsx +53 -0
  161. package/for_applyThemeTokens/when_switching_themes.ts +74 -0
  162. package/for_themeTokens/when_converting_a_token_name.ts +22 -0
  163. package/for_validatePackageBundle/when_the_bundle_and_manifest_disagree.ts +72 -0
  164. package/for_validatePackageBundle/when_the_bundle_matches_its_manifest.ts +12 -0
  165. package/index.ts +9 -0
  166. package/package.json +60 -0
  167. package/packages/ScenePackageBundle.ts +137 -0
  168. package/packages/index.ts +4 -0
  169. package/renderer/ComponentRegistry.ts +23 -0
  170. package/renderer/UnresolvedComponent.tsx +20 -0
  171. package/renderer/createReactRenderer.tsx +35 -0
  172. package/renderer/index.ts +6 -0
  173. package/theme/SceneThemeProvider.tsx +58 -0
  174. package/theme/index.ts +5 -0
  175. package/theme/themeTokens.ts +59 -0
@@ -0,0 +1,36 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution
5
+ * point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the
6
+ * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`) - the
7
+ * same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,
8
+ * made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built
9
+ * yet) - whoever builds that seam should either produce contributions matching this contract or this
10
+ * function should move to match whatever Stage#37 actually emits.
11
+ *
12
+ * @param contribution The contribution to read.
13
+ * @returns The extracted {@link NavigationItem}, or `undefined` when `contribution.content` isn't an {@link ExternalComponent} or is missing a required property.
14
+ */ function extractNavigationItem(contribution) {
15
+ const content = contribution.content;
16
+ if (!content.properties) {
17
+ return undefined;
18
+ }
19
+ const { label, targetScreen, routeParameterBindings, order, group } = content.properties;
20
+ if (typeof label !== 'string' || typeof targetScreen !== 'string') {
21
+ return undefined;
22
+ }
23
+ return {
24
+ label,
25
+ targetScreen,
26
+ routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},
27
+ order: typeof order === 'number' ? order : contribution.order,
28
+ group: typeof group === 'string' ? group : undefined
29
+ };
30
+ }
31
+ function isBindingExpressionRecord(value) {
32
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
33
+ }
34
+
35
+ export { extractNavigationItem };
36
+ //# sourceMappingURL=extractNavigationItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractNavigationItem.js","sources":["../../../NavBar/extractNavigationItem.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingExpression, Contribution, ExternalComponent, NavigationItem } from '@cratis/scene.model';\n\n/**\n * Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution\n * point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the\n * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`) - the\n * same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,\n * made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built\n * yet) - whoever builds that seam should either produce contributions matching this contract or this\n * function should move to match whatever Stage#37 actually emits.\n *\n * @param contribution The contribution to read.\n * @returns The extracted {@link NavigationItem}, or `undefined` when `contribution.content` isn't an {@link ExternalComponent} or is missing a required property.\n */\nexport function extractNavigationItem(contribution: Contribution): NavigationItem | undefined {\n const content = contribution.content as Partial<ExternalComponent>;\n if (!content.properties) {\n return undefined;\n }\n\n const { label, targetScreen, routeParameterBindings, order, group } = content.properties as Record<string, unknown>;\n if (typeof label !== 'string' || typeof targetScreen !== 'string') {\n return undefined;\n }\n\n return {\n label,\n targetScreen,\n routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},\n order: typeof order === 'number' ? order : contribution.order,\n group: typeof group === 'string' ? group : undefined,\n };\n}\n\nfunction isBindingExpressionRecord(value: unknown): value is Record<string, BindingExpression> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"names":["extractNavigationItem","contribution","content","properties","undefined","label","targetScreen","routeParameterBindings","order","group","isBindingExpressionRecord","value","Array","isArray"],"mappings":"AAAA;AACA;AAIA;;;;;;;;;;;IAYO,SAASA,qBAAAA,CAAsBC,YAA0B,EAAA;IAC5D,MAAMC,OAAAA,GAAUD,aAAaC,OAAO;IACpC,IAAI,CAACA,OAAAA,CAAQC,UAAU,EAAE;QACrB,OAAOC,SAAAA;AACX,IAAA;AAEA,IAAA,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAEC,sBAAsB,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGP,QAAQC,UAAU;AACxF,IAAA,IAAI,OAAOE,KAAAA,KAAU,QAAA,IAAY,OAAOC,iBAAiB,QAAA,EAAU;QAC/D,OAAOF,SAAAA;AACX,IAAA;IAEA,OAAO;AACHC,QAAAA,KAAAA;AACAC,QAAAA,YAAAA;QACAC,sBAAAA,EAAwBG,yBAAAA,CAA0BH,sBAAAA,CAAAA,GAA0BA,sBAAAA,GAAyB,EAAC;AACtGC,QAAAA,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQP,aAAaO,KAAK;QAC7DC,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQL;AAC/C,KAAA;AACJ;AAEA,SAASM,0BAA0BC,KAAc,EAAA;IAC7C,OAAO,OAAOA,UAAU,QAAA,IAAYA,KAAAA,KAAU,QAAQ,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA;AACzE;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_rendering_navigation_contributions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_rendering_navigation_contributions.d.ts","sourceRoot":"","sources":["../../../../NavBar/for_NavBar/when_rendering_navigation_contributions.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen } from '@testing-library/react';
3
+ import { HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
4
+ import { NavBar } from '../NavBar';
5
+ function navigationContribution(id, properties, order) {
6
+ const content = {
7
+ id,
8
+ name: id,
9
+ properties,
10
+ visibility: Visibility.Visible,
11
+ isEnabled: true,
12
+ opacity: 1,
13
+ size: {},
14
+ zIndex: 0,
15
+ minimumSize: {},
16
+ maximumSize: {},
17
+ margin: { left: 0, top: 0, right: 0, bottom: 0 },
18
+ horizontalAlignment: HorizontalAlignment.Stretch,
19
+ verticalAlignment: VerticalAlignment.Stretch,
20
+ componentName: 'core:navigation-item',
21
+ slots: {},
22
+ };
23
+ return { contributionPointName: 'Navigation', content, order };
24
+ }
25
+ describe('when rendering navigation contributions', () => {
26
+ describe('and no item declares a group', () => {
27
+ const contributions = [
28
+ navigationContribution('adjustments', { label: 'Adjustments', targetScreen: 'Adjustments' }, 20),
29
+ navigationContribution('invoices', { label: 'Invoices', targetScreen: 'InvoiceList' }, 10),
30
+ ];
31
+ beforeEach(() => {
32
+ render(_jsx(NavBar, { contributions: contributions, renderRoute: item => `/${item.targetScreen}` }));
33
+ });
34
+ it('should render every item as a link to its rendered route', () => {
35
+ screen.getByRole('link', { name: 'Invoices' }).getAttribute('href').should.equal('/InvoiceList');
36
+ screen.getByRole('link', { name: 'Adjustments' }).getAttribute('href').should.equal('/Adjustments');
37
+ });
38
+ it('should render items in aggregated order', () => {
39
+ const links = screen.getAllByRole('link').map(link => link.textContent);
40
+ links.should.deep.equal(['Invoices', 'Adjustments']);
41
+ });
42
+ });
43
+ describe('and a contribution cannot be extracted into a navigation item', () => {
44
+ const contributions = [navigationContribution('broken', { label: 'Broken' })];
45
+ beforeEach(() => {
46
+ render(_jsx(NavBar, { contributions: contributions, renderRoute: item => `/${item.targetScreen}` }));
47
+ });
48
+ it('should skip it rather than render a broken link', () => {
49
+ screen.queryAllByRole('link').should.have.lengthOf(0);
50
+ });
51
+ });
52
+ });
53
+ //# sourceMappingURL=when_rendering_navigation_contributions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_rendering_navigation_contributions.js","sourceRoot":"","sources":["../../../../NavBar/for_NavBar/when_rendering_navigation_contributions.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAmC,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1H,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,SAAS,sBAAsB,CAAC,EAAU,EAAE,UAAmC,EAAE,KAAc;IAC3F,MAAM,OAAO,GAAsB;QAC/B,EAAE;QACF,IAAI,EAAE,EAAE;QACR,UAAU;QACV,UAAU,EAAE,UAAU,CAAC,OAAO;QAC9B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAChD,mBAAmB,EAAE,mBAAmB,CAAC,OAAO;QAChD,iBAAiB,EAAE,iBAAiB,CAAC,OAAO;QAC5C,aAAa,EAAE,sBAAsB;QACrC,KAAK,EAAE,EAAE;KACZ,CAAC;IACF,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnE,CAAC;AAED,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACrD,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;QAC1C,MAAM,aAAa,GAAG;YAClB,sBAAsB,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE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AC,GAAG,EAAE;YACZ,MAAM,CAAC,KAAC,MAAM,IAAC,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,GAAI,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACvD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_extracting_from_a_navigation_contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_extracting_from_a_navigation_contribution.d.ts","sourceRoot":"","sources":["../../../../NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.ts"],"names":[],"mappings":""}
@@ -0,0 +1,45 @@
1
+ import { HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
2
+ import { extractNavigationItem } from '../extractNavigationItem';
3
+ function navigationContribution(properties, order) {
4
+ const content = {
5
+ id: 'nav-item',
6
+ name: 'nav-item',
7
+ properties,
8
+ visibility: Visibility.Visible,
9
+ isEnabled: true,
10
+ opacity: 1,
11
+ size: {},
12
+ zIndex: 0,
13
+ minimumSize: {},
14
+ maximumSize: {},
15
+ margin: { left: 0, top: 0, right: 0, bottom: 0 },
16
+ horizontalAlignment: HorizontalAlignment.Stretch,
17
+ verticalAlignment: VerticalAlignment.Stretch,
18
+ componentName: 'core:navigation-item',
19
+ slots: {},
20
+ };
21
+ return { contributionPointName: 'Navigation', content, order };
22
+ }
23
+ describe('when extracting from a navigation contribution', () => {
24
+ describe('and the required properties are present', () => {
25
+ let result;
26
+ beforeEach(() => {
27
+ result = extractNavigationItem(navigationContribution({ label: 'Invoices', targetScreen: 'InvoiceList', group: 'Sales' }, 10));
28
+ });
29
+ it('should extract the label', () => result.label.should.equal('Invoices'));
30
+ it('should extract the target screen', () => result.targetScreen.should.equal('InvoiceList'));
31
+ it('should extract the group', () => result.group.should.equal('Sales'));
32
+ it('should fall back to the contribution order when the properties bag has none', () => result.order.should.equal(10));
33
+ });
34
+ describe('and the label is missing', () => {
35
+ it('should return undefined', () => {
36
+ (extractNavigationItem(navigationContribution({ targetScreen: 'InvoiceList' })) === undefined).should.be.true;
37
+ });
38
+ });
39
+ describe('and the target screen is missing', () => {
40
+ it('should return undefined', () => {
41
+ (extractNavigationItem(navigationContribution({ label: 'Invoices' })) === undefined).should.be.true;
42
+ });
43
+ });
44
+ });
45
+ //# sourceMappingURL=when_extracting_from_a_navigation_contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_extracting_from_a_navigation_contribution.js","sourceRoot":"","sources":["../../../../NavBar/for_extractNavigationItem/when_extracting_from_a_navigation_contribution.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmC,mBAAmB,EAAkB,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1I,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,SAAS,sBAAsB,CAAC,UAAmC,EAAE,KAAc;IAC/E,MAAM,OAAO,GAAsB;QAC/B,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,UAAU;QACV,UAAU,EAAE,UAAU,CAAC,OAAO;QAC9B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAChD,mBAAmB,EAAE,mBAAmB,CAAC,OAAO;QAChD,iBAA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AAC,EAAE,CAAC,IAAI,CAAC;QAClH,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC9C,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YAC/B,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QACxG,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './NavBar';
2
+ export * from './extractNavigationItem';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../NavBar/index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './NavBar';
2
+ export * from './extractNavigationItem';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../NavBar/index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BindingResolver } from '@cratis/scene.engine';
2
+ import { SceneElement } from '@cratis/scene.model';
3
+ import { ComponentRegistry } from './renderer';
4
+ export interface SceneElementViewProps {
5
+ element: SceneElement;
6
+ registry: ComponentRegistry;
7
+ resolveBinding: BindingResolver;
8
+ }
9
+ export declare function SceneElementView({ element, registry, resolveBinding }: SceneElementViewProps): import("react").JSX.Element;
10
+ //# sourceMappingURL=SceneElementView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneElementView.d.ts","sourceRoot":"","sources":["../../SceneElementView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,cAAc,EAAE,eAAe,CAAC;CACnC;AAMD,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,qBAAqB,+BAG5F"}
@@ -0,0 +1,19 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { renderElement } from '@cratis/scene.engine';
4
+ import { createReactRenderer } from './renderer/createReactRenderer.js';
5
+
6
+ /**
7
+ * Renders a Scene element tree with the real `Scene.React` renderer - the WYSIWYG building block Studio's
8
+ * preview surface and Stage's shipped web bundle both consume unmodified.
9
+ */ function SceneElementView({ element, registry, resolveBinding }) {
10
+ const renderer = useMemo(()=>createReactRenderer(registry), [
11
+ registry
12
+ ]);
13
+ return /*#__PURE__*/ jsx(Fragment, {
14
+ children: renderElement(element, renderer, resolveBinding)
15
+ });
16
+ }
17
+
18
+ export { SceneElementView };
19
+ //# sourceMappingURL=SceneElementView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneElementView.js","sources":["../../SceneElementView.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { renderElement, BindingResolver } from '@cratis/scene.engine';\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry, createReactRenderer } from './renderer';\n\nexport interface SceneElementViewProps {\n element: SceneElement;\n registry: ComponentRegistry;\n resolveBinding: BindingResolver;\n}\n\n/**\n * Renders a Scene element tree with the real `Scene.React` renderer - the WYSIWYG building block Studio's\n * preview surface and Stage's shipped web bundle both consume unmodified.\n */\nexport function SceneElementView({ element, registry, resolveBinding }: SceneElementViewProps) {\n const renderer = useMemo(() => createReactRenderer(registry), [registry]);\n return <>{renderElement(element, renderer, resolveBinding)}</>;\n}\n"],"names":["SceneElementView","element","registry","resolveBinding","renderer","useMemo","createReactRenderer","_jsx","_Fragment","renderElement"],"mappings":";;;;;AAcA;;;IAIO,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,cAAc,EAAyB,EAAA;AACzF,IAAA,MAAMC,QAAAA,GAAWC,OAAAA,CAAQ,IAAMC,mBAAAA,CAAoBJ,QAAAA,CAAAA,EAAW;AAACA,QAAAA;AAAS,KAAA,CAAA;IACxE,qBAAOK,GAAA,CAAAC,QAAA,EAAA;AAAGC,QAAAA,QAAAA,EAAAA,aAAAA,CAAcR,SAASG,QAAAA,EAAUD,cAAAA;;AAC/C;;;;"}
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { SceneElementView } from './SceneElementView';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof SceneElementView;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const CoreCardWithText: Story;
14
+ export declare const UnresolvedComponent: Story;
15
+ //# sourceMappingURL=SceneElementView.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneElementView.stories.d.ts","sourceRoot":"","sources":["../../SceneElementView.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAoCtD,QAAA,MAAM,IAAI;;;;;QAIQ,MAAM;;CACiB,CAAC;eAE3B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAMjC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
2
+ import { SceneElementView } from './SceneElementView';
3
+ import { coreComponents } from './core';
4
+ function control(id) {
5
+ return {
6
+ id,
7
+ name: id,
8
+ properties: {},
9
+ visibility: Visibility.Visible,
10
+ isEnabled: true,
11
+ opacity: 1,
12
+ size: {},
13
+ zIndex: 0,
14
+ minimumSize: {},
15
+ maximumSize: {},
16
+ margin: { left: 0, top: 0, right: 0, bottom: 0 },
17
+ horizontalAlignment: HorizontalAlignment.Stretch,
18
+ verticalAlignment: VerticalAlignment.Stretch,
19
+ borderThickness: { left: 0, top: 0, right: 0, bottom: 0 },
20
+ padding: { left: 0, top: 0, right: 0, bottom: 0 },
21
+ tabIndex: 0,
22
+ };
23
+ }
24
+ function coreComponent(id, componentName, properties = {}) {
25
+ return { ...control(id), properties, componentName, slots: {} };
26
+ }
27
+ const card = {
28
+ ...control('welcome-card'),
29
+ componentName: 'core:card',
30
+ slots: { content: [coreComponent('welcome-text', 'core:text', { text: 'Welcome to Scene' })] },
31
+ };
32
+ const root = { ...control('root'), children: [card] };
33
+ const meta = {
34
+ title: 'Scene/SceneElementView',
35
+ component: SceneElementView,
36
+ tags: ['autodocs'],
37
+ parameters: { layout: 'padded' },
38
+ };
39
+ export default meta;
40
+ export const CoreCardWithText = {
41
+ args: {
42
+ element: root,
43
+ registry: coreComponents,
44
+ resolveBinding: () => undefined,
45
+ },
46
+ };
47
+ export const UnresolvedComponent = {
48
+ args: {
49
+ element: coreComponent('missing', 'vendor:fancy-widget'),
50
+ registry: coreComponents,
51
+ resolveBinding: () => undefined,
52
+ },
53
+ };
54
+ //# sourceMappingURL=SceneElementView.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneElementView.stories.js","sourceRoot":"","sources":["../../SceneElementView.stories.tsx"],"names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;IAC1B,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC,EAAE;CACjG,CAAC;AAEF,MAAM,IAAI,GAAU,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAE7D,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;CACK,CAAC;AAE1C,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACnC,IAAI,EAAE;QACF,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,cAAc;QACxB,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;KAClC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAU;IACtC,IAAI,EAAE;QACF,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,qBAAqB,CAAC;QACxD,QAAQ,EAAE,cAAc;QACxB,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;KAClC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { RegisteredComponentProps } from '../renderer';
2
+ export declare function CoreButton({ element, slots }: RegisteredComponentProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=CoreButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreButton.d.ts","sourceRoot":"","sources":["../../../core/CoreButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAKvD,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAQtE"}
@@ -0,0 +1,20 @@
1
+ import { jsxs } from 'react/jsx-runtime';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The `core:button` component - part of the minimum vocabulary a `ui profile` can always fall back to.
7
+ */ function CoreButton({ element, slots }) {
8
+ const label = typeof element.properties.label === 'string' ? element.properties.label : '';
9
+ return /*#__PURE__*/ jsxs("button", {
10
+ type: "button",
11
+ "data-scene-id": element.id,
12
+ children: [
13
+ label,
14
+ slots.content
15
+ ]
16
+ });
17
+ }
18
+
19
+ export { CoreButton };
20
+ //# sourceMappingURL=CoreButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreButton.js","sources":["../../../core/CoreButton.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '../renderer';\n\n/**\n * The `core:button` component - part of the minimum vocabulary a `ui profile` can always fall back to.\n */\nexport function CoreButton({ element, slots }: RegisteredComponentProps) {\n const label = typeof element.properties.label === 'string' ? element.properties.label : '';\n return (\n <button type=\"button\" data-scene-id={element.id}>\n {label}\n {slots.content}\n </button>\n );\n}\n"],"names":["CoreButton","element","slots","label","properties","_jsxs","button","type","data-scene-id","id","content"],"mappings":";;AAAA;AACA;AAIA;;AAEC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACnE,IAAA,MAAMC,KAAAA,GAAQ,OAAOF,OAAAA,CAAQG,UAAU,CAACD,KAAK,KAAK,QAAA,GAAWF,OAAAA,CAAQG,UAAU,CAACD,KAAK,GAAG,EAAA;AACxF,IAAA,qBACIE,IAAA,CAACC,QAAAA,EAAAA;QAAOC,IAAAA,EAAK,QAAA;AAASC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;;AAC1CN,YAAAA,KAAAA;AACAD,YAAAA,KAAAA,CAAMQ;;;AAGnB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { RegisteredComponentProps } from '../renderer';
2
+ export declare function CoreCard({ element, slots }: RegisteredComponentProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=CoreCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreCard.d.ts","sourceRoot":"","sources":["../../../core/CoreCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAKvD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAMpE"}
@@ -0,0 +1,20 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The `core:card` component - part of the minimum vocabulary a `ui profile` can always fall back to.
7
+ */ function CoreCard({ element, slots }) {
8
+ return /*#__PURE__*/ jsx("section", {
9
+ "data-scene-id": element.id,
10
+ style: {
11
+ border: '1px solid #ccc',
12
+ borderRadius: 4,
13
+ padding: '0.75rem'
14
+ },
15
+ children: slots.content
16
+ });
17
+ }
18
+
19
+ export { CoreCard };
20
+ //# sourceMappingURL=CoreCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreCard.js","sources":["../../../core/CoreCard.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '../renderer';\n\n/**\n * The `core:card` component - part of the minimum vocabulary a `ui profile` can always fall back to.\n */\nexport function CoreCard({ element, slots }: RegisteredComponentProps) {\n return (\n <section data-scene-id={element.id} style={{ border: '1px solid #ccc', borderRadius: 4, padding: '0.75rem' }}>\n {slots.content}\n </section>\n );\n}\n"],"names":["CoreCard","element","slots","_jsx","section","data-scene-id","id","style","border","borderRadius","padding","content"],"mappings":";;AAAA;AACA;AAIA;;AAEC,IACM,SAASA,QAAAA,CAAS,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACjE,IAAA,qBACIC,GAAA,CAACC,SAAAA,EAAAA;AAAQC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,KAAAA,EAAO;YAAEC,MAAAA,EAAQ,gBAAA;YAAkBC,YAAAA,EAAc,CAAA;YAAGC,OAAAA,EAAS;AAAU,SAAA;AACtGR,QAAAA,QAAAA,EAAAA,KAAAA,CAAMS;;AAGnB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { RegisteredComponentProps } from '../renderer';
2
+ export declare function CoreText({ element }: RegisteredComponentProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=CoreText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreText.d.ts","sourceRoot":"","sources":["../../../core/CoreText.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAMvD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BAG7D"}
@@ -0,0 +1,17 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The `core:text` component - the minimum vocabulary a `ui profile` can always fall back to, regardless
7
+ * of which packages it lists, per Scene#3's `core` fallback guarantee.
8
+ */ function CoreText({ element }) {
9
+ const text = typeof element.properties.text === 'string' ? element.properties.text : '';
10
+ return /*#__PURE__*/ jsx("span", {
11
+ "data-scene-id": element.id,
12
+ children: text
13
+ });
14
+ }
15
+
16
+ export { CoreText };
17
+ //# sourceMappingURL=CoreText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreText.js","sources":["../../../core/CoreText.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '../renderer';\n\n/**\n * The `core:text` component - the minimum vocabulary a `ui profile` can always fall back to, regardless\n * of which packages it lists, per Scene#3's `core` fallback guarantee.\n */\nexport function CoreText({ element }: RegisteredComponentProps) {\n const text = typeof element.properties.text === 'string' ? element.properties.text : '';\n return <span data-scene-id={element.id}>{text}</span>;\n}\n"],"names":["CoreText","element","text","properties","_jsx","span","data-scene-id","id"],"mappings":";;AAAA;AACA;AAIA;;;AAGC,IACM,SAASA,QAAAA,CAAS,EAAEC,OAAO,EAA4B,EAAA;AAC1D,IAAA,MAAMC,IAAAA,GAAO,OAAOD,OAAAA,CAAQE,UAAU,CAACD,IAAI,KAAK,QAAA,GAAWD,OAAAA,CAAQE,UAAU,CAACD,IAAI,GAAG,EAAA;AACrF,IAAA,qBAAOE,GAAA,CAACC,MAAAA,EAAAA;AAAKC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;AAAGL,QAAAA,QAAAA,EAAAA;;AAC7C;;;;"}
@@ -0,0 +1,3 @@
1
+ import { ComponentRegistry } from '../renderer';
2
+ export declare const coreComponents: ComponentRegistry;
3
+ //# sourceMappingURL=coreComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coreComponents.d.ts","sourceRoot":"","sources":["../../../core/coreComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUhD,eAAO,MAAM,cAAc,EAAE,iBAI5B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { componentRegistryKey } from '../packages/ScenePackageBundle.js';
2
+ import { CoreText } from './CoreText.js';
3
+ import { CoreButton } from './CoreButton.js';
4
+ import { CoreCard } from './CoreCard.js';
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * The `core` package's component registry - the final fallback every `ui profile` resolves against
10
+ * regardless of which other packages it lists (Scene#3).
11
+ */ const coreComponents = {
12
+ [componentRegistryKey('core', 'text')]: CoreText,
13
+ [componentRegistryKey('core', 'button')]: CoreButton,
14
+ [componentRegistryKey('core', 'card')]: CoreCard
15
+ };
16
+
17
+ export { coreComponents };
18
+ //# sourceMappingURL=coreComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coreComponents.js","sources":["../../../core/coreComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry } from '../renderer';\nimport { componentRegistryKey } from '../packages';\nimport { CoreText } from './CoreText';\nimport { CoreButton } from './CoreButton';\nimport { CoreCard } from './CoreCard';\n\n/**\n * The `core` package's component registry - the final fallback every `ui profile` resolves against\n * regardless of which other packages it lists (Scene#3).\n */\nexport const coreComponents: ComponentRegistry = {\n [componentRegistryKey('core', 'text')]: CoreText,\n [componentRegistryKey('core', 'button')]: CoreButton,\n [componentRegistryKey('core', 'card')]: CoreCard,\n};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard"],"mappings":";;;;;AAAA;AACA;AAQA;;;UAIaA,cAAAA,GAAoC;IAC7C,CAACC,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUC,QAAAA;IACxC,CAACD,oBAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYE,UAAAA;IAC1C,CAACF,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUG;AAC5C;;;;"}
@@ -0,0 +1,5 @@
1
+ import { ScenePackage } from '@cratis/scene.model';
2
+ import { ScenePackageBundle } from '../packages';
3
+ export declare const corePackageManifest: ScenePackage;
4
+ export declare const corePackage: ScenePackageBundle;
5
+ //# sourceMappingURL=corePackage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corePackage.d.ts","sourceRoot":"","sources":["../../../core/corePackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAUjD,eAAO,MAAM,mBAAmB,EAAE,YAajC,CAAC;AAKF,eAAO,MAAM,WAAW,EAAE,kBAGzB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { PackageKind } from '@cratis/scene.model';
2
+ import { coreComponents } from './coreComponents.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * The `core` package's declaration. Every other package is loaded by a host that reads its manifest;
8
+ * `core` ships inside the renderer itself, because Scene#3 guarantees a bare name always has somewhere to
9
+ * resolve regardless of which packages a profile lists. It is still declared the same way as any other -
10
+ * a package picker should be able to show it, and the dependency resolver should be able to reason about
11
+ * it, without a special case.
12
+ */ const corePackageManifest = {
13
+ name: 'core',
14
+ version: '1.0.0',
15
+ kind: PackageKind.ComponentLibrary,
16
+ dependencies: [],
17
+ components: [
18
+ 'text',
19
+ 'button',
20
+ 'card'
21
+ ],
22
+ layouts: [],
23
+ screenTemplates: [],
24
+ dialogTemplates: [],
25
+ themes: [],
26
+ displayName: 'Core',
27
+ description: 'The built-in fallback vocabulary every ui profile resolves against.',
28
+ module: '@cratis/scene.react'
29
+ };
30
+ /**
31
+ * The `core` package as a loadable bundle.
32
+ */ const corePackage = {
33
+ manifest: corePackageManifest,
34
+ components: coreComponents
35
+ };
36
+
37
+ export { corePackage, corePackageManifest };
38
+ //# sourceMappingURL=corePackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corePackage.js","sources":["../../../core/corePackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '../packages';\nimport { coreComponents } from './coreComponents';\n\n/**\n * The `core` package's declaration. Every other package is loaded by a host that reads its manifest;\n * `core` ships inside the renderer itself, because Scene#3 guarantees a bare name always has somewhere to\n * resolve regardless of which packages a profile lists. It is still declared the same way as any other -\n * a package picker should be able to show it, and the dependency resolver should be able to reason about\n * it, without a special case.\n */\nexport const corePackageManifest: ScenePackage = {\n name: 'core',\n version: '1.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [],\n components: ['text', 'button', 'card'],\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n displayName: 'Core',\n description: 'The built-in fallback vocabulary every ui profile resolves against.',\n module: '@cratis/scene.react',\n};\n\n/**\n * The `core` package as a loadable bundle.\n */\nexport const corePackage: ScenePackageBundle = {\n manifest: corePackageManifest,\n components: coreComponents,\n};\n"],"names":["corePackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","corePackage","manifest","coreComponents"],"mappings":";;;AAAA;AACA;AAMA;;;;;;UAOaA,mBAAAA,GAAoC;IAC7CC,IAAAA,EAAM,MAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,gBAAgB;AAClCC,IAAAA,YAAAA,EAAc,EAAE;IAChBC,UAAAA,EAAY;AAAC,QAAA,MAAA;AAAQ,QAAA,QAAA;AAAU,QAAA;AAAO,KAAA;AACtCC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,MAAAA,EAAQ;AACZ;AAEA;;UAGaC,WAAAA,GAAkC;IAC3CC,QAAAA,EAAUhB,mBAAAA;IACVO,UAAAA,EAAYU;AAChB;;;;"}
@@ -0,0 +1,6 @@
1
+ export * from './CoreText';
2
+ export * from './CoreButton';
3
+ export * from './CoreCard';
4
+ export * from './coreComponents';
5
+ export * from './corePackage';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './CoreText';
2
+ export * from './CoreButton';
3
+ export * from './CoreCard';
4
+ export * from './coreComponents';
5
+ export * from './corePackage';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_rendering_a_tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_rendering_a_tree.d.ts","sourceRoot":"","sources":["../../../for_SceneElementView/when_rendering_a_tree.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { expect } from 'chai';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
5
+ import { SceneElementView } from '../SceneElementView';
6
+ import { coreComponents } from '../core';
7
+ function control(id) {
8
+ return {
9
+ id,
10
+ name: id,
11
+ properties: {},
12
+ visibility: Visibility.Visible,
13
+ isEnabled: true,
14
+ opacity: 1,
15
+ size: {},
16
+ zIndex: 0,
17
+ minimumSize: {},
18
+ maximumSize: {},
19
+ margin: { left: 0, top: 0, right: 0, bottom: 0 },
20
+ horizontalAlignment: HorizontalAlignment.Stretch,
21
+ verticalAlignment: VerticalAlignment.Stretch,
22
+ borderThickness: { left: 0, top: 0, right: 0, bottom: 0 },
23
+ padding: { left: 0, top: 0, right: 0, bottom: 0 },
24
+ tabIndex: 0,
25
+ };
26
+ }
27
+ describe('when rendering a tree', () => {
28
+ describe('and every component resolves', () => {
29
+ const text = { ...control('greeting'), componentName: 'core:text', properties: { text: 'Hello Scene' }, slots: {} };
30
+ const card = { ...control('card'), componentName: 'core:card', slots: { content: [text] } };
31
+ beforeEach(() => {
32
+ render(_jsx(SceneElementView, { element: card, registry: coreComponents, resolveBinding: () => undefined }));
33
+ });
34
+ it('should render the nested core:text content', () => expect(screen.getByText('Hello Scene')).to.exist);
35
+ });
36
+ describe('and a component does not resolve', () => {
37
+ const missing = { ...control('missing'), componentName: 'vendor:fancy-widget', slots: {} };
38
+ beforeEach(() => {
39
+ render(_jsx(SceneElementView, { element: missing, registry: coreComponents, resolveBinding: () => undefined }));
40
+ });
41
+ it('should render a visible unresolved-component placeholder', () => expect(screen.getByText('Unresolved component: vendor:fancy-widget')).to.exist);
42
+ });
43
+ });
44
+ //# sourceMappingURL=when_rendering_a_tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_rendering_a_tree.js","sourceRoot":"","sources":["../../../for_SceneElementView/when_rendering_a_tree.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAA8B,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,SAAS,OAAO,CAAC,EAAU;IACvB,OAAO;QACH,EAAE;QACF,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,UAAU,CAAC,OAAO;QAC9B,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,EAAE;QACf,WAAW,EA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,CAAC,KAAK,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC9C,MAAM,OAAO,GAAsB,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QAE9G,UAAU,CAAC,GAAG,EAAE;YACZ,MAAM,CAAC,KAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS,GAAI,CAAC,CAAC;QAC9G,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE,CAChE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,2CAA2C,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_switching_themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_switching_themes.d.ts","sourceRoot":"","sources":["../../../for_applyThemeTokens/when_switching_themes.ts"],"names":[],"mappings":""}