@creopse/react 0.0.12 → 0.0.14
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/{index-jw_2nhs3.js → content-CM9eJ2st.js} +326 -6
- package/dist/{index-hI__ihu3.cjs → content-WeAhwlM_.cjs} +320 -0
- package/dist/hooks/index.cjs +7 -372
- package/dist/hooks/index.mjs +7 -372
- package/dist/index.cjs +207 -62
- package/dist/index.mjs +187 -42
- package/package.json +4 -2
- package/types/components/RootContainer/RootContainer.d.ts +1 -8
- package/types/components/RootContainer/index.d.ts +1 -1
- package/types/hooks/content.d.ts +1 -4
- package/types/hooks/setup.d.ts +7 -0
- package/types/index.d.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const content = require("./content-WeAhwlM_.cjs");
|
|
5
5
|
require("@inertiajs/react");
|
|
6
6
|
const reactDom = require("react-dom");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
@@ -424,7 +424,7 @@ const AsyncImg = ({
|
|
|
424
424
|
};
|
|
425
425
|
const Image = (props) => {
|
|
426
426
|
const { src, alt = "", width, height, title, loading, style, size = "original", sync = false } = props;
|
|
427
|
-
const { getImage } =
|
|
427
|
+
const { getImage } = content.useHelper();
|
|
428
428
|
const filteredProps = {
|
|
429
429
|
alt,
|
|
430
430
|
width,
|
|
@@ -454,9 +454,9 @@ function addUniqueItem(arr, item) {
|
|
|
454
454
|
arr.push(item);
|
|
455
455
|
}
|
|
456
456
|
function removeItem(arr, item) {
|
|
457
|
-
const
|
|
458
|
-
if (
|
|
459
|
-
arr.splice(
|
|
457
|
+
const index = arr.indexOf(item);
|
|
458
|
+
if (index > -1)
|
|
459
|
+
arr.splice(index, 1);
|
|
460
460
|
}
|
|
461
461
|
const clamp = (min, max, v) => {
|
|
462
462
|
if (v > max)
|
|
@@ -1535,8 +1535,8 @@ const isNotNull$1 = (value) => value !== null;
|
|
|
1535
1535
|
function getFinalKeyframe$1(keyframes2, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) {
|
|
1536
1536
|
const resolvedKeyframes = keyframes2.filter(isNotNull$1);
|
|
1537
1537
|
const useFirstKeyframe = speed < 0 || repeat && repeatType !== "loop" && repeat % 2 === 1;
|
|
1538
|
-
const
|
|
1539
|
-
return !
|
|
1538
|
+
const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;
|
|
1539
|
+
return !index || finalKeyframe === void 0 ? resolvedKeyframes[index] : finalKeyframe;
|
|
1540
1540
|
}
|
|
1541
1541
|
const transitionTypeMap = {
|
|
1542
1542
|
decay: inertia,
|
|
@@ -3921,8 +3921,8 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
3921
3921
|
for (const key in target) {
|
|
3922
3922
|
let valueTarget = target[key];
|
|
3923
3923
|
if (Array.isArray(valueTarget)) {
|
|
3924
|
-
const
|
|
3925
|
-
valueTarget = valueTarget[
|
|
3924
|
+
const index = isInitialAnimationBlocked ? valueTarget.length - 1 : 0;
|
|
3925
|
+
valueTarget = valueTarget[index];
|
|
3926
3926
|
}
|
|
3927
3927
|
if (valueTarget !== null) {
|
|
3928
3928
|
values[key] = valueTarget;
|
|
@@ -4875,8 +4875,8 @@ function getOptimisedAppearId(visualElement) {
|
|
|
4875
4875
|
const isNotNull = (value) => value !== null;
|
|
4876
4876
|
function getFinalKeyframe(keyframes2, { repeat, repeatType = "loop" }, finalKeyframe) {
|
|
4877
4877
|
const resolvedKeyframes = keyframes2.filter(isNotNull);
|
|
4878
|
-
const
|
|
4879
|
-
return resolvedKeyframes[
|
|
4878
|
+
const index = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1;
|
|
4879
|
+
return resolvedKeyframes[index];
|
|
4880
4880
|
}
|
|
4881
4881
|
const underDampedSpring = {
|
|
4882
4882
|
type: "spring",
|
|
@@ -8087,26 +8087,131 @@ const StickyTop = ({
|
|
|
8087
8087
|
}
|
|
8088
8088
|
);
|
|
8089
8089
|
};
|
|
8090
|
-
const
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8090
|
+
const byteToHex = [];
|
|
8091
|
+
for (let i = 0; i < 256; ++i) {
|
|
8092
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
8093
|
+
}
|
|
8094
|
+
function unsafeStringify(arr, offset = 0) {
|
|
8095
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
8096
|
+
}
|
|
8097
|
+
let getRandomValues;
|
|
8098
|
+
const rnds8 = new Uint8Array(16);
|
|
8099
|
+
function rng() {
|
|
8100
|
+
if (!getRandomValues) {
|
|
8101
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
8102
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
8103
|
+
}
|
|
8104
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
8105
|
+
}
|
|
8106
|
+
return getRandomValues(rnds8);
|
|
8107
|
+
}
|
|
8108
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
8109
|
+
const native = { randomUUID };
|
|
8110
|
+
function _v4(options, buf, offset) {
|
|
8111
|
+
options = options || {};
|
|
8112
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
8113
|
+
if (rnds.length < 16) {
|
|
8114
|
+
throw new Error("Random bytes length must be >= 16");
|
|
8115
|
+
}
|
|
8116
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
8117
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
8118
|
+
return unsafeStringify(rnds);
|
|
8119
|
+
}
|
|
8120
|
+
function v4(options, buf, offset) {
|
|
8121
|
+
if (native.randomUUID && true && !options) {
|
|
8122
|
+
return native.randomUUID();
|
|
8123
|
+
}
|
|
8124
|
+
return _v4(options);
|
|
8125
|
+
}
|
|
8126
|
+
const useSetup = () => {
|
|
8127
|
+
const getComponents = React.useCallback(
|
|
8128
|
+
(resolveSections) => {
|
|
8129
|
+
const components = {};
|
|
8130
|
+
if (!resolveSections) {
|
|
8131
|
+
throw new Error("[@creopse/react] resolveSections is required");
|
|
8132
|
+
}
|
|
8133
|
+
const files = resolveSections();
|
|
8134
|
+
for (const [key, value] of Object.entries(files)) {
|
|
8135
|
+
const componentName = key.replace(/^\.\/(.*)\.\w+$/, "$1");
|
|
8136
|
+
const parts = componentName.split("/");
|
|
8137
|
+
const name = parts[parts.length - 1]?.split(".")[0];
|
|
8138
|
+
components[name] = value.default;
|
|
8139
|
+
}
|
|
8140
|
+
return components;
|
|
8141
|
+
},
|
|
8142
|
+
[]
|
|
8143
|
+
);
|
|
8144
|
+
const getSectionsInOrder = React.useCallback(
|
|
8145
|
+
(props) => {
|
|
8146
|
+
const sections = props.pageData?.sections;
|
|
8147
|
+
const sectionsOrder = props.pageData?.sectionsOrder;
|
|
8148
|
+
const sectionsOrdered = [];
|
|
8149
|
+
if (Array.isArray(sections) && Array.isArray(sectionsOrder)) {
|
|
8150
|
+
for (const section of sectionsOrder) {
|
|
8151
|
+
if (section) {
|
|
8152
|
+
const item = sections.find(
|
|
8153
|
+
(value) => `${value.slug}__${value.pivot?.linkId}` === section
|
|
8154
|
+
);
|
|
8155
|
+
if (item) {
|
|
8156
|
+
sectionsOrdered.push(item);
|
|
8157
|
+
}
|
|
8158
|
+
}
|
|
8159
|
+
}
|
|
8160
|
+
}
|
|
8161
|
+
return sectionsOrdered.length ? sectionsOrdered : sections || [];
|
|
8162
|
+
},
|
|
8163
|
+
[]
|
|
8164
|
+
);
|
|
8165
|
+
const getFinalPageSections = React.useCallback(
|
|
8166
|
+
(props) => {
|
|
8167
|
+
const sections = getSectionsInOrder(props);
|
|
8168
|
+
const sectionsDisabled = props.pageData?.sectionsDisabled;
|
|
8169
|
+
return sections.filter((section) => {
|
|
8170
|
+
return !sectionsDisabled?.includes(
|
|
8171
|
+
`${section.slug}__${section.pivot?.linkId}`
|
|
8172
|
+
);
|
|
8173
|
+
});
|
|
8174
|
+
},
|
|
8175
|
+
[getSectionsInOrder]
|
|
8176
|
+
);
|
|
8177
|
+
return {
|
|
8178
|
+
getComponents,
|
|
8179
|
+
getSectionsInOrder,
|
|
8180
|
+
getFinalPageSections
|
|
8181
|
+
};
|
|
8182
|
+
};
|
|
8183
|
+
const RootContainer = () => {
|
|
8184
|
+
const { page } = content.useContent();
|
|
8185
|
+
const props = content.useProps();
|
|
8186
|
+
const manager = React.useContext(content.PropsContext);
|
|
8187
|
+
const resolveSections = React.useContext(content.ResolveSectionsContext);
|
|
8188
|
+
const { getComponents, getFinalPageSections } = useSetup();
|
|
8189
|
+
const [sections, setSections] = React.useState(
|
|
8190
|
+
() => getFinalPageSections(props)
|
|
8191
|
+
);
|
|
8192
|
+
const [components] = React.useState(() => getComponents(resolveSections));
|
|
8193
|
+
const [sectionsWrapperKey, setSectionsWrapperKey] = React.useState(v4());
|
|
8194
|
+
const [sectionKeys, setSectionKeys] = React.useState({});
|
|
8195
|
+
const sectionsStateRef = React.useRef({});
|
|
8196
|
+
const pagePropsCopyRef = React.useRef(content.cloneDeep(props));
|
|
8095
8197
|
React.useEffect(() => {
|
|
8096
|
-
const
|
|
8097
|
-
|
|
8198
|
+
const keys = {};
|
|
8199
|
+
sections.forEach((section) => {
|
|
8200
|
+
keys[`${section.slug}__${section.pivot?.linkId}-key`] = v4();
|
|
8201
|
+
});
|
|
8202
|
+
setSectionKeys(keys);
|
|
8203
|
+
}, [sections]);
|
|
8204
|
+
React.useEffect(() => {
|
|
8205
|
+
const timer = setTimeout(() => {
|
|
8206
|
+
const sectionData = page.props.sectionData;
|
|
8098
8207
|
if (sectionData && sections.find(
|
|
8099
8208
|
(section) => section.slug === sectionData.slug && section.pivot?.linkId === sectionData.pivot?.linkId
|
|
8100
8209
|
)) {
|
|
8101
|
-
|
|
8210
|
+
content.slideToId(`${sectionData.slug}__${sectionData.pivot?.linkId}-container`);
|
|
8102
8211
|
}
|
|
8103
8212
|
}, 1e3);
|
|
8104
|
-
return () => clearTimeout(
|
|
8105
|
-
}, [page, sections]);
|
|
8106
|
-
const sectionsStateRef = React.useRef({});
|
|
8107
|
-
const sectionsRef = React.useRef(sections);
|
|
8108
|
-
const pageProps = index.useProps();
|
|
8109
|
-
console.log(pageProps);
|
|
8213
|
+
return () => clearTimeout(timer);
|
|
8214
|
+
}, [page.props.sectionData, sections]);
|
|
8110
8215
|
React.useEffect(() => {
|
|
8111
8216
|
const deselectAllSections = () => {
|
|
8112
8217
|
Object.keys(sectionsStateRef.current).forEach((key) => {
|
|
@@ -8120,16 +8225,16 @@ const RootContainer = ({
|
|
|
8120
8225
|
};
|
|
8121
8226
|
const handleMessage = (event) => {
|
|
8122
8227
|
switch (event.data?.type) {
|
|
8123
|
-
case
|
|
8228
|
+
case content.EditorMessageType.RELOAD:
|
|
8124
8229
|
sessionStorage.setItem("shouldNotifyReload", "1");
|
|
8125
8230
|
sessionStorage.setItem("replyOrigin", event.origin);
|
|
8126
8231
|
window.location.reload();
|
|
8127
8232
|
break;
|
|
8128
|
-
case
|
|
8233
|
+
case content.EditorMessageType.ENABLE_EDITION_MODE: {
|
|
8129
8234
|
const primaryColor = event.data?.primaryColor ?? "blue";
|
|
8130
8235
|
sessionStorage.setItem("replyOrigin", event.origin);
|
|
8131
8236
|
sessionStorage.setItem("primaryColor", primaryColor);
|
|
8132
|
-
|
|
8237
|
+
sections?.forEach((section) => {
|
|
8133
8238
|
if (section.slug && section.pivot?.linkId) {
|
|
8134
8239
|
const sectionElementId = `${section.slug}__${section.pivot?.linkId}-container`;
|
|
8135
8240
|
const sectionElement = document.getElementById(sectionElementId);
|
|
@@ -8147,7 +8252,7 @@ const RootContainer = ({
|
|
|
8147
8252
|
this.style.boxShadow = `0 0 10px ${primaryColor}`;
|
|
8148
8253
|
window.parent.postMessage(
|
|
8149
8254
|
{
|
|
8150
|
-
type:
|
|
8255
|
+
type: content.EditorMessageType.SELECT_PREVIEW_SECTION,
|
|
8151
8256
|
slug: section.slug,
|
|
8152
8257
|
linkId: section.pivot?.linkId
|
|
8153
8258
|
},
|
|
@@ -8162,15 +8267,15 @@ const RootContainer = ({
|
|
|
8162
8267
|
});
|
|
8163
8268
|
break;
|
|
8164
8269
|
}
|
|
8165
|
-
case
|
|
8270
|
+
case content.EditorMessageType.DESELECT_ALL_SECTIONS:
|
|
8166
8271
|
deselectAllSections();
|
|
8167
8272
|
break;
|
|
8168
|
-
case
|
|
8273
|
+
case content.EditorMessageType.SELECT_SIDEBAR_SECTION: {
|
|
8169
8274
|
setTimeout(() => {
|
|
8170
|
-
if (
|
|
8275
|
+
if (sections.find(
|
|
8171
8276
|
(section) => section.slug === event.data?.slug && section.pivot?.linkId === event.data?.linkId
|
|
8172
8277
|
)) {
|
|
8173
|
-
|
|
8278
|
+
content.slideToId(`${event.data?.slug}__${event.data?.linkId}-container`);
|
|
8174
8279
|
}
|
|
8175
8280
|
}, 1e3);
|
|
8176
8281
|
const elementId = `${event.data?.slug}__${event.data?.linkId}-container`;
|
|
@@ -8184,38 +8289,72 @@ const RootContainer = ({
|
|
|
8184
8289
|
}
|
|
8185
8290
|
break;
|
|
8186
8291
|
}
|
|
8187
|
-
case
|
|
8188
|
-
|
|
8189
|
-
|
|
8292
|
+
case content.EditorMessageType.SEND_BASE_SECTION_SETTINGS:
|
|
8293
|
+
case content.EditorMessageType.SEND_SECTION_SETTINGS: {
|
|
8294
|
+
const sectionIndex = pagePropsCopyRef.current.pageData?.sections?.findIndex(
|
|
8295
|
+
(section) => section.slug === event.data?.slug && section.pivot?.linkId === event.data?.linkId
|
|
8296
|
+
);
|
|
8297
|
+
if (typeof sectionIndex !== "number" || sectionIndex === -1) {
|
|
8298
|
+
return;
|
|
8190
8299
|
}
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8300
|
+
if (pagePropsCopyRef.current.pageData?.sections && pagePropsCopyRef.current.pageData?.sections[sectionIndex].pivot?.settings) {
|
|
8301
|
+
pagePropsCopyRef.current.pageData.sections[sectionIndex].pivot.settings = event.data?.settings;
|
|
8302
|
+
manager?.sync(pagePropsCopyRef.current);
|
|
8303
|
+
setSectionKeys((prev) => ({
|
|
8304
|
+
...prev,
|
|
8305
|
+
[`${event.data?.slug}__${event.data?.linkId}-key`]: v4()
|
|
8306
|
+
}));
|
|
8195
8307
|
}
|
|
8196
8308
|
break;
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8309
|
+
}
|
|
8310
|
+
case content.EditorMessageType.SEND_BASE_SECTION_DATA:
|
|
8311
|
+
case content.EditorMessageType.SEND_SECTION_DATA: {
|
|
8312
|
+
const sectionIndex = pagePropsCopyRef.current.pageData?.sections?.findIndex(
|
|
8313
|
+
(section) => section.slug === event.data?.slug && section.pivot?.linkId === event.data?.linkId
|
|
8314
|
+
);
|
|
8315
|
+
if (typeof sectionIndex !== "number" || sectionIndex === -1) {
|
|
8316
|
+
return;
|
|
8200
8317
|
}
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8318
|
+
if (pagePropsCopyRef.current.pageData?.sections && pagePropsCopyRef.current.pageData?.sections[sectionIndex].pivot?.data) {
|
|
8319
|
+
pagePropsCopyRef.current.pageData.sections[sectionIndex].pivot.data = event.data?.data;
|
|
8320
|
+
manager?.sync(pagePropsCopyRef.current);
|
|
8321
|
+
setSectionKeys((prev) => ({
|
|
8322
|
+
...prev,
|
|
8323
|
+
[`${event.data?.slug}__${event.data?.linkId}-key`]: v4()
|
|
8324
|
+
}));
|
|
8205
8325
|
}
|
|
8206
8326
|
break;
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8327
|
+
}
|
|
8328
|
+
case content.EditorMessageType.SEND_PAGE_SECTIONS: {
|
|
8329
|
+
if (!pagePropsCopyRef.current.pageData) return;
|
|
8330
|
+
pagePropsCopyRef.current.pageData.sectionsOrder = event.data?.sectionsOrder;
|
|
8331
|
+
pagePropsCopyRef.current.pageData.sectionsDisabled = event.data?.sectionsDisabled;
|
|
8332
|
+
const currentSections = content.cloneDeep(
|
|
8333
|
+
pagePropsCopyRef.current.pageData.sections || []
|
|
8334
|
+
);
|
|
8335
|
+
pagePropsCopyRef.current.pageData.sections = event.data?.sectionsList || [];
|
|
8336
|
+
currentSections.forEach((currentSection) => {
|
|
8337
|
+
const sectionIndex = pagePropsCopyRef.current.pageData?.sections?.findIndex(
|
|
8338
|
+
(newSection) => newSection.slug === currentSection?.slug && newSection.pivot?.linkId === currentSection.pivot?.linkId
|
|
8339
|
+
);
|
|
8340
|
+
if (typeof sectionIndex === "number" && sectionIndex > -1 && pagePropsCopyRef.current.pageData?.sections?.[sectionIndex].pivot) {
|
|
8341
|
+
pagePropsCopyRef.current.pageData.sections[sectionIndex].pivot.data = currentSection.pivot?.data;
|
|
8342
|
+
pagePropsCopyRef.current.pageData.sections[sectionIndex].pivot.settings = currentSection.pivot?.settings;
|
|
8343
|
+
}
|
|
8344
|
+
});
|
|
8345
|
+
manager?.sync(pagePropsCopyRef.current);
|
|
8346
|
+
const newProps = manager?.getState().props;
|
|
8347
|
+
setSections(getFinalPageSections(newProps));
|
|
8348
|
+
setSectionsWrapperKey(v4());
|
|
8211
8349
|
break;
|
|
8350
|
+
}
|
|
8212
8351
|
}
|
|
8213
8352
|
};
|
|
8214
8353
|
window.addEventListener("message", handleMessage);
|
|
8215
8354
|
if (sessionStorage.getItem("shouldNotifyReload") === "1") {
|
|
8216
8355
|
const origin = sessionStorage.getItem("replyOrigin") || "*";
|
|
8217
8356
|
window.parent.postMessage(
|
|
8218
|
-
{ type:
|
|
8357
|
+
{ type: content.EditorMessageType.RELOAD_COMPLETE },
|
|
8219
8358
|
origin
|
|
8220
8359
|
);
|
|
8221
8360
|
sessionStorage.removeItem("shouldNotifyReload");
|
|
@@ -8224,21 +8363,26 @@ const RootContainer = ({
|
|
|
8224
8363
|
return () => {
|
|
8225
8364
|
window.removeEventListener("message", handleMessage);
|
|
8226
8365
|
};
|
|
8227
|
-
}, []);
|
|
8228
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8366
|
+
}, [sections, manager, getFinalPageSections]);
|
|
8367
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { all: "unset" }, children: sections.map((section) => {
|
|
8229
8368
|
const Component = components[section.name];
|
|
8230
|
-
|
|
8369
|
+
const staticKey = `${section.slug}__${section.pivot?.linkId}`;
|
|
8370
|
+
const dynamicKey = sectionKeys[`${staticKey}-key`];
|
|
8371
|
+
if (!Component) {
|
|
8372
|
+
console.warn(`[@creopse/react] Component not found: ${section.name}`);
|
|
8373
|
+
return null;
|
|
8374
|
+
}
|
|
8231
8375
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8232
8376
|
"section",
|
|
8233
8377
|
{
|
|
8234
|
-
id: `${
|
|
8235
|
-
|
|
8378
|
+
id: `${staticKey}-container`,
|
|
8379
|
+
style: { all: "unset" },
|
|
8236
8380
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8237
8381
|
Component,
|
|
8238
8382
|
{
|
|
8239
8383
|
data: section.pivot?.data,
|
|
8240
8384
|
settings: section.pivot?.settings,
|
|
8241
|
-
sectionKey:
|
|
8385
|
+
sectionKey: staticKey,
|
|
8242
8386
|
metadata: {
|
|
8243
8387
|
slug: section.slug,
|
|
8244
8388
|
name: section.name,
|
|
@@ -8247,12 +8391,13 @@ const RootContainer = ({
|
|
|
8247
8391
|
createdAt: section.createdAt,
|
|
8248
8392
|
updatedAt: section.updatedAt
|
|
8249
8393
|
}
|
|
8250
|
-
}
|
|
8394
|
+
},
|
|
8395
|
+
dynamicKey
|
|
8251
8396
|
)
|
|
8252
8397
|
},
|
|
8253
|
-
|
|
8398
|
+
staticKey
|
|
8254
8399
|
);
|
|
8255
|
-
}) });
|
|
8400
|
+
}) }, sectionsWrapperKey);
|
|
8256
8401
|
};
|
|
8257
8402
|
function CreopseProvider({ children, options }) {
|
|
8258
8403
|
if (!options?.initialProps) {
|
|
@@ -8275,7 +8420,7 @@ function CreopseProvider({ children, options }) {
|
|
|
8275
8420
|
console.warn("[@creopse/react] No router - props won't sync");
|
|
8276
8421
|
}
|
|
8277
8422
|
}, [options.router, manager]);
|
|
8278
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8423
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(content.RouterContext.Provider, { value: options.router || null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(content.ConfigContext.Provider, { value: options.config, children: /* @__PURE__ */ jsxRuntimeExports.jsx(content.ResolveSectionsContext.Provider, { value: options.resolveSections, children: /* @__PURE__ */ jsxRuntimeExports.jsx(content.PropsContext.Provider, { value: manager, children }) }) }) });
|
|
8279
8424
|
}
|
|
8280
8425
|
exports.AsyncImg = AsyncImg;
|
|
8281
8426
|
exports.CreopseProvider = CreopseProvider;
|