@plitzi/sdk-shared 0.32.1 → 0.32.3
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/CHANGELOG.md +16 -0
- package/dist/dataSource/getBindingsDetails.d.ts +10 -0
- package/dist/dataSource/getBindingsDetails.mjs +49 -0
- package/dist/dataSource/hooks/useRegisterSource.mjs +1 -1
- package/dist/dataSource/index.d.ts +2 -0
- package/dist/dataSource/index.mjs +3 -1
- package/dist/dataSource/utility/arrayMap.d.ts +6 -0
- package/dist/dataSource/utility/arrayMap.mjs +28 -0
- package/dist/dataSource/utility/capitalize.d.ts +3 -0
- package/dist/dataSource/utility/capitalize.mjs +11 -0
- package/dist/dataSource/utility/dateConverter.d.ts +3 -0
- package/dist/dataSource/utility/dateConverter.mjs +60 -0
- package/dist/dataSource/utility/index.d.ts +7 -0
- package/dist/dataSource/utility/index.mjs +22 -0
- package/dist/dataSource/utility/staticValue.d.ts +3 -0
- package/dist/dataSource/utility/staticValue.mjs +47 -0
- package/dist/dataSource/utility/stringToArray.d.ts +3 -0
- package/dist/dataSource/utility/stringToArray.mjs +20 -0
- package/dist/dataSource/utility/styleSelector.d.ts +3 -0
- package/dist/dataSource/utility/styleSelector.mjs +42 -0
- package/dist/dataSource/utility/twigTemplate.d.ts +3 -0
- package/dist/dataSource/utility/twigTemplate.mjs +26 -0
- package/dist/devTools/utils/PlitziConsole.mjs +30 -17
- package/dist/elements/index.d.ts +1 -5
- package/dist/elements/index.mjs +1 -3
- package/dist/helpers/security.mjs +2 -1
- package/dist/hooks/useNetwork.d.ts +2 -1
- package/dist/hooks/useNetwork.mjs +21 -23
- package/dist/hooks/usePlitziServiceContext.d.ts +1 -1
- package/dist/index.mjs +23 -24
- package/dist/server/index.d.ts +1 -3
- package/dist/server/index.mjs +2 -3
- package/dist/server/rsc/RscProvider.d.ts +1 -1
- package/dist/server/rsc/RscProvider.mjs +22 -22
- package/dist/store/index.d.ts +193 -0
- package/dist/store/index.mjs +5 -0
- package/dist/store/tracing/index.d.ts +8 -0
- package/dist/store/tracing/index.mjs +6 -0
- package/dist/store/tracing/preview.d.ts +3 -0
- package/dist/store/tracing/preview.mjs +38 -0
- package/dist/store/tracing/tracingCollector.d.ts +17 -0
- package/dist/store/tracing/tracingCollector.mjs +85 -0
- package/dist/store/tracing/tracingMiddleware.d.ts +2 -0
- package/dist/store/tracing/tracingMiddleware.mjs +5 -0
- package/dist/store/tracing/tracingStore.d.ts +6 -0
- package/dist/store/tracing/tracingStore.mjs +10 -0
- package/dist/store/tracing/useTracing.d.ts +6 -0
- package/dist/store/tracing/useTracing.mjs +13 -0
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/types/CommonTypes.d.ts +1 -0
- package/dist/types/ServerTypes.d.ts +10 -2
- package/dist/types/StoreTypes.d.ts +39 -0
- package/dist/websockets/RTCodec.mjs +1 -1
- package/package.json +103 -38
- package/setupTests.ts +4 -0
- package/dist/elements/ElementContext.d.ts +0 -19
- package/dist/elements/ElementContext.mjs +0 -6
- package/dist/elements/hooks/useElement.d.ts +0 -3
- package/dist/elements/hooks/useElement.mjs +0 -10
- package/dist/server/hooks/useRscData.d.ts +0 -14
- package/dist/server/hooks/useRscData.mjs +0 -16
package/dist/index.mjs
CHANGED
|
@@ -10,29 +10,28 @@ import { ParamsFromURL as _, delay as v, emptyObject as y, generateID as b, getD
|
|
|
10
10
|
import { disableReactDevTools as O } from "./helpers/security.mjs";
|
|
11
11
|
import { createStripTypenameLink as k, stripTypenameDeep as A } from "./helpers/stripTypename.mjs";
|
|
12
12
|
import j from "./dataSource/hooks/useRegisterSource.mjs";
|
|
13
|
-
import M from "./
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import L from "./
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { StyleVariableCategory as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { EMPTY_SCHEMA as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import he from "./server/hooks/useRscData.mjs";
|
|
13
|
+
import M, { utilityOptions as N } from "./dataSource/utility/index.mjs";
|
|
14
|
+
import P from "./dataSource/getBindingsDetails.mjs";
|
|
15
|
+
import F from "./devTools/DevToolsContext.mjs";
|
|
16
|
+
import I, { createStoreDevToolsLogger as L, pConsole as R } from "./devTools/utils/PlitziConsole.mjs";
|
|
17
|
+
import z from "./elements/ComponentContext.mjs";
|
|
18
|
+
import B from "./hooks/useNetwork.mjs";
|
|
19
|
+
import V, { PlitziServiceContext as H, PlitziServiceProvider as U } from "./hooks/usePlitziServiceContext.mjs";
|
|
20
|
+
import { StyleVariableCategory as W } from "./types/StyleTypes.mjs";
|
|
21
|
+
import G, { EMPTY_STYLE_SCHEMA as K, StyleBindingsAllowed as q, baseDefaultValue as J, inheritableAttributesBase as Y } from "./style/styleConstants.mjs";
|
|
22
|
+
import X from "./schema/SchemaContext.mjs";
|
|
23
|
+
import { EMPTY_SCHEMA as Z, VARIABLE_REGEX as Q } from "./schema/schemaConstants.mjs";
|
|
24
|
+
import $ from "./network/NetworkContext.mjs";
|
|
25
|
+
import ee from "./network/NetworkInternalContext.mjs";
|
|
26
|
+
import te from "./network/graphql/builder/Mutations/index.mjs";
|
|
27
|
+
import ne from "./network/graphql/builder/Queries/index.mjs";
|
|
28
|
+
import re from "./network/graphql/builder/Subscriptions/index.mjs";
|
|
29
|
+
import ie from "./network/graphql/sdk/Mutations/index.mjs";
|
|
30
|
+
import ae from "./network/graphql/sdk/Queries/index.mjs";
|
|
31
|
+
import oe from "./segments/SegmentsContext.mjs";
|
|
32
|
+
import se, { RTEvent as ce, RTEventCloseCode as le, getInstance as ue, isRTEvent as de, setInstance as fe } from "./websockets/RTCodec.mjs";
|
|
33
|
+
import pe, { ThemeContext as me } from "./theme/ThemeProvider.mjs";
|
|
34
|
+
import he from "./server/rsc/RscContext.mjs";
|
|
36
35
|
import ge from "./server/rsc/RscProvider.mjs";
|
|
37
36
|
import { runtimeStatePersist as _e } from "./state/runtimeStatePersist.mjs";
|
|
38
|
-
export { e as BuilderContext,
|
|
37
|
+
export { e as BuilderContext, te as BuilderMutations, ne as BuilderQueries, re as BuilderSubscriptions, n as CollectionContext, z as ComponentContext, F as DevToolsContext, Z as EMPTY_SCHEMA, K as EMPTY_STYLE_SCHEMA, $ as NetworkContext, ee as NetworkInternalContext, _ as ParamsFromURL, I as PlitziConsole, H as PlitziServiceContext, U as PlitziServiceProvider, se as RTCodec, ce as RTEvent, le as RTEventCloseCode, he as RscContext, ge as RscProvider, X as SchemaContext, ie as SdkMutations, ae as SdkQueries, oe as SegmentsContext, q as StyleBindingsAllowed, W as StyleVariableCategory, me as ThemeContext, pe as ThemeProvider, Q as VARIABLE_REGEX, J as baseDefaultValue, t as contexts, L as createStoreDevToolsLogger, k as createStripTypenameLink, v as delay, O as disableReactDevTools, y as emptyObject, r as fetchManifest, o as formatDate, s as formatDateUTC, c as formatFromNow, l as formatUTCToLocal, i as generateFacade, b as generateID, P as getBindingsDetails, x as getDisplayName, u as getDurationMs, ue as getInstance, S as getKeyDecoded, C as getPathsFromObeject, h as hasValidToken, w as hexToRGB, Y as inheritableAttributesBase, d as isDate, T as isInViewport, de as isRTEvent, E as isTestMode, f as isValidFormat, D as makeId, R as pConsole, p as parseDate, g as processTwig, _e as runtimeStatePersist, fe as setInstance, A as stripTypenameDeep, G as styleConstants, a as syntaxHighlight, m as toUnixSeconds, B as useNetwork, V as usePlitziServiceContext, j as useRegisterSource, M as utility, N as utilityOptions };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { default as useRscData } from './hooks/useRscData';
|
|
2
1
|
import { default as RscContext } from './rsc/RscContext';
|
|
3
2
|
import { default as RscProvider } from './rsc/RscProvider';
|
|
4
|
-
export * from './hooks/useRscData';
|
|
5
3
|
export * from './rsc/RscContext';
|
|
6
4
|
export * from './rsc/RscProvider';
|
|
7
|
-
export {
|
|
5
|
+
export { RscContext, RscProvider };
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import e from "./rsc/RscContext.mjs";
|
|
2
|
-
import t from "./
|
|
3
|
-
|
|
4
|
-
export { e as RscContext, n as RscProvider, t as useRscData };
|
|
2
|
+
import t from "./rsc/RscProvider.mjs";
|
|
3
|
+
export { e as RscContext, t as RscProvider };
|
|
@@ -9,5 +9,5 @@ export type RscProviderProps = {
|
|
|
9
9
|
/** Change this value on SPA navigation to trigger an RSC re-fetch (e.g. pass currentPageId). */
|
|
10
10
|
navigationKey?: string;
|
|
11
11
|
};
|
|
12
|
-
declare const RscProvider: ({ children, rscPath: rscPathProp, rscData, navigationKey }: RscProviderProps) => import("react
|
|
12
|
+
declare const RscProvider: ({ children, rscPath: rscPathProp, rscData, navigationKey }: RscProviderProps) => import("react").JSX.Element;
|
|
13
13
|
export default RscProvider;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import e from "./RscContext.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useCommonStore as t } from "../../store/index.mjs";
|
|
3
|
+
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
4
|
import { jsx as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/server/rsc/RscProvider.tsx
|
|
6
6
|
var s = ({ children: s, rscPath: c, rscData: l, navigationKey: u }) => {
|
|
7
|
-
let
|
|
8
|
-
if (!(!
|
|
9
|
-
let t = e?.length ? `${
|
|
7
|
+
let [d] = t("schema.rsc", { mode: "mount" }), [f, p] = a(l ?? {}), m = d?.enabled ?? !1, h = c ?? d?.path ?? "/_rsc", g = n(async (e) => {
|
|
8
|
+
if (!(!m || typeof window > "u")) try {
|
|
9
|
+
let t = e?.length ? `${h}?ids=${e.join(",")}` : h, n = await fetch(t, { headers: { Accept: "application/json" } });
|
|
10
10
|
if (!n.ok) return;
|
|
11
11
|
let r = await n.json();
|
|
12
|
-
e?.length ?
|
|
12
|
+
e?.length ? p((e) => ({ serverData: {
|
|
13
13
|
...e.serverData,
|
|
14
14
|
...r.serverData
|
|
15
|
-
} })) :
|
|
15
|
+
} })) : p({ serverData: r.serverData });
|
|
16
16
|
} catch {}
|
|
17
|
-
}, [
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
}, [m, h]);
|
|
18
|
+
r(() => {
|
|
19
|
+
m && l === void 0 && g();
|
|
20
20
|
}, [
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
m,
|
|
22
|
+
g,
|
|
23
23
|
u
|
|
24
24
|
]);
|
|
25
|
-
let
|
|
25
|
+
let _ = n((e) => f.serverData?.[e], [f.serverData]);
|
|
26
26
|
return /* @__PURE__ */ o(e, {
|
|
27
|
-
value:
|
|
28
|
-
enabled:
|
|
29
|
-
serverData:
|
|
30
|
-
getElementData:
|
|
31
|
-
refresh:
|
|
27
|
+
value: i(() => ({
|
|
28
|
+
enabled: m,
|
|
29
|
+
serverData: f.serverData,
|
|
30
|
+
getElementData: _,
|
|
31
|
+
refresh: g
|
|
32
32
|
}), [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
m,
|
|
34
|
+
f.serverData,
|
|
35
|
+
_,
|
|
36
|
+
g
|
|
37
37
|
]),
|
|
38
38
|
children: s
|
|
39
39
|
});
|