@alpaca-headless/alpaca-headless-nextjs 0.0.3 → 1.0.13
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/dist/cjs/alpacaContext.js +7 -6
- package/dist/cjs/components/Image.js +36 -0
- package/dist/cjs/components/Link.js +22 -0
- package/dist/cjs/components/Picture.js +119 -0
- package/dist/cjs/components/PictureEditor.js +43 -0
- package/dist/cjs/components/Placeholder.js +43 -5
- package/dist/cjs/components/RichText.js +44 -0
- package/dist/cjs/components/RichTextEditor.js +82 -0
- package/dist/cjs/components/Slot.js +8 -0
- package/dist/cjs/components/Text.js +24 -4
- package/dist/cjs/components/TextEditor.js +68 -0
- package/dist/cjs/components/Translate.js +14 -0
- package/dist/cjs/components/index.js +5 -0
- package/dist/cjs/editor/AiTerminal.js +150 -0
- package/dist/cjs/editor/ComponentInfo.js +14 -0
- package/dist/cjs/editor/ComponentPalette.js +78 -0
- package/dist/cjs/editor/ComponentTree.js +200 -0
- package/dist/cjs/editor/ContentTree.js +120 -0
- package/dist/cjs/editor/Debug.js +16 -0
- package/dist/cjs/editor/DictionaryEditor.js +35 -0
- package/dist/cjs/editor/EditFrame.js +61 -0
- package/dist/cjs/editor/EditHistory.js +30 -0
- package/dist/cjs/editor/Editor.js +27 -0
- package/dist/cjs/editor/EditorClient.js +457 -0
- package/dist/cjs/editor/EditorClientHost.js +37 -0
- package/dist/cjs/editor/FieldList.js +59 -0
- package/dist/cjs/editor/GraphQL.js +90 -0
- package/dist/cjs/editor/LanguageSelector.js +21 -0
- package/dist/cjs/editor/MediaSelector.js +61 -0
- package/dist/cjs/editor/PageInfo.js +12 -0
- package/dist/cjs/editor/PlaceholderDropZone.js +54 -0
- package/dist/cjs/editor/PlaceholderDropZoneHost.js +37 -0
- package/dist/cjs/editor/Terminal.js +51 -0
- package/dist/cjs/editor/TranslateEditor.js +25 -0
- package/dist/cjs/editor/VersionSelector.js +21 -0
- package/dist/cjs/editor/componentTreeHelper.js +18 -0
- package/dist/cjs/editor/contentService.js +38 -0
- package/dist/cjs/editor/editContext.js +35 -0
- package/dist/cjs/editor/editService.js +150 -0
- package/dist/cjs/editor/fieldTypes/RichTextEditor.js +19 -0
- package/dist/cjs/editor/fieldTypes/SingleLineText.js +17 -0
- package/dist/cjs/editor/index.js +18 -0
- package/dist/cjs/graphQLTypes.js +2 -0
- package/dist/cjs/index.js +17 -0
- package/dist/cjs/loadRouteData.js +102 -38
- package/dist/cjs/mediaProtection.js +56 -0
- package/dist/editor.css +120 -0
- package/dist/esm/alpacaContext.js +6 -4
- package/dist/esm/components/Image.js +32 -0
- package/dist/esm/components/Link.js +18 -0
- package/dist/esm/components/Picture.js +115 -0
- package/dist/esm/components/PictureEditor.js +39 -0
- package/dist/esm/components/Placeholder.js +41 -6
- package/dist/esm/components/RichText.js +37 -0
- package/dist/esm/components/RichTextEditor.js +55 -0
- package/dist/esm/components/Slot.js +5 -0
- package/dist/esm/components/Text.js +24 -4
- package/dist/esm/components/TextEditor.js +41 -0
- package/dist/esm/components/Translate.js +10 -0
- package/dist/esm/components/index.js +5 -0
- package/dist/esm/editor/AiTerminal.js +146 -0
- package/dist/esm/editor/ComponentInfo.js +10 -0
- package/dist/esm/editor/ComponentPalette.js +71 -0
- package/dist/esm/editor/ComponentTree.js +196 -0
- package/dist/esm/editor/ContentTree.js +117 -0
- package/dist/esm/editor/Debug.js +9 -0
- package/dist/esm/editor/DictionaryEditor.js +31 -0
- package/dist/esm/editor/EditFrame.js +57 -0
- package/dist/esm/editor/EditHistory.js +26 -0
- package/dist/esm/editor/Editor.js +23 -0
- package/dist/esm/editor/EditorClient.js +450 -0
- package/dist/esm/editor/EditorClientHost.js +7 -0
- package/dist/esm/editor/FieldList.js +55 -0
- package/dist/esm/editor/GraphQL.js +83 -0
- package/dist/esm/editor/LanguageSelector.js +17 -0
- package/dist/esm/editor/MediaSelector.js +54 -0
- package/dist/esm/editor/PageInfo.js +8 -0
- package/dist/esm/editor/PlaceholderDropZone.js +50 -0
- package/dist/esm/editor/PlaceholderDropZoneHost.js +7 -0
- package/dist/esm/editor/Terminal.js +47 -0
- package/dist/esm/editor/TranslateEditor.js +21 -0
- package/dist/esm/editor/VersionSelector.js +17 -0
- package/dist/esm/editor/componentTreeHelper.js +14 -0
- package/dist/esm/editor/contentService.js +31 -0
- package/dist/esm/editor/editContext.js +5 -0
- package/dist/esm/editor/editService.js +139 -0
- package/dist/esm/editor/fieldTypes/RichTextEditor.js +15 -0
- package/dist/esm/editor/fieldTypes/SingleLineText.js +13 -0
- package/dist/esm/editor/index.js +2 -0
- package/dist/esm/graphQLTypes.js +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/loadRouteData.js +102 -38
- package/dist/esm/mediaProtection.js +49 -0
- package/next-env.d.ts +5 -5
- package/package.json +51 -39
- package/types/alpacaContext.d.ts +20 -7
- package/types/components/Image.d.ts +10 -0
- package/types/components/Link.d.ts +6 -0
- package/types/components/Picture.d.ts +20 -0
- package/types/components/PictureEditor.d.ts +3 -0
- package/types/components/RichText.d.ts +7 -0
- package/types/components/RichTextEditor.d.ts +296 -0
- package/types/components/Slot.d.ts +4 -0
- package/types/components/Text.d.ts +3 -2
- package/types/components/TextEditor.d.ts +296 -0
- package/types/components/Translate.d.ts +3 -0
- package/types/components/index.d.ts +5 -0
- package/types/editor/AiTerminal.d.ts +4 -0
- package/types/editor/ComponentInfo.d.ts +4 -0
- package/types/editor/ComponentPalette.d.ts +7 -0
- package/types/editor/ComponentTree.d.ts +5 -0
- package/types/editor/ContentTree.d.ts +13 -0
- package/types/editor/Debug.d.ts +6 -0
- package/types/editor/DictionaryEditor.d.ts +3 -0
- package/types/editor/EditFrame.d.ts +6 -0
- package/types/editor/EditHistory.d.ts +4 -0
- package/types/editor/Editor.d.ts +6 -0
- package/types/editor/EditorClient.d.ts +9 -0
- package/types/editor/EditorClientHost.d.ts +8 -0
- package/types/editor/FieldList.d.ts +4 -0
- package/types/editor/GraphQL.d.ts +5 -0
- package/types/editor/LanguageSelector.d.ts +5 -0
- package/types/editor/MediaSelector.d.ts +5 -0
- package/types/editor/PageInfo.d.ts +4 -0
- package/types/editor/PlaceholderDropZone.d.ts +6 -0
- package/types/editor/PlaceholderDropZoneHost.d.ts +6 -0
- package/types/editor/Terminal.d.ts +4 -0
- package/types/editor/TranslateEditor.d.ts +3 -0
- package/types/editor/VersionSelector.d.ts +5 -0
- package/types/editor/componentTreeHelper.d.ts +2 -0
- package/types/editor/contentService.d.ts +14 -0
- package/types/editor/editContext.d.ts +81 -0
- package/types/editor/editService.d.ts +12 -0
- package/types/editor/fieldTypes/RichTextEditor.d.ts +4 -0
- package/types/editor/fieldTypes/SingleLineText.d.ts +4 -0
- package/types/editor/index.d.ts +2 -0
- package/types/fieldTypes.d.ts +63 -1
- package/types/graphQLTypes.d.ts +24 -0
- package/types/index.d.ts +4 -0
- package/types/layoutData.d.ts +56 -1
- package/types/loadRouteData.d.ts +34 -2
- package/types/mediaProtection.d.ts +2 -0
- package/types/AlpacaHeadless.d.ts +0 -37
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useAlpacaContext = void 0;
|
|
4
4
|
function useAlpacaContext() {
|
|
5
|
-
|
|
5
|
+
let context = globalThis.alpacaContext;
|
|
6
|
+
if (!context) {
|
|
7
|
+
context = {};
|
|
8
|
+
globalThis.alpacaContext = context;
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
6
11
|
}
|
|
7
12
|
exports.useAlpacaContext = useAlpacaContext;
|
|
8
|
-
function setAlpacaContext(context) {
|
|
9
|
-
globalThis.alpacaContext = context;
|
|
10
|
-
}
|
|
11
|
-
exports.setAlpacaContext = setAlpacaContext;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Image = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
// const addClassName = (otherAttrs: { [key: string]: unknown }): void => {
|
|
17
|
+
// if (otherAttrs.class) {
|
|
18
|
+
// // if any classes are defined properly already
|
|
19
|
+
// if (otherAttrs.className) {
|
|
20
|
+
// let className: string = otherAttrs.className as string;
|
|
21
|
+
// className += ` ${otherAttrs.class}`;
|
|
22
|
+
// otherAttrs.className = className;
|
|
23
|
+
// } else {
|
|
24
|
+
// otherAttrs.className = otherAttrs.class;
|
|
25
|
+
// }
|
|
26
|
+
// delete otherAttrs.class;
|
|
27
|
+
// }
|
|
28
|
+
// };
|
|
29
|
+
const Image = (_a) => {
|
|
30
|
+
var { field } = _a, otherProps = __rest(_a, ["field"]);
|
|
31
|
+
if (!field)
|
|
32
|
+
return;
|
|
33
|
+
const attrs = Object.assign(Object.assign({}, field.value), otherProps);
|
|
34
|
+
return (0, jsx_runtime_1.jsx)("img", Object.assign({}, attrs, { alt: "" }));
|
|
35
|
+
};
|
|
36
|
+
exports.Image = Image;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Link = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
function Link(_a) {
|
|
17
|
+
var { field, children } = _a, props = __rest(_a, ["field", "children"]);
|
|
18
|
+
if (!field)
|
|
19
|
+
return;
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: field.value.url }, props, { children: children })));
|
|
21
|
+
}
|
|
22
|
+
exports.Link = Link;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Picture = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const mediaProtection_1 = require("../mediaProtection");
|
|
17
|
+
const __1 = require("..");
|
|
18
|
+
const PictureEditor_1 = require("./PictureEditor");
|
|
19
|
+
// const addClassName = (otherAttrs: { [key: string]: unknown }): void => {
|
|
20
|
+
// if (otherAttrs.class) {
|
|
21
|
+
// // if any classes are defined properly already
|
|
22
|
+
// if (otherAttrs.className) {
|
|
23
|
+
// let className: string = otherAttrs.className as string;
|
|
24
|
+
// className += ` ${otherAttrs.class}`;
|
|
25
|
+
// otherAttrs.className = className;
|
|
26
|
+
// } else {
|
|
27
|
+
// otherAttrs.className = otherAttrs.class;
|
|
28
|
+
// }
|
|
29
|
+
// delete otherAttrs.class;
|
|
30
|
+
// }
|
|
31
|
+
// };
|
|
32
|
+
const Picture = (_a) => {
|
|
33
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
34
|
+
var { field, imageParams, sources, defaultVariant, renderJsonLinkedData } = _a, otherProps = __rest(_a, ["field", "imageParams", "sources", "defaultVariant", "renderJsonLinkedData"]);
|
|
35
|
+
if (!field)
|
|
36
|
+
return null;
|
|
37
|
+
if ((_b = (0, __1.useAlpacaContext)().pageContext) === null || _b === void 0 ? void 0 : _b.pageEditing)
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(PictureEditor_1.PictureEditor, Object.assign({ field: field }, otherProps));
|
|
39
|
+
const variants = (_c = field.value) === null || _c === void 0 ? void 0 : _c.variants;
|
|
40
|
+
const img = (_e = (_d = field.value) === null || _d === void 0 ? void 0 : _d.variants.find((x) => x.name.toUpperCase() == (defaultVariant === null || defaultVariant === void 0 ? void 0 : defaultVariant.toUpperCase()))) !== null && _e !== void 0 ? _e : (_f = field.value) === null || _f === void 0 ? void 0 : _f.variants[0];
|
|
41
|
+
const attrs = Object.assign({ src: img === null || img === void 0 ? void 0 : img.src }, otherProps);
|
|
42
|
+
const video = img === null || img === void 0 ? void 0 : img.videoUrl;
|
|
43
|
+
const videoAttr = Object.assign({ src: video }, otherProps);
|
|
44
|
+
if (!(sources === null || sources === void 0 ? void 0 : sources.length)) {
|
|
45
|
+
return (0, jsx_runtime_1.jsx)("img", Object.assign({}, attrs, { alt: (_g = field.value) === null || _g === void 0 ? void 0 : _g.alt }));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("picture", { children: [sources === null || sources === void 0 ? void 0 : sources.map((source) => {
|
|
49
|
+
const variant = variants === null || variants === void 0 ? void 0 : variants.find((v) => v.name.toLowerCase() == source.variant.toLowerCase());
|
|
50
|
+
if (!(variant === null || variant === void 0 ? void 0 : variant.src))
|
|
51
|
+
return;
|
|
52
|
+
let srcSet = (0, mediaProtection_1.hashImageUrl)(variant.src);
|
|
53
|
+
const getScaledImage = (variant, width) => {
|
|
54
|
+
if (width > variant.width)
|
|
55
|
+
return { src: variant.src, width: 0 };
|
|
56
|
+
else
|
|
57
|
+
return {
|
|
58
|
+
src: variant.src +
|
|
59
|
+
`${variant.src.includes("?") ? "&" : "?"}mw=` +
|
|
60
|
+
width,
|
|
61
|
+
width: width,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
if (source.widths && source.widths.length) {
|
|
65
|
+
let scaledImages = source.widths.map((x) => getScaledImage(variant, x));
|
|
66
|
+
srcSet = "";
|
|
67
|
+
for (let w = 0; w < scaledImages.length; w++) {
|
|
68
|
+
if (srcSet.length)
|
|
69
|
+
srcSet = srcSet + ", ";
|
|
70
|
+
srcSet +=
|
|
71
|
+
(0, mediaProtection_1.hashImageUrl)(scaledImages[w].src) +
|
|
72
|
+
" " +
|
|
73
|
+
source.widths[w] +
|
|
74
|
+
"w";
|
|
75
|
+
if (scaledImages[w].width === 0)
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
if (source.width) {
|
|
81
|
+
srcSet = (0, mediaProtection_1.hashImageUrl)(getScaledImage(variant, source.width).src);
|
|
82
|
+
if (source.scales) {
|
|
83
|
+
let scaledImages = source.scales.map((x) => { var _a; return getScaledImage(variant, ((_a = source.width) !== null && _a !== void 0 ? _a : 0) * x); });
|
|
84
|
+
srcSet = "";
|
|
85
|
+
for (let w = 0; w < scaledImages.length; w++) {
|
|
86
|
+
if (srcSet.length)
|
|
87
|
+
srcSet = srcSet + ", ";
|
|
88
|
+
srcSet +=
|
|
89
|
+
(0, mediaProtection_1.hashImageUrl)(scaledImages[w].src) +
|
|
90
|
+
" " +
|
|
91
|
+
source.scales[w] +
|
|
92
|
+
"x";
|
|
93
|
+
if (scaledImages[w].width === 0)
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return ((0, jsx_runtime_1.jsx)("source", { srcSet: srcSet, media: source.media }, source.variant + source.media));
|
|
100
|
+
}), (0, jsx_runtime_1.jsx)("img", Object.assign({}, attrs, { alt: (_h = field.value) === null || _h === void 0 ? void 0 : _h.alt }))] }), renderJsonLinkedData && !video ? ((0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
101
|
+
__html: JSON.stringify({
|
|
102
|
+
"@context": "http://schema.org",
|
|
103
|
+
"@type": "ImageObject",
|
|
104
|
+
image: img === null || img === void 0 ? void 0 : img.src,
|
|
105
|
+
description: (_j = field.value) === null || _j === void 0 ? void 0 : _j.alt,
|
|
106
|
+
name: (_k = field.value) === null || _k === void 0 ? void 0 : _k.name,
|
|
107
|
+
}),
|
|
108
|
+
} })) : null, video && (0, jsx_runtime_1.jsx)("video", Object.assign({}, videoAttr)), renderJsonLinkedData && video ? ((0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
109
|
+
__html: JSON.stringify({
|
|
110
|
+
"@context": "http://schema.org",
|
|
111
|
+
"@type": "VideoObject",
|
|
112
|
+
contentUrl: img === null || img === void 0 ? void 0 : img.src,
|
|
113
|
+
description: (_l = field.value) === null || _l === void 0 ? void 0 : _l.alt,
|
|
114
|
+
name: (_m = field.value) === null || _m === void 0 ? void 0 : _m.name,
|
|
115
|
+
}),
|
|
116
|
+
} })) : null] }));
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.Picture = Picture;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
8
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
10
|
+
t[p[i]] = s[p[i]];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PictureEditor = void 0;
|
|
16
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const react_1 = require("react");
|
|
18
|
+
const Picture_1 = require("./Picture");
|
|
19
|
+
const __1 = require("..");
|
|
20
|
+
const MediaSelector_1 = require("../editor/MediaSelector");
|
|
21
|
+
const dialog_1 = require("primereact/dialog");
|
|
22
|
+
const PictureEditor = (_a) => {
|
|
23
|
+
var _b, _c;
|
|
24
|
+
var { field, imageParams, sources, defaultVariant, renderJsonLinkedData } = _a, otherProps = __rest(_a, ["field", "imageParams", "sources", "defaultVariant", "renderJsonLinkedData"]);
|
|
25
|
+
function selectImage() {
|
|
26
|
+
setMediaSelectorVisible(true);
|
|
27
|
+
}
|
|
28
|
+
const editContext = (0, __1.useEditContext)();
|
|
29
|
+
const [mediaSelectorVisible, setMediaSelectorVisible] = (0, react_1.useState)(false);
|
|
30
|
+
const [editorVisible, setEditorVisible] = (0, react_1.useState)(false);
|
|
31
|
+
if (!editContext)
|
|
32
|
+
return;
|
|
33
|
+
function imageSelected(imageId) {
|
|
34
|
+
const value = (field === null || field === void 0 ? void 0 : field.value) || {};
|
|
35
|
+
//value.variants[0].mediaId = imageId;
|
|
36
|
+
console.log(imageId);
|
|
37
|
+
if (field)
|
|
38
|
+
editContext === null || editContext === void 0 ? void 0 : editContext.editField(field, JSON.stringify(value), false);
|
|
39
|
+
}
|
|
40
|
+
console.log(JSON.stringify(field));
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MediaSelector_1.MediaSelector, { visible: mediaSelectorVisible, onHide: () => setMediaSelectorVisible(false), onMediaSelected: imageSelected }), (0, jsx_runtime_1.jsxs)(dialog_1.Dialog, { header: "Header", visible: editorVisible, style: { width: "50vw" }, onHide: () => setEditorVisible(false), children: [(0, jsx_runtime_1.jsx)("div", { className: "flex gap-1", children: (_c = (_b = field === null || field === void 0 ? void 0 : field.value) === null || _b === void 0 ? void 0 : _b.variants) === null || _c === void 0 ? void 0 : _c.map((variant) => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "h-24 w-24 border", children: variant.src && (0, jsx_runtime_1.jsx)("img", { src: variant.src }) }), (0, jsx_runtime_1.jsx)("div", { children: variant.name }), (0, jsx_runtime_1.jsx)("div", { children: variant.aspectRatioText })] }))) }), (0, jsx_runtime_1.jsx)("div", { onClick: selectImage, children: "Select image" })] }), (0, jsx_runtime_1.jsxs)("span", Object.assign({}, otherProps, { onClick: () => setEditorVisible(true), children: ["PICTURE", (0, jsx_runtime_1.jsx)(Picture_1.Picture, { field: field, imageParams: imageParams, sources: sources })] }))] }));
|
|
42
|
+
};
|
|
43
|
+
exports.PictureEditor = PictureEditor;
|
|
@@ -8,24 +8,62 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.Placeholder = void 0;
|
|
13
16
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const EditFrame_1 = require("../editor/EditFrame");
|
|
18
|
+
const __1 = require("..");
|
|
19
|
+
const PlaceholderDropZoneHost_1 = require("../editor/PlaceholderDropZoneHost");
|
|
20
|
+
const Slot_1 = __importDefault(require("./Slot"));
|
|
14
21
|
function Placeholder({ name, content, }) {
|
|
15
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
23
|
const data = yield content;
|
|
17
|
-
if (data
|
|
24
|
+
if (!data || !("placeholders" in data))
|
|
18
25
|
return;
|
|
19
26
|
const placeholderData = data.placeholders.find((x) => x.name == name);
|
|
20
27
|
if (!placeholderData)
|
|
21
28
|
return;
|
|
22
|
-
const
|
|
29
|
+
const context = (0, __1.useAlpacaContext)();
|
|
30
|
+
const loader = context.componentModuleLoader;
|
|
23
31
|
const promises = placeholderData === null || placeholderData === void 0 ? void 0 : placeholderData.components.map((component) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
if (component.componentType == "Slot")
|
|
33
|
+
return { Component: Slot_1.default, data: component, parent: data };
|
|
34
|
+
let module = null;
|
|
35
|
+
try {
|
|
36
|
+
module = yield loader(component.componentType);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
console.log(e);
|
|
40
|
+
}
|
|
41
|
+
if (!module) {
|
|
42
|
+
console.log("Could not find module " + component.componentType);
|
|
43
|
+
return {
|
|
44
|
+
data: { name: component.componentType, id: "0" },
|
|
45
|
+
Component: ComponentNotFound,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return { parent: data, data: component, Component: module.default };
|
|
26
49
|
}));
|
|
27
50
|
const components = yield Promise.all(promises);
|
|
28
|
-
|
|
51
|
+
if (context.pageContext.pageEditing) {
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [components.map(({ Component, data, parent }, index) => {
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(PlaceholderDropZoneHost_1.PlaceholderDropZoneHost, { parentName: parent === null || parent === void 0 ? void 0 : parent.name, placeholder: placeholderData, index: index + 1 }), (0, jsx_runtime_1.jsx)(EditFrame_1.EditFrame, { componentId: data.id, children: (0, jsx_runtime_1.jsx)(Component, { component: data }) }, data.id)] }));
|
|
54
|
+
}), (0, jsx_runtime_1.jsx)(PlaceholderDropZoneHost_1.PlaceholderDropZoneHost, { parentName: data === null || data === void 0 ? void 0 : data.name, placeholder: placeholderData, index: components.length + 1 })] }));
|
|
55
|
+
}
|
|
56
|
+
else
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: components.map(({ Component, data }) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Component, { component: data }) }))) }));
|
|
29
58
|
});
|
|
30
59
|
}
|
|
31
60
|
exports.Placeholder = Placeholder;
|
|
61
|
+
function ComponentNotFound({ component }) {
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
63
|
+
backgroundColor: "orange",
|
|
64
|
+
color: "red",
|
|
65
|
+
fontSize: 18,
|
|
66
|
+
padding: 10,
|
|
67
|
+
border: "3px solid red",
|
|
68
|
+
}, children: ["Component not found: ", component.name, " "] }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.RichText = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const react_1 = __importDefault(require("react"));
|
|
29
|
+
const RichTextEditor_1 = require("./RichTextEditor");
|
|
30
|
+
const __1 = require("..");
|
|
31
|
+
function RichText(_a) {
|
|
32
|
+
var { field, tag, editable } = _a, props = __rest(_a, ["field", "tag", "editable"]);
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (!field)
|
|
35
|
+
return;
|
|
36
|
+
const internalProps = Object.assign(Object.assign({}, props), { dangerouslySetInnerHTML: {
|
|
37
|
+
__html: field.value,
|
|
38
|
+
}, editable: editable, contentEditable: true, "data-test": "test", placeholder: '[' + field.name + ']' });
|
|
39
|
+
if ((0, __1.useAlpacaContext)().pageContext.pageEditing)
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(RichTextEditor_1.RichTextEditor, Object.assign({ field: field, tag: tag }, props));
|
|
41
|
+
return react_1.default.createElement(tag || "div", Object.assign(props, internalProps));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.RichText = RichText;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
29
|
+
t[p] = s[p];
|
|
30
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
31
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
33
|
+
t[p[i]] = s[p[i]];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.RichTextEditor = void 0;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const editContext_1 = require("../editor/editContext");
|
|
41
|
+
function RichTextEditor(_a) {
|
|
42
|
+
var { field, tag } = _a, props = __rest(_a, ["field", "tag"]);
|
|
43
|
+
const editContext = (0, editContext_1.useEditContext)();
|
|
44
|
+
const [value, setValue] = (0, react_1.useState)("");
|
|
45
|
+
const [editedValue, setEditedValue] = (0, react_1.useState)();
|
|
46
|
+
if (!editContext)
|
|
47
|
+
return;
|
|
48
|
+
const { updateContentEditingFields } = editContext;
|
|
49
|
+
const component = editContext.getComponentById(field.itemId);
|
|
50
|
+
if (!component)
|
|
51
|
+
return;
|
|
52
|
+
const liveField = Object.values(component.fields).find((f) => f.id == field.id);
|
|
53
|
+
(0, react_1.useEffect)(() => {
|
|
54
|
+
if (editedValue != liveField.value &&
|
|
55
|
+
"<p>" + editedValue + "</p>" != liveField.value) {
|
|
56
|
+
// console.log(
|
|
57
|
+
// "editedValue:" + editedValue + " liveField.value " + liveField.value
|
|
58
|
+
// );
|
|
59
|
+
setValue(liveField.value);
|
|
60
|
+
}
|
|
61
|
+
}, [liveField.value]);
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
63
|
+
setValue(liveField.value); // Otherwise react would not update the field after the refresh
|
|
64
|
+
}, [updateContentEditingFields]);
|
|
65
|
+
const setFieldValue = (val) => {
|
|
66
|
+
if (val != editedValue) {
|
|
67
|
+
setEditedValue(val);
|
|
68
|
+
if (editContext)
|
|
69
|
+
editContext.editField(field, val, true);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const eventHandler = (0, react_1.useCallback)((e) => {
|
|
73
|
+
setFieldValue(e.currentTarget.innerHTML);
|
|
74
|
+
}, [editContext.editField]);
|
|
75
|
+
return (0, react_1.useMemo)(() => {
|
|
76
|
+
const properies = Object.assign(Object.assign({}, props), { contentEditable: true, suppressContentEditableWarning: true, onInput: eventHandler, placeholder: "[" + field.name + "]", dangerouslySetInnerHTML: {
|
|
77
|
+
__html: value,
|
|
78
|
+
} });
|
|
79
|
+
return react_1.default.createElement(tag || "div", properies);
|
|
80
|
+
}, [value]);
|
|
81
|
+
}
|
|
82
|
+
exports.RichTextEditor = RichTextEditor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
function Section({ component }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(__1.Placeholder, { name: "ph-slot-content", content: component }) }));
|
|
7
|
+
}
|
|
8
|
+
exports.default = Section;
|
|
@@ -8,18 +8,38 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
14
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
26
|
exports.Text = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
28
|
const react_1 = __importDefault(require("react"));
|
|
17
|
-
|
|
29
|
+
const TextEditor_1 = require("./TextEditor");
|
|
30
|
+
const __1 = require("..");
|
|
31
|
+
function Text(_a) {
|
|
32
|
+
var { field, tag, editable } = _a, props = __rest(_a, ["field", "tag", "editable"]);
|
|
18
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
34
|
+
if (!field)
|
|
35
|
+
return;
|
|
36
|
+
if (field.jsonValue) {
|
|
37
|
+
field = field.jsonValue;
|
|
38
|
+
}
|
|
39
|
+
if ((0, __1.useAlpacaContext)().pageContext.pageEditing)
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(TextEditor_1.TextEditor, Object.assign({ field: field, tag: tag }, props));
|
|
21
41
|
else
|
|
22
|
-
return react_1.default.createElement(tag || "div",
|
|
42
|
+
return react_1.default.createElement(tag || "div", props, field.value);
|
|
23
43
|
});
|
|
24
44
|
}
|
|
25
45
|
exports.Text = Text;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
29
|
+
t[p] = s[p];
|
|
30
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
31
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
33
|
+
t[p[i]] = s[p[i]];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.TextEditor = void 0;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const editContext_1 = require("../editor/editContext");
|
|
41
|
+
function TextEditor(_a) {
|
|
42
|
+
var { field, tag } = _a, props = __rest(_a, ["field", "tag"]);
|
|
43
|
+
const editContext = (0, editContext_1.useEditContext)();
|
|
44
|
+
const [value, setValue] = (0, react_1.useState)("");
|
|
45
|
+
const [editedValue, setEditedValue] = (0, react_1.useState)();
|
|
46
|
+
if (!editContext)
|
|
47
|
+
return;
|
|
48
|
+
const { updateContentEditingFields } = editContext;
|
|
49
|
+
const component = editContext.getComponentById(field.itemId);
|
|
50
|
+
if (!component)
|
|
51
|
+
return;
|
|
52
|
+
const liveField = Object.values(component.fields).find((f) => f.id == field.id);
|
|
53
|
+
(0, react_1.useEffect)(() => {
|
|
54
|
+
if (editedValue != liveField.value)
|
|
55
|
+
setValue(liveField.value);
|
|
56
|
+
}, [liveField.value]);
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
setValue(liveField.value); // Otherwise react would not update the field after the refresh
|
|
59
|
+
}, [updateContentEditingFields]);
|
|
60
|
+
const properies = Object.assign(Object.assign({}, props), { contentEditable: true, suppressContentEditableWarning: true, onInput: (e) => setFieldValue(e.currentTarget.textContent), placeholder: "[" + field.name + "]" });
|
|
61
|
+
const setFieldValue = (val) => {
|
|
62
|
+
setEditedValue(val);
|
|
63
|
+
if (editContext)
|
|
64
|
+
editContext.editField(field, val, true);
|
|
65
|
+
};
|
|
66
|
+
return react_1.default.createElement(tag || "div", properies, value);
|
|
67
|
+
}
|
|
68
|
+
exports.TextEditor = TextEditor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Translate = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
const TranslateEditor_1 = require("../editor/TranslateEditor");
|
|
7
|
+
function Translate({ text }) {
|
|
8
|
+
const context = (0, __1.useAlpacaContext)();
|
|
9
|
+
const dictionary = context.dictionary;
|
|
10
|
+
if (context.pageContext.pageEditing)
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(TranslateEditor_1.TranslateEditor, { text: text });
|
|
12
|
+
return dictionary[text] || text;
|
|
13
|
+
}
|
|
14
|
+
exports.Translate = Translate;
|
|
@@ -16,3 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Placeholder"), exports);
|
|
18
18
|
__exportStar(require("./Text"), exports);
|
|
19
|
+
__exportStar(require("./Picture"), exports);
|
|
20
|
+
__exportStar(require("./RichText"), exports);
|
|
21
|
+
__exportStar(require("./Image"), exports);
|
|
22
|
+
__exportStar(require("./Link"), exports);
|
|
23
|
+
__exportStar(require("./Translate"), exports);
|