@webiny/website-builder-react 6.6.0-alpha.1 → 6.6.0-alpha.11

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 (98) hide show
  1. package/components/ConnectToEditor.d.ts +3 -1
  2. package/components/ConnectToEditor.js +7 -5
  3. package/components/ConnectToEditor.js.map +1 -1
  4. package/components/ContentClientContext.d.ts +3 -0
  5. package/components/ContentClientContext.js +6 -0
  6. package/components/ContentClientContext.js.map +1 -0
  7. package/components/ContentClientProvider.d.ts +12 -0
  8. package/components/ContentClientProvider.js +9 -0
  9. package/components/ContentClientProvider.js.map +1 -0
  10. package/components/ContentClientProvider.test.d.ts +1 -0
  11. package/components/ContentClientProvider.test.js +143 -0
  12. package/components/ContentClientProvider.test.js.map +1 -0
  13. package/components/DocumentRenderer.d.ts +8 -3
  14. package/components/DocumentRenderer.js +22 -10
  15. package/components/DocumentRenderer.js.map +1 -1
  16. package/components/DocumentStoreProvider.d.ts +7 -0
  17. package/components/DocumentStoreProvider.js +24 -5
  18. package/components/DocumentStoreProvider.js.map +1 -1
  19. package/components/DocumentStoreProvider.test.d.ts +1 -0
  20. package/components/DocumentStoreProvider.test.js +66 -0
  21. package/components/DocumentStoreProvider.test.js.map +1 -0
  22. package/components/EditingElementRenderer/EditingElementRenderer.d.ts +5 -0
  23. package/components/EditingElementRenderer/EditingElementRenderer.js +21 -9
  24. package/components/EditingElementRenderer/EditingElementRenderer.js.map +1 -1
  25. package/components/EditingElementRenderer/EditingElementRenderer.presenter.d.ts +2 -2
  26. package/components/EditingElementRenderer/EditingElementRenderer.presenter.js +4 -3
  27. package/components/EditingElementRenderer/EditingElementRenderer.presenter.js.map +1 -1
  28. package/components/ElementRenderer.js +17 -4
  29. package/components/ElementRenderer.js.map +1 -1
  30. package/components/ElementSlot.js +5 -2
  31. package/components/ElementSlot.js.map +1 -1
  32. package/components/FragmentsProvider.js +4 -3
  33. package/components/FragmentsProvider.js.map +1 -1
  34. package/components/GlobalComponent.d.ts +10 -0
  35. package/components/GlobalComponent.js +17 -0
  36. package/components/GlobalComponent.js.map +1 -0
  37. package/components/GlobalPlacement.d.ts +11 -0
  38. package/components/GlobalPlacement.js +27 -0
  39. package/components/GlobalPlacement.js.map +1 -0
  40. package/components/LayoutAreas.d.ts +19 -0
  41. package/components/LayoutAreas.js +15 -0
  42. package/components/LayoutAreas.js.map +1 -0
  43. package/components/LayoutRenderer.d.ts +14 -0
  44. package/components/LayoutRenderer.js +60 -0
  45. package/components/LayoutRenderer.js.map +1 -0
  46. package/components/LayoutRenderer.test.d.ts +1 -0
  47. package/components/LayoutRenderer.test.js +138 -0
  48. package/components/LayoutRenderer.test.js.map +1 -0
  49. package/components/LiveElementRenderer.js +9 -3
  50. package/components/LiveElementRenderer.js.map +1 -1
  51. package/components/PageLayout.d.ts +40 -0
  52. package/components/PageLayout.js +71 -0
  53. package/components/PageLayout.js.map +1 -0
  54. package/components/PreviewElementSlot.js +11 -1
  55. package/components/PreviewElementSlot.js.map +1 -1
  56. package/components/SlotLabel.d.ts +15 -0
  57. package/components/SlotLabel.js +13 -0
  58. package/components/SlotLabel.js.map +1 -0
  59. package/components/index.d.ts +7 -0
  60. package/components/index.js +6 -0
  61. package/components/renderWithLayout.d.ts +5 -0
  62. package/components/renderWithLayout.js +7 -0
  63. package/components/renderWithLayout.js.map +1 -0
  64. package/components/useContentClient.d.ts +6 -0
  65. package/components/useContentClient.js +11 -0
  66. package/components/useContentClient.js.map +1 -0
  67. package/components/useIsElementSelected.d.ts +8 -0
  68. package/components/useIsElementSelected.js +22 -0
  69. package/components/useIsElementSelected.js.map +1 -0
  70. package/components/useSeededDocumentStore.d.ts +10 -0
  71. package/components/useSeededDocumentStore.js +22 -0
  72. package/components/useSeededDocumentStore.js.map +1 -0
  73. package/contentEntry/useContentEntryList.d.ts +22 -0
  74. package/contentEntry/useContentEntryList.js +51 -0
  75. package/contentEntry/useContentEntryList.js.map +1 -0
  76. package/editorComponents/Grid.d.ts +1 -1
  77. package/editorComponents/Grid.js +3 -2
  78. package/editorComponents/Grid.js.map +1 -1
  79. package/editorComponents/LayoutContent.d.ts +6 -0
  80. package/editorComponents/LayoutContent.js +121 -0
  81. package/editorComponents/LayoutContent.js.map +1 -0
  82. package/editorComponents/LayoutContent.manifest.d.ts +10 -0
  83. package/editorComponents/LayoutContent.manifest.js +32 -0
  84. package/editorComponents/LayoutContent.manifest.js.map +1 -0
  85. package/editorComponents/LayoutContentLabel.d.ts +2 -0
  86. package/editorComponents/LayoutContentLabel.js +7 -0
  87. package/editorComponents/LayoutContentLabel.js.map +1 -0
  88. package/editorComponents/LayoutContentLabel.test.d.ts +1 -0
  89. package/editorComponents/LayoutContentLabel.test.js +23 -0
  90. package/editorComponents/LayoutContentLabel.test.js.map +1 -0
  91. package/editorComponents/index.js +4 -1
  92. package/editorComponents/index.js.map +1 -1
  93. package/image/getImageProps.test.js +1 -1
  94. package/image/getImageProps.test.js.map +1 -1
  95. package/index.d.ts +2 -1
  96. package/index.js +2 -1
  97. package/package.json +11 -9
  98. package/types.d.ts +2 -0
