react-minolith 2.0.3 → 2.0.4
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/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.d.ts.map +1 -1
- package/dist/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.js +12 -12
- package/dist/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.js.map +1 -1
- package/dist/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.stories.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinolithClientCustomCssVariablesProvider.d.ts","sourceRoot":"","sources":["../../../src/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA+B,MAAM,OAAO,CAAC;AAElE,OAAO,6CAA6C,MAAM,iDAAiD,CAAC;AAE5G,MAAM,CAAC,OAAO,UAAU,wCAAwC,CAC9D,KAAK,EAAE,6CAA6C,GACnD,YAAY,
|
|
1
|
+
{"version":3,"file":"MinolithClientCustomCssVariablesProvider.d.ts","sourceRoot":"","sources":["../../../src/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA+B,MAAM,OAAO,CAAC;AAElE,OAAO,6CAA6C,MAAM,iDAAiD,CAAC;AAE5G,MAAM,CAAC,OAAO,UAAU,wCAAwC,CAC9D,KAAK,EAAE,6CAA6C,GACnD,YAAY,CAqCd"}
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
import { jsx as c, Fragment as m } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { useMemo as u, useInsertionEffect as a } from "react";
|
|
4
4
|
import d from "../../utilities/minolithStyleUtility/minolithStyleUtility.js";
|
|
5
|
-
function
|
|
6
|
-
const
|
|
5
|
+
function f(e) {
|
|
6
|
+
const o = u(
|
|
7
7
|
() => d.getMinolithCssVariableStyles(
|
|
8
|
-
|
|
8
|
+
e.minolithCssVariables
|
|
9
9
|
),
|
|
10
|
-
[
|
|
10
|
+
[e.minolithCssVariables]
|
|
11
11
|
);
|
|
12
12
|
return a(() => {
|
|
13
|
-
const
|
|
13
|
+
const i = "minolith-custom-css-variables", l = () => {
|
|
14
14
|
const t = document.createElement("style");
|
|
15
|
-
return t.id =
|
|
15
|
+
return t.id = i, t.textContent = o.join(), t;
|
|
16
16
|
}, n = (t) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const r =
|
|
17
|
+
const s = t.querySelector(`#${i}`);
|
|
18
|
+
s && t.removeChild(s);
|
|
19
|
+
const r = l();
|
|
20
20
|
t.append(r);
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
}, [
|
|
22
|
+
n(document.head), document.querySelector(`#${i}`) === null && n(document.body);
|
|
23
|
+
}, [o]), /* @__PURE__ */ c(m, { children: e.children });
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
f as default
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=MinolithClientCustomCssVariablesProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinolithClientCustomCssVariablesProvider.js","sources":["../../../src/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactElement, useInsertionEffect, useMemo } from \"react\";\r\nimport minolithStyleUtility from \"../../utilities/minolithStyleUtility\";\r\nimport MinolithClientCustomCssVariablesProviderProps from \"./MinolithClientCustomCssVariablesProviderProps\";\r\n\r\nexport default function MinolithClientCustomCssVariablesProvider(\r\n props: MinolithClientCustomCssVariablesProviderProps,\r\n): ReactElement {\r\n const minolithStyles = useMemo(\r\n () =>\r\n minolithStyleUtility.getMinolithCssVariableStyles(\r\n props.minolithCssVariables,\r\n ),\r\n [props.minolithCssVariables],\r\n );\r\n\r\n useInsertionEffect(() => {\r\n const styleId = \"minolith-custom-css-variables\";\r\n\r\n const createMinolithCustomStyleElement = () => {\r\n const style = document.createElement(\"style\");\r\n style.id = styleId;\r\n style.textContent = minolithStyles.join();\r\n return style;\r\n };\r\n\r\n const setStyle = (element: HTMLElement) => {\r\n const currentCustomStyle = element.querySelector(`#${styleId}`);\r\n if (currentCustomStyle) {\r\n element.removeChild(currentCustomStyle);\r\n }\r\n\r\n const style = createMinolithCustomStyleElement();\r\n element.append(style);\r\n };\r\n\r\n
|
|
1
|
+
{"version":3,"file":"MinolithClientCustomCssVariablesProvider.js","sources":["../../../src/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactElement, useInsertionEffect, useMemo } from \"react\";\r\nimport minolithStyleUtility from \"../../utilities/minolithStyleUtility\";\r\nimport MinolithClientCustomCssVariablesProviderProps from \"./MinolithClientCustomCssVariablesProviderProps\";\r\n\r\nexport default function MinolithClientCustomCssVariablesProvider(\r\n props: MinolithClientCustomCssVariablesProviderProps,\r\n): ReactElement {\r\n const minolithStyles = useMemo(\r\n () =>\r\n minolithStyleUtility.getMinolithCssVariableStyles(\r\n props.minolithCssVariables,\r\n ),\r\n [props.minolithCssVariables],\r\n );\r\n\r\n useInsertionEffect(() => {\r\n const styleId = \"minolith-custom-css-variables\";\r\n\r\n const createMinolithCustomStyleElement = () => {\r\n const style = document.createElement(\"style\");\r\n style.id = styleId;\r\n style.textContent = minolithStyles.join();\r\n return style;\r\n };\r\n\r\n const setStyle = (element: HTMLElement) => {\r\n const currentCustomStyle = element.querySelector(`#${styleId}`);\r\n if (currentCustomStyle) {\r\n element.removeChild(currentCustomStyle);\r\n }\r\n\r\n const style = createMinolithCustomStyleElement();\r\n element.append(style);\r\n };\r\n\r\n setStyle(document.head);\r\n\r\n if (document.querySelector(`#${styleId}`) === null) {\r\n setStyle(document.body);\r\n }\r\n }, [minolithStyles]);\r\n\r\n return <>{props.children}</>;\r\n}\r\n"],"names":["MinolithClientCustomCssVariablesProvider","props","minolithStyles","useMemo","minolithStyleUtility","useInsertionEffect","styleId","createMinolithCustomStyleElement","style","setStyle","element","currentCustomStyle","jsx","Fragment"],"mappings":";;;;AAMA,SAAwBA,EACtBC,GACc;AACd,QAAMC,IAAiBC;AAAA,IACrB,MACEC,EAAqB;AAAA,MACnBH,EAAM;AAAA,IAAA;AAAA,IAEV,CAACA,EAAM,oBAAoB;AAAA,EAAA;AAG7B,SAAAI,EAAmB,MAAM;AACvB,UAAMC,IAAU,iCAEVC,IAAmC,MAAM;AAC7C,YAAMC,IAAQ,SAAS,cAAc,OAAO;AAC5C,aAAAA,EAAM,KAAKF,GACXE,EAAM,cAAcN,EAAe,KAAA,GAC5BM;AAAA,IACT,GAEMC,IAAW,CAACC,MAAyB;AACzC,YAAMC,IAAqBD,EAAQ,cAAc,IAAIJ,CAAO,EAAE;AAC9D,MAAIK,KACFD,EAAQ,YAAYC,CAAkB;AAGxC,YAAMH,IAAQD,EAAA;AACd,MAAAG,EAAQ,OAAOF,CAAK;AAAA,IACtB;AAEA,IAAAC,EAAS,SAAS,IAAI,GAElB,SAAS,cAAc,IAAIH,CAAO,EAAE,MAAM,QAC5CG,EAAS,SAAS,IAAI;AAAA,EAE1B,GAAG,CAACP,CAAc,CAAC,GAEZ,gBAAAU,EAAAC,GAAA,EAAG,YAAM,SAAA,CAAS;AAC3B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinolithClientCustomCssVariablesProvider.stories.d.ts","sourceRoot":"","sources":["../../../src/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiD3D,OAAO,wCAAwC,MAAM,GAAG,CAAC;AAIzD,QAAA,MAAM,IAAI;;;;;CAKuD,CAAC;AAElE,eAAe,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MinolithClientCustomCssVariablesProvider.stories.d.ts","sourceRoot":"","sources":["../../../src/base/MinolithClientCustomCssVariablesProvider/MinolithClientCustomCssVariablesProvider.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiD3D,OAAO,wCAAwC,MAAM,GAAG,CAAC;AAIzD,QAAA,MAAM,IAAI;;;;;CAKuD,CAAC;AAElE,eAAe,IAAI,CAAC;AA24BpB,eAAO,MAAM,uBAAuB,EAAE,OAgBrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAgBpC,CAAC"}
|