@plitzi/sdk-shared 0.36.1 → 0.37.0
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 +61 -0
- package/dist/authoring/builder.d.ts +8 -1
- package/dist/authoring/builder.mjs +8 -5
- package/dist/dataSource/hooks/useRegisterSource.mjs +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/hooks/useStableValue.d.ts +12 -0
- package/dist/hooks/useStableValue.mjs +9 -0
- package/dist/index.mjs +33 -30
- package/dist/navigation/routes.mjs +1 -1
- package/dist/network/spaceEvents.d.ts +16 -4
- package/dist/network/spaceEvents.mjs +219 -224
- package/dist/queries/queryCache.d.ts +39 -2
- package/dist/queries/queryCache.mjs +35 -12
- package/dist/queries/useQuery.d.ts +1 -1
- package/dist/queries/useQuery.mjs +1 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.mjs +3 -2
- package/dist/schema/layoutChain.d.ts +17 -0
- package/dist/schema/layoutChain.mjs +25 -0
- package/dist/store/index.d.ts +23 -23
- package/dist/store/tracing/tracingCollector.d.ts +2 -0
- package/dist/store/tracing/tracingCollector.mjs +56 -36
- package/dist/style/index.d.ts +1 -0
- package/dist/style/index.mjs +2 -1
- package/dist/style/styleConstants.d.ts +9 -2
- package/dist/style/styleConstants.mjs +16 -0
- package/dist/style/styleStates.d.ts +17 -0
- package/dist/style/styleStates.mjs +31 -0
- package/dist/types/ElementTypes.d.ts +6 -3
- package/dist/types/SchemaTypes.d.ts +5 -1
- package/dist/types/StoreTypes.d.ts +6 -0
- package/dist/types/StyleTypes.d.ts +17 -2
- package/package.json +23 -11
package/dist/schema/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import e from "./SchemaContext.mjs";
|
|
2
2
|
import { EMPTY_SCHEMA as t, VARIABLE_REGEX as n } from "./schemaConstants.mjs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { findLayoutCycle as r, resolveLayoutChain as i } from "./layoutChain.mjs";
|
|
4
|
+
import { collectServerElements as a, hasServerElements as o } from "./serverElements.mjs";
|
|
5
|
+
export { t as EMPTY_SCHEMA, e as SchemaContext, n as VARIABLE_REGEX, a as collectServerElements, r as findLayoutCycle, o as hasServerElements, i as resolveLayoutChain };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Element } from '../types';
|
|
2
|
+
/** One shell a page is rendered inside: the layoutContainer element, and the container in it that takes the body. */
|
|
3
|
+
export type LayoutLink = {
|
|
4
|
+
layout: string;
|
|
5
|
+
slot: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The shells around a page, innermost first.
|
|
9
|
+
*
|
|
10
|
+
* A page names ONE shell (`layout`) and the container in it its body goes into (`layoutContainer`). That shell may
|
|
11
|
+
* name one of its own the same way — analytics pages share a header and tabs, and that header sits inside the
|
|
12
|
+
* platform's sidebar shell — so the chain is followed until a shell names none. A shell the document does not hold, or
|
|
13
|
+
* one already in the chain, ends it: a cycle is a mistake in the document, and rendering it would never finish.
|
|
14
|
+
*/
|
|
15
|
+
export declare const resolveLayoutChain: (getElement: (id: string) => Element | undefined, layout: string, layoutContainer: string) => LayoutLink[];
|
|
16
|
+
/** The layouts a chain passes through that close it on itself, if any: `layout` → … → `layout`. */
|
|
17
|
+
export declare const findLayoutCycle: (getElement: (id: string) => Element | undefined, layout: string) => string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/schema/layoutChain.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
let n = e?.attributes[t];
|
|
4
|
+
return typeof n == "string" ? n : "";
|
|
5
|
+
}, t = (t, n, r) => {
|
|
6
|
+
let i = [], a = /* @__PURE__ */ new Set(), o = n, s = r;
|
|
7
|
+
for (; o && !a.has(o) && i.length < 16;) {
|
|
8
|
+
let n = t(o);
|
|
9
|
+
if (n?.definition.type !== "layoutContainer") break;
|
|
10
|
+
a.add(o), i.push({
|
|
11
|
+
layout: o,
|
|
12
|
+
slot: s || o
|
|
13
|
+
}), o = e(n, "layout"), s = e(n, "layoutContainer");
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}, n = (t, n) => {
|
|
17
|
+
let r = [], i = n;
|
|
18
|
+
for (; i && r.length <= 16;) {
|
|
19
|
+
if (r.includes(i)) return [...r.slice(r.indexOf(i)), i];
|
|
20
|
+
r.push(i), i = e(t(i), "layout");
|
|
21
|
+
}
|
|
22
|
+
return [];
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as findLayoutCycle, t as resolveLayoutChain };
|