@@ -0,0 +1,121 @@
1
+ import react, { useMemo } from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { toJS } from "mobx";
4
+ import { LayoutContentArea, withGlobalElementDefaults } from "@webiny/website-builder-sdk";
5
+ import { ElementRenderer } from "../components/ElementRenderer.js";
6
+ import { ElementSlot } from "../components/ElementSlot.js";
7
+ import { DocumentStoreScope, useDocumentStore } from "../components/DocumentStoreProvider.js";
8
+ import { useSeededDocumentStore } from "../components/useSeededDocumentStore.js";
9
+ import { PageScope, ReadOnlyScope, usePageLayout } from "../components/PageLayout.js";
10
+ import { SlotLabel } from "../components/SlotLabel.js";
11
+ import { LayoutAreasProvider, getLayoutAreaContent, useLayoutAreas } from "../components/LayoutAreas.js";
12
+ import { getContentAreaLabel } from "./LayoutContentLabel.js";
13
+ import { useContentClient } from "../components/useContentClient.js";
14
+ const toPreviewDocument = (page, client)=>{
15
+ const document = {
16
+ id: page.id,
17
+ version: 1,
18
+ state: {},
19
+ extensions: {},
20
+ metadata: {},
21
+ properties: page.properties ?? {
22
+ id: page.id
23
+ },
24
+ elements: page.elements ?? {},
25
+ bindings: page.bindings ?? {}
26
+ };
27
+ const withDefaults = withGlobalElementDefaults(document, client.getComponentManifests());
28
+ return {
29
+ ...document,
30
+ elements: withDefaults.elements,
31
+ bindings: withDefaults.bindings
32
+ };
33
+ };
34
+ const PageArea = observer(({ area })=>{
35
+ const documentStore = useDocumentStore();
36
+ const slot = area.slot();
37
+ if (area.isMain()) return /*#__PURE__*/ react.createElement(SlotLabel, {
38
+ parentId: "root",
39
+ slot: slot,
40
+ label: getContentAreaLabel(area)
41
+ }, /*#__PURE__*/ react.createElement(ElementRenderer, {
42
+ id: "root"
43
+ }));
44
+ const ids = documentStore.getDocument()?.bindings.root?.inputs?.[slot]?.static;
45
+ return /*#__PURE__*/ react.createElement(SlotLabel, {
46
+ parentId: "root",
47
+ slot: slot,
48
+ label: getContentAreaLabel(area)
49
+ }, /*#__PURE__*/ react.createElement(ElementSlot, {
50
+ parentId: "root",
51
+ slot: slot,
52
+ elements: Array.isArray(ids) ? [
53
+ ...ids
54
+ ] : []
55
+ }));
56
+ });
57
+ const PreviewPageScope = ({ document, children })=>{
58
+ const store = useSeededDocumentStore(document);
59
+ return /*#__PURE__*/ react.createElement(DocumentStoreScope, {
60
+ store: store
61
+ }, children);
62
+ };
63
+ const PreviewPageContent = ({ pageJson, area })=>{
64
+ const client = useContentClient();
65
+ const document = useMemo(()=>toPreviewDocument(JSON.parse(pageJson), client), [
66
+ pageJson,
67
+ client
68
+ ]);
69
+ return /*#__PURE__*/ react.createElement(ReadOnlyScope, null, /*#__PURE__*/ react.createElement(PreviewPageScope, {
70
+ key: document.id,
71
+ document: document
72
+ }, /*#__PURE__*/ react.createElement(PageArea, {
73
+ area: area
74
+ })));
75
+ };
76
+ const Placeholder = ({ area })=>/*#__PURE__*/ react.createElement("div", {
77
+ style: {
78
+ display: "flex",
79
+ minHeight: "200px",
80
+ backgroundColor: "#f4f4f4",
81
+ border: "2px dashed #d0d0d0",
82
+ justifyContent: "center",
83
+ alignItems: "center",
84
+ color: "#6b6b6b"
85
+ }
86
+ }, getContentAreaLabel(area));
87
+ const LayoutEditorContent = observer(({ area })=>{
88
+ const documentStore = useDocumentStore();
89
+ const previewPage = documentStore.getDocument()?.previewPage;
90
+ if (previewPage) return /*#__PURE__*/ react.createElement(PreviewPageContent, {
91
+ pageJson: JSON.stringify(toJS(previewPage)),
92
+ area: area
93
+ });
94
+ return /*#__PURE__*/ react.createElement(Placeholder, {
95
+ area: area
96
+ });
97
+ });
98
+ const ContentArea = ({ area })=>{
99
+ const client = useContentClient();
100
+ const pageLayout = usePageLayout();
101
+ const layoutAreas = useLayoutAreas();
102
+ if (layoutAreas) return /*#__PURE__*/ react.createElement(PageScope, null, /*#__PURE__*/ react.createElement(LayoutAreasProvider, {
103
+ value: void 0
104
+ }, getLayoutAreaContent(layoutAreas, area)));
105
+ if (pageLayout) return /*#__PURE__*/ react.createElement(PageScope, null, /*#__PURE__*/ react.createElement(PageArea, {
106
+ area: area
107
+ }));
108
+ if (!client.isEditing()) return null;
109
+ return /*#__PURE__*/ react.createElement(LayoutEditorContent, {
110
+ area: area
111
+ });
112
+ };
113
+ const MainContentComponent = ({ element })=>/*#__PURE__*/ react.createElement(ContentArea, {
114
+ area: LayoutContentArea.fromElement(element)
115
+ });
116
+ const NamedContentComponent = ({ inputs, element })=>/*#__PURE__*/ react.createElement(ContentArea, {
117
+ area: LayoutContentArea.fromElement(element, inputs?.area)
118
+ });
119
+ export { MainContentComponent, NamedContentComponent };
120
+
121
+ //# sourceMappingURL=LayoutContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorComponents/LayoutContent.js","sources":["../../src/editorComponents/LayoutContent.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { toJS } from \"mobx\";\nimport {\n type ContentClient,\n type Document,\n LayoutContentArea,\n type PreviewPage,\n withGlobalElementDefaults\n} from \"@webiny/website-builder-sdk\";\nimport { ElementRenderer } from \"~/components/ElementRenderer.js\";\nimport { ElementSlot } from \"~/components/ElementSlot.js\";\nimport type { ComponentProps } from \"~/types.js\";\nimport { DocumentStoreScope, useDocumentStore } from \"~/components/DocumentStoreProvider.js\";\nimport { useSeededDocumentStore } from \"~/components/useSeededDocumentStore.js\";\nimport { PageScope, ReadOnlyScope, usePageLayout } from \"~/components/PageLayout.js\";\nimport { SlotLabel } from \"~/components/SlotLabel.js\";\nimport {\n getLayoutAreaContent,\n LayoutAreasProvider,\n useLayoutAreas\n} from \"~/components/LayoutAreas.js\";\nimport { getContentAreaLabel } from \"./LayoutContentLabel.js\";\nimport { useContentClient } from \"~/components/useContentClient.js\";\n\nconst toPreviewDocument = (page: PreviewPage, client: ContentClient): Document => {\n const document: Document = {\n id: page.id,\n version: 1,\n state: {},\n extensions: {},\n metadata: {},\n properties: page.properties ?? { id: page.id },\n elements: page.elements ?? {},\n bindings: page.bindings ?? {}\n };\n\n // Globals the page has no stored instance of render from their manifest defaults, as on the live site.\n const withDefaults = withGlobalElementDefaults(document, client.getComponentManifests());\n return { ...document, elements: withDefaults.elements, bindings: withDefaults.bindings };\n};\n\n/**\n * The page's content of one area. The main area is the page root, as on a page without a layout; the\n * others are slots of the page root. In the page editor, each is a place to drop content.\n */\nconst PageArea = observer(({ area }: { area: LayoutContentArea }) => {\n const documentStore = useDocumentStore();\n const slot = area.slot();\n\n // While an area is empty, its drop area in the page editor says which one it is.\n if (area.isMain()) {\n return (\n <SlotLabel parentId={\"root\"} slot={slot} label={getContentAreaLabel(area)}>\n <ElementRenderer id={\"root\"} />\n </SlotLabel>\n );\n }\n\n const ids = documentStore.getDocument()?.bindings.root?.inputs?.[slot]?.static;\n\n return (\n <SlotLabel parentId={\"root\"} slot={slot} label={getContentAreaLabel(area)}>\n <ElementSlot\n parentId={\"root\"}\n slot={slot}\n elements={Array.isArray(ids) ? [...ids] : []}\n />\n </SlotLabel>\n );\n});\n\nconst PreviewPageScope = ({\n document,\n children\n}: {\n document: Document;\n children: React.ReactNode;\n}) => {\n const store = useSeededDocumentStore(document);\n\n return <DocumentStoreScope store={store}>{children}</DocumentStoreScope>;\n};\n\n/**\n * In the layout editor, the page picked to preview the layout with: shown in place of the page content,\n * as on the live site. It can't be selected; it belongs to the page, not to the layout.\n */\nconst PreviewPageContent = ({ pageJson, area }: { pageJson: string; area: LayoutContentArea }) => {\n const client = useContentClient();\n const document = useMemo(\n () => toPreviewDocument(JSON.parse(pageJson), client),\n [pageJson, client]\n );\n\n // Keyed by page: picking another page renders it from scratch. Its elements share ids with the previous\n // page's (\"root\"), so they would otherwise keep what they had read from the previous page.\n return (\n <ReadOnlyScope>\n <PreviewPageScope key={document.id} document={document}>\n <PageArea area={area} />\n </PreviewPageScope>\n </ReadOnlyScope>\n );\n};\n\nconst Placeholder = ({ area }: { area: LayoutContentArea }) => {\n return (\n <div\n style={{\n display: \"flex\",\n minHeight: \"200px\",\n backgroundColor: \"#f4f4f4\",\n border: \"2px dashed #d0d0d0\",\n justifyContent: \"center\",\n alignItems: \"center\",\n color: \"#6b6b6b\"\n }}\n >\n {getContentAreaLabel(area)}\n </div>\n );\n};\n\nconst LayoutEditorContent = observer(({ area }: { area: LayoutContentArea }) => {\n const documentStore = useDocumentStore();\n const previewPage = documentStore.getDocument()?.previewPage;\n\n if (previewPage) {\n return <PreviewPageContent pageJson={JSON.stringify(toJS(previewPage))} area={area} />;\n }\n\n return <Placeholder area={area} />;\n});\n\n/**\n * A page content area: where a page renders its own content of that area inside a layout. In the layout\n * editor, there is no page: it shows a placeholder, or the page picked to preview the layout with.\n */\nconst ContentArea = ({ area }: { area: LayoutContentArea }) => {\n const client = useContentClient();\n const pageLayout = usePageLayout();\n const layoutAreas = useLayoutAreas();\n\n // Content from code rendered in the layout (see <LayoutRenderer>). It's not part of the layout, so\n // nothing of the layout is around it any more.\n if (layoutAreas) {\n return (\n <PageScope>\n <LayoutAreasProvider value={undefined}>\n {getLayoutAreaContent(layoutAreas, area)}\n </LayoutAreasProvider>\n </PageScope>\n );\n }\n\n if (pageLayout) {\n return (\n <PageScope>\n <PageArea area={area} />\n </PageScope>\n );\n }\n\n if (!client.isEditing()) {\n return null;\n }\n\n return <LayoutEditorContent area={area} />;\n};\n\nexport const MainContentComponent = ({ element }: ComponentProps) => {\n return <ContentArea area={LayoutContentArea.fromElement(element)} />;\n};\n\nexport const NamedContentComponent = ({ inputs, element }: ComponentProps<{ area?: string }>) => {\n return <ContentArea area={LayoutContentArea.fromElement(element, inputs?.area)} />;\n};\n"],"names":["toPreviewDocument","page","client","document","withDefaults","withGlobalElementDefaults","PageArea","observer","area","documentStore","useDocumentStore","slot","SlotLabel","getContentAreaLabel","ElementRenderer","ids","ElementSlot","Array","PreviewPageScope","children","store","useSeededDocumentStore","DocumentStoreScope","PreviewPageContent","pageJson","useContentClient","useMemo","JSON","ReadOnlyScope","Placeholder","LayoutEditorContent","previewPage","toJS","ContentArea","pageLayout","usePageLayout","layoutAreas","useLayoutAreas","PageScope","LayoutAreasProvider","undefined","getLayoutAreaContent","MainContentComponent","element","LayoutContentArea","NamedContentComponent","inputs"],"mappings":"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"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The main page content area of a layout. Every layout starts with it, and keeps it: it can be moved and
3
+ * styled, but not deleted, renamed or inserted again.
4
+ */
5
+ export declare const LayoutContent: import("@webiny/website-builder-sdk").Component;
6
+ /**
7
+ * A named page content area, inserted in the layout editor (only there). Pages fill each named area in
8
+ * the page editor.
9
+ */
10
+ export declare const NamedContent: import("@webiny/website-builder-sdk").Component;
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { LayoutContentArea, createTextInput } from "@webiny/website-builder-sdk";
3
+ import { createComponent } from "../createComponent.js";
4
+ import { MainContentComponent, NamedContentComponent } from "./LayoutContent.js";
5
+ const LayoutContent_manifest_image = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 5v14h18V5H3zm16 12H5V7h14v10zM7 9h10v2H7V9zm0 4h7v2H7v-2z"/></svg>';
6
+ const LayoutContent = createComponent(MainContentComponent, {
7
+ name: LayoutContentArea.MAIN_COMPONENT,
8
+ label: "Main content",
9
+ group: "basic",
10
+ hideFromToolbar: true,
11
+ useInAiContentGeneration: false,
12
+ inputs: [],
13
+ image: LayoutContent_manifest_image
14
+ });
15
+ const NamedContent = createComponent(NamedContentComponent, {
16
+ name: LayoutContentArea.NAMED_COMPONENT,
17
+ label: "Named content",
18
+ group: "basic",
19
+ useInAiContentGeneration: false,
20
+ inputs: [
21
+ createTextInput({
22
+ name: LayoutContentArea.NAME_INPUT,
23
+ label: "Area name",
24
+ translatable: false,
25
+ description: "Shown in the page editor so authors can tell the areas apart. Renaming an area keeps the content pages added to it."
26
+ })
27
+ ],
28
+ image: LayoutContent_manifest_image
29
+ });
30
+ export { LayoutContent, NamedContent };
31
+
32
+ //# sourceMappingURL=LayoutContent.manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorComponents/LayoutContent.manifest.js","sources":["../../src/editorComponents/LayoutContent.manifest.ts"],"sourcesContent":["\"use client\";\nimport { createTextInput, LayoutContentArea } from \"@webiny/website-builder-sdk\";\nimport { createComponent } from \"~/createComponent.js\";\nimport { MainContentComponent, NamedContentComponent } from \"./LayoutContent.js\";\n\nconst image = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M3 5v14h18V5H3zm16 12H5V7h14v10zM7 9h10v2H7V9zm0 4h7v2H7v-2z\"/></svg>`;\n\n/**\n * The main page content area of a layout. Every layout starts with it, and keeps it: it can be moved and\n * styled, but not deleted, renamed or inserted again.\n */\nexport const LayoutContent = createComponent(MainContentComponent, {\n name: LayoutContentArea.MAIN_COMPONENT,\n label: \"Main content\",\n group: \"basic\",\n hideFromToolbar: true,\n useInAiContentGeneration: false,\n inputs: [],\n image\n});\n\n/**\n * A named page content area, inserted in the layout editor (only there). Pages fill each named area in\n * the page editor.\n */\nexport const NamedContent = createComponent(NamedContentComponent, {\n name: LayoutContentArea.NAMED_COMPONENT,\n label: \"Named content\",\n group: \"basic\",\n useInAiContentGeneration: false,\n inputs: [\n createTextInput({\n name: LayoutContentArea.NAME_INPUT,\n label: \"Area name\",\n // A label for people: pages' content of the area is stored by the area element's id.\n translatable: false,\n description:\n \"Shown in the page editor so authors can tell the areas apart. Renaming an area keeps the content pages added to it.\"\n })\n ],\n image\n});\n"],"names":["image","LayoutContent","createComponent","MainContentComponent","LayoutContentArea","NamedContent","NamedContentComponent","createTextInput"],"mappings":";;;;AAKA,MAAMA,+BAAQ;AAMP,MAAMC,gBAAgBC,gBAAgBC,sBAAsB;IAC/D,MAAMC,kBAAkB,cAAc;IACtC,OAAO;IACP,OAAO;IACP,iBAAiB;IACjB,0BAA0B;IAC1B,QAAQ,EAAE;IACVJ,OAAAA;AACJ;AAMO,MAAMK,eAAeH,gBAAgBI,uBAAuB;IAC/D,MAAMF,kBAAkB,eAAe;IACvC,OAAO;IACP,OAAO;IACP,0BAA0B;IAC1B,QAAQ;QACJG,gBAAgB;YACZ,MAAMH,kBAAkB,UAAU;YAClC,OAAO;YAEP,cAAc;YACd,aACI;QACR;KACH;IACDJ,OAAAA;AACJ"}
@@ -0,0 +1,2 @@
1
+ import type { LayoutContentArea } from "@webiny/website-builder-sdk";
2
+ export declare const getContentAreaLabel: (area: LayoutContentArea) => string;
@@ -0,0 +1,7 @@
1
+ const getContentAreaLabel = (area)=>{
2
+ if (area.isMain()) return "Main content";
3
+ return area.name() ?? "Named content";
4
+ };
5
+ export { getContentAreaLabel };
6
+
7
+ //# sourceMappingURL=LayoutContentLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorComponents/LayoutContentLabel.js","sources":["../../src/editorComponents/LayoutContentLabel.ts"],"sourcesContent":["import type { LayoutContentArea } from \"@webiny/website-builder-sdk\";\n\n// What a content area is called on the canvas. Its name is only a label: content is stored by its slot.\nexport const getContentAreaLabel = (area: LayoutContentArea) => {\n if (area.isMain()) {\n return \"Main content\";\n }\n return area.name() ?? \"Named content\";\n};\n"],"names":["getContentAreaLabel","area"],"mappings":"AAGO,MAAMA,sBAAsB,CAACC;IAChC,IAAIA,KAAK,MAAM,IACX,OAAO;IAEX,OAAOA,KAAK,IAAI,MAAM;AAC1B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { LayoutContentArea } from "@webiny/website-builder-sdk";
3
+ import { getContentAreaLabel } from "./LayoutContentLabel.js";
4
+ const LayoutContentLabel_test_element = (id, name)=>({
5
+ id,
6
+ component: {
7
+ name
8
+ }
9
+ });
10
+ describe("getContentAreaLabel", ()=>{
11
+ it('labels the main content area "Main content", and a named one by its own name, with no "Named content ·" prefix', ()=>{
12
+ const main = LayoutContentArea.fromElement(LayoutContentLabel_test_element("content", "Webiny/LayoutContent"));
13
+ const named = LayoutContentArea.fromElement(LayoutContentLabel_test_element("sidebar", "Webiny/NamedContent"), "sidebar");
14
+ expect(getContentAreaLabel(main)).toBe("Main content");
15
+ expect(getContentAreaLabel(named)).toBe("sidebar");
16
+ });
17
+ it('labels a named content area without a name "Named content"', ()=>{
18
+ const area = LayoutContentArea.fromElement(LayoutContentLabel_test_element("area", "Webiny/NamedContent"), " ");
19
+ expect(getContentAreaLabel(area)).toBe("Named content");
20
+ });
21
+ });
22
+
23
+ //# sourceMappingURL=LayoutContentLabel.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorComponents/LayoutContentLabel.test.js","sources":["../../src/editorComponents/LayoutContentLabel.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { LayoutContentArea } from \"@webiny/website-builder-sdk\";\nimport { getContentAreaLabel } from \"./LayoutContentLabel.js\";\n\nconst element = (id: string, name: string) => ({ id, component: { name } });\n\ndescribe(\"getContentAreaLabel\", () => {\n it('labels the main content area \"Main content\", and a named one by its own name, with no \"Named content ·\" prefix', () => {\n const main = LayoutContentArea.fromElement(element(\"content\", \"Webiny/LayoutContent\"));\n const named = LayoutContentArea.fromElement(\n element(\"sidebar\", \"Webiny/NamedContent\"),\n \"sidebar\"\n );\n\n expect(getContentAreaLabel(main)).toBe(\"Main content\");\n expect(getContentAreaLabel(named)).toBe(\"sidebar\");\n });\n\n it('labels a named content area without a name \"Named content\"', () => {\n const area = LayoutContentArea.fromElement(element(\"area\", \"Webiny/NamedContent\"), \" \");\n\n expect(getContentAreaLabel(area)).toBe(\"Named content\");\n });\n});\n"],"names":["element","id","name","describe","it","main","LayoutContentArea","named","expect","getContentAreaLabel","area"],"mappings":";;;AAIA,MAAMA,kCAAU,CAACC,IAAYC,OAAkB;QAAED;QAAI,WAAW;YAAEC;QAAK;IAAE;AAEzEC,SAAS,uBAAuB;IAC5BC,GAAG,kHAAkH;QACjH,MAAMC,OAAOC,kBAAkB,WAAW,CAACN,gCAAQ,WAAW;QAC9D,MAAMO,QAAQD,kBAAkB,WAAW,CACvCN,gCAAQ,WAAW,wBACnB;QAGJQ,OAAOC,oBAAoBJ,OAAO,IAAI,CAAC;QACvCG,OAAOC,oBAAoBF,QAAQ,IAAI,CAAC;IAC5C;IAEAH,GAAG,8DAA8D;QAC7D,MAAMM,OAAOJ,kBAAkB,WAAW,CAACN,gCAAQ,QAAQ,wBAAwB;QAEnFQ,OAAOC,oBAAoBC,OAAO,IAAI,CAAC;IAC3C;AACJ"}
@@ -5,6 +5,7 @@ import { Lexical } from "./Lexical.manifest.js";
5
5
  import { Root } from "./Root.manifest.js";
