@webiny/app-website-builder 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.f9f12f52a0
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/BaseEditor/config/Elements.d.ts +11 -2
- package/BaseEditor/config/Elements.js +6 -4
- package/BaseEditor/config/Elements.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/ApplyTheme.d.ts +1 -0
- package/BaseEditor/defaultConfig/Content/Preview/ApplyTheme.js +51 -0
- package/BaseEditor/defaultConfig/Content/Preview/ApplyTheme.js.map +1 -0
- package/BaseEditor/defaultConfig/Content/Preview/Preview.js +2 -2
- package/BaseEditor/defaultConfig/Content/Preview/Preview.js.map +1 -1
- package/BaseEditor/index.d.ts +1 -1
- package/BaseEditor/index.js +0 -1
- package/BaseEditor/index.js.map +1 -1
- package/configs/pages/list/Browser/FolderAction.d.ts +2 -2
- package/configs/pages/list/Browser/FolderAction.js +1 -2
- package/configs/pages/list/Browser/FolderAction.js.map +1 -1
- package/configs/pages/list/Browser/PageAction.d.ts +2 -2
- package/configs/pages/list/Browser/PageAction.js +1 -2
- package/configs/pages/list/Browser/PageAction.js.map +1 -1
- package/configs/pages/list/Browser/Table/Column.d.ts +2 -2
- package/configs/pages/list/Browser/Table/Column.js +1 -2
- package/configs/pages/list/Browser/Table/Column.js.map +1 -1
- package/package.json +28 -28
- package/BaseEditor/defaultConfig/Content/Preview/LoadThemeStylesheet.d.ts +0 -1
- package/BaseEditor/defaultConfig/Content/Preview/LoadThemeStylesheet.js +0 -31
- package/BaseEditor/defaultConfig/Content/Preview/LoadThemeStylesheet.js.map +0 -1
|
@@ -3,8 +3,17 @@ import type { ElementConfig } from "./Element";
|
|
|
3
3
|
declare global {
|
|
4
4
|
namespace JSX {
|
|
5
5
|
interface IntrinsicElements {
|
|
6
|
-
"
|
|
7
|
-
|
|
6
|
+
"wb-editor-ui-elements": {
|
|
7
|
+
class?: string;
|
|
8
|
+
"data-scope"?: string;
|
|
9
|
+
"data-group"?: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
"wb-editor-ui-element": {
|
|
13
|
+
class?: string;
|
|
14
|
+
"data-name"?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
8
17
|
}
|
|
9
18
|
}
|
|
10
19
|
}
|
|
@@ -19,12 +19,14 @@ export const Elements = ({
|
|
|
19
19
|
const groupElements = useMemo(() => {
|
|
20
20
|
return elements.filter(byGroup(group)).filter(byScope(scope));
|
|
21
21
|
}, [elements, group, scope]);
|
|
22
|
-
return /*#__PURE__*/React.createElement("
|
|
22
|
+
return /*#__PURE__*/React.createElement("wb-editor-ui-elements", {
|
|
23
23
|
"data-scope": scope,
|
|
24
|
-
"data-group": group
|
|
25
|
-
|
|
24
|
+
"data-group": group,
|
|
25
|
+
class: "wby-contents"
|
|
26
|
+
}, transform(groupElements).map(element => /*#__PURE__*/React.createElement("wb-editor-ui-element", {
|
|
26
27
|
key: element.name,
|
|
27
|
-
"data-name": element.name
|
|
28
|
+
"data-name": element.name,
|
|
29
|
+
class: "wby-contents"
|
|
28
30
|
}, element.element)));
|
|
29
31
|
};
|
|
30
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","useEditorConfig","passthrough","byGroup","group","item","byScope","scope","defaultTransform","elements","Elements","transform","groupElements","filter","createElement","map","element","key","name"],"sources":["Elements.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { useEditorConfig } from \"./EditorConfig\";\nimport type { ElementConfig } from \"./Element\";\n\ndeclare global {\n // eslint-disable-next-line\n namespace JSX {\n interface IntrinsicElements {\n \"
|
|
1
|
+
{"version":3,"names":["React","useMemo","useEditorConfig","passthrough","byGroup","group","item","byScope","scope","defaultTransform","elements","Elements","transform","groupElements","filter","createElement","class","map","element","key","name"],"sources":["Elements.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { useEditorConfig } from \"./EditorConfig\";\nimport type { ElementConfig } from \"./Element\";\n\ndeclare global {\n // eslint-disable-next-line\n namespace JSX {\n interface IntrinsicElements {\n \"wb-editor-ui-elements\": {\n class?: string;\n \"data-scope\"?: string;\n \"data-group\"?: string;\n [key: string]: any;\n };\n \"wb-editor-ui-element\": {\n class?: string;\n \"data-name\"?: string;\n [key: string]: any;\n };\n }\n }\n}\n\nexport interface ElementsProps {\n group?: string;\n scope?: string;\n transform?: (elements: ElementConfig[]) => ElementConfig[];\n}\n\nconst passthrough = () => true;\n\nconst byGroup = (group?: string) => {\n return group ? (item: ElementConfig) => item.group === group : passthrough;\n};\nconst byScope = (scope?: string) => {\n return scope ? (item: ElementConfig) => item.scope === scope : passthrough;\n};\n\nconst defaultTransform = (elements: ElementConfig[]) => elements;\n\nexport const Elements = ({ group, scope, transform = defaultTransform }: ElementsProps) => {\n const { elements } = useEditorConfig();\n\n const groupElements = useMemo(() => {\n return elements.filter(byGroup(group)).filter(byScope(scope));\n }, [elements, group, scope]);\n\n return (\n <wb-editor-ui-elements data-scope={scope} data-group={group} class={\"wby-contents\"}>\n {transform(groupElements).map(element => (\n <wb-editor-ui-element\n key={element.name}\n data-name={element.name}\n class={\"wby-contents\"}\n >\n {element.element}\n </wb-editor-ui-element>\n ))}\n </wb-editor-ui-elements>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,eAAe;AA4BxB,MAAMC,WAAW,GAAGA,CAAA,KAAM,IAAI;AAE9B,MAAMC,OAAO,GAAIC,KAAc,IAAK;EAChC,OAAOA,KAAK,GAAIC,IAAmB,IAAKA,IAAI,CAACD,KAAK,KAAKA,KAAK,GAAGF,WAAW;AAC9E,CAAC;AACD,MAAMI,OAAO,GAAIC,KAAc,IAAK;EAChC,OAAOA,KAAK,GAAIF,IAAmB,IAAKA,IAAI,CAACE,KAAK,KAAKA,KAAK,GAAGL,WAAW;AAC9E,CAAC;AAED,MAAMM,gBAAgB,GAAIC,QAAyB,IAAKA,QAAQ;AAEhE,OAAO,MAAMC,QAAQ,GAAGA,CAAC;EAAEN,KAAK;EAAEG,KAAK;EAAEI,SAAS,GAAGH;AAAgC,CAAC,KAAK;EACvF,MAAM;IAAEC;EAAS,CAAC,GAAGR,eAAe,CAAC,CAAC;EAEtC,MAAMW,aAAa,GAAGZ,OAAO,CAAC,MAAM;IAChC,OAAOS,QAAQ,CAACI,MAAM,CAACV,OAAO,CAACC,KAAK,CAAC,CAAC,CAACS,MAAM,CAACP,OAAO,CAACC,KAAK,CAAC,CAAC;EACjE,CAAC,EAAE,CAACE,QAAQ,EAAEL,KAAK,EAAEG,KAAK,CAAC,CAAC;EAE5B,oBACIR,KAAA,CAAAe,aAAA;IAAuB,cAAYP,KAAM;IAAC,cAAYH,KAAM;IAACW,KAAK,EAAE;EAAe,GAC9EJ,SAAS,CAACC,aAAa,CAAC,CAACI,GAAG,CAACC,OAAO,iBACjClB,KAAA,CAAAe,aAAA;IACII,GAAG,EAAED,OAAO,CAACE,IAAK;IAClB,aAAWF,OAAO,CAACE,IAAK;IACxBJ,KAAK,EAAE;EAAe,GAErBE,OAAO,CAACA,OACS,CACzB,CACkB,CAAC;AAEhC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ApplyTheme: () => null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useWebsiteBuilderTheme } from "../../../components";
|
|
3
|
+
export const ApplyTheme = () => {
|
|
4
|
+
const {
|
|
5
|
+
theme
|
|
6
|
+
} = useWebsiteBuilderTheme();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!theme) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (theme.css) {
|
|
12
|
+
const existing = document.querySelector(`style[id="wb-editor-css"]`);
|
|
13
|
+
const style = document.createElement("style");
|
|
14
|
+
style.id = "wb-editor-css";
|
|
15
|
+
style.innerHTML = theme.css;
|
|
16
|
+
if (existing) {
|
|
17
|
+
existing.replaceWith(style);
|
|
18
|
+
} else {
|
|
19
|
+
document.head.appendChild(style);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (theme.cssVariables) {
|
|
23
|
+
const existing = document.querySelector(`style[id="wb-editor-css-variables"]`);
|
|
24
|
+
const style = document.createElement("style");
|
|
25
|
+
style.id = "wb-editor-css-variables";
|
|
26
|
+
style.innerHTML = `:root {
|
|
27
|
+
${Object.entries(theme.cssVariables).map(([key, value]) => `${key}: ${value}`).join("\n")}
|
|
28
|
+
`;
|
|
29
|
+
if (existing) {
|
|
30
|
+
existing.replaceWith(style);
|
|
31
|
+
} else {
|
|
32
|
+
document.head.appendChild(style);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (theme.fonts) {
|
|
36
|
+
theme.fonts.forEach(font => {
|
|
37
|
+
const existing = document.querySelector(`link[href="${font}"]`);
|
|
38
|
+
if (existing) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const link = document.createElement("link");
|
|
42
|
+
link.href = font;
|
|
43
|
+
link.rel = "stylesheet";
|
|
44
|
+
document.head.appendChild(link);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, [theme]);
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=ApplyTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useWebsiteBuilderTheme","ApplyTheme","theme","css","existing","document","querySelector","style","createElement","id","innerHTML","replaceWith","head","appendChild","cssVariables","Object","entries","map","key","value","join","fonts","forEach","font","link","href","rel"],"sources":["ApplyTheme.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useWebsiteBuilderTheme } from \"~/BaseEditor/components\";\n\nexport const ApplyTheme = () => {\n const { theme } = useWebsiteBuilderTheme();\n\n useEffect(() => {\n if (!theme) {\n return;\n }\n\n if (theme.css) {\n const existing = document.querySelector(`style[id=\"wb-editor-css\"]`);\n\n const style = document.createElement(\"style\");\n style.id = \"wb-editor-css\";\n style.innerHTML = theme.css;\n\n if (existing) {\n existing.replaceWith(style);\n } else {\n document.head.appendChild(style);\n }\n }\n\n if (theme.cssVariables) {\n const existing = document.querySelector(`style[id=\"wb-editor-css-variables\"]`);\n\n const style = document.createElement(\"style\");\n style.id = \"wb-editor-css-variables\";\n style.innerHTML = `:root {\n ${Object.entries(theme.cssVariables)\n .map(([key, value]) => `${key}: ${value}`)\n .join(\"\\n\")}\n `;\n\n if (existing) {\n existing.replaceWith(style);\n } else {\n document.head.appendChild(style);\n }\n }\n\n if (theme.fonts) {\n theme.fonts.forEach(font => {\n const existing = document.querySelector(`link[href=\"${font}\"]`);\n if (existing) {\n return;\n }\n\n const link = document.createElement(\"link\");\n link.href = font;\n link.rel = \"stylesheet\";\n document.head.appendChild(link);\n });\n }\n }, [theme]);\n\n return null;\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,sBAAsB;AAE/B,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAAM;EAC5B,MAAM;IAAEC;EAAM,CAAC,GAAGF,sBAAsB,CAAC,CAAC;EAE1CD,SAAS,CAAC,MAAM;IACZ,IAAI,CAACG,KAAK,EAAE;MACR;IACJ;IAEA,IAAIA,KAAK,CAACC,GAAG,EAAE;MACX,MAAMC,QAAQ,GAAGC,QAAQ,CAACC,aAAa,CAAC,2BAA2B,CAAC;MAEpE,MAAMC,KAAK,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;MAC7CD,KAAK,CAACE,EAAE,GAAG,eAAe;MAC1BF,KAAK,CAACG,SAAS,GAAGR,KAAK,CAACC,GAAG;MAE3B,IAAIC,QAAQ,EAAE;QACVA,QAAQ,CAACO,WAAW,CAACJ,KAAK,CAAC;MAC/B,CAAC,MAAM;QACHF,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACN,KAAK,CAAC;MACpC;IACJ;IAEA,IAAIL,KAAK,CAACY,YAAY,EAAE;MACpB,MAAMV,QAAQ,GAAGC,QAAQ,CAACC,aAAa,CAAC,qCAAqC,CAAC;MAE9E,MAAMC,KAAK,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;MAC7CD,KAAK,CAACE,EAAE,GAAG,yBAAyB;MACpCF,KAAK,CAACG,SAAS,GAAG;AAC9B,kBAAkBK,MAAM,CAACC,OAAO,CAACd,KAAK,CAACY,YAAY,CAAC,CAC/BG,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,GAAGD,GAAG,KAAKC,KAAK,EAAE,CAAC,CACzCC,IAAI,CAAC,IAAI,CAAC;AAC/B,aAAa;MAED,IAAIhB,QAAQ,EAAE;QACVA,QAAQ,CAACO,WAAW,CAACJ,KAAK,CAAC;MAC/B,CAAC,MAAM;QACHF,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACN,KAAK,CAAC;MACpC;IACJ;IAEA,IAAIL,KAAK,CAACmB,KAAK,EAAE;MACbnB,KAAK,CAACmB,KAAK,CAACC,OAAO,CAACC,IAAI,IAAI;QACxB,MAAMnB,QAAQ,GAAGC,QAAQ,CAACC,aAAa,CAAC,cAAciB,IAAI,IAAI,CAAC;QAC/D,IAAInB,QAAQ,EAAE;UACV;QACJ;QAEA,MAAMoB,IAAI,GAAGnB,QAAQ,CAACG,aAAa,CAAC,MAAM,CAAC;QAC3CgB,IAAI,CAACC,IAAI,GAAGF,IAAI;QAChBC,IAAI,CAACE,GAAG,GAAG,YAAY;QACvBrB,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACW,IAAI,CAAC;MACnC,CAAC,CAAC;IACN;EACJ,CAAC,EAAE,CAACtB,KAAK,CAAC,CAAC;EAEX,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@ import { Commands } from "../../..";
|
|
|
14
14
|
import { useSelectFromEditor } from "../../../hooks/useSelectFromEditor";
|
|
15
15
|
import { AwaitIframeUrl } from "./AwaitIframeUrl";
|
|
16
16
|
import { PreviewEvents } from "./PreviewEvents";
|
|
17
|
-
import {
|
|
17
|
+
import { ApplyTheme } from "./ApplyTheme";
|
|
18
18
|
export const Preview = () => {
|
|
19
19
|
const editor = useDocumentEditor();
|
|
20
20
|
const [iframeTimestamp, setIframeTimestamp] = useState(Date.now());
|
|
@@ -100,7 +100,7 @@ export const Preview = () => {
|
|
|
100
100
|
}, []);
|
|
101
101
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropZoneManagerProvider, {
|
|
102
102
|
dropzoneManager: dropzoneManager
|
|
103
|
-
}, /*#__PURE__*/React.createElement(
|
|
103
|
+
}, /*#__PURE__*/React.createElement(ApplyTheme, null), /*#__PURE__*/React.createElement(AddressBar, null), /*#__PURE__*/React.createElement(AwaitIframeUrl, null, ({
|
|
104
104
|
url
|
|
105
105
|
}) => /*#__PURE__*/React.createElement(Iframe, {
|
|
106
106
|
url: url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","useDocumentEditor","AddressBar","Iframe","HoverManager","DropZoneManager","DropZoneManagerProvider","Boxes","ScrollTracker","KeyboardShortcuts","ViewportManager","mouseTracker","Commands","useSelectFromEditor","AwaitIframeUrl","PreviewEvents","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","useDocumentEditor","AddressBar","Iframe","HoverManager","DropZoneManager","DropZoneManagerProvider","Boxes","ScrollTracker","KeyboardShortcuts","ViewportManager","mouseTracker","Commands","useSelectFromEditor","AwaitIframeUrl","PreviewEvents","ApplyTheme","Preview","editor","iframeTimestamp","setIframeTimestamp","Date","now","loadingPreview","state","scrollTracker","window","e","source","target","dataset","role","hoverManager","editorState","getEditorState","read","boxes","filter","box","id","viewportManager","previewEvents","dropzoneManager","updateEditor","offRefreshPreview","registerCommandHandler","RefreshPreview","preview","start","stop","destroy","setMousePositionFromDrag","setPosition","clientX","clientY","addEventListener","offHoverChange","onHoverChange","highlightedElement","removeEventListener","onConnected","messenger","createElement","Fragment","url","timestamp","showLoading"],"sources":["Preview.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { Messenger } from \"@webiny/website-builder-sdk\";\nimport { useDocumentEditor } from \"~/DocumentEditor\";\nimport { AddressBar } from \"./AddressBar\";\nimport { Iframe } from \"./Iframe\";\nimport { HoverManager } from \"./HoverManager\";\nimport { DropZoneManager } from \"./DropZoneManager\";\nimport { DropZoneManagerProvider } from \"./DropZoneManagerProvider\";\nimport { Boxes } from \"~/BaseEditor/hooks/Boxes\";\nimport { ScrollTracker } from \"~/BaseEditor/defaultConfig/Content/Preview/ScrollTracker\";\nimport { KeyboardShortcuts } from \"./KeyboardShortcuts\";\nimport { ViewportManager } from \"@webiny/website-builder-sdk\";\nimport { mouseTracker } from \"@webiny/website-builder-sdk\";\nimport { Commands } from \"~/BaseEditor\";\nimport { useSelectFromEditor } from \"~/BaseEditor/hooks/useSelectFromEditor\";\nimport { AwaitIframeUrl } from \"~/BaseEditor/defaultConfig/Content/Preview/AwaitIframeUrl\";\nimport { PreviewEvents } from \"~/BaseEditor/defaultConfig/Content/Preview/PreviewEvents\";\nimport { ApplyTheme } from \"./ApplyTheme\";\n\nexport const Preview = () => {\n const editor = useDocumentEditor();\n const [iframeTimestamp, setIframeTimestamp] = useState(Date.now());\n\n const loadingPreview = useSelectFromEditor(state => state.loadingPreview);\n\n const scrollTracker = useMemo(() => {\n return new ScrollTracker(window, e => {\n const source = e.target as HTMLDivElement | null;\n\n if (!source) {\n return false;\n }\n\n return source.dataset.role === \"element-overlay\";\n });\n }, []);\n\n const hoverManager = useMemo(() => {\n return new HoverManager(mouseTracker, () => {\n const editorState = editor.getEditorState().read();\n return new Boxes(editorState.boxes.editor).filter(box => box.id !== \"root\");\n });\n }, [mouseTracker]);\n\n const viewportManager = useMemo(() => {\n return new ViewportManager();\n }, []);\n\n const previewEvents = useMemo(() => {\n return new PreviewEvents(editor, scrollTracker);\n }, []);\n\n const dropzoneManager = useMemo(() => {\n return new DropZoneManager(mouseTracker);\n }, [mouseTracker]);\n\n useEffect(() => {\n // On first mount, show loading.\n editor.updateEditor(state => {\n state.loadingPreview = true;\n });\n\n const offRefreshPreview = editor.registerCommandHandler(Commands.RefreshPreview, () => {\n setIframeTimestamp(Date.now());\n\n editor.updateEditor(state => {\n // Unset boxes to remove old overlays.\n state.loadingPreview = true;\n state.boxes = {\n preview: {},\n editor: {}\n };\n });\n });\n\n return () => {\n offRefreshPreview();\n };\n }, []);\n\n // Start various trackers\n useEffect(() => {\n scrollTracker.start();\n mouseTracker.start();\n dropzoneManager.start();\n\n return () => {\n dropzoneManager.stop();\n mouseTracker.stop();\n scrollTracker.destroy();\n viewportManager.destroy();\n hoverManager.destroy();\n previewEvents.destroy();\n };\n }, [dropzoneManager, scrollTracker, mouseTracker]);\n\n // Update mouse position while dragging\n useEffect(() => {\n const setMousePositionFromDrag = (e: DragEvent) => {\n mouseTracker.setPosition(e.clientX, e.clientY);\n };\n\n window.addEventListener(\"dragover\", setMousePositionFromDrag);\n\n const offHoverChange = hoverManager.onHoverChange(id => {\n editor.updateEditor(state => {\n state.highlightedElement = id;\n });\n });\n\n return () => {\n window.removeEventListener(\"dragover\", setMousePositionFromDrag);\n offHoverChange();\n };\n }, []);\n\n const onConnected = useCallback((messenger: Messenger) => {\n previewEvents.onConnected(messenger);\n }, []);\n\n return (\n <>\n <DropZoneManagerProvider dropzoneManager={dropzoneManager}>\n <ApplyTheme />\n <AddressBar />\n <AwaitIframeUrl>\n {({ url }) => (\n <Iframe\n url={url}\n timestamp={iframeTimestamp}\n viewportManager={viewportManager}\n onConnected={onConnected}\n showLoading={loadingPreview}\n />\n )}\n </AwaitIframeUrl>\n </DropZoneManagerProvider>\n <KeyboardShortcuts />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,E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C,UAAU,MAAE,CAAC,eACdpB,KAAA,CAAAkE,aAAA,CAAC5D,UAAU,MAAE,CAAC,eACdN,KAAA,CAAAkE,aAAA,CAAChD,cAAc,QACV,CAAC;IAAEkD;EAAI,CAAC,kBACLpE,KAAA,CAAAkE,aAAA,CAAC3D,MAAM;IACH6D,GAAG,EAAEA,GAAI;IACTC,SAAS,EAAE9C,eAAgB;IAC3BqB,eAAe,EAAEA,eAAgB;IACjCoB,WAAW,EAAEA,WAAY;IACzBM,WAAW,EAAE3C;EAAe,CAC/B,CAEO,CACK,CAAC,eAC1B3B,KAAA,CAAAkE,aAAA,CAACrD,iBAAiB,MAAE,CACtB,CAAC;AAEX,CAAC","ignoreList":[]}
|
package/BaseEditor/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { DefaultEditorConfig } from "./defaultConfig/DefaultEditorConfig";
|
|
2
2
|
export * from "./config";
|
|
3
3
|
export * from "./commands";
|
|
4
|
-
export { ElementInputRendererProps } from "./config/ElementInput";
|
|
4
|
+
export type { ElementInputRendererProps } from "./config/ElementInput";
|
package/BaseEditor/index.js
CHANGED
package/BaseEditor/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DefaultEditorConfig"
|
|
1
|
+
{"version":3,"names":["DefaultEditorConfig"],"sources":["index.tsx"],"sourcesContent":["export { DefaultEditorConfig } from \"./defaultConfig/DefaultEditorConfig\";\nexport * from \"./config\";\nexport * from \"./commands\";\nexport type { ElementInputRendererProps } from \"./config/ElementInput\";\n"],"mappings":"AAAA,SAASA,mBAAmB;AAC5B;AACA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AcoConfig, FolderActionConfig } from "@webiny/app-aco";
|
|
3
|
-
export { FolderActionConfig };
|
|
2
|
+
import { AcoConfig, type FolderActionConfig } from "@webiny/app-aco";
|
|
3
|
+
export type { FolderActionConfig };
|
|
4
4
|
type FolderActionProps = React.ComponentProps<typeof AcoConfig.Folder.Action>;
|
|
5
5
|
export declare const FolderAction: ((props: FolderActionProps) => React.JSX.Element) & {
|
|
6
6
|
OptionsMenuItem: (props: import("@webiny/app-admin").OptionsMenuItemProps) => React.JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AcoConfig
|
|
2
|
+
import { AcoConfig } from "@webiny/app-aco";
|
|
3
3
|
const {
|
|
4
4
|
Folder
|
|
5
5
|
} = AcoConfig;
|
|
6
|
-
export { FolderActionConfig };
|
|
7
6
|
const BaseFolderAction = props => {
|
|
8
7
|
return /*#__PURE__*/React.createElement(AcoConfig, null, /*#__PURE__*/React.createElement(Folder.Action, props));
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","AcoConfig","
|
|
1
|
+
{"version":3,"names":["React","AcoConfig","Folder","BaseFolderAction","props","createElement","Action","FolderAction","Object","assign","OptionsMenuItem"],"sources":["FolderAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type FolderActionConfig } from \"@webiny/app-aco\";\n\nconst { Folder } = AcoConfig;\n\nexport type { FolderActionConfig };\n\ntype FolderActionProps = React.ComponentProps<typeof AcoConfig.Folder.Action>;\n\nconst BaseFolderAction = (props: FolderActionProps) => {\n return (\n <AcoConfig>\n <Folder.Action {...props} />\n </AcoConfig>\n );\n};\n\nexport const FolderAction = Object.assign(BaseFolderAction, {\n OptionsMenuItem: Folder.Action.OptionsMenuItem\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAiC,iBAAiB;AAEpE,MAAM;EAAEC;AAAO,CAAC,GAAGD,SAAS;AAM5B,MAAME,gBAAgB,GAAIC,KAAwB,IAAK;EACnD,oBACIJ,KAAA,CAAAK,aAAA,CAACJ,SAAS,qBACND,KAAA,CAAAK,aAAA,CAACH,MAAM,CAACI,MAAM,EAAKF,KAAQ,CACpB,CAAC;AAEpB,CAAC;AAED,OAAO,MAAMG,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACN,gBAAgB,EAAE;EACxDO,eAAe,EAAER,MAAM,CAACI,MAAM,CAACI;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AcoConfig, RecordActionConfig } from "@webiny/app-aco";
|
|
3
|
-
export { RecordActionConfig as PageActionConfig };
|
|
2
|
+
import { AcoConfig, type RecordActionConfig } from "@webiny/app-aco";
|
|
3
|
+
export type { RecordActionConfig as PageActionConfig };
|
|
4
4
|
type PageActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;
|
|
5
5
|
export declare const PageAction: ((props: PageActionProps) => React.JSX.Element) & {
|
|
6
6
|
OptionsMenuItem: (props: import("@webiny/app-admin").OptionsMenuItemProps) => React.JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AcoConfig
|
|
2
|
+
import { AcoConfig } from "@webiny/app-aco";
|
|
3
3
|
const {
|
|
4
4
|
Record
|
|
5
5
|
} = AcoConfig;
|
|
6
|
-
export { RecordActionConfig as PageActionConfig };
|
|
7
6
|
const BasePageAction = props => {
|
|
8
7
|
return /*#__PURE__*/React.createElement(AcoConfig, null, /*#__PURE__*/React.createElement(Record.Action, props));
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","AcoConfig","
|
|
1
|
+
{"version":3,"names":["React","AcoConfig","Record","BasePageAction","props","createElement","Action","PageAction","Object","assign","OptionsMenuItem","OptionsMenuLink"],"sources":["PageAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type RecordActionConfig } from \"@webiny/app-aco\";\n\nconst { Record } = AcoConfig;\n\nexport type { RecordActionConfig as PageActionConfig };\n\ntype PageActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;\n\nconst BasePageAction = (props: PageActionProps) => {\n return (\n <AcoConfig>\n <Record.Action {...props} />\n </AcoConfig>\n );\n};\n\nexport const PageAction = Object.assign(BasePageAction, {\n OptionsMenuItem: Record.Action.OptionsMenuItem,\n OptionsMenuLink: Record.Action.OptionsMenuLink\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAiC,iBAAiB;AAEpE,MAAM;EAAEC;AAAO,CAAC,GAAGD,SAAS;AAM5B,MAAME,cAAc,GAAIC,KAAsB,IAAK;EAC/C,oBACIJ,KAAA,CAAAK,aAAA,CAACJ,SAAS,qBACND,KAAA,CAAAK,aAAA,CAACH,MAAM,CAACI,MAAM,EAAKF,KAAQ,CACpB,CAAC;AAEpB,CAAC;AAED,OAAO,MAAMG,UAAU,GAAGC,MAAM,CAACC,MAAM,CAACN,cAAc,EAAE;EACpDO,eAAe,EAAER,MAAM,CAACI,MAAM,CAACI,eAAe;EAC9CC,eAAe,EAAET,MAAM,CAACI,MAAM,CAACK;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AcoConfig, TableColumnConfig as ColumnConfig } from "@webiny/app-aco";
|
|
2
|
+
import { AcoConfig, type TableColumnConfig as ColumnConfig } from "@webiny/app-aco";
|
|
3
3
|
import type { DocumentDto } from "../../../../../modules/pages/PagesList/presenters/DocumentListMapper.js";
|
|
4
|
-
export { ColumnConfig };
|
|
4
|
+
export type { ColumnConfig };
|
|
5
5
|
type ColumnProps = React.ComponentProps<typeof AcoConfig.Table.Column>;
|
|
6
6
|
export declare const Column: ((props: ColumnProps) => React.JSX.Element) & {
|
|
7
7
|
original: (props: ColumnProps) => React.JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AcoConfig
|
|
2
|
+
import { AcoConfig } from "@webiny/app-aco";
|
|
3
3
|
import { makeDecoratable } from "@webiny/react-composition";
|
|
4
4
|
const {
|
|
5
5
|
Table
|
|
6
6
|
} = AcoConfig;
|
|
7
|
-
export { ColumnConfig };
|
|
8
7
|
const BaseColumnComponent = props => {
|
|
9
8
|
return /*#__PURE__*/React.createElement(AcoConfig, null, /*#__PURE__*/React.createElement(Table.Column, props));
|
|
10
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","AcoConfig","
|
|
1
|
+
{"version":3,"names":["React","AcoConfig","makeDecoratable","Table","BaseColumnComponent","props","createElement","Column","BaseColumn","Object","assign","useTableRow","createUseTableRow","isFolderRow"],"sources":["Column.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type TableColumnConfig as ColumnConfig } from \"@webiny/app-aco\";\nimport type { DocumentDto } from \"~/modules/pages/PagesList/presenters/DocumentListMapper.js\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\n\nconst { Table } = AcoConfig;\n\nexport type { ColumnConfig };\n\ntype ColumnProps = React.ComponentProps<typeof AcoConfig.Table.Column>;\n\nconst BaseColumnComponent = (props: ColumnProps) => {\n return (\n <AcoConfig>\n <Table.Column {...props} />\n </AcoConfig>\n );\n};\n\nconst BaseColumn = makeDecoratable(\"Column\", BaseColumnComponent);\n\nexport const Column = Object.assign(BaseColumn, {\n useTableRow: Table.Column.createUseTableRow<DocumentDto>(),\n isFolderRow: Table.Column.isFolderRow\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAgD,iBAAiB;AAEnF,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,MAAM;EAAEC;AAAM,CAAC,GAAGF,SAAS;AAM3B,MAAMG,mBAAmB,GAAIC,KAAkB,IAAK;EAChD,oBACIL,KAAA,CAAAM,aAAA,CAACL,SAAS,qBACND,KAAA,CAAAM,aAAA,CAACH,KAAK,CAACI,MAAM,EAAKF,KAAQ,CACnB,CAAC;AAEpB,CAAC;AAED,MAAMG,UAAU,GAAGN,eAAe,CAAC,QAAQ,EAAEE,mBAAmB,CAAC;AAEjE,OAAO,MAAMG,MAAM,GAAGE,MAAM,CAACC,MAAM,CAACF,UAAU,EAAE;EAC5CG,WAAW,EAAER,KAAK,CAACI,MAAM,CAACK,iBAAiB,CAAc,CAAC;EAC1DC,WAAW,EAAEV,KAAK,CAACI,MAAM,CAACM;AAC9B,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-website-builder",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.f9f12f52a0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,30 +21,30 @@
|
|
|
21
21
|
"@monaco-editor/react": "4.7.0",
|
|
22
22
|
"@svgr/webpack": "6.5.1",
|
|
23
23
|
"@types/react": "18.2.79",
|
|
24
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
25
|
-
"@webiny/app": "0.0.0-unstable.
|
|
26
|
-
"@webiny/app-aco": "0.0.0-unstable.
|
|
27
|
-
"@webiny/app-admin": "0.0.0-unstable.
|
|
28
|
-
"@webiny/app-headless-cms-common": "0.0.0-unstable.
|
|
29
|
-
"@webiny/app-i18n": "0.0.0-unstable.
|
|
30
|
-
"@webiny/app-security": "0.0.0-unstable.
|
|
31
|
-
"@webiny/app-tenancy": "0.0.0-unstable.
|
|
32
|
-
"@webiny/app-utils": "0.0.0-unstable.
|
|
33
|
-
"@webiny/error": "0.0.0-unstable.
|
|
34
|
-
"@webiny/form": "0.0.0-unstable.
|
|
35
|
-
"@webiny/icons": "0.0.0-unstable.
|
|
36
|
-
"@webiny/lexical-converter": "0.0.0-unstable.
|
|
37
|
-
"@webiny/lexical-editor": "0.0.0-unstable.
|
|
38
|
-
"@webiny/lexical-nodes": "0.0.0-unstable.
|
|
39
|
-
"@webiny/lexical-theme": "0.0.0-unstable.
|
|
40
|
-
"@webiny/react-composition": "0.0.0-unstable.
|
|
41
|
-
"@webiny/react-properties": "0.0.0-unstable.
|
|
42
|
-
"@webiny/react-router": "0.0.0-unstable.
|
|
43
|
-
"@webiny/theme": "0.0.0-unstable.
|
|
44
|
-
"@webiny/ui": "0.0.0-unstable.
|
|
45
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
46
|
-
"@webiny/validation": "0.0.0-unstable.
|
|
47
|
-
"@webiny/website-builder-sdk": "0.0.0-unstable.
|
|
24
|
+
"@webiny/admin-ui": "0.0.0-unstable.f9f12f52a0",
|
|
25
|
+
"@webiny/app": "0.0.0-unstable.f9f12f52a0",
|
|
26
|
+
"@webiny/app-aco": "0.0.0-unstable.f9f12f52a0",
|
|
27
|
+
"@webiny/app-admin": "0.0.0-unstable.f9f12f52a0",
|
|
28
|
+
"@webiny/app-headless-cms-common": "0.0.0-unstable.f9f12f52a0",
|
|
29
|
+
"@webiny/app-i18n": "0.0.0-unstable.f9f12f52a0",
|
|
30
|
+
"@webiny/app-security": "0.0.0-unstable.f9f12f52a0",
|
|
31
|
+
"@webiny/app-tenancy": "0.0.0-unstable.f9f12f52a0",
|
|
32
|
+
"@webiny/app-utils": "0.0.0-unstable.f9f12f52a0",
|
|
33
|
+
"@webiny/error": "0.0.0-unstable.f9f12f52a0",
|
|
34
|
+
"@webiny/form": "0.0.0-unstable.f9f12f52a0",
|
|
35
|
+
"@webiny/icons": "0.0.0-unstable.f9f12f52a0",
|
|
36
|
+
"@webiny/lexical-converter": "0.0.0-unstable.f9f12f52a0",
|
|
37
|
+
"@webiny/lexical-editor": "0.0.0-unstable.f9f12f52a0",
|
|
38
|
+
"@webiny/lexical-nodes": "0.0.0-unstable.f9f12f52a0",
|
|
39
|
+
"@webiny/lexical-theme": "0.0.0-unstable.f9f12f52a0",
|
|
40
|
+
"@webiny/react-composition": "0.0.0-unstable.f9f12f52a0",
|
|
41
|
+
"@webiny/react-properties": "0.0.0-unstable.f9f12f52a0",
|
|
42
|
+
"@webiny/react-router": "0.0.0-unstable.f9f12f52a0",
|
|
43
|
+
"@webiny/theme": "0.0.0-unstable.f9f12f52a0",
|
|
44
|
+
"@webiny/ui": "0.0.0-unstable.f9f12f52a0",
|
|
45
|
+
"@webiny/utils": "0.0.0-unstable.f9f12f52a0",
|
|
46
|
+
"@webiny/validation": "0.0.0-unstable.f9f12f52a0",
|
|
47
|
+
"@webiny/website-builder-sdk": "0.0.0-unstable.f9f12f52a0",
|
|
48
48
|
"apollo-cache": "1.3.5",
|
|
49
49
|
"apollo-client": "2.6.10",
|
|
50
50
|
"apollo-link": "1.2.14",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@types/react-virtualized": "9.22.0",
|
|
81
81
|
"@types/resize-observer-browser": "0.1.7",
|
|
82
82
|
"@types/store": "2.0.2",
|
|
83
|
-
"@webiny/cli": "0.0.0-unstable.
|
|
84
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
83
|
+
"@webiny/cli": "0.0.0-unstable.f9f12f52a0",
|
|
84
|
+
"@webiny/project-utils": "0.0.0-unstable.f9f12f52a0",
|
|
85
85
|
"execa": "5.1.1",
|
|
86
86
|
"rimraf": "6.0.1",
|
|
87
87
|
"typescript": "5.3.3"
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
]
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "f9f12f52a0e2f8e4a2987aa71b4104f70f5d68c8"
|
|
105
105
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LoadThemeStylesheet: () => null;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { useWebsiteBuilderTheme } from "../../../components";
|
|
3
|
-
import { usePreviewDomain } from "./usePreviewDomain";
|
|
4
|
-
export const LoadThemeStylesheet = () => {
|
|
5
|
-
const {
|
|
6
|
-
theme
|
|
7
|
-
} = useWebsiteBuilderTheme();
|
|
8
|
-
const {
|
|
9
|
-
previewDomain
|
|
10
|
-
} = usePreviewDomain();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (theme && theme.themeUrl) {
|
|
13
|
-
const url = theme.themeUrl.startsWith("/") ? `${previewDomain}${theme.themeUrl}` : theme.themeUrl;
|
|
14
|
-
|
|
15
|
-
// Remove existing stylesheet with the same href
|
|
16
|
-
const existing = document.querySelector(`link[rel="stylesheet"][href="${url}"]`);
|
|
17
|
-
if (existing) {
|
|
18
|
-
existing.remove();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Create a new link element
|
|
22
|
-
const link = document.createElement("link");
|
|
23
|
-
link.rel = "stylesheet";
|
|
24
|
-
link.href = url;
|
|
25
|
-
document.head.appendChild(link);
|
|
26
|
-
}
|
|
27
|
-
}, [theme]);
|
|
28
|
-
return null;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=LoadThemeStylesheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useWebsiteBuilderTheme","usePreviewDomain","LoadThemeStylesheet","theme","previewDomain","themeUrl","url","startsWith","existing","document","querySelector","remove","link","createElement","rel","href","head","appendChild"],"sources":["LoadThemeStylesheet.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useWebsiteBuilderTheme } from \"~/BaseEditor/components\";\nimport { usePreviewDomain } from \"~/BaseEditor/defaultConfig/Content/Preview/usePreviewDomain\";\n\nexport const LoadThemeStylesheet = () => {\n const { theme } = useWebsiteBuilderTheme();\n const { previewDomain } = usePreviewDomain();\n\n useEffect(() => {\n if (theme && theme.themeUrl) {\n const url = theme.themeUrl.startsWith(\"/\")\n ? `${previewDomain}${theme.themeUrl}`\n : theme.themeUrl;\n\n // Remove existing stylesheet with the same href\n const existing = document.querySelector(`link[rel=\"stylesheet\"][href=\"${url}\"]`);\n if (existing) {\n existing.remove();\n }\n\n // Create a new link element\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = url;\n\n document.head.appendChild(link);\n }\n }, [theme]);\n\n return null;\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,sBAAsB;AAC/B,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACrC,MAAM;IAAEC;EAAM,CAAC,GAAGH,sBAAsB,CAAC,CAAC;EAC1C,MAAM;IAAEI;EAAc,CAAC,GAAGH,gBAAgB,CAAC,CAAC;EAE5CF,SAAS,CAAC,MAAM;IACZ,IAAII,KAAK,IAAIA,KAAK,CAACE,QAAQ,EAAE;MACzB,MAAMC,GAAG,GAAGH,KAAK,CAACE,QAAQ,CAACE,UAAU,CAAC,GAAG,CAAC,GACpC,GAAGH,aAAa,GAAGD,KAAK,CAACE,QAAQ,EAAE,GACnCF,KAAK,CAACE,QAAQ;;MAEpB;MACA,MAAMG,QAAQ,GAAGC,QAAQ,CAACC,aAAa,CAAC,gCAAgCJ,GAAG,IAAI,CAAC;MAChF,IAAIE,QAAQ,EAAE;QACVA,QAAQ,CAACG,MAAM,CAAC,CAAC;MACrB;;MAEA;MACA,MAAMC,IAAI,GAAGH,QAAQ,CAACI,aAAa,CAAC,MAAM,CAAC;MAC3CD,IAAI,CAACE,GAAG,GAAG,YAAY;MACvBF,IAAI,CAACG,IAAI,GAAGT,GAAG;MAEfG,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACL,IAAI,CAAC;IACnC;EACJ,CAAC,EAAE,CAACT,KAAK,CAAC,CAAC;EAEX,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
|