@plitzi/sdk-shared 0.38.15 → 0.38.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/actions/cron.mjs +5 -9
  3. package/dist/actions/validateDocument.mjs +24 -50
  4. package/dist/activity/describe.d.ts +6 -0
  5. package/dist/activity/describe.mjs +22 -0
  6. package/dist/activity/guard.d.ts +6 -0
  7. package/dist/activity/guard.mjs +13 -0
  8. package/dist/activity/index.d.ts +3 -0
  9. package/dist/activity/index.mjs +4 -0
  10. package/dist/activity/types.d.ts +94 -0
  11. package/dist/activity/types.mjs +4 -0
  12. package/dist/connectors/validateManifest.mjs +28 -73
  13. package/dist/dataSource/helpers/index.mjs +1 -2
  14. package/dist/dataSource/index.d.ts +1 -1
  15. package/dist/dataSource/index.mjs +6 -8
  16. package/dist/dataSource/utility/index.d.ts +1 -0
  17. package/dist/dataSource/utility/index.mjs +16 -15
  18. package/dist/devTools/utils/PlitziConsole.mjs +8 -12
  19. package/dist/elements/index.mjs +1 -2
  20. package/dist/flags/index.d.ts +2 -0
  21. package/dist/flags/index.mjs +2 -1
  22. package/dist/flags/useFlagResolution.mjs +6 -6
  23. package/dist/helpers/index.d.ts +8 -0
  24. package/dist/helpers/index.mjs +21 -13
  25. package/dist/helpers/keys.mjs +4 -8
  26. package/dist/helpers/twigWrapper/Evaluator/index.mjs +1 -2
  27. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +12 -26
  28. package/dist/helpers/twigWrapper/Parser/index.mjs +1 -2
  29. package/dist/helpers/twigWrapper/TemplateCache/index.mjs +1 -2
  30. package/dist/helpers/twigWrapper/charClass.mjs +2 -6
  31. package/dist/helpers/twigWrapper/filters/index.mjs +1 -2
  32. package/dist/helpers/twigWrapper/templateRoots.mjs +3 -8
  33. package/dist/hooks/useNetwork.mjs +1 -4
  34. package/dist/index.d.ts +5 -18
  35. package/dist/index.mjs +3 -96
  36. package/dist/network/graphql/builder/Mutations/index.d.ts +1 -0
  37. package/dist/network/graphql/builder/Mutations/index.mjs +148 -148
  38. package/dist/network/graphql/builder/Queries/index.mjs +4 -4
  39. package/dist/network/index.mjs +8 -8
  40. package/dist/plugins/{bundle.mjs → bundle/bundle.mjs} +1 -1
  41. package/dist/plugins/bundle/index.d.ts +2 -0
  42. package/dist/plugins/bundle/index.mjs +1 -0
  43. package/dist/plugins/index.d.ts +4 -0
  44. package/dist/plugins/index.mjs +3 -0
  45. package/dist/project/index.d.ts +8 -0
  46. package/dist/project/index.mjs +5 -0
  47. package/dist/project/layout.mjs +4 -4
  48. package/dist/queries/queryCache.mjs +1 -7
  49. package/dist/realtime/client.mjs +3 -12
  50. package/dist/schema/index.d.ts +5 -0
  51. package/dist/schema/index.mjs +12 -7
  52. package/dist/server/actions/useActionsSync.mjs +1 -1
  53. package/dist/server/actions/useImagesSync.mjs +1 -1
  54. package/dist/server/actions/useRealtimeSync.mjs +1 -1
  55. package/dist/server/index.d.ts +4 -0
  56. package/dist/server/index.mjs +8 -4
  57. package/dist/server/rsc/refreshRsc.mjs +11 -11
  58. package/dist/server/rsc/useRscSync.mjs +1 -1
  59. package/dist/server/usePluginRoute.mjs +1 -1
  60. package/dist/state/runtimeStatePersist.mjs +9 -15
  61. package/dist/store/index.d.ts +1 -193
  62. package/dist/store/index.mjs +6 -9
  63. package/dist/store/renderSettings.mjs +1 -1
  64. package/dist/store/storeHooks.d.ts +193 -0
  65. package/dist/store/storeHooks.mjs +5 -0
  66. package/dist/store/tracing/tracingCollector.mjs +1 -5
  67. package/dist/style/fonts.mjs +17 -25
  68. package/dist/style/index.d.ts +4 -0
  69. package/dist/style/index.mjs +19 -15
  70. package/dist/style/stylePseudos.mjs +2 -5
  71. package/dist/style/styleTarget.mjs +6 -6
  72. package/dist/theme/ThemeProvider.mjs +1 -1
  73. package/dist/theme/index.d.ts +1 -0
  74. package/dist/theme/index.mjs +4 -4
  75. package/dist/types/BuilderTypes.d.ts +8 -0
  76. package/dist/types/SchemaTypes.d.ts +2 -1
  77. package/dist/types/ServerTypes.d.ts +10 -1
  78. package/dist/websockets/index.mjs +1 -2
  79. package/package.json +21 -1587
  80. package/vite.config.ts +20 -4
  81. package/dist/auth/authFailureLink.d.ts +0 -9
  82. package/dist/auth/authFailureLink.mjs +0 -20
  83. package/dist/dataSource/hooks/index.d.ts +0 -4
  84. package/dist/dataSource/hooks/index.mjs +0 -3
  85. package/dist/dataSource/hooks/useRegisterSource.d.ts +0 -9
  86. package/dist/dataSource/hooks/useRegisterSource.mjs +0 -40
  87. package/dist/dataSource/hooks/useResolvedVariables.d.ts +0 -12
  88. package/dist/dataSource/hooks/useResolvedVariables.mjs +0 -28
  89. package/dist/helpers/stripTypename.d.ts +0 -15
  90. package/dist/helpers/stripTypename.mjs +0 -41
  91. /package/dist/plugins/{bundle.d.ts → bundle/bundle.d.ts} +0 -0
@@ -56,17 +56,7 @@ var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}
56
56
  this.#r.push(n), this.#r.length > this.recentLimit && this.#r.shift();
57
57
  for (let e of this.#n) e(n);
58
58
  }
