@plitzi/sdk-shared 0.38.3 → 0.38.5
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 +522 -0
- package/dist/actions/functions.d.ts +10 -0
- package/dist/actions/functions.mjs +10 -10
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.mjs +6 -6
- package/dist/authoring/elementCallbacks.d.ts +2 -2
- package/dist/dataSource/getBindingsDetails.mjs +1 -1
- package/dist/devTools/chrome.d.ts +8 -0
- package/dist/devTools/chrome.mjs +4 -0
- package/dist/devTools/index.d.ts +1 -0
- package/dist/devTools/index.mjs +5 -4
- package/dist/helpers/images.d.ts +5 -0
- package/dist/helpers/images.mjs +2 -2
- package/dist/helpers/twigWrapper/inspectTemplate.mjs +14 -7
- package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +4 -3
- package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +32 -22
- package/dist/history/types.d.ts +4 -4
- package/dist/index.mjs +56 -54
- package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.d.ts +10 -0
- package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +4 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +124 -122
- package/dist/network/graphql/builder/Queries/InitQuery.d.ts +1 -3
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +4 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +2 -0
- package/dist/network/graphql/builder/Queries/index.mjs +22 -20
- package/dist/network/spaceEvents.d.ts +2 -2
- package/dist/plugins/bundle.d.ts +26 -0
- package/dist/plugins/bundle.mjs +62 -0
- package/dist/plugins/declaration.d.ts +12 -0
- package/dist/plugins/declaration.mjs +9 -0
- package/dist/queries/queryCache.d.ts +7 -0
- package/dist/queries/queryCache.mjs +14 -7
- package/dist/queries/useQuery.d.ts +2 -0
- package/dist/queries/useQuery.mjs +5 -2
- package/dist/schema/anchor.d.ts +11 -0
- package/dist/schema/anchor.mjs +6 -2
- package/dist/schema/index.mjs +6 -6
- package/dist/schema/markdownHeadings.d.ts +13 -0
- package/dist/schema/markdownHeadings.mjs +24 -0
- package/dist/schema/motion.d.ts +47 -15
- package/dist/schema/motion.mjs +208 -32
- package/dist/schema/motionReveal.d.ts +10 -0
- package/dist/schema/motionReveal.mjs +23 -0
- package/dist/schema/pageElements.d.ts +12 -0
- package/dist/schema/pageElements.mjs +41 -0
- package/dist/schema/wire.mjs +4 -3
- package/dist/server/index.mjs +4 -4
- package/dist/server/rsc/projectData.d.ts +6 -0
- package/dist/server/rsc/projectData.mjs +4 -0
- package/dist/server/rsc/refreshRsc.d.ts +18 -5
- package/dist/server/rsc/refreshRsc.mjs +80 -20
- package/dist/server/rsc/useRscSync.mjs +26 -15
- package/dist/server/usePluginRoute.d.ts +18 -0
- package/dist/server/usePluginRoute.mjs +14 -0
- package/dist/source/export.d.ts +18 -0
- package/dist/source/import.d.ts +55 -0
- package/dist/source/import.mjs +4 -0
- package/dist/source/index.d.ts +2 -0
- package/dist/source/index.mjs +3 -2
- package/dist/store/index.d.ts +45 -45
- package/dist/style/cssLayers.d.ts +18 -0
- package/dist/style/cssLayers.mjs +14 -0
- package/dist/style/index.d.ts +1 -0
- package/dist/style/index.mjs +11 -10
- package/dist/style/styleConstants.d.ts +10 -2
- package/dist/style/styleConstants.mjs +16 -0
- package/dist/style/useDisplayMode.d.ts +11 -0
- package/dist/style/useDisplayMode.mjs +18 -0
- package/dist/types/ActionTypes.d.ts +3 -3
- package/dist/types/ComponentTypes.d.ts +13 -0
- package/dist/types/DataTypes.d.ts +36 -0
- package/dist/types/InteractionTypes.d.ts +16 -2
- package/dist/types/SchemaTypes.d.ts +10 -2
- package/dist/types/SchemaTypes.mjs +2 -1
- package/dist/types/ServerTypes.d.ts +60 -8
- package/dist/types/StoreTypes.d.ts +19 -6
- package/dist/types/index.d.ts +1 -2
- package/package.json +58 -28
- package/setupTests.ts +16 -13
- package/dist/types/AITypes.d.ts +0 -80
- package/dist/types/McpTypes/index.d.ts +0 -56
- package/dist/types/McpTypes/index.mjs +0 -0
- /package/dist/types/{AITypes.mjs → DataTypes.mjs} +0 -0
package/dist/actions/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { accessRefusal as e } from "./access.mjs";
|
|
2
2
|
import { cronFiresBetween as t, cronMatches as n, cronNextFire as r, isKnownTimeZone as i, parseCron as a, zonedClock as o } from "./cron.mjs";
|
|
3
3
|
import { FAILURE_HANDLER_TASK as s } from "./failureHandler.mjs";
|
|
4
|
-
import { DEFAULT_FUNCTION_TIME_LIMITS as c, FUNCTION_ROUTES_PREFIX as l,
|
|
5
|
-
import { triggerAccess as
|
|
6
|
-
import { actionName as
|
|
7
|
-
import { isActionDocument as
|
|
8
|
-
import { SMTP_CREDENTIAL_KEYS as
|
|
9
|
-
export { c as DEFAULT_FUNCTION_TIME_LIMITS, s as FAILURE_HANDLER_TASK, l as FUNCTION_ROUTES_PREFIX,
|
|
4
|
+
import { DEFAULT_FUNCTION_TIME_LIMITS as c, FUNCTION_ROUTES_PREFIX as l, PLUGIN_FUNCTIONS_SOURCE as u, PLUGIN_ROUTES_SEGMENT as d, isFunctionRoutePath as f, isFunctionsSourcePath as p, pluginRoutePath as m, readFunctionsSource as h } from "./functions.mjs";
|
|
5
|
+
import { triggerAccess as g, triggerCacheMs as _, triggerHasStaleVerify as v, triggerInput as y, triggerVerify as b } from "./triggerParams.mjs";
|
|
6
|
+
import { actionName as x, actionTriggers as S, isActionEnabled as C } from "./triggers.mjs";
|
|
7
|
+
import { isActionDocument as w, validateActionDocument as T } from "./validateDocument.mjs";
|
|
8
|
+
import { SMTP_CREDENTIAL_KEYS as E, isSingleEmailAddress as D, readSmtpCredential as O } from "./smtp.mjs";
|
|
9
|
+
export { c as DEFAULT_FUNCTION_TIME_LIMITS, s as FAILURE_HANDLER_TASK, l as FUNCTION_ROUTES_PREFIX, u as PLUGIN_FUNCTIONS_SOURCE, d as PLUGIN_ROUTES_SEGMENT, E as SMTP_CREDENTIAL_KEYS, e as accessRefusal, x as actionName, S as actionTriggers, t as cronFiresBetween, n as cronMatches, r as cronNextFire, w as isActionDocument, C as isActionEnabled, f as isFunctionRoutePath, p as isFunctionsSourcePath, i as isKnownTimeZone, D as isSingleEmailAddress, a as parseCron, m as pluginRoutePath, h as readFunctionsSource, O as readSmtpCredential, g as triggerAccess, _ as triggerCacheMs, v as triggerHasStaleVerify, y as triggerInput, b as triggerVerify, T as validateActionDocument, o as zonedClock };
|
|
@@ -53,13 +53,13 @@ export declare const SCROLL_CALLBACKS: {
|
|
|
53
53
|
type: "select";
|
|
54
54
|
description: string;
|
|
55
55
|
default: string;
|
|
56
|
-
options: ("
|
|
56
|
+
options: ("start" | "center" | "end" | "nearest")[];
|
|
57
57
|
};
|
|
58
58
|
inline: {
|
|
59
59
|
type: "select";
|
|
60
60
|
description: string;
|
|
61
61
|
default: string;
|
|
62
|
-
options: ("
|
|
62
|
+
options: ("start" | "center" | "end" | "nearest")[];
|
|
63
63
|
};
|
|
64
64
|
behavior: BuiltinParam;
|
|
65
65
|
};
|
|
@@ -8,7 +8,7 @@ import { produce as s } from "immer";
|
|
|
8
8
|
var c = (e, t, n, r, a) => {
|
|
9
9
|
let o = r === "initialState" ? `definition.${r}.${a}` : `${r}.${a}`;
|
|
10
10
|
return {
|
|
11
|
-
fromValue: t ? i(e, t
|
|
11
|
+
fromValue: t ? i(e, t) : void 0,
|
|
12
12
|
toValue: i(n, o, t ? i(e, t) : void 0)
|
|
13
13
|
};
|
|
14
14
|
}, l = (l, u, d = {}) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attribute every piece of the dev tools' own chrome carries — the badge, the panel — so whatever looks at the
|
|
3
|
+
* page rather than at the tools can leave it out: `plitzi shot` and `plitzi check` hide it, and a picture of a page is
|
|
4
|
+
* a picture of the page.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEV_TOOLS_ATTRIBUTE = "data-plitzi-devtools";
|
|
7
|
+
/** The rule that hides the dev tools' chrome, for a capture of the page alone. */
|
|
8
|
+
export declare const HIDE_DEV_TOOLS_CSS = "[data-plitzi-devtools] { display: none !important; }";
|
package/dist/devTools/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { default as debugCookieName } from './debugCookie';
|
|
|
2
2
|
import { default as DevToolsContext } from './DevToolsContext';
|
|
3
3
|
import { default as isInteractionFlow } from './interactionLog';
|
|
4
4
|
import { default as PlitziConsole } from './utils/PlitziConsole';
|
|
5
|
+
export * from './chrome';
|
|
5
6
|
export * from './debugCookie';
|
|
6
7
|
export * from './DevToolsContext';
|
|
7
8
|
export * from './interactionLog';
|
package/dist/devTools/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import e from "./DevToolsContext.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
import { DEV_TOOLS_ATTRIBUTE as t, HIDE_DEV_TOOLS_CSS as n } from "./chrome.mjs";
|
|
3
|
+
import { debugCookieName as r } from "./debugCookie.mjs";
|
|
4
|
+
import i from "./interactionLog.mjs";
|
|
5
|
+
import a, { createStoreDevToolsLogger as o, pConsole as s } from "./utils/PlitziConsole.mjs";
|
|
6
|
+
export { t as DEV_TOOLS_ATTRIBUTE, e as DevToolsContext, n as HIDE_DEV_TOOLS_CSS, a as PlitziConsole, o as createStoreDevToolsLogger, r as debugCookieName, i as isInteractionFlow, s as pConsole };
|
package/dist/helpers/images.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export type ImageWidth = (typeof IMAGE_WIDTHS)[number];
|
|
|
12
12
|
export declare const isImageWidth: (width: number) => width is ImageWidth;
|
|
13
13
|
/** A picture another site serves — the only kind there is anything to resize; a path of this site is served as it is. */
|
|
14
14
|
export declare const isRemoteImage: (src: string) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the page server makes sizes of a picture: another site's, and not a vector — an SVG is the same at any width,
|
|
17
|
+
* and the endpoint sends one back to where it is.
|
|
18
|
+
*/
|
|
19
|
+
export declare const isResizableImage: (src: string) => boolean;
|
|
15
20
|
/** The address of `src` at `width` on the endpoint. */
|
|
16
21
|
export declare const imageUrl: (endpoint: string, src: string, width: ImageWidth) => string;
|
|
17
22
|
/** Every width as a `srcset`, for the browser to pick the one its layout needs. */
|
package/dist/helpers/images.mjs
CHANGED
|
@@ -8,6 +8,6 @@ var e = "/_plitzi/img", t = [
|
|
|
8
8
|
1280,
|
|
9
9
|
1600,
|
|
10
10
|
1920
|
|
11
|
-
], n = (e) => t.some((t) => t === e), r = (e) => /^https?:\/\//i.test(e), i = (e, t, n) => `${e}?url=${encodeURIComponent(t)}&w=${String(n)}`,
|
|
11
|
+
], n = (e) => t.some((t) => t === e), r = (e) => /^https?:\/\//i.test(e), i = (e) => r(e) && !/\.svgz?(?:[?#]|$)/i.test(e), a = (e, t, n) => `${e}?url=${encodeURIComponent(t)}&w=${String(n)}`, o = (e, n) => t.map((t) => `${a(e, n, t)} ${String(t)}w`).join(", ");
|
|
12
12
|
//#endregion
|
|
13
|
-
export { e as IMAGE_PATH, t as IMAGE_WIDTHS,
|
|
13
|
+
export { e as IMAGE_PATH, t as IMAGE_WIDTHS, o as imageSrcSet, a as imageUrl, n as isImageWidth, r as isRemoteImage, i as isResizableImage };
|
|
@@ -7,7 +7,14 @@ var r = /* @__PURE__ */ new Set([
|
|
|
7
7
|
"max",
|
|
8
8
|
"min",
|
|
9
9
|
"range"
|
|
10
|
-
]), i =
|
|
10
|
+
]), i = (e) => `value|round(0, '${e}')`, a = {
|
|
11
|
+
floor: i("floor"),
|
|
12
|
+
ceil: i("ceil"),
|
|
13
|
+
clamp: "min(max(value, low), high)"
|
|
14
|
+
}, o = (t) => {
|
|
15
|
+
let n = Object.hasOwn(e, t) ? `value|${t}` : a[t];
|
|
16
|
+
return `Unknown function "${t}()"${n ? ` — write \`${n}\`` : ""}: the functions are ${[...r].join(", ")}`;
|
|
17
|
+
}, s = "loop", c = class {
|
|
11
18
|
issues = [];
|
|
12
19
|
freeNames = /* @__PURE__ */ new Set();
|
|
13
20
|
nodes(e, t) {
|
|
@@ -29,7 +36,7 @@ var r = /* @__PURE__ */ new Set([
|
|
|
29
36
|
let e = /* @__PURE__ */ new Set([
|
|
30
37
|
...n,
|
|
31
38
|
t.valueVar,
|
|
32
|
-
|
|
39
|
+
s,
|
|
33
40
|
...t.keyVar ? [t.keyVar] : []
|
|
34
41
|
]);
|
|
35
42
|
this.nodes(t.body, e), n = /* @__PURE__ */ new Set([...n, ...this.setsIn(t.body)]), t.elseBody && this.nodes(t.elseBody, n);
|
|
@@ -70,7 +77,7 @@ var r = /* @__PURE__ */ new Set([
|
|
|
70
77
|
this.expression(e.object, t), this.expression(e.index, t);
|
|
71
78
|
return;
|
|
72
79
|
case "function":
|
|
73
|
-
r.has(e.name) || this.issues.push(
|
|
80
|
+
r.has(e.name) || this.issues.push(o(e.name)), e.args.forEach((e) => this.expression(e, t));
|
|
74
81
|
return;
|
|
75
82
|
case "filter":
|
|
76
83
|
this.expression(e.subject, t), this.filterNames(e.filters.map((e) => e.name));
|
|
@@ -94,17 +101,17 @@ var r = /* @__PURE__ */ new Set([
|
|
|
94
101
|
case "arrow": this.expression(e.body, /* @__PURE__ */ new Set([...t, ...e.params]));
|
|
95
102
|
}
|
|
96
103
|
}
|
|
97
|
-
},
|
|
104
|
+
}, l = (e) => {
|
|
98
105
|
let r = t(e);
|
|
99
106
|
if (r.error) return {
|
|
100
107
|
issues: [r.error],
|
|
101
108
|
freeNames: []
|
|
102
109
|
};
|
|
103
|
-
let i = new
|
|
104
|
-
return
|
|
110
|
+
let i = new c(), { nodes: a, error: o } = n(r.tokens, !1, i.issues);
|
|
111
|
+
return o && i.issues.push(o), i.nodes(a, /* @__PURE__ */ new Set()), {
|
|
105
112
|
issues: [...new Set(i.issues)],
|
|
106
113
|
freeNames: [...i.freeNames]
|
|
107
114
|
};
|
|
108
115
|
};
|
|
109
116
|
//#endregion
|
|
110
|
-
export {
|
|
117
|
+
export { l as inspectTemplate };
|
|
@@ -5,7 +5,8 @@ export declare const processTwig: (template: string, variables?: Record<string,
|
|
|
5
5
|
* boolean, `{{ total }}` the number it holds.
|
|
6
6
|
*
|
|
7
7
|
* A template that is one `{{ expression }}` and nothing else (surrounding whitespace aside) answers that expression's
|
|
8
|
-
* value untouched
|
|
8
|
+
* value untouched — and so does one whose `{% set %}` name the parts of that expression first. Anything with text
|
|
9
|
+
* around it, or other tags, is text by nature and renders as {@link processTwig}.
|
|
9
10
|
*
|
|
10
11
|
* Unlike `processTwig`'s `asRaw`, nothing goes through JSON on the way: `0`, `false` and `null` come back as
|
|
11
12
|
* themselves, and a string that looks like a number stays a string.
|
|
@@ -14,8 +15,8 @@ export declare const processTwigValue: (template: string, variables?: Record<str
|
|
|
14
15
|
/**
|
|
15
16
|
* A flow step's param — in the browser's flows and in a server action's — as the value the step is handed.
|
|
16
17
|
*
|
|
17
|
-
* A param that is one `{{ expression }}` is that expression's value, exactly:
|
|
18
|
-
* looks. The type is the VALUE's, never guessed from its text — which is what the step params used to do, rendering
|
|
18
|
+
* A param that is one `{{ expression }}` (after any `{% set %}` naming its parts) is that expression's value, exactly:
|
|
19
|
+
* a string stays a string however it looks. The type is the VALUE's, never guessed from its text — which is what the step params used to do, rendering
|
|
19
20
|
* the value to text and reading the text back as JSON: a password typed as `1234` reached the server as a number, and
|
|
20
21
|
* a text field declared `text` on the far side then saw no password at all. What a param should be converted to is
|
|
21
22
|
* the business of whoever declares its type — `setState`'s `type`, an action's input fields — not of the resolver.
|
|
@@ -32,21 +32,31 @@ var s = (i, s = {}, c = !1, l = !1) => {
|
|
|
32
32
|
} catch {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
}, u = (e
|
|
35
|
+
}, u = (e) => {
|
|
36
|
+
let t = e?.filter((e) => e.type !== "text" || e.value.trim() !== "") ?? [], n = t.at(-1), r = t.slice(0, -1);
|
|
37
|
+
if (n?.type === "variable" && r.every((e) => e.type === "set")) return {
|
|
38
|
+
statements: r,
|
|
39
|
+
expression: n.expression
|
|
40
|
+
};
|
|
41
|
+
}, d = ({ statements: e, expression: n }, a) => {
|
|
42
|
+
let o = "variables" in a ? t(a) : a;
|
|
43
|
+
if (e.length === 0) return i(n, o);
|
|
44
|
+
let { variables: s } = r(e, o);
|
|
45
|
+
return Object.assign(a, s), i(n, s);
|
|
46
|
+
}, f = (e, t = {}) => {
|
|
36
47
|
if (typeof e != "string") return e;
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
48
|
+
let n = o(e), r = u(n ? n.nodes ?? n.nodesWithSource : null);
|
|
49
|
+
if (!r) return s(e, t);
|
|
39
50
|
try {
|
|
40
|
-
|
|
41
|
-
return i(a[0].expression, e);
|
|
51
|
+
return d(r, t);
|
|
42
52
|
} catch {
|
|
43
53
|
return e;
|
|
44
54
|
}
|
|
45
|
-
},
|
|
55
|
+
}, p = /* @__PURE__ */ new Set([
|
|
46
56
|
"json_encode",
|
|
47
57
|
"to_json",
|
|
48
58
|
"object_as_json"
|
|
49
|
-
]),
|
|
59
|
+
]), m = (e) => e.type === "filter" && p.has(e.filters[e.filters.length - 1]?.name ?? ""), h = (e) => {
|
|
50
60
|
let t = e.trim();
|
|
51
61
|
if (!t.startsWith("{") && !t.startsWith("[")) return e;
|
|
52
62
|
try {
|
|
@@ -54,28 +64,28 @@ var s = (i, s = {}, c = !1, l = !1) => {
|
|
|
54
64
|
} catch {
|
|
55
65
|
return e;
|
|
56
66
|
}
|
|
57
|
-
},
|
|
67
|
+
}, g = (e, t = {}) => {
|
|
58
68
|
if (typeof e != "string") return e;
|
|
59
|
-
let
|
|
60
|
-
if (
|
|
61
|
-
let
|
|
62
|
-
if (
|
|
63
|
-
let r = s(e,
|
|
64
|
-
return typeof r == "string" ?
|
|
69
|
+
let n = o(e), r = u(n ? n.nodes ?? n.nodesWithSource : null);
|
|
70
|
+
if (!r) {
|
|
71
|
+
let n = e.includes("\"") ? l(e, t) : void 0;
|
|
72
|
+
if (n !== void 0) return n;
|
|
73
|
+
let r = s(e, t);
|
|
74
|
+
return typeof r == "string" ? h(r) : r;
|
|
65
75
|
}
|
|
66
|
-
let { expression:
|
|
76
|
+
let { expression: i } = r;
|
|
67
77
|
try {
|
|
68
|
-
let e =
|
|
69
|
-
if (
|
|
70
|
-
if (typeof
|
|
71
|
-
return JSON.parse(
|
|
78
|
+
let e = d(r, t);
|
|
79
|
+
if (e === void 0) return "";
|
|
80
|
+
if (typeof e == "string" && m(i)) try {
|
|
81
|
+
return JSON.parse(e);
|
|
72
82
|
} catch {
|
|
73
|
-
return
|
|
83
|
+
return e;
|
|
74
84
|
}
|
|
75
|
-
return
|
|
85
|
+
return e;
|
|
76
86
|
} catch {
|
|
77
87
|
return e;
|
|
78
88
|
}
|
|
79
89
|
};
|
|
80
90
|
//#endregion
|
|
81
|
-
export { s as processTwig,
|
|
91
|
+
export { s as processTwig, g as processTwigParam, f as processTwigValue };
|
package/dist/history/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** Which of a space's documents a change was made to: its schema, its style, or its functions' source. */
|
|
2
|
-
export type ChangeDocument = 'schema' | 'style' | 'functions';
|
|
2
|
+
export type ChangeDocument = 'schema' | 'style' | 'functions' | 'data';
|
|
3
3
|
/**
|
|
4
|
-
* Where a change came from: a person in the builder, an agent over MCP, the
|
|
5
|
-
*
|
|
4
|
+
* Where a change came from: a person in the builder, an agent over MCP, the autofix, a GraphQL client that is not a
|
|
5
|
+
* person, or a writer with nothing to say (a seed, a script).
|
|
6
6
|
*/
|
|
7
|
-
export type ChangeOrigin = 'builder' | 'mcp' | '
|
|
7
|
+
export type ChangeOrigin = 'builder' | 'mcp' | 'autofix' | 'api' | 'system';
|
|
8
8
|
/**
|
|
9
9
|
* What one entry is about. Schema: an element (pages and layouts are elements too), a page folder, a schema variable,
|
|
10
10
|
* a setting (`settings.<key>`, `definition.<key>`, the page order `pages`). Style: a class selector, a global style
|
package/dist/index.mjs
CHANGED
|
@@ -34,57 +34,59 @@ import ye from "./dataSource/helpers/getSourceName.mjs";
|
|
|
34
34
|
import be from "./dataSource/hooks/useRegisterSource.mjs";
|
|
35
35
|
import xe from "./dataSource/resolveVariables.mjs";
|
|
36
36
|
import Se from "./devTools/DevToolsContext.mjs";
|
|
37
|
-
import {
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import Oe from "./
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import Ke from "./
|
|
45
|
-
import
|
|
46
|
-
import {
|
|
47
|
-
import et from "./
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import
|
|
64
|
-
import {
|
|
65
|
-
import
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import
|
|
79
|
-
import
|
|
80
|
-
import
|
|
81
|
-
import {
|
|
82
|
-
import Gn from "./theme/
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import
|
|
88
|
-
import
|
|
89
|
-
import
|
|
90
|
-
|
|
37
|
+
import { DEV_TOOLS_ATTRIBUTE as Ce, HIDE_DEV_TOOLS_CSS as we } from "./devTools/chrome.mjs";
|
|
38
|
+
import { debugCookieName as Te } from "./devTools/debugCookie.mjs";
|
|
39
|
+
import Ee from "./devTools/interactionLog.mjs";
|
|
40
|
+
import De, { createStoreDevToolsLogger as Oe, pConsole as ke } from "./devTools/utils/PlitziConsole.mjs";
|
|
41
|
+
import Ae from "./elements/ComponentContext.mjs";
|
|
42
|
+
import { FLAG_GATE_PATTERN as je, FLAG_NAME_PATTERN as Me, isFlagName as Ne, isSchemaFlag as Pe } from "./flags/schemaFlag.mjs";
|
|
43
|
+
import { flagsCookieName as Fe, forcedFlagsFromCookies as Ie, parseFlagList as Le, serializeFlagList as Re, withForcedFlag as ze, writeForcedFlags as Be } from "./flags/flagsCookie.mjs";
|
|
44
|
+
import { FLAG_LAYERS as Ve, flagUserFromSSR as He, flagValues as Ue, hasConditions as We, passesFlagGate as Ge, resolveFlags as Ke, undeclaredFlagOverrides as qe } from "./flags/resolveFlags.mjs";
|
|
45
|
+
import Je from "./hooks/useStableValue.mjs";
|
|
46
|
+
import { describeChange as Ye, fieldChanges as Xe, uniqueLines as Ze } from "./history/describe.mjs";
|
|
47
|
+
import { diffSchema as Qe, diffStyle as $e, jsonCopy as et, sameValue as tt } from "./history/diff.mjs";
|
|
48
|
+
import nt from "./hooks/useFontHead.mjs";
|
|
49
|
+
import rt from "./hooks/useNetwork.mjs";
|
|
50
|
+
import it, { PlitziServiceContext as at, PlitziServiceProvider as ot } from "./hooks/usePlitziServiceContext.mjs";
|
|
51
|
+
import { WHILE_RUNNING_MODES as st } from "./types/SchemaTypes.mjs";
|
|
52
|
+
import { StyleVariableCategory as ct, isStyleVariableCategory as lt } from "./types/StyleTypes.mjs";
|
|
53
|
+
import ut, { EMPTY_STYLE_SCHEMA as dt, StyleBindingsAllowed as ft, baseDefaultValue as pt, inheritableAttributesBase as mt } from "./style/styleConstants.mjs";
|
|
54
|
+
import { DISPLAY_MODE_MIN_WIDTH as ht, displayModeAt as gt, displayModeWidthRem as _t } from "./style/breakpoints.mjs";
|
|
55
|
+
import { PLUGIN_CSS_LAYER as vt, RUNTIME_CSS_LAYER as yt, inPluginLayer as bt } from "./style/cssLayers.mjs";
|
|
56
|
+
import { DISPLAY_MODES as xt, isDisplayMode as St } from "./style/displayModes.mjs";
|
|
57
|
+
import { fontLinkAssets as Ct } from "./style/fontAssets.mjs";
|
|
58
|
+
import { SYSTEM_FONTS as wt, availableFonts as Tt, familiesInCss as Et, fontFamilyStack as Dt, fontUrlResolver as Ot, fontsToHead as kt, googleCss2Url as At, googleTextSubsetUrl as jt, isSafeFontUrl as Mt, primaryFamily as Nt } from "./style/fonts.mjs";
|
|
59
|
+
import { FontValidationError as Pt, parseSpaceFont as Ft } from "./style/fontValidation.mjs";
|
|
60
|
+
import { fallbackForFamily as It, fontsFromCss as Lt } from "./style/fontsFromCss.mjs";
|
|
61
|
+
import { LAYOUT_GRIDS as Rt, layoutGridCss as zt, layoutGridLook as Bt } from "./style/layoutGrid.mjs";
|
|
62
|
+
import { RUNTIME_STYLE_ID as Vt, markStyleCache as Ht, styleCacheFromDocument as Ut, styleCacheTravelsInDocument as Wt } from "./style/runtimeStyle.mjs";
|
|
63
|
+
import { mergeSnippetStyle as Gt, sameSelector as Kt, selectorsOf as qt } from "./style/snippetStyle.mjs";
|
|
64
|
+
import { CURRENT_PAGE_SELECTOR as Jt, HIDDEN_CLASS as Yt, STYLE_STATES as Xt, STYLE_STATE_LABELS as Zt, inCascadeOrder as Qt, isKnownState as $t, isStartingState as en, stateSuffix as tn } from "./style/styleStates.mjs";
|
|
65
|
+
import nn from "./schema/SchemaContext.mjs";
|
|
66
|
+
import { ANCHOR_PATTERN as rn, anchorOf as an, isAnchor as on, uniqueAnchor as sn } from "./schema/anchor.mjs";
|
|
67
|
+
import { COMPONENT_PROPS_SOURCE as cn, EMPTY_SCHEMA as ln, VARIABLE_REGEX as un } from "./schema/schemaConstants.mjs";
|
|
68
|
+
import { findLayoutCycle as dn, resolveLayoutChain as fn } from "./schema/layoutChain.mjs";
|
|
69
|
+
import { collectServerElements as pn, hasServerElements as mn } from "./schema/serverElements.mjs";
|
|
70
|
+
import { isSnippet as hn } from "./schema/snippet.mjs";
|
|
71
|
+
import gn from "./network/NetworkContext.mjs";
|
|
72
|
+
import _n from "./network/NetworkInternalContext.mjs";
|
|
73
|
+
import { elementFromWire as vn, schemaFromWire as yn, schemaToWire as bn } from "./schema/wire.mjs";
|
|
74
|
+
import { SpaceEvents as xn, spaceEventSchemas as Sn, validateSpaceEvent as Cn } from "./network/spaceEvents.mjs";
|
|
75
|
+
import wn from "./network/graphql/builder/Mutations/index.mjs";
|
|
76
|
+
import Tn from "./network/graphql/builder/Queries/index.mjs";
|
|
77
|
+
import En from "./network/graphql/builder/Subscriptions/index.mjs";
|
|
78
|
+
import Dn from "./network/graphql/sdk/Mutations/index.mjs";
|
|
79
|
+
import On from "./network/graphql/sdk/Queries/index.mjs";
|
|
80
|
+
import kn, { RTEvent as An, RTEventCloseCode as jn, getInstance as Mn, isRTEvent as Nn, isRTEventCloseCode as Pn, setInstance as Fn } from "./websockets/RTCodec.mjs";
|
|
81
|
+
import { THEME_CLASSES as In, THEME_COOKIE_NAME as Ln, applyThemeClass as Rn, isTheme as zn, readThemeCookie as Bn, themeFromCookies as Vn, writeThemeCookie as Hn } from "./theme/themeCookie.mjs";
|
|
82
|
+
import Un, { createThemeState as Wn, createThemeStore as Gn, resolveScheme as Kn, setAreaTheme as qn, setMachineScheme as Jn, setThemeMode as Yn, themeFor as Xn } from "./theme/themeStore.mjs";
|
|
83
|
+
import { useThemeStore as Zn } from "./theme/ThemeScope.mjs";
|
|
84
|
+
import Qn from "./theme/ThemeProvider.mjs";
|
|
85
|
+
import $n, { SPACE_THEME_AREA as er } from "./theme/useTheme.mjs";
|
|
86
|
+
import tr from "./server/actions/useActionsSync.mjs";
|
|
87
|
+
import nr, { cancelRsc as rr, currentRscLocation as ir, releaseRscRequests as ar, rscDataPath as or } from "./server/rsc/refreshRsc.mjs";
|
|
88
|
+
import sr from "./server/rsc/useRscRefresh.mjs";
|
|
89
|
+
import cr from "./server/rsc/useRscSync.mjs";
|
|
90
|
+
import { PAINTED_STATE_BUDGET as lr, clearPaintedEntry as ur, paintedEntryFromCookies as dr, paintedKeys as fr, paintedStateCookieName as pr, paintedStateFor as mr, pickPainted as hr, readPaintedEntry as gr, writePaintedEntry as _r } from "./state/paintedState.mjs";
|
|
91
|
+
import { runtimeStatePersist as vr, stateOwner as yr } from "./state/runtimeStatePersist.mjs";
|
|
92
|
+
export { rn as ANCHOR_PATTERN, x as BODYLESS_METHODS, y as BuilderContext, wn as BuilderMutations, Tn as BuilderQueries, cn as COMPONENT_PROPS_SOURCE, N as COMPUTED_GLOBALS, S as CONNECTOR_HTTP_METHODS, Jt as CURRENT_PAGE_SELECTOR, Ae as ComponentContext, C as DEFAULT_READ_ENDPOINT, Ce as DEV_TOOLS_ATTRIBUTE, xt as DISPLAY_MODES, ht as DISPLAY_MODE_MIN_WIDTH, Se as DevToolsContext, w as EMPTY_RESPONSE_METHODS, ln as EMPTY_SCHEMA, dt as EMPTY_STYLE_SCHEMA, je as FLAG_GATE_PATTERN, Ve as FLAG_LAYERS, Me as FLAG_NAME_PATTERN, Pt as FontValidationError, P as GLOBAL_SOURCES, Yt as HIDDEN_CLASS, we as HIDE_DEV_TOOLS_CSS, ee as INTERVAL_TRIGGER, Rt as LAYOUT_GRIDS, m as MAX_PARAM_PASSES, te as MIN_INTERVAL_MS, gn as NetworkContext, _n as NetworkInternalContext, lr as PAINTED_STATE_BUDGET, vt as PLUGIN_CSS_LAYER, oe as ParamsFromURL, De as PlitziConsole, at as PlitziServiceContext, ot as PlitziServiceProvider, T as READ_ENDPOINT_NAMES, kn as RTCodec, An as RTEvent, jn as RTEventCloseCode, yt as RUNTIME_CSS_LAYER, Vt as RUNTIME_STYLE_ID, er as SPACE_THEME_AREA, Xt as STYLE_STATES, Zt as STYLE_STATE_LABELS, wt as SYSTEM_FONTS, nn as SchemaContext, Dn as SdkMutations, On as SdkQueries, En as SpaceEventSubscription, xn as SpaceEvents, ft as StyleBindingsAllowed, ct as StyleVariableCategory, In as THEME_CLASSES, Ln as THEME_COOKIE_NAME, Qn as ThemeProvider, un as VARIABLE_REGEX, a as VISITOR_NAME, st as WHILE_RUNNING_MODES, E as WRITE_ENDPOINT_NAMES, an as anchorOf, Rn as applyThemeClass, t as authFailureFromResponse, Tt as availableFonts, pt as baseDefaultValue, rr as cancelRsc, o as checkVisitorRoles, ur as clearPaintedEntry, pn as collectServerElements, k as connectorPresets, D as connectorTokens, b as contexts, B as cookieFromHeader, Oe as createStoreDevToolsLogger, Wn as createThemeState, Gn as createThemeStore, ir as currentRscLocation, Te as debugCookieName, se as delay, Ye as describeChange, Qe as diffSchema, $e as diffStyle, he as disableReactDevTools, gt as displayModeAt, _t as displayModeWidthRem, V as documentCookies, vn as elementFromWire, H as elementOf, A as emptyManifest, ce as emptyObject, F as evaluateComputed, ae as evaluateRuleGroup, It as fallbackForFamily, Et as familiesInCss, L as fetchManifest, Xe as fieldChanges, c as filters, dn as findLayoutCycle, He as flagUserFromSSR, Ue as flagValues, Fe as flagsCookieName, Dt as fontFamilyStack, Ct as fontLinkAssets, Ot as fontUrlResolver, Lt as fontsFromCss, kt as fontsToHead, Ie as forcedFlagsFromCookies, K as formatDate, q as formatDateUTC, J as formatFromNow, Y as formatUTCToLocal, R as generateFacade, ve as getBindingsDetails, O as getConnectorTokens, le as getDisplayName, X as getDurationMs, Mn as getInstance, ue as getKeyDecoded, de as getPathsFromObeject, ye as getSourceName, At as googleCss2Url, jt as googleTextSubsetUrl, We as hasConditions, mn as hasServerElements, f as hasTemplateSyntax, p as hasValidToken, fe as hexToRGB, Qt as inCascadeOrder, bt as inPluginLayer, mt as inheritableAttributesBase, g as inspectTemplate, ne as intervalOf, on as isAnchor, j as isConnectorManifestDraft, re as isDate, St as isDisplayMode, U as isElementTarget, Ne as isFlagName, pe as isInViewport, Ee as isInteractionFlow, $t as isKnownState, W as isNodeTarget, Nn as isRTEvent, Pn as isRTEventCloseCode, e as isRecord, Mt as isSafeFontUrl, Pe as isSchemaFlag, hn as isSnippet, en as isStartingState, lt as isStyleVariableCategory, zn as isTheme, ie as isUserEdit, Z as isValidFormat, et as jsonCopy, zt as layoutGridCss, Bt as layoutGridLook, I as liveSources, me as makeId, Ht as markStyleCache, Gt as mergeSnippetStyle, G as nodeOf, n as onAuthFailure, ke as pConsole, dr as paintedEntryFromCookies, fr as paintedKeys, pr as paintedStateCookieName, mr as paintedStateFor, Q as parseDate, Le as parseFlagList, Ft as parseSpaceFont, Ge as passesFlagGate, hr as pickPainted, Nt as primaryFamily, l as processTwig, u as processTwigParam, d as processTwigValue, gr as readPaintedEntry, Bn as readThemeCookie, nr as refreshRsc, ar as releaseRscRequests, r as reportAuthFailure, Ke as resolveFlags, fn as resolveLayoutChain, Kn as resolveScheme, h as resolveStepParam, xe as resolveVariables, or as rscDataPath, vr as runtimeStatePersist, i as sameRegistrableDomain, Kt as sameSelector, tt as sameValue, yn as schemaFromWire, bn as schemaToWire, qt as selectorsOf, Re as serializeFlagList, qn as setAreaTheme, Fn as setInstance, Jn as setMachineScheme, Yn as setThemeMode, Sn as spaceEventSchemas, yr as stateOwner, tn as stateSuffix, Ut as styleCacheFromDocument, Wt as styleCacheTravelsInDocument, ut as styleConstants, z as syntaxHighlight, _ as templatePaths, v as templateRootNames, Xn as themeFor, Vn as themeFromCookies, Un as themeStore, $ as toUnixSeconds, qe as undeclaredFlagOverrides, sn as uniqueAnchor, Ze as uniqueLines, tr as useActionsSync, nt as useFontHead, rt as useNetwork, it as usePlitziServiceContext, be as useRegisterSource, sr as useRscRefresh, cr as useRscSync, Je as useStableValue, $n as useTheme, Zn as useThemeStore, ge as utility, _e as utilityOptions, M as validateConnectorManifest, Cn as validateSpaceEvent, s as visitorAccess, ze as withForcedFlag, Be as writeForcedFlags, _r as writePaintedEntry, Hn as writeThemeCookie };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DataProblem, DataRefusal } from '../../../../../../types';
|
|
2
|
+
/** As GraphQL carries it: one shape with every field, `ok` saying which of them mean something. */
|
|
3
|
+
export type TSpaceSaveDataMutation = {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
version: string | null;
|
|
6
|
+
problems: DataProblem[];
|
|
7
|
+
refusal: DataRefusal | null;
|
|
8
|
+
};
|
|
9
|
+
declare const SpaceSaveDataMutation = "\n mutation SpaceSaveDataMutation($files: Json!, $base: String) {\n SpaceSaveData(files: $files, base: $base) {\n ok\n version\n problems {\n file\n message\n }\n refusal {\n status\n error\n limit\n }\n }\n }\n";
|
|
10
|
+
export default SpaceSaveDataMutation;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.ts
|
|
2
|
+
var e = "\n mutation SpaceSaveDataMutation($files: Json!, $base: String) {\n SpaceSaveData(files: $files, base: $base) {\n ok\n version\n problems {\n file\n message\n }\n refusal {\n status\n error\n limit\n }\n }\n }\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -16,6 +16,7 @@ import { TSpaceUpdateComponentMutation } from './Space/components/SpaceUpdateCom
|
|
|
16
16
|
import { TSpaceAddConnectorMutation } from './Space/connectors/SpaceAddConnectorMutation';
|
|
17
17
|
import { TSpaceRemoveConnectorMutation } from './Space/connectors/SpaceRemoveConnectorMutation';
|
|
18
18
|
import { TSpaceUpdateConnectorMutation } from './Space/connectors/SpaceUpdateConnectorMutation';
|
|
19
|
+
import { TSpaceSaveDataMutation } from './Space/data/SpaceSaveDataMutation';
|
|
19
20
|
import { TSpacePublishFlagsMutation } from './Space/flags/SpacePublishFlagsMutation';
|
|
20
21
|
import { TSpaceAddPageFolderMutation } from './Space/folders/SpaceAddPageFolderMutation';
|
|
21
22
|
import { TSpaceRemovePageFolderMutation } from './Space/folders/SpaceRemovePageFolderMutation';
|
|
@@ -81,6 +82,7 @@ export type BuilderMutationsMap = {
|
|
|
81
82
|
SpaceUpdateAction: TSpaceUpdateActionMutation;
|
|
82
83
|
SpaceRemoveAction: TSpaceRemoveActionMutation;
|
|
83
84
|
SpaceRunAction: TSpaceRunActionMutation;
|
|
85
|
+
SpaceSaveData: TSpaceSaveDataMutation;
|
|
84
86
|
SpaceSaveFunctions: TSpaceSaveFunctionsMutation;
|
|
85
87
|
SpaceRemoveFunctions: TSpaceRemoveFunctionsMutation;
|
|
86
88
|
SpaceInstallTemplateFunctions: TSpaceInstallTemplateFunctionsMutation;
|