@creopse/react 0.0.15 → 0.0.17
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/{content-CM9eJ2st.js → content-CfIj9nZq.js} +4 -2
- package/dist/{content-WeAhwlM_.cjs → content-yneKOQn5.cjs} +4 -2
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.cjs +12 -3
- package/dist/index.mjs +12 -3
- package/package.json +1 -1
- package/types/components/RootContainer/Core.d.ts +2 -0
- package/types/components/RootContainer/RootContainer.d.ts +1 -2
|
@@ -7944,7 +7944,7 @@ const useContent = () => {
|
|
|
7944
7944
|
);
|
|
7945
7945
|
const getMenu = useCallback(
|
|
7946
7946
|
(name, filterByIsActive = true) => {
|
|
7947
|
-
const menu = props?.menus?.find((menu2) => menu2.name === name);
|
|
7947
|
+
const menu = cloneDeep(props?.menus?.find((menu2) => menu2.name === name));
|
|
7948
7948
|
if (menu) {
|
|
7949
7949
|
menu.items = cloneDeep(
|
|
7950
7950
|
menu.items?.filter((item) => !filterByIsActive || item.isActive)?.sort((a, b) => a.position - b.position)
|
|
@@ -7956,7 +7956,9 @@ const useContent = () => {
|
|
|
7956
7956
|
);
|
|
7957
7957
|
const getMenuByLocation = useCallback(
|
|
7958
7958
|
(name, filterByIsActive = true) => {
|
|
7959
|
-
const menu =
|
|
7959
|
+
const menu = cloneDeep(
|
|
7960
|
+
props?.menus?.find((menu2) => menu2.location?.name === name)
|
|
7961
|
+
);
|
|
7960
7962
|
if (menu) {
|
|
7961
7963
|
menu.items = cloneDeep(
|
|
7962
7964
|
menu.items?.filter((item) => !filterByIsActive || item.isActive)?.sort((a, b) => a.position - b.position)
|
|
@@ -7945,7 +7945,7 @@ const useContent = () => {
|
|
|
7945
7945
|
);
|
|
7946
7946
|
const getMenu = React.useCallback(
|
|
7947
7947
|
(name, filterByIsActive = true) => {
|
|
7948
|
-
const menu = props?.menus?.find((menu2) => menu2.name === name);
|
|
7948
|
+
const menu = cloneDeep(props?.menus?.find((menu2) => menu2.name === name));
|
|
7949
7949
|
if (menu) {
|
|
7950
7950
|
menu.items = cloneDeep(
|
|
7951
7951
|
menu.items?.filter((item) => !filterByIsActive || item.isActive)?.sort((a, b) => a.position - b.position)
|
|
@@ -7957,7 +7957,9 @@ const useContent = () => {
|
|
|
7957
7957
|
);
|
|
7958
7958
|
const getMenuByLocation = React.useCallback(
|
|
7959
7959
|
(name, filterByIsActive = true) => {
|
|
7960
|
-
const menu =
|
|
7960
|
+
const menu = cloneDeep(
|
|
7961
|
+
props?.menus?.find((menu2) => menu2.location?.name === name)
|
|
7962
|
+
);
|
|
7961
7963
|
if (menu) {
|
|
7962
7964
|
menu.items = cloneDeep(
|
|
7963
7965
|
menu.items?.filter((item) => !filterByIsActive || item.isActive)?.sort((a, b) => a.position - b.position)
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const content = require("../content-
|
|
3
|
+
const content = require("../content-yneKOQn5.cjs");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const useNewsletter = () => {
|
|
6
6
|
const { request } = content.useApi();
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as useApi } from "../content-
|
|
2
|
-
import { f, a, u, b } from "../content-
|
|
1
|
+
import { e as useApi } from "../content-CfIj9nZq.js";
|
|
2
|
+
import { f, a, u, b } from "../content-CfIj9nZq.js";
|
|
3
3
|
import { useState, useCallback } from "react";
|
|
4
4
|
const useNewsletter = () => {
|
|
5
5
|
const { request } = useApi();
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const content = require("./content-
|
|
5
|
-
require("@inertiajs/react");
|
|
4
|
+
const content = require("./content-yneKOQn5.cjs");
|
|
5
|
+
const react = require("@inertiajs/react");
|
|
6
6
|
const reactDom = require("react-dom");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -8184,7 +8184,7 @@ const resetStyles = "_reset-styles_1tka1_1";
|
|
|
8184
8184
|
const styles = {
|
|
8185
8185
|
resetStyles
|
|
8186
8186
|
};
|
|
8187
|
-
const RootContainer = () => {
|
|
8187
|
+
const RootContainer$1 = () => {
|
|
8188
8188
|
const { page } = content.useContent();
|
|
8189
8189
|
const props = content.useProps();
|
|
8190
8190
|
const manager = React.useContext(content.PropsContext);
|
|
@@ -8403,6 +8403,15 @@ const RootContainer = () => {
|
|
|
8403
8403
|
);
|
|
8404
8404
|
}) }, sectionsWrapperKey);
|
|
8405
8405
|
};
|
|
8406
|
+
function RootContainer() {
|
|
8407
|
+
const [key, setKey] = React.useState(() => v4());
|
|
8408
|
+
React.useEffect(() => {
|
|
8409
|
+
return react.router.on("navigate", () => {
|
|
8410
|
+
setKey(v4());
|
|
8411
|
+
});
|
|
8412
|
+
}, []);
|
|
8413
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RootContainer$1, {}, key);
|
|
8414
|
+
}
|
|
8406
8415
|
function CreopseProvider({ children, options }) {
|
|
8407
8416
|
if (!options?.initialProps) {
|
|
8408
8417
|
throw new Error("[@creopse/react] initialProps is required");
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React__default, { useState, useEffect, createContext, useRef, useLayoutEffect, useId, useContext, useInsertionEffect, useMemo, useCallback, Children, isValidElement, Fragment, createElement, forwardRef, Component } from "react";
|
|
3
|
-
import { u as useHelper, a as useContent, b as useProps, P as PropsContext, R as ResolveSectionsContext, c as cloneDeep, s as slideToId, E as EditorMessageType, d as RouterContext, C as ConfigContext } from "./content-
|
|
4
|
-
import "@inertiajs/react";
|
|
3
|
+
import { u as useHelper, a as useContent, b as useProps, P as PropsContext, R as ResolveSectionsContext, c as cloneDeep, s as slideToId, E as EditorMessageType, d as RouterContext, C as ConfigContext } from "./content-CfIj9nZq.js";
|
|
4
|
+
import { router } from "@inertiajs/react";
|
|
5
5
|
import { createPortal } from "react-dom";
|
|
6
6
|
var jsxRuntime = { exports: {} };
|
|
7
7
|
var reactJsxRuntime_production = {};
|
|
@@ -8166,7 +8166,7 @@ const resetStyles = "_reset-styles_1tka1_1";
|
|
|
8166
8166
|
const styles = {
|
|
8167
8167
|
resetStyles
|
|
8168
8168
|
};
|
|
8169
|
-
const RootContainer = () => {
|
|
8169
|
+
const RootContainer$1 = () => {
|
|
8170
8170
|
const { page } = useContent();
|
|
8171
8171
|
const props = useProps();
|
|
8172
8172
|
const manager = useContext(PropsContext);
|
|
@@ -8385,6 +8385,15 @@ const RootContainer = () => {
|
|
|
8385
8385
|
);
|
|
8386
8386
|
}) }, sectionsWrapperKey);
|
|
8387
8387
|
};
|
|
8388
|
+
function RootContainer() {
|
|
8389
|
+
const [key, setKey] = useState(() => v4());
|
|
8390
|
+
useEffect(() => {
|
|
8391
|
+
return router.on("navigate", () => {
|
|
8392
|
+
setKey(v4());
|
|
8393
|
+
});
|
|
8394
|
+
}, []);
|
|
8395
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RootContainer$1, {}, key);
|
|
8396
|
+
}
|
|
8388
8397
|
function CreopseProvider({ children, options }) {
|
|
8389
8398
|
if (!options?.initialProps) {
|
|
8390
8399
|
throw new Error("[@creopse/react] initialProps is required");
|
package/package.json
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default RootContainer;
|
|
1
|
+
export default function RootContainer(): import("react/jsx-runtime").JSX.Element;
|