59
- if (!this.callbackInternal) {
60
- this.pendingLogs.push({
61
- logType: e,
62
- category: t,
63
- message: r,
64
- params: i,
65
- time: a
66
- }), this.pendingLogs.length > this.pendingLimit && this.pendingLogs.shift();
67
- return;
68
- }
69
- this.listening ? this.logsListened.push({
59
+ this.callbackInternal ? (this.listening ? this.logsListened.push({
70
60
  logType: e,
71
61
  category: t,
72
62
  message: r,
@@ -78,7 +68,13 @@ var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}
78
68
  message: r,
79
69
  params: i,
80
70
  time: a
81
- }), this.#a()), this.logsListened.length > this.logsListenedLimit && this.logsListened.shift();
71
+ }), this.#a()), this.logsListened.length > this.logsListenedLimit && this.logsListened.shift()) : (this.pendingLogs.push({
72
+ logType: e,
73
+ category: t,
74
+ message: r,
75
+ params: i,
76
+ time: a
77
+ }), this.pendingLogs.length > this.pendingLimit && this.pendingLogs.shift());
82
78
  }
83
79
  #a() {
84
80
  this.#t || (this.#t = !0, queueMicrotask(() => {
@@ -1,2 +1 @@
1
- import e from "./ComponentContext.mjs";
2
- export { e as ComponentContext };
1
+ export { default as ComponentContext } from "./ComponentContext.mjs";
@@ -1,3 +1,5 @@
1
1
  export * from './schemaFlag';
2
2
  export * from './resolveFlags';
3
3
  export * from './flagsCookie';
4
+ export * from './useFlagResolution';
5
+ export { default as useFlagResolution } from './useFlagResolution';
@@ -1,4 +1,5 @@
1
1
  import { FLAG_GATE_PATTERN as e, FLAG_NAME_PATTERN as t, isFlagName as n, isSchemaFlag as r } from "./schemaFlag.mjs";
2
2
  import { flagsCookieName as i, forcedFlagsFromCookies as a, parseFlagList as o, serializeFlagList as s, withForcedFlag as c, writeForcedFlags as l } from "./flagsCookie.mjs";
3
3
  import { FLAG_LAYERS as u, flagUserFromSSR as d, flagValues as f, hasConditions as p, passesFlagGate as m, resolveFlags as h, undeclaredFlagOverrides as g } from "./resolveFlags.mjs";
4
- export { e as FLAG_GATE_PATTERN, u as FLAG_LAYERS, t as FLAG_NAME_PATTERN, d as flagUserFromSSR, f as flagValues, i as flagsCookieName, a as forcedFlagsFromCookies, p as hasConditions, n as isFlagName, r as isSchemaFlag, o as parseFlagList, m as passesFlagGate, h as resolveFlags, s as serializeFlagList, g as undeclaredFlagOverrides, c as withForcedFlag, l as writeForcedFlags };
4
+ import _, { flagUserFrom as v } from "./useFlagResolution.mjs";
5
+ export { e as FLAG_GATE_PATTERN, u as FLAG_LAYERS, t as FLAG_NAME_PATTERN, v as flagUserFrom, d as flagUserFromSSR, f as flagValues, i as flagsCookieName, a as forcedFlagsFromCookies, p as hasConditions, n as isFlagName, r as isSchemaFlag, o as parseFlagList, m as passesFlagGate, h as resolveFlags, s as serializeFlagList, g as undeclaredFlagOverrides, _ as useFlagResolution, c as withForcedFlag, l as writeForcedFlags };
@@ -1,7 +1,7 @@
1
- import e from "../hooks/useStableValue.mjs";
2
- import t from "../store/renderSettings.mjs";
3
- import { useCommonStore as n } from "../store/index.mjs";
4
- import { resolveFlags as r } from "./resolveFlags.mjs";
1
+ import { resolveFlags as e } from "./resolveFlags.mjs";
2
+ import t from "../hooks/useStableValue.mjs";
3
+ import { useCommonStore as n } from "../store/storeHooks.mjs";
4
+ import r from "../store/renderSettings.mjs";
5
5
  import { useMemo as i } from "react";
6
6
  //#region src/flags/useFlagResolution.ts