6
6
  import { GridColumn } from "./GridColumn.manifest.js";
7
7
  import { Fragment } from "./Fragment.manifest.js";
8
+ import { LayoutContent, NamedContent } from "./LayoutContent.manifest.js";
8
9
  const editorComponents = [
9
10
  Root,
10
11
  Box,
@@ -12,7 +13,9 @@ const editorComponents = [
12
13
  GridColumn,
13
14
  Image,
14
15
  Lexical,
15
- Fragment
16
+ Fragment,
17
+ LayoutContent,
18
+ NamedContent
16
19
  ];
17
20
  export { editorComponents };
18
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"editorComponents/index.js","sources":["../../src/editorComponents/index.ts"],"sourcesContent":["import { Box } from \"./Box.manifest.js\";\nimport { Grid } from \"./Grid.manifest.js\";\nimport { Image } from \"./Image.manifest.js\";\nimport { Lexical } from \"./Lexical.manifest.js\";\nimport { Root } from \"./Root.manifest.js\";\nimport { GridColumn } from \"./GridColumn.manifest.js\";\nimport { Fragment } from \"./Fragment.manifest.js\";\n\nexport const editorComponents = [Root, Box, Grid, GridColumn, Image, Lexical, Fragment];\n"],"names":["editorComponents","Root","Box","Grid","GridColumn","Image","Lexical","Fragment"],"mappings":";;;;;;;AAQO,MAAMA,mBAAmB;IAACC;IAAMC;IAAKC;IAAMC;IAAYC;IAAOC;IAASC;CAAS"}
1
+ {"version":3,"file":"editorComponents/index.js","sources":["../../src/editorComponents/index.ts"],"sourcesContent":["import { Box } from \"./Box.manifest.js\";\nimport { Grid } from \"./Grid.manifest.js\";\nimport { Image } from \"./Image.manifest.js\";\nimport { Lexical } from \"./Lexical.manifest.js\";\nimport { Root } from \"./Root.manifest.js\";\nimport { GridColumn } from \"./GridColumn.manifest.js\";\nimport { Fragment } from \"./Fragment.manifest.js\";\nimport { LayoutContent, NamedContent } from \"./LayoutContent.manifest.js\";\n\nexport const editorComponents = [\n Root,\n Box,\n Grid,\n GridColumn,\n Image,\n Lexical,\n Fragment,\n LayoutContent,\n NamedContent\n];\n"],"names":["editorComponents","Root","Box","Grid","GridColumn","Image","Lexical","Fragment","LayoutContent","NamedContent"],"mappings":";;;;;;;;AASO,MAAMA,mBAAmB;IAC5BC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACH"}
@@ -4,7 +4,7 @@ const asset = (overrides = {})=>({
4
4
  id: "1",
5
5
  name: "photo.jpg",
6
6
  size: 1234,
7
- type: "image/jpeg",
7
+ mimeType: "image/jpeg",
8
8
  src: "https://cdn.test/photo.jpg",
9
9
  url: "https://cdn.test/photo.jpg",
10
10
  image: {
@@ -1 +1 @@
1
- {"version":3,"file":"image/getImageProps.test.js","sources":["../../src/image/getImageProps.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { getImageProps } from \"./getImageProps.js\";\nimport type { Asset } from \"@webiny/website-builder-sdk\";\n\nconst asset = (overrides: Partial<Asset> = {}): Asset => ({\n id: \"1\",\n name: \"photo.jpg\",\n size: 1234,\n type: \"image/jpeg\",\n src: \"https://cdn.test/photo.jpg\",\n url: \"https://cdn.test/photo.jpg\",\n image: { width: 1600, height: 900 },\n ...overrides\n});\n\ndescribe(\"getImageProps\", () => {\n it(\"returns wrapper + image styles and passes through src and dimensions\", () => {\n const props = getImageProps(asset());\n expect(props.src).toBe(\"https://cdn.test/photo.jpg\");\n expect(props.width).toBe(1600);\n expect(props.height).toBe(900);\n expect(props.style.overflow).toBe(\"hidden\");\n expect(props.style.position).toBe(\"relative\");\n expect(props.imgStyle.position).toBe(\"absolute\");\n });\n\n it(\"resolves alt from the explicit option first\", () => {\n const props = getImageProps(asset({ image: { alt: \"stored alt\" } }), {\n alt: \"explicit alt\"\n });\n expect(props.alt).toBe(\"explicit alt\");\n });\n\n it(\"falls back to the image's stored alt\", () => {\n const props = getImageProps(asset({ image: { alt: \"stored alt\" } }));\n expect(props.alt).toBe(\"stored alt\");\n });\n\n it(\"defaults alt to an empty string\", () => {\n expect(getImageProps(asset()).alt).toBe(\"\");\n });\n\n it(\"produces a wrapper with the requested aspect ratio\", () => {\n const props = getImageProps(asset(), { aspectRatio: 1 });\n expect(props.style.aspectRatio).toBe(\"1\");\n });\n\n it(\"offsets the image to reveal a focal-point-shifted crop region\", () => {\n const props = getImageProps(\n asset({\n image: {\n width: 1600,\n height: 900,\n focalPoint: { x: 0.9, y: 0.5 }\n }\n }),\n { aspectRatio: 1 }\n );\n expect(parseFloat(props.imgStyle.left as string)).toBeLessThan(0);\n });\n});\n"],"names":["asset","overrides","describe","it","props","getImageProps","expect","parseFloat"],"mappings":";;AAIA,MAAMA,QAAQ,CAACC,YAA4B,CAAC,CAAC,GAAa;QACtD,IAAI;QACJ,MAAM;QACN,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,OAAO;YAAE,OAAO;YAAM,QAAQ;QAAI;QAClC,GAAGA,SAAS;IAChB;AAEAC,SAAS,iBAAiB;IACtBC,GAAG,wEAAwE;QACvE,MAAMC,QAAQC,cAAcL;QAC5BM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;QACvBE,OAAOF,MAAM,KAAK,EAAE,IAAI,CAAC;QACzBE,OAAOF,MAAM,MAAM,EAAE,IAAI,CAAC;QAC1BE,OAAOF,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClCE,OAAOF,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClCE,OAAOF,MAAM,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACzC;IAEAD,GAAG,+CAA+C;QAC9C,MAAMC,QAAQC,cAAcL,MAAM;YAAE,OAAO;gBAAE,KAAK;YAAa;QAAE,IAAI;YACjE,KAAK;QACT;QACAM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;IAC3B;IAEAD,GAAG,wCAAwC;QACvC,MAAMC,QAAQC,cAAcL,MAAM;YAAE,OAAO;gBAAE,KAAK;YAAa;QAAE;QACjEM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;IAC3B;IAEAD,GAAG,mCAAmC;QAClCG,OAAOD,cAAcL,SAAS,GAAG,EAAE,IAAI,CAAC;IAC5C;IAEAG,GAAG,sDAAsD;QACrD,MAAMC,QAAQC,cAAcL,SAAS;YAAE,aAAa;QAAE;QACtDM,OAAOF,MAAM,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;IACzC;IAEAD,GAAG,iEAAiE;QAChE,MAAMC,QAAQC,cACVL,MAAM;YACF,OAAO;gBACH,OAAO;gBACP,QAAQ;gBACR,YAAY;oBAAE,GAAG;oBAAK,GAAG;gBAAI;YACjC;QACJ,IACA;YAAE,aAAa;QAAE;QAErBM,OAAOC,WAAWH,MAAM,QAAQ,CAAC,IAAI,GAAa,YAAY,CAAC;IACnE;AACJ"}
1
+ {"version":3,"file":"image/getImageProps.test.js","sources":["../../src/image/getImageProps.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { getImageProps } from \"./getImageProps.js\";\nimport type { Asset } from \"@webiny/website-builder-sdk\";\n\nconst asset = (overrides: Partial<Asset> = {}): Asset => ({\n id: \"1\",\n name: \"photo.jpg\",\n size: 1234,\n mimeType: \"image/jpeg\",\n src: \"https://cdn.test/photo.jpg\",\n url: \"https://cdn.test/photo.jpg\",\n image: { width: 1600, height: 900 },\n ...overrides\n});\n\ndescribe(\"getImageProps\", () => {\n it(\"returns wrapper + image styles and passes through src and dimensions\", () => {\n const props = getImageProps(asset());\n expect(props.src).toBe(\"https://cdn.test/photo.jpg\");\n expect(props.width).toBe(1600);\n expect(props.height).toBe(900);\n expect(props.style.overflow).toBe(\"hidden\");\n expect(props.style.position).toBe(\"relative\");\n expect(props.imgStyle.position).toBe(\"absolute\");\n });\n\n it(\"resolves alt from the explicit option first\", () => {\n const props = getImageProps(asset({ image: { alt: \"stored alt\" } }), {\n alt: \"explicit alt\"\n });\n expect(props.alt).toBe(\"explicit alt\");\n });\n\n it(\"falls back to the image's stored alt\", () => {\n const props = getImageProps(asset({ image: { alt: \"stored alt\" } }));\n expect(props.alt).toBe(\"stored alt\");\n });\n\n it(\"defaults alt to an empty string\", () => {\n expect(getImageProps(asset()).alt).toBe(\"\");\n });\n\n it(\"produces a wrapper with the requested aspect ratio\", () => {\n const props = getImageProps(asset(), { aspectRatio: 1 });\n expect(props.style.aspectRatio).toBe(\"1\");\n });\n\n it(\"offsets the image to reveal a focal-point-shifted crop region\", () => {\n const props = getImageProps(\n asset({\n image: {\n width: 1600,\n height: 900,\n focalPoint: { x: 0.9, y: 0.5 }\n }\n }),\n { aspectRatio: 1 }\n );\n expect(parseFloat(props.imgStyle.left as string)).toBeLessThan(0);\n });\n});\n"],"names":["asset","overrides","describe","it","props","getImageProps","expect","parseFloat"],"mappings":";;AAIA,MAAMA,QAAQ,CAACC,YAA4B,CAAC,CAAC,GAAa;QACtD,IAAI;QACJ,MAAM;QACN,MAAM;QACN,UAAU;QACV,KAAK;QACL,KAAK;QACL,OAAO;YAAE,OAAO;YAAM,QAAQ;QAAI;QAClC,GAAGA,SAAS;IAChB;AAEAC,SAAS,iBAAiB;IACtBC,GAAG,wEAAwE;QACvE,MAAMC,QAAQC,cAAcL;QAC5BM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;QACvBE,OAAOF,MAAM,KAAK,EAAE,IAAI,CAAC;QACzBE,OAAOF,MAAM,MAAM,EAAE,IAAI,CAAC;QAC1BE,OAAOF,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClCE,OAAOF,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClCE,OAAOF,MAAM,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACzC;IAEAD,GAAG,+CAA+C;QAC9C,MAAMC,QAAQC,cAAcL,MAAM;YAAE,OAAO;gBAAE,KAAK;YAAa;QAAE,IAAI;YACjE,KAAK;QACT;QACAM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;IAC3B;IAEAD,GAAG,wCAAwC;QACvC,MAAMC,QAAQC,cAAcL,MAAM;YAAE,OAAO;gBAAE,KAAK;YAAa;QAAE;QACjEM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;IAC3B;IAEAD,GAAG,mCAAmC;QAClCG,OAAOD,cAAcL,SAAS,GAAG,EAAE,IAAI,CAAC;IAC5C;IAEAG,GAAG,sDAAsD;QACrD,MAAMC,QAAQC,cAAcL,SAAS;YAAE,aAAa;QAAE;QACtDM,OAAOF,MAAM,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;IACzC;IAEAD,GAAG,iEAAiE;QAChE,MAAMC,QAAQC,cACVL,MAAM;YACF,OAAO;gBACH,OAAO;gBACP,QAAQ;gBACR,YAAY;oBAAE,GAAG;oBAAK,GAAG;gBAAI;YACjC;QACJ,IACA;YAAE,aAAa;QAAE;QAErBM,OAAOC,WAAWH,MAAM,QAAQ,CAAC,IAAI,GAAa,YAAY,CAAC;IACnE;AACJ"}
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./components/index.js";
2
+ export * from "./contentEntry/useContentEntryList.js";
2
3
  export { createComponent } from "@webiny/website-builder-sdk";
3
- export { createTextInput, createLongTextInput, createNumberInput, createBooleanInput, createColorInput, createFileInput, createDateInput, createLexicalInput, createSelectInput, createRadioInput, createObjectInput, createTagsInput, createSlotInput, createInput, createElement, createTheme, contentSdk, environment, setHeadersProvider, getHeadersProvider, registerComponentGroup, getPageWithExperiment, resolveVisitorContext, assignVariant, forcedAssignment, registerAnalyticsProvider, getAnalyticsProvider, ASPECT_RATIO_PRESETS, FORCED_VARIANT_PARAM, DEFAULT_VISITOR_COOKIE, CONTROL_VARIANT_ID, type ActiveExperiment, type ActiveExperimentVariant, type VariantContent, type VariantAssignment, type VisitorContext, type DeviceType, type ExperimentTrafficSplit, type ExperimentTargeting, type ExperimentAnalyticsConfig, type ExperimentSdk, type ExperimentRenderResult, type GetPageWithExperimentOptions, type ExperimentCookie, type CssProperties, type Document, type DocumentElement, type Breakpoint, type CreateElementParams, type ContentSDKConfig, type ComponentManifest, type ComponentInput, type ComponentConstraint, type WebsiteBuilderThemeInput, type AssetCrop, type AssetFocalPoint, type Asset, type AssetImage, type AssetDocument, type AssetVideo, type AssetCategory, normalizeToAsset, getAssetCategory, getAssetUrl, getAssetCropParam, type AssetUrlOptions, IMAGE_RESIZE_WIDTHS, getImageSrcSet, getImageDimensions, type ImageSrcSet, type ImageSrcSetOptions, type ImageDimensions, type AspectRatioInput, type AspectRatioPreset, StyleSettings } from "@webiny/website-builder-sdk";
4
+ export { createTextInput, createLongTextInput, createNumberInput, createBooleanInput, createColorInput, createFileInput, createDateInput, createLexicalInput, createSelectInput, createRadioInput, createObjectInput, createTagsInput, createSlotInput, createContentEntryInput, createInput, createElement, createTheme, contentSdk, createContentClient, environment, setHeadersProvider, getHeadersProvider, setDefaultComponentLoader, getDefaultComponentLoader, registerComponentGroup, getPageWithExperiment, resolveVisitorContext, assignVariant, forcedAssignment, registerAnalyticsProvider, getAnalyticsProvider, ASPECT_RATIO_PRESETS, FORCED_VARIANT_PARAM, DEFAULT_VISITOR_COOKIE, CONTROL_VARIANT_ID, type ActiveExperiment, type ActiveExperimentVariant, type VariantContent, type VariantAssignment, type VisitorContext, type DeviceType, type ExperimentTrafficSplit, type ExperimentTargeting, type ExperimentAnalyticsConfig, type ExperimentSdk, type ExperimentRenderResult, type GetPageWithExperimentOptions, type ExperimentCookie, type CssProperties, type Document, type PageLayout, type DocumentElement, type Breakpoint, type CreateElementParams, type ContentSDKConfig, type ContentClient, type ComponentLoader, type ComponentLoaderFactory, type ComponentLoaderFactoryParams, type ComponentManifest, type ComponentInput, type ContentEntryInput, type ContentEntryReference, type ContentEntryQueryConfig, type ContentEntryQueryValue, type ComponentConstraint, type WebsiteBuilderThemeInput, type AssetCrop, type AssetFocalPoint, type Asset, type AssetImage, type AssetDocument, type AssetVideo, type AssetCategory, normalizeToAsset, getAssetCategory, getAssetUrl, getAssetCropParam, type AssetUrlOptions, IMAGE_RESIZE_WIDTHS, getImageSrcSet, getImageDimensions, type ImageSrcSet, type ImageSrcSetOptions, type ImageDimensions, type AspectRatioInput, type AspectRatioPreset, StyleSettings } from "@webiny/website-builder-sdk";
4
5
  export type { ComponentProps, ComponentPropsWithChildren, InferManifest, InferComponentChange, InferDescendantChange } from "./types.js";
package/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./components/index.js";
2
- export { ASPECT_RATIO_PRESETS, CONTROL_VARIANT_ID, DEFAULT_VISITOR_COOKIE, FORCED_VARIANT_PARAM, IMAGE_RESIZE_WIDTHS, StyleSettings, assignVariant, contentSdk, createBooleanInput, createColorInput, createComponent, createDateInput, createElement, createFileInput, createInput, createLexicalInput, createLongTextInput, createNumberInput, createObjectInput, createRadioInput, createSelectInput, createSlotInput, createTagsInput, createTextInput, createTheme, environment, forcedAssignment, getAnalyticsProvider, getAssetCategory, getAssetCropParam, getAssetUrl, getHeadersProvider, getImageDimensions, getImageSrcSet, getPageWithExperiment, normalizeToAsset, registerAnalyticsProvider, registerComponentGroup, resolveVisitorContext, setHeadersProvider } from "@webiny/website-builder-sdk";
2
+ export * from "./contentEntry/useContentEntryList.js";
3
+ export { ASPECT_RATIO_PRESETS, CONTROL_VARIANT_ID, DEFAULT_VISITOR_COOKIE, FORCED_VARIANT_PARAM, IMAGE_RESIZE_WIDTHS, StyleSettings, assignVariant, contentSdk, createBooleanInput, createColorInput, createComponent, createContentClient, createContentEntryInput, createDateInput, createElement, createFileInput, createInput, createLexicalInput, createLongTextInput, createNumberInput, createObjectInput, createRadioInput, createSelectInput, createSlotInput, createTagsInput, createTextInput, createTheme, environment, forcedAssignment, getAnalyticsProvider, getAssetCategory, getAssetCropParam, getAssetUrl, getDefaultComponentLoader, getHeadersProvider, getImageDimensions, getImageSrcSet, getPageWithExperiment, normalizeToAsset, registerAnalyticsProvider, registerComponentGroup, resolveVisitorContext, setDefaultComponentLoader, setHeadersProvider } from "@webiny/website-builder-sdk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/website-builder-react",
3
- "version": "6.6.0-alpha.1",
3
+ "version": "6.6.0-alpha.11",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,18 +17,20 @@
17
17
  ],
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "@webiny/website-builder-sdk": "6.6.0-alpha.1",
20
+ "@webiny/cms-sdk": "6.6.0-alpha.11",
21
+ "@webiny/website-builder-sdk": "6.6.0-alpha.11",
21
22
  "deep-equal": "2.2.3",
22
- "mobx": "7.0.3",
23
- "mobx-react-lite": "5.0.3",
24
- "react": "18.3.1",
25
- "react-dom": "18.3.1"
23
+ "mobx": "7.1.4",
24
+ "mobx-react-lite": "5.1.2",
25
+ "react": "19.3.1",
26
+ "react-dom": "19.3.1"
26
27
  },
27
28
  "devDependencies": {
28
- "@types/react": "18.3.31",
29
- "@webiny/build-tools": "6.6.0-alpha.1",
29
+ "@testing-library/react": "16.3.3",
30
+ "@types/react": "19.3.0",
31
+ "@webiny/build-tools": "6.6.0-alpha.11",
30
32
  "typescript": "7.0.2",
31
- "vitest": "4.1.11"
33
+ "vitest": "5.0.5"
32
34
  },
33
35
  "publishConfig": {
34
36
  "access": "public"
package/types.d.ts CHANGED
@@ -5,6 +5,8 @@ export type ComponentProps<TInputs = unknown> = {
5
5
  styles: CssProperties;
6
6
  element: DocumentElement;
7
7
  breakpoint: string;
8
+ /** The theme's breakpoint names, widest first (`desktop`, `tablet`, `mobile`). */
9
+ breakpoints: string[];
8
10
  };
9
11
  export type ComponentPropsWithChildren<TInputs = unknown> = ComponentProps<TInputs & {
10
12
  children: React.ReactNode;