7
7
  var a = ({ authenticated: e, user: t }) => {
@@ -13,7 +13,7 @@ var a = ({ authenticated: e, user: t }) => {
13
13
  roles: n.roles
14
14
  } : r;
15
15
  }, o = (o) => {
16
- let { environment: s } = t(), [[c, l, u, d, f]] = n([
16
+ let { environment: s } = r(), [[c, l, u, d, f]] = n([
17
17
  "schema.flags",
18
18
  "navigation.routeParams",
19
19
  "navigation.queryParams",
@@ -23,7 +23,7 @@ var a = ({ authenticated: e, user: t }) => {
23
23
  authenticated: p,
24
24
  user: m
25
25
  }), [p, m]);
26
- return e(i(() => r(c, {
26
+ return t(i(() => e(c, {
27
27
  environment: s,
28
28
  hostname: d,
29
29
  routeParams: l,
@@ -16,3 +16,11 @@ export * from './twigWrapper';
16
16
  export * from './utils';
17
17
  export * from './security';
18
18
  export { fetchManifest, generateFacade, syntaxHighlight };
19
+ export * from './enclosingSpace';
20
+ export * from './canonicalJson';
21
+ export * from './spaceRoot';
22
+ export * from './sharedContext';
23
+ export * from './images';
24
+ export * from './keys';
25
+ export * from './scroll';
26
+ export * from './clipboard';
@@ -6,16 +6,24 @@ import { hasValidToken as o } from "./twigWrapper/tokens/hasValidToken.mjs";
6
6
  import { MAX_PARAM_PASSES as s, resolveStepParam as c } from "./twigWrapper/processTwig/resolveStepParam.mjs";
7
7
  import { inspectTemplate as l } from "./twigWrapper/inspectTemplate.mjs";
8
8
  import { templatePaths as u, templateRootNames as d } from "./twigWrapper/templateRoots.mjs";
9
- import f from "./fetchManifest.mjs";
10
- import p from "./generateFacade.mjs";
11
- import m from "./syntaxHighlight.mjs";
12
- import { cookieFromHeader as h, documentCookies as g } from "./cookies.mjs";
13
- import { elementOf as _, isElementTarget as v, isNodeTarget as y, nodeOf as b } from "./eventTarget.mjs";
14
- import { formatDate as x, formatDateUTC as S, formatFromNow as C, formatUTCToLocal as w, getDurationMs as T, isValidFormat as E, parseDate as D, toUnixSeconds as O } from "./formatDate.mjs";
15
- import { INTERVAL_TRIGGER as k, MIN_INTERVAL_MS as A, intervalOf as j } from "./interval.mjs";
16
- import { isDate as M } from "./isDate.mjs";
17
- import { isUserEdit as N } from "./reducerOrigin.mjs";
18
- import { evaluateRuleGroup as P } from "./ruleEvaluator.mjs";
19
- import { ParamsFromURL as F, delay as I, emptyObject as L, getDisplayName as R, getKeyDecoded as z, getPathsFromObject as B, hexToRGB as V, isInViewport as H, makeId as U } from "./utils.mjs";
20
- import { disableReactDevTools as W } from "./security.mjs";
21
- export { k as INTERVAL_TRIGGER, s as MAX_PARAM_PASSES, A as MIN_INTERVAL_MS, F as ParamsFromURL, h as cookieFromHeader, I as delay, W as disableReactDevTools, g as documentCookies, _ as elementOf, L as emptyObject, P as evaluateRuleGroup, f as fetchManifest, t as filters, x as formatDate, S as formatDateUTC, C as formatFromNow, w as formatUTCToLocal, p as generateFacade, R as getDisplayName, T as getDurationMs, z as getKeyDecoded, B as getPathsFromObject, a as hasTemplateSyntax, o as hasValidToken, V as hexToRGB, l as inspectTemplate, j as intervalOf, M as isDate, v as isElementTarget, H as isInViewport, y as isNodeTarget, e as isRecord, N as isUserEdit, E as isValidFormat, U as makeId, b as nodeOf, D as parseDate, n as processTwig, r as processTwigParam, i as processTwigValue, c as resolveStepParam, m as syntaxHighlight, u as templatePaths, d as templateRootNames, O as toUnixSeconds };
9
+ import { SCROLL_BEHAVIORS as f, SCROLL_POSITIONS as p, SCROLL_TRIGGER as m, scrollDistance as h, scrollPosition as g, scrollState as _ } from "./scroll.mjs";
10
+ import { sharedContext as v } from "./sharedContext.mjs";
11
+ import y from "./fetchManifest.mjs";
12
+ import b from "./generateFacade.mjs";
13
+ import x from "./syntaxHighlight.mjs";
14
+ import { cookieFromHeader as S, documentCookies as C } from "./cookies.mjs";
15
+ import { elementOf as w, isElementTarget as T, isNodeTarget as E, nodeOf as D } from "./eventTarget.mjs";
16
+ import { formatDate as O, formatDateUTC as k, formatFromNow as A, formatUTCToLocal as j, getDurationMs as M, isValidFormat as N, parseDate as P, toUnixSeconds as F } from "./formatDate.mjs";
17
+ import { INTERVAL_TRIGGER as I, MIN_INTERVAL_MS as L, intervalOf as R } from "./interval.mjs";
18
+ import { isDate as z } from "./isDate.mjs";
19
+ import { isUserEdit as B } from "./reducerOrigin.mjs";
20
+ import { evaluateRuleGroup as V } from "./ruleEvaluator.mjs";
21
+ import { ParamsFromURL as H, delay as U, emptyObject as W, getDisplayName as G, getKeyDecoded as K, getPathsFromObject as q, hexToRGB as J, isInViewport as Y, makeId as X } from "./utils.mjs";
22
+ import { disableReactDevTools as Z } from "./security.mjs";
23
+ import { EnclosingSpaceContext as Q } from "./enclosingSpace.mjs";
24
+ import { canonicalJson as $ } from "./canonicalJson.mjs";
25
+ import { SPACE_ROOT_CLASS as ee, spaceRootOf as te } from "./spaceRoot.mjs";
26
+ import { IMAGE_PATH as ne, IMAGE_WIDTHS as re, imageSrcSet as ie, imageUrl as ae, isImageWidth as oe, isRemoteImage as se, isResizableImage as ce } from "./images.mjs";
27
+ import { KEY_TRIGGER as le, isFieldEditing as ue, keyPressCombo as de, parseKeys as fe } from "./keys.mjs";
28
+ import { NOT_COPIED_REASON as pe, clipboardWriter as me, copyText as he } from "./clipboard.mjs";
29
+ export { Q as EnclosingSpaceContext, ne as IMAGE_PATH, re as IMAGE_WIDTHS, I as INTERVAL_TRIGGER, le as KEY_TRIGGER, s as MAX_PARAM_PASSES, L as MIN_INTERVAL_MS, pe as NOT_COPIED_REASON, H as ParamsFromURL, f as SCROLL_BEHAVIORS, p as SCROLL_POSITIONS, m as SCROLL_TRIGGER, ee as SPACE_ROOT_CLASS, $ as canonicalJson, me as clipboardWriter, S as cookieFromHeader, he as copyText, U as delay, Z as disableReactDevTools, C as documentCookies, w as elementOf, W as emptyObject, V as evaluateRuleGroup, y as fetchManifest, t as filters, O as formatDate, k as formatDateUTC, A as formatFromNow, j as formatUTCToLocal, b as generateFacade, G as getDisplayName, M as getDurationMs, K as getKeyDecoded, q as getPathsFromObject, a as hasTemplateSyntax, o as hasValidToken, J as hexToRGB, ie as imageSrcSet, ae as imageUrl, l as inspectTemplate, R as intervalOf, z as isDate, T as isElementTarget, ue as isFieldEditing, oe as isImageWidth, Y as isInViewport, E as isNodeTarget, e as isRecord, se as isRemoteImage, ce as isResizableImage, B as isUserEdit, N as isValidFormat, de as keyPressCombo, X as makeId, D as nodeOf, P as parseDate, fe as parseKeys, n as processTwig, r as processTwigParam, i as processTwigValue, c as resolveStepParam, h as scrollDistance, g as scrollPosition, _ as scrollState, v as sharedContext, te as spaceRootOf, x as syntaxHighlight, u as templatePaths, d as templateRootNames, F as toUnixSeconds };
@@ -47,14 +47,10 @@ var e = "onKey", t = [
47
47
  let o = e.trim().toLowerCase();
48
48
  if (!o) return { problem: "an empty shortcut (two commas in a row, or one at the end)" };
49
49
  let s = o.endsWith("++") ? [...o.slice(0, -2).split("+"), "+"] : o.split("+"), c = o === "+" ? ["+"] : s.filter((e) => e !== ""), l = /* @__PURE__ */ new Set(), u = [];
50
- for (let e of c) {
51
- if (Object.hasOwn(n, e)) {
52
- let r = n[e];
53
- l.add(r === "mod" ? t ? "meta" : "ctrl" : r);
54
- continue;
55
- }
56
- u.push(Object.hasOwn(r, e) ? r[e] : e);
57
- }
50
+ for (let e of c) if (Object.hasOwn(n, e)) {
51
+ let r = n[e];
52
+ l.add(r === "mod" ? t ? "meta" : "ctrl" : r);
53
+ } else u.push(Object.hasOwn(r, e) ? r[e] : e);
58
54
  if (u.length !== 1) return { problem: `"${e.trim()}" names ${u.length ? `${u.length} keys (${u.join(", ")})` : "no key, only modifiers"}: a shortcut is modifiers and ONE key, like "shift+f"` };
59
55
  let [d] = u;
60
56
  return d.length !== 1 && !i.has(d) ? { problem: `"${d}" in "${e.trim()}" is not a key: use one character ("f", "?", "+") or a key's name (${[...i].slice(0, 15).join(", ")}, f1…f12)` } : { combo: a(l, d) };
@@ -1,2 +1 @@
1
- import { evaluate as e, evaluateExpression as t } from "./Evaluator.mjs";
2
- export { e as evaluate, t as evaluateExpression };
1
+ export { evaluate, evaluateExpression } from "./Evaluator.mjs";
@@ -19,11 +19,7 @@ var r = (e, t) => {
19
19
  this.skipWs(), this.eof() || this.report(`Unexpected "${this.src.slice(this.pos).trim()}" in "${this.src.trim()}"`);
20
20
  }
21
21
  expectChar(e, t) {
22
- if (this.skipWs(), this.peek() === e) {
23
- this.pos++;
24
- return;
25
- }
26
- this.report(`Missing ${t} in "${this.src.trim()}"`);
22
+ this.skipWs(), this.peek() === e ? this.pos++ : this.report(`Missing ${t} in "${this.src.trim()}"`);
27
23
  }
28
24
  parseTernary() {
29
25
  let t = this.parseOr();
@@ -153,16 +149,13 @@ var r = (e, t) => {
153
149
  continue;
154
150
  }
155
151
  let n = this.matchBinaryOp();
156
- if (n) {
157
- e = {
158
- type: "binary",
159
- operator: n,
160
- left: e,
161
- right: this.parseConcat()
162
- }, this.skipWs();
163
- continue;
164
- }
165
- break;
152
+ if (n) e = {
153
+ type: "binary",
154
+ operator: n,
155
+ left: e,
156
+ right: this.parseConcat()
157
+ }, this.skipWs();
158
+ else break;
166
159
  }
167
160
  return e;
168
161
  }
@@ -300,11 +293,8 @@ var r = (e, t) => {
300
293
  for (this.skipWs(); this.peek() !== e.RParen;) {
301
294
  let r = this.scanName();
302
295
  if (!r) return this.pos = t, null;
303
- if (n.push(r), this.skipWs(), this.peek() === e.Comma) {
304
- this.pos++, this.skipWs();
305
- continue;
306
- }
307
- break;
296
+ if (n.push(r), this.skipWs(), this.peek() === e.Comma) this.pos++, this.skipWs();
297
+ else break;
308
298
  }
309
299
  return this.skipWs(), this.peek() === e.RParen && (this.pos++, this.skipWs(), this.peek() === e.Equals && this.at(1) === e.Greater) ? (this.pos += 2, n) : (this.pos = t, null);
310
300
  }
@@ -367,18 +357,14 @@ var r = (e, t) => {
367
357
  if (t !== e.LBracket) break;
368
358
  this.pos++;
369
359
  let n = this.parseTernary();
370
- if (this.expectChar(e.RBracket, "a closing \"]\""), i && n.type === "literal" && (typeof n.value == "string" || typeof n.value == "number")) {
371
- i.push(String(n.value));
372
- continue;
373
- }
374
- i &&= (r = {
360
+ this.expectChar(e.RBracket, "a closing \"]\""), i && n.type === "literal" && (typeof n.value == "string" || typeof n.value == "number") ? i.push(String(n.value)) : (i &&= (r = {
375
361
  type: "path",
376
362
  segments: i
377
363
  }, null), r = {
378
364
  type: "index",
379
365
  object: r,
380
366
  index: n
381
- };
367
+ });
382
368
  }
383
369
  return i ? {
384
370
  type: "path",
@@ -1,2 +1 @@
1
- import { parse as e } from "./Parser.mjs";
2
- export { e as parse };
1
+ export { parse } from "./Parser.mjs";
@@ -1,2 +1 @@
1
- import { getCacheStats as e, getNodes as t, resetCacheStats as n, resolveTokens as r } from "./TemplateCache.mjs";
2
- export { e as getCacheStats, t as getNodes, n as resetCacheStats, r as resolveTokens };
1
+ export { getCacheStats, getNodes, resetCacheStats, resolveTokens } from "./TemplateCache.mjs";
@@ -48,14 +48,10 @@ var e = {
48
48
  if (a === e.Dot) {
49
49
  if (o) return !1;
50
50
  o = !0, s = !1;
51
- continue;
52
- }
53
- if (o) {
51
+ } else if (o) {
54
52
  if (s = i(a), !s && !t(a)) return !1;
55
53
  o = !1;
56
- continue;
57
- }
58
- if (s ? !i(a) : !n(a)) return !1;
54
+ } else if (s ? !i(a) : !n(a)) return !1;
59
55
  }
60
56
  return !o;
61
57
  }, c = (e) => o(e);
@@ -1,2 +1 @@
1
- import { ARROW_PARAMS as e, RAW_MARKER as t, filters as n, isRawMarker as r, unwrapRaw as i, wrapRaw as a } from "./filters.mjs";
2
- export { e as ARROW_PARAMS, t as RAW_MARKER, n as filters, r as isRawMarker, i as unwrapRaw, a as wrapRaw };
1
+ export { ARROW_PARAMS, RAW_MARKER, filters, isRawMarker, unwrapRaw, wrapRaw } from "./filters.mjs";
@@ -1,17 +1,12 @@
1
1
  import { resolveTokens as e } from "./TemplateCache/TemplateCache.mjs";
2
2
  //#region src/helpers/twigWrapper/templateRoots.ts
3
3
  var t = (e, n) => {
4
- if (Array.isArray(e)) {
5
- for (let r of e) t(r, n);
6
- return;
7
- }
8
- if (typeof e == "object" && e) {
4
+ if (Array.isArray(e)) for (let r of e) t(r, n);
5
+ else if (typeof e == "object" && e) {
9
6
  if ("type" in e && e.type === "path" && "segments" in e && Array.isArray(e.segments)) {
10
7
  let t = e.segments.filter((e) => typeof e == "string");
11
8
  t.length > 0 && n.add(t.join("."));
12
- return;
13
- }
14
- for (let r of Object.values(e)) t(r, n);
9
+ } else for (let r of Object.values(e)) t(r, n);
15
10
  }
16
11
  }, n = (n) => {
17
12
  let r = e(n);
@@ -14,10 +14,7 @@ var i = ({ initLoading: i = !1, server: a, webKey: o, internalUsage: s = !0, bas
14
14
  s && a && (f = c ?? a.serverUrl);
15
15
  let p = r;
16
16
  (r instanceof FormData ? Array.from(r.values()) : Object.values(r)).forEach((e) => {
17
- if (e instanceof Blob && d.get("Content-Type") !== "multipart/form-data") {
18
- d.delete("Content-Type");
19
- return;
20
- }
17
+ e instanceof Blob && d.get("Content-Type") !== "multipart/form-data" && d.delete("Content-Type");
21
18
  }), p instanceof FormData || (p = new FormData(), Object.entries(r).forEach(([e, t]) => {
22
19
  p.append(e, t);
23
20
  }));
package/dist/index.d.ts CHANGED
@@ -1,19 +1,6 @@
1
+ /**
2
+ * The document every package reads and writes — a space, its elements, styles, flows and the contracts around them —
3
+ * as types, and nothing else. What the package does is imported from the folder that does it
4
+ * (`@plitzi/sdk-shared/helpers`, `@plitzi/sdk-shared/theme`…), so importing a type never loads the runtime.
5
+ */
1
6
  export * from './types';
2
- export * from './auth';
3
- export * from './helpers';
4
- export * from './hooks';
5
- export * from './builder';
6
- export * from './style';
7
- export * from './schema';
8
- export * from './elements';
9
- export * from './dataSource';
10
- export * from './connectors';
11
- export * from './network';
12
- export * from './network/graphql';
13
- export * from './websockets';
14
- export * from './devTools';
15
- export * from './theme';
16
- export * from './server';
17
- export * from './state';
18
- export * from './history';
19
- export * from './flags';
package/dist/index.mjs CHANGED
@@ -1,96 +1,3 @@
1
- import { isRecord as e } from "./helpers/isRecord.mjs";
2
- import { authFailureFromResponse as t, onAuthFailure as n, reportAuthFailure as r, sameRegistrableDomain as i } from "./auth/failureChannel.mjs";
3
- import { VISITOR_NAME as a, checkVisitorRoles as o, visitorAccess as s } from "./auth/visitorRoles.mjs";
4
- import { filters as c } from "./helpers/twigWrapper/filters/filters.mjs";
5
- import { processTwig as l, processTwigParam as u, processTwigValue as d } from "./helpers/twigWrapper/processTwig/processTwig.mjs";
6
- import { hasTemplateSyntax as f } from "./helpers/twigWrapper/tokens/hasTemplateSyntax.mjs";
7
- import { hasValidToken as p } from "./helpers/twigWrapper/tokens/hasValidToken.mjs";
8
- import { MAX_PARAM_PASSES as m, resolveStepParam as h } from "./helpers/twigWrapper/processTwig/resolveStepParam.mjs";
9
- import { inspectTemplate as g } from "./helpers/twigWrapper/inspectTemplate.mjs";
10
- import { templatePaths as _, templateRootNames as v } from "./helpers/twigWrapper/templateRoots.mjs";
11
- import y from "./builder/contexts/BuilderContext.mjs";
12
- import { contexts_exports as b } from "./builder/contexts/index.mjs";
13
- import { BODYLESS_METHODS as x, CONNECTOR_HTTP_METHODS as S, DEFAULT_READ_ENDPOINT as C, EMPTY_RESPONSE_METHODS as w, READ_ENDPOINT_NAMES as T, WRITE_ENDPOINT_NAMES as E } from "./connectors/constants.mjs";
14
- import { connectorTokens as D, getConnectorTokens as O } from "./connectors/manifestTokens.mjs";
15
- import { connectorPresets as k, emptyManifest as A } from "./connectors/presets.mjs";
16
- import { isConnectorManifestDraft as j, validateConnectorManifest as M } from "./connectors/validateManifest.mjs";
17
- import { COMPUTED_GLOBALS as N, GLOBAL_SOURCES as P } from "./dataSource/globalSources.mjs";
18
- import { evaluateComputed as F, liveSources as I } from "./dataSource/computed.mjs";
19
- import L from "./helpers/fetchManifest.mjs";
20
- import R from "./helpers/generateFacade.mjs";
21
- import z from "./helpers/syntaxHighlight.mjs";
22
- import { cookieFromHeader as B, documentCookies as V } from "./helpers/cookies.mjs";
23
- import { elementOf as H, isElementTarget as U, isNodeTarget as W, nodeOf as G } from "./helpers/eventTarget.mjs";
24
- import { formatDate as K, formatDateUTC as q, formatFromNow as J, formatUTCToLocal as Y, getDurationMs as X, isValidFormat as Z, parseDate as Q, toUnixSeconds as $ } from "./helpers/formatDate.mjs";
25
- import { INTERVAL_TRIGGER as ee, MIN_INTERVAL_MS as te, intervalOf as ne } from "./helpers/interval.mjs";
26
- import { isDate as re } from "./helpers/isDate.mjs";
27
- import { isUserEdit as ie } from "./helpers/reducerOrigin.mjs";
28
- import { evaluateRuleGroup as ae } from "./helpers/ruleEvaluator.mjs";
29
- import { ParamsFromURL as oe, delay as se, emptyObject as ce, getDisplayName as le, getKeyDecoded as ue, getPathsFromObject as de, hexToRGB as fe, isInViewport as pe, makeId as me } from "./helpers/utils.mjs";
30
- import { disableReactDevTools as he } from "./helpers/security.mjs";
31
- import ge, { utilityOptions as _e } from "./dataSource/utility/index.mjs";
32
- import ve from "./dataSource/getBindingsDetails.mjs";
33
- import ye from "./dataSource/helpers/getSourceName.mjs";
34
- import be from "./dataSource/hooks/useRegisterSource.mjs";
35
- import xe from "./hooks/useStableValue.mjs";
36
- import Se from "./dataSource/resolveVariables.mjs";
37
- import Ce from "./dataSource/hooks/useResolvedVariables.mjs";
38
- import we from "./devTools/DevToolsContext.mjs";
39
- import { DEV_TOOLS_ATTRIBUTE as Te, HIDE_DEV_TOOLS_CSS as Ee } from "./devTools/chrome.mjs";
40
- import { debugCookieName as De } from "./devTools/debugCookie.mjs";
41
- import Oe from "./devTools/interactionLog.mjs";
42
- import ke, { createStoreDevToolsLogger as Ae, pConsole as je } from "./devTools/utils/PlitziConsole.mjs";
43
- import Me from "./elements/ComponentContext.mjs";
44
- import { FLAG_GATE_PATTERN as Ne, FLAG_NAME_PATTERN as Pe, isFlagName as Fe, isSchemaFlag as Ie } from "./flags/schemaFlag.mjs";
45
- import { flagsCookieName as Le, forcedFlagsFromCookies as Re, parseFlagList as ze, serializeFlagList as Be, withForcedFlag as Ve, writeForcedFlags as He } from "./flags/flagsCookie.mjs";
46
- import { FLAG_LAYERS as Ue, flagUserFromSSR as We, flagValues as Ge, hasConditions as Ke, passesFlagGate as qe, resolveFlags as Je, undeclaredFlagOverrides as Ye } from "./flags/resolveFlags.mjs";
47
- import { describeChange as Xe, fieldChanges as Ze, uniqueLines as Qe } from "./history/describe.mjs";
48
- import { diffSchema as $e, diffStyle as et, jsonCopy as tt, sameValue as nt } from "./history/diff.mjs";
49
- import rt from "./hooks/useFontHead.mjs";
50
- import it from "./hooks/useNetwork.mjs";
51
- import at, { PlitziContext as ot, PlitziProvider as st } from "./hooks/usePlitzi.mjs";
52
- import { WHILE_RUNNING_MODES as ct } from "./types/SchemaTypes.mjs";
53
- import { StyleVariableCategory as lt, isStyleVariableCategory as ut } from "./types/StyleTypes.mjs";
54
- import dt, { EMPTY_STYLE_SCHEMA as ft, StyleBindingsAllowed as pt, baseDefaultValue as mt, inheritableAttributesBase as ht } from "./style/styleConstants.mjs";
55
- import { DISPLAY_MODE_MIN_WIDTH as gt, displayModeAt as _t, displayModeWidthRem as vt } from "./style/breakpoints.mjs";
56
- import { PLUGIN_CSS_LAYER as yt, RUNTIME_CSS_LAYER as bt, inPluginLayer as xt } from "./style/cssLayers.mjs";
57
- import { DISPLAY_MODES as St, isDisplayMode as Ct } from "./style/displayModes.mjs";
58
- import { fontLinkAssets as wt } from "./style/fontAssets.mjs";
59
- import { SYSTEM_FONTS as Tt, availableFonts as Et, familiesInCss as Dt, fontFamilyStack as Ot, fontUrlResolver as kt, fontsToHead as At, googleCss2Url as jt, googleTextSubsetUrl as Mt, isSafeFontUrl as Nt, primaryFamily as Pt } from "./style/fonts.mjs";
60
- import { FontValidationError as Ft, parseSpaceFont as It } from "./style/fontValidation.mjs";
61
- import { fallbackForFamily as Lt, fontsFromCss as Rt } from "./style/fontsFromCss.mjs";
62
- import { LAYOUT_GRIDS as zt, layoutGridCss as Bt, layoutGridLook as Vt } from "./style/layoutGrid.mjs";
63
- import { RUNTIME_STYLE_ID as Ht, markStyleCache as Ut, styleCacheFromDocument as Wt, styleCacheTravelsInDocument as Gt } from "./style/runtimeStyle.mjs";
64
- import { mergeSnippetStyle as Kt, sameSelector as qt, selectorsOf as Jt } from "./style/snippetStyle.mjs";
65
- import { MOTION_CONDITIONS as Yt, STYLE_CONDITION_LABELS as Xt, STYLE_MOTION_CONDITIONS as Zt, canonicalCondition as Qt, conditionAtRule as $t, conditionLabel as en, conditionOfAtRule as tn, isStyleCondition as nn, parseContainerCondition as rn } from "./style/styleConditions.mjs";
66
- import { CONTENT_PSEUDOS as an, GENERATED_PSEUDOS as on, PSEUDO_PROPERTIES as sn, STYLE_PSEUDOS as cn, STYLE_PSEUDO_LABELS as ln, isContentValue as un, isStylePseudo as dn, pseudoHonours as fn, pseudoSuffix as pn } from "./style/stylePseudos.mjs";
67
- import { CURRENT_SELECTOR as mn, EXPANDED_SELECTOR as hn, HIDDEN_CLASS as gn, PARENT_ANCESTOR as _n, STYLE_STATES as vn, STYLE_STATE_LABELS as yn, inCascadeOrder as bn, isKnownState as xn, isParentAncestor as Sn, isStartingState as Cn, stateSuffix as wn } from "./style/styleStates.mjs";
68
- import { isStyleRules as Tn, setAtKeys as En, styleTargetKeys as Dn, styleTargetProblem as On, styleTargetRules as kn, valueAtKeys as An } from "./style/styleTarget.mjs";
69
- import jn from "./schema/SchemaContext.mjs";
70
- import { ANCHOR_PATTERN as Mn, anchorOf as Nn, isAnchor as Pn, uniqueAnchor as Fn } from "./schema/anchor.mjs";
71
- import { COMPONENT_PROPS_SOURCE as In, EMPTY_SCHEMA as Ln, VARIABLE_REGEX as Rn } from "./schema/schemaConstants.mjs";
72
- import { findLayoutCycle as zn, resolveLayoutChain as Bn } from "./schema/layoutChain.mjs";
73
- import { collectServerElements as Vn, hasServerElements as Hn, notFoundProvider as Un, pageNotFound as Wn, pageSeoText as Gn, pageServerContext as Kn } from "./schema/serverElements.mjs";
74
- import { isSnippet as qn } from "./schema/snippet.mjs";
75
- import Jn from "./network/NetworkContext.mjs";
76
- import Yn from "./network/NetworkInternalContext.mjs";
77
- import { elementFromWire as Xn, schemaFromWire as Zn, schemaToWire as Qn } from "./schema/wire.mjs";
78
- import { SpaceEvents as $n, spaceEventSchemas as er, validateSpaceEvent as tr } from "./network/spaceEvents.mjs";
79
- import nr from "./network/graphql/builder/Mutations/index.mjs";
80
- import rr from "./network/graphql/builder/Queries/index.mjs";
81
- import ir from "./network/graphql/builder/Subscriptions/index.mjs";
82
- import ar from "./network/graphql/sdk/Mutations/index.mjs";
83
- import or from "./network/graphql/sdk/Queries/index.mjs";
84
- import sr, { RTEvent as cr, RTEventCloseCode as lr, getInstance as ur, isRTEvent as dr, isRTEventCloseCode as fr, setInstance as pr } from "./websockets/RTCodec.mjs";
85
- import { THEME_CLASSES as mr, THEME_COOKIE_NAME as hr, applyThemeClass as gr, isTheme as _r, readThemeCookie as vr, themeFromCookies as yr, writeThemeCookie as br } from "./theme/themeCookie.mjs";
86
- import xr, { createThemeState as Sr, createThemeStore as Cr, resolveScheme as wr, setAreaTheme as Tr, setMachineScheme as Er, setThemeMode as Dr, startingThemeState as Or, themeFor as kr } from "./theme/themeStore.mjs";
87
- import { ThemeStartContext as Ar, useThemeState as jr, useThemeStore as Mr } from "./theme/ThemeScope.mjs";
88
- import Nr from "./theme/ThemeProvider.mjs";
89
- import Pr, { SPACE_THEME_AREA as Fr } from "./theme/useTheme.mjs";
90
- import Ir from "./server/actions/useActionsSync.mjs";
91
- import Lr, { cancelRsc as Rr, currentRscLocation as zr, releaseRscRequests as Br, rscDataPath as Vr } from "./server/rsc/refreshRsc.mjs";
92
- import Hr from "./server/rsc/useRscRefresh.mjs";
93
- import Ur from "./server/rsc/useRscSync.mjs";
94
- import { PAINTED_STATE_BUDGET as Wr, clearPaintedEntry as Gr, paintedEntryFromCookies as Kr, paintedKeys as qr, paintedStateCookieName as Jr, paintedStateFor as Yr, pickPainted as Xr, readPaintedEntry as Zr, writePaintedEntry as Qr } from "./state/paintedState.mjs";
95
- import { runtimeStatePersist as $r, stateOwner as ei } from "./state/runtimeStatePersist.mjs";
96
- export { Mn as ANCHOR_PATTERN, x as BODYLESS_METHODS, y as BuilderContext, nr as BuilderMutations, rr as BuilderQueries, In as COMPONENT_PROPS_SOURCE, N as COMPUTED_GLOBALS, S as CONNECTOR_HTTP_METHODS, an as CONTENT_PSEUDOS, mn as CURRENT_SELECTOR, Me as ComponentContext, C as DEFAULT_READ_ENDPOINT, Te as DEV_TOOLS_ATTRIBUTE, St as DISPLAY_MODES, gt as DISPLAY_MODE_MIN_WIDTH, we as DevToolsContext, w as EMPTY_RESPONSE_METHODS, Ln as EMPTY_SCHEMA, ft as EMPTY_STYLE_SCHEMA, hn as EXPANDED_SELECTOR, Ne as FLAG_GATE_PATTERN, Ue as FLAG_LAYERS, Pe as FLAG_NAME_PATTERN, Ft as FontValidationError, on as GENERATED_PSEUDOS, P as GLOBAL_SOURCES, gn as HIDDEN_CLASS, Ee as HIDE_DEV_TOOLS_CSS, ee as INTERVAL_TRIGGER, zt as LAYOUT_GRIDS, m as MAX_PARAM_PASSES, te as MIN_INTERVAL_MS, Yt as MOTION_CONDITIONS, Jn as NetworkContext, Yn as NetworkInternalContext, Wr as PAINTED_STATE_BUDGET, _n as PARENT_ANCESTOR, yt as PLUGIN_CSS_LAYER, sn as PSEUDO_PROPERTIES, oe as ParamsFromURL, ke as PlitziConsole, ot as PlitziContext, st as PlitziProvider, T as READ_ENDPOINT_NAMES, sr as RTCodec, cr as RTEvent, lr as RTEventCloseCode, bt as RUNTIME_CSS_LAYER, Ht as RUNTIME_STYLE_ID, Fr as SPACE_THEME_AREA, Xt as STYLE_CONDITION_LABELS, Zt as STYLE_MOTION_CONDITIONS, cn as STYLE_PSEUDOS, ln as STYLE_PSEUDO_LABELS, vn as STYLE_STATES, yn as STYLE_STATE_LABELS, Tt as SYSTEM_FONTS, jn as SchemaContext, ar as SdkMutations, or as SdkQueries, ir as SpaceEventSubscription, $n as SpaceEvents, pt as StyleBindingsAllowed, lt as StyleVariableCategory, mr as THEME_CLASSES, hr as THEME_COOKIE_NAME, Nr as ThemeProvider, Ar as ThemeStartContext, Rn as VARIABLE_REGEX, a as VISITOR_NAME, ct as WHILE_RUNNING_MODES, E as WRITE_ENDPOINT_NAMES, Nn as anchorOf, gr as applyThemeClass, t as authFailureFromResponse, Et as availableFonts, mt as baseDefaultValue, Rr as cancelRsc, Qt as canonicalCondition, o as checkVisitorRoles, Gr as clearPaintedEntry, Vn as collectServerElements, $t as conditionAtRule, en as conditionLabel, tn as conditionOfAtRule, k as connectorPresets, D as connectorTokens, b as contexts, B as cookieFromHeader, Ae as createStoreDevToolsLogger, Sr as createThemeState, Cr as createThemeStore, zr as currentRscLocation, De as debugCookieName, se as delay, Xe as describeChange, $e as diffSchema, et as diffStyle, he as disableReactDevTools, _t as displayModeAt, vt as displayModeWidthRem, V as documentCookies, Xn as elementFromWire, H as elementOf, A as emptyManifest, ce as emptyObject, F as evaluateComputed, ae as evaluateRuleGroup, Lt as fallbackForFamily, Dt as familiesInCss, L as fetchManifest, Ze as fieldChanges, c as filters, zn as findLayoutCycle, We as flagUserFromSSR, Ge as flagValues, Le as flagsCookieName, Ot as fontFamilyStack, wt as fontLinkAssets, kt as fontUrlResolver, Rt as fontsFromCss, At as fontsToHead, Re 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, ur as getInstance, ue as getKeyDecoded, de as getPathsFromObject, ye as getSourceName, jt as googleCss2Url, Mt as googleTextSubsetUrl, Ke as hasConditions, Hn as hasServerElements, f as hasTemplateSyntax, p as hasValidToken, fe as hexToRGB, bn as inCascadeOrder, xt as inPluginLayer, ht as inheritableAttributesBase, g as inspectTemplate, ne as intervalOf, Pn as isAnchor, j as isConnectorManifestDraft, un as isContentValue, re as isDate, Ct as isDisplayMode, U as isElementTarget, Fe as isFlagName, pe as isInViewport, Oe as isInteractionFlow, xn as isKnownState, W as isNodeTarget, Sn as isParentAncestor, dr as isRTEvent, fr as isRTEventCloseCode, e as isRecord, Nt as isSafeFontUrl, Ie as isSchemaFlag, qn as isSnippet, Cn as isStartingState, nn as isStyleCondition, dn as isStylePseudo, Tn as isStyleRules, ut as isStyleVariableCategory, _r as isTheme, ie as isUserEdit, Z as isValidFormat, tt as jsonCopy, Bt as layoutGridCss, Vt as layoutGridLook, I as liveSources, me as makeId, Ut as markStyleCache, Kt as mergeSnippetStyle, G as nodeOf, Un as notFoundProvider, n as onAuthFailure, je as pConsole, Wn as pageNotFound, Gn as pageSeoText, Kn as pageServerContext, Kr as paintedEntryFromCookies, qr as paintedKeys, Jr as paintedStateCookieName, Yr as paintedStateFor, rn as parseContainerCondition, Q as parseDate, ze as parseFlagList, It as parseSpaceFont, qe as passesFlagGate, Xr as pickPainted, Pt as primaryFamily, l as processTwig, u as processTwigParam, d as processTwigValue, fn as pseudoHonours, pn as pseudoSuffix, Zr as readPaintedEntry, vr as readThemeCookie, Lr as refreshRsc, Br as releaseRscRequests, r as reportAuthFailure, Je as resolveFlags, Bn as resolveLayoutChain, wr as resolveScheme, h as resolveStepParam, Se as resolveVariables, Vr as rscDataPath, $r as runtimeStatePersist, i as sameRegistrableDomain, qt as sameSelector, nt as sameValue, Zn as schemaFromWire, Qn as schemaToWire, Jt as selectorsOf, Be as serializeFlagList, Tr as setAreaTheme, En as setAtKeys, pr as setInstance, Er as setMachineScheme, Dr as setThemeMode, er as spaceEventSchemas, Or as startingThemeState, ei as stateOwner, wn as stateSuffix, Wt as styleCacheFromDocument, Gt as styleCacheTravelsInDocument, dt as styleConstants, Dn as styleTargetKeys, On as styleTargetProblem, kn as styleTargetRules, z as syntaxHighlight, _ as templatePaths, v as templateRootNames, kr as themeFor, yr as themeFromCookies, xr as themeStore, $ as toUnixSeconds, Ye as undeclaredFlagOverrides, Fn as uniqueAnchor, Qe as uniqueLines, Ir as useActionsSync, rt as useFontHead, it as useNetwork, at as usePlitzi, be as useRegisterSource, Ce as useResolvedVariables, Hr as useRscRefresh, Ur as useRscSync, xe as useStableValue, Pr as useTheme, jr as useThemeState, Mr as useThemeStore, ge as utility, _e as utilityOptions, M as validateConnectorManifest, tr as validateSpaceEvent, An as valueAtKeys, s as visitorAccess, Ve as withForcedFlag, He as writeForcedFlags, Qr as writePaintedEntry, br as writeThemeCookie };
1
+ import { WHILE_RUNNING_MODES as e } from "./types/SchemaTypes.mjs";
2
+ import { StyleVariableCategory as t, isStyleVariableCategory as n } from "./types/StyleTypes.mjs";
3
+ export { t as StyleVariableCategory, e as WHILE_RUNNING_MODES, n as isStyleVariableCategory };
@@ -123,4 +123,5 @@ export type BuilderMutationsMap = {
123
123
  StyleUpdateSettings: unknown;
124
124
  };
125
125
  declare const BuilderMutations: Record<keyof BuilderMutationsMap, string>;
126
+ export type { TSpaceFix } from './Space/SpaceFixIssuesMutation';
126
127
  export default BuilderMutations;