@plitzi/sdk-shared 0.38.6 → 0.38.8
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 +381 -0
- package/dist/authoring/declare.d.ts +1 -1
- package/dist/authoring/index.mjs +4 -4
- package/dist/authoring/paramSpec.d.ts +2 -1
- package/dist/authoring/paramSpec.mjs +20 -11
- package/dist/dataSource/globalSources.d.ts +34 -1
- package/dist/dataSource/globalSources.mjs +22 -2
- package/dist/dataSource/hooks/index.d.ts +2 -1
- package/dist/dataSource/hooks/index.mjs +2 -1
- package/dist/dataSource/hooks/useResolvedVariables.d.ts +12 -0
- package/dist/dataSource/hooks/useResolvedVariables.mjs +28 -0
- package/dist/dataSource/index.mjs +2 -1
- package/dist/dataSource/resolveVariables.d.ts +2 -2
- package/dist/devTools/chrome.d.ts +1 -1
- package/dist/flags/useFlagResolution.mjs +6 -6
- package/dist/helpers/canonicalJson.d.ts +6 -0
- package/dist/helpers/canonicalJson.mjs +5 -0
- package/dist/index.mjs +62 -58
- package/dist/network/spaceEvents.d.ts +31 -1
- package/dist/network/spaceEvents.mjs +150 -147
- package/dist/project/layout.d.ts +197 -0
- package/dist/project/layout.mjs +394 -0
- package/dist/project/paths.d.ts +84 -0
- package/dist/project/paths.mjs +4 -0
- package/dist/project/root.d.ts +24 -0
- package/dist/project/root.mjs +26 -0
- package/dist/queries/index.d.ts +12 -2
- package/dist/queries/index.mjs +27 -17
- package/dist/queries/serverQueries.d.ts +22 -0
- package/dist/queries/serverQueries.mjs +9 -0
- package/dist/queries/useServerQuery.d.ts +19 -0
- package/dist/queries/useServerQuery.mjs +21 -0
- package/dist/server/rsc/refreshRsc.d.ts +22 -10
- package/dist/server/rsc/refreshRsc.mjs +65 -53
- package/dist/server/rsc/useRscRefresh.d.ts +2 -1
- package/dist/server/rsc/useRscRefresh.mjs +1 -1
- package/dist/source/export.d.ts +2 -2
- package/dist/source/import.d.ts +1 -1
- package/dist/store/index.d.ts +45 -45
- package/dist/style/cssLayers.d.ts +1 -1
- package/dist/style/index.d.ts +3 -0
- package/dist/style/index.mjs +5 -2
- package/dist/style/keyframes.d.ts +39 -0
- package/dist/style/keyframes.mjs +41 -0
- package/dist/style/notifications.d.ts +34 -12
- package/dist/style/notifications.mjs +69 -32
- package/dist/style/styleConditions.d.ts +43 -0
- package/dist/style/styleConditions.mjs +29 -0
- package/dist/style/styleConstants.d.ts +3 -2
- package/dist/style/styleConstants.mjs +2 -0
- package/dist/style/stylePseudos.d.ts +40 -0
- package/dist/style/stylePseudos.mjs +109 -0
- package/dist/style/styleStates.d.ts +35 -8
- package/dist/style/styleStates.mjs +38 -15
- package/dist/style/styleTarget.d.ts +23 -0
- package/dist/style/styleTarget.mjs +35 -0
- package/dist/types/AuthTypes.d.ts +5 -0
- package/dist/types/CommonTypes.d.ts +12 -0
- package/dist/types/SchemaTypes.d.ts +2 -0
- package/dist/types/ServerTypes.d.ts +11 -4
- package/dist/types/StoreTypes.d.ts +5 -1
- package/dist/types/StyleTypes.d.ts +20 -2
- package/package.json +46 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaVariable } from '../types';
|
|
1
|
+
import { SchemaVariable, SchemaVariableValue } from '../types';
|
|
2
2
|
/** What a variable's `subValues` are matched against — everything a `when` rule may name. */
|
|
3
3
|
export type VariableScope = {
|
|
4
4
|
routeParams?: Record<string, unknown>;
|
|
@@ -18,5 +18,5 @@ export type VariableScope = {
|
|
|
18
18
|
* a page that sends an unauthenticated visitor to `{{authUrl}}/` is deciding not to render at all, so the
|
|
19
19
|
* provider that would have resolved the token never runs.
|
|
20
20
|
*/
|
|
21
|
-
export declare const resolveVariables: (variables: SchemaVariable[] | undefined, scope?: VariableScope) => Record<string,
|
|
21
|
+
export declare const resolveVariables: (variables: SchemaVariable[] | undefined, scope?: VariableScope) => Record<string, SchemaVariableValue>;
|
|
22
22
|
export default resolveVariables;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
3
|
+
* page rather than at the tools can leave it out: `plitzi page shot` and `plitzi page check` hide it, and a picture of a page is
|
|
4
4
|
* a picture of the page.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DEV_TOOLS_ATTRIBUTE = "data-plitzi-devtools";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../
|
|
3
|
-
import n from "../store/
|
|
4
|
-
import {
|
|
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";
|
|
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 } =
|
|
16
|
+
let { environment: s } = t(), [[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
|
|
26
|
+
return e(i(() => r(c, {
|
|
27
27
|
environment: s,
|
|
28
28
|
hostname: d,
|
|
29
29
|
routeParams: l,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value as JSON with every object's keys in order, so two values that say the same thing in another order read the
|
|
3
|
+
* same: what a before-and-after comparison is made with, where a key moved is not a change. `undefined` reads
|
|
4
|
+
* `undefined`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const canonicalJson: (value: unknown) => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { isRecord as e } from "./isRecord.mjs";
|
|
2
|
+
//#region src/helpers/canonicalJson.ts
|
|
3
|
+
var t = (t) => t === void 0 ? "undefined" : JSON.stringify(t, (t, n) => e(n) ? Object.fromEntries(Object.keys(n).toSorted().map((e) => [e, n[e]])) : n);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { t as canonicalJson };
|
package/dist/index.mjs
CHANGED
|
@@ -32,61 +32,65 @@ import ge, { utilityOptions as _e } from "./dataSource/utility/index.mjs";
|
|
|
32
32
|
import ve from "./dataSource/getBindingsDetails.mjs";
|
|
33
33
|
import ye from "./dataSource/helpers/getSourceName.mjs";
|
|
34
34
|
import be from "./dataSource/hooks/useRegisterSource.mjs";
|
|
35
|
-
import xe from "./
|
|
36
|
-
import Se from "./
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import Ee from "./devTools/
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import {
|
|
45
|
-
import
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import nt from "./
|
|
49
|
-
import rt from "./hooks/
|
|
50
|
-
import it
|
|
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 nn from "./
|
|
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
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import
|
|
88
|
-
import
|
|
89
|
-
import
|
|
90
|
-
import
|
|
91
|
-
import {
|
|
92
|
-
|
|
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, { PlitziServiceContext as ot, PlitziServiceProvider as st } from "./hooks/usePlitziServiceContext.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 } from "./schema/serverElements.mjs";
|
|
74
|
+
import { isSnippet as Un } from "./schema/snippet.mjs";
|
|
75
|
+
import Wn from "./network/NetworkContext.mjs";
|
|
76
|
+
import Gn from "./network/NetworkInternalContext.mjs";
|
|
77
|
+
import { elementFromWire as Kn, schemaFromWire as qn, schemaToWire as Jn } from "./schema/wire.mjs";
|
|
78
|
+
import { SpaceEvents as Yn, spaceEventSchemas as Xn, validateSpaceEvent as Zn } from "./network/spaceEvents.mjs";
|
|
79
|
+
import Qn from "./network/graphql/builder/Mutations/index.mjs";
|
|
80
|
+
import $n from "./network/graphql/builder/Queries/index.mjs";
|
|
81
|
+
import er from "./network/graphql/builder/Subscriptions/index.mjs";
|
|
82
|
+
import tr from "./network/graphql/sdk/Mutations/index.mjs";
|
|
83
|
+
import nr from "./network/graphql/sdk/Queries/index.mjs";
|
|
84
|
+
import rr, { RTEvent as ir, RTEventCloseCode as ar, getInstance as or, isRTEvent as sr, isRTEventCloseCode as cr, setInstance as lr } from "./websockets/RTCodec.mjs";
|
|
85
|
+
import { THEME_CLASSES as ur, THEME_COOKIE_NAME as dr, applyThemeClass as fr, isTheme as pr, readThemeCookie as mr, themeFromCookies as hr, writeThemeCookie as gr } from "./theme/themeCookie.mjs";
|
|
86
|
+
import _r, { createThemeState as vr, createThemeStore as yr, resolveScheme as br, setAreaTheme as xr, setMachineScheme as Sr, setThemeMode as Cr, themeFor as wr } from "./theme/themeStore.mjs";
|
|
87
|
+
import { useThemeStore as Tr } from "./theme/ThemeScope.mjs";
|
|
88
|
+
import Er from "./theme/ThemeProvider.mjs";
|
|
89
|
+
import Dr, { SPACE_THEME_AREA as Or } from "./theme/useTheme.mjs";
|
|
90
|
+
import kr from "./server/actions/useActionsSync.mjs";
|
|
91
|
+
import Ar, { cancelRsc as jr, currentRscLocation as Mr, releaseRscRequests as Nr, rscDataPath as Pr } from "./server/rsc/refreshRsc.mjs";
|
|
92
|
+
import Fr from "./server/rsc/useRscRefresh.mjs";
|
|
93
|
+
import Ir from "./server/rsc/useRscSync.mjs";
|
|
94
|
+
import { PAINTED_STATE_BUDGET as Lr, clearPaintedEntry as Rr, paintedEntryFromCookies as zr, paintedKeys as Br, paintedStateCookieName as Vr, paintedStateFor as Hr, pickPainted as Ur, readPaintedEntry as Wr, writePaintedEntry as Gr } from "./state/paintedState.mjs";
|
|
95
|
+
import { runtimeStatePersist as Kr, stateOwner as qr } from "./state/runtimeStatePersist.mjs";
|
|
96
|
+
export { Mn as ANCHOR_PATTERN, x as BODYLESS_METHODS, y as BuilderContext, Qn as BuilderMutations, $n 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, Wn as NetworkContext, Gn as NetworkInternalContext, Lr 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 PlitziServiceContext, st as PlitziServiceProvider, T as READ_ENDPOINT_NAMES, rr as RTCodec, ir as RTEvent, ar as RTEventCloseCode, bt as RUNTIME_CSS_LAYER, Ht as RUNTIME_STYLE_ID, Or 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, tr as SdkMutations, nr as SdkQueries, er as SpaceEventSubscription, Yn as SpaceEvents, pt as StyleBindingsAllowed, lt as StyleVariableCategory, ur as THEME_CLASSES, dr as THEME_COOKIE_NAME, Er as ThemeProvider, Rn as VARIABLE_REGEX, a as VISITOR_NAME, ct as WHILE_RUNNING_MODES, E as WRITE_ENDPOINT_NAMES, Nn as anchorOf, fr as applyThemeClass, t as authFailureFromResponse, Et as availableFonts, mt as baseDefaultValue, jr as cancelRsc, Qt as canonicalCondition, o as checkVisitorRoles, Rr 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, vr as createThemeState, yr as createThemeStore, Mr 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, Kn 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, or as getInstance, ue as getKeyDecoded, de as getPathsFromObeject, 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, sr as isRTEvent, cr as isRTEventCloseCode, e as isRecord, Nt as isSafeFontUrl, Ie as isSchemaFlag, Un as isSnippet, Cn as isStartingState, nn as isStyleCondition, dn as isStylePseudo, Tn as isStyleRules, ut as isStyleVariableCategory, pr 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, n as onAuthFailure, je as pConsole, zr as paintedEntryFromCookies, Br as paintedKeys, Vr as paintedStateCookieName, Hr as paintedStateFor, rn as parseContainerCondition, Q as parseDate, ze as parseFlagList, It as parseSpaceFont, qe as passesFlagGate, Ur as pickPainted, Pt as primaryFamily, l as processTwig, u as processTwigParam, d as processTwigValue, fn as pseudoHonours, pn as pseudoSuffix, Wr as readPaintedEntry, mr as readThemeCookie, Ar as refreshRsc, Nr as releaseRscRequests, r as reportAuthFailure, Je as resolveFlags, Bn as resolveLayoutChain, br as resolveScheme, h as resolveStepParam, Se as resolveVariables, Pr as rscDataPath, Kr as runtimeStatePersist, i as sameRegistrableDomain, qt as sameSelector, nt as sameValue, qn as schemaFromWire, Jn as schemaToWire, Jt as selectorsOf, Be as serializeFlagList, xr as setAreaTheme, En as setAtKeys, lr as setInstance, Sr as setMachineScheme, Cr as setThemeMode, Xn as spaceEventSchemas, qr 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, wr as themeFor, hr as themeFromCookies, _r as themeStore, $ as toUnixSeconds, Ye as undeclaredFlagOverrides, Fn as uniqueAnchor, Qe as uniqueLines, kr as useActionsSync, rt as useFontHead, it as useNetwork, at as usePlitziServiceContext, be as useRegisterSource, Ce as useResolvedVariables, Fr as useRscRefresh, Ir as useRscSync, xe as useStableValue, Dr as useTheme, Tr as useThemeStore, ge as utility, _e as utilityOptions, M as validateConnectorManifest, Zn as validateSpaceEvent, An as valueAtKeys, s as visitorAccess, Ve as withForcedFlag, He as writeForcedFlags, Gr as writePaintedEntry, gr as writeThemeCookie };
|
|
@@ -90,7 +90,7 @@ export declare const spaceEventSchemas: {
|
|
|
90
90
|
}, z.core.$strip>;
|
|
91
91
|
/**
|
|
92
92
|
* A plugin installed — or installed again at a new address, which is how a new version arrives: from the builder,
|
|
93
|
-
* or from `plitzi upload
|
|
93
|
+
* or from `plitzi plugin upload` with no builder open. An open builder loads it without a reload.
|
|
94
94
|
*/
|
|
95
95
|
readonly SPACE_ADD_PLUGIN: z.ZodObject<{
|
|
96
96
|
plugin: z.ZodObject<{
|
|
@@ -141,10 +141,25 @@ export declare const spaceEventSchemas: {
|
|
|
141
141
|
checked: "checked";
|
|
142
142
|
visited: "visited";
|
|
143
143
|
current: "current";
|
|
144
|
+
expanded: "expanded";
|
|
144
145
|
hidden: "hidden";
|
|
146
|
+
first: "first";
|
|
147
|
+
last: "last";
|
|
148
|
+
odd: "odd";
|
|
149
|
+
even: "even";
|
|
145
150
|
}>>;
|
|
146
151
|
styleVariant: z.ZodOptional<z.ZodString>;
|
|
147
152
|
styleAncestor: z.ZodOptional<z.ZodString>;
|
|
153
|
+
stylePseudo: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
before: "before";
|
|
155
|
+
after: "after";
|
|
156
|
+
marker: "marker";
|
|
157
|
+
placeholder: "placeholder";
|
|
158
|
+
"first-letter": "first-letter";
|
|
159
|
+
"first-line": "first-line";
|
|
160
|
+
selection: "selection";
|
|
161
|
+
}>>;
|
|
162
|
+
styleCondition: z.ZodOptional<z.ZodString>;
|
|
148
163
|
}, z.core.$strip>;
|
|
149
164
|
}, z.core.$strip>;
|
|
150
165
|
readonly STYLE_UPDATE_SELECTOR: z.ZodObject<{
|
|
@@ -168,10 +183,25 @@ export declare const spaceEventSchemas: {
|
|
|
168
183
|
checked: "checked";
|
|
169
184
|
visited: "visited";
|
|
170
185
|
current: "current";
|
|
186
|
+
expanded: "expanded";
|
|
171
187
|
hidden: "hidden";
|
|
188
|
+
first: "first";
|
|
189
|
+
last: "last";
|
|
190
|
+
odd: "odd";
|
|
191
|
+
even: "even";
|
|
172
192
|
}>>;
|
|
173
193
|
styleVariant: z.ZodOptional<z.ZodString>;
|
|
174
194
|
styleAncestor: z.ZodOptional<z.ZodString>;
|
|
195
|
+
stylePseudo: z.ZodOptional<z.ZodEnum<{
|
|
196
|
+
before: "before";
|
|
197
|
+
after: "after";
|
|
198
|
+
marker: "marker";
|
|
199
|
+
placeholder: "placeholder";
|
|
200
|
+
"first-letter": "first-letter";
|
|
201
|
+
"first-line": "first-line";
|
|
202
|
+
selection: "selection";
|
|
203
|
+
}>>;
|
|
204
|
+
styleCondition: z.ZodOptional<z.ZodString>;
|
|
175
205
|
styleSelector: z.ZodString;
|
|
176
206
|
}, z.core.$strip>;
|
|
177
207
|
}, z.core.$strip>;
|
|
@@ -2,163 +2,166 @@ import { isRecord as e } from "../helpers/isRecord.mjs";
|
|
|
2
2
|
import { isSchemaFlag as t } from "../flags/schemaFlag.mjs";
|
|
3
3
|
import { StyleVariableCategory as n } from "../types/StyleTypes.mjs";
|
|
4
4
|
import { DISPLAY_MODES as r } from "../style/displayModes.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { STYLE_PSEUDOS as i } from "../style/stylePseudos.mjs";
|
|
6
|
+
import { STYLE_STATES as a } from "../style/styleStates.mjs";
|
|
7
|
+
import { elementFromWire as o, schemaFromWire as s, schemaToWire as c } from "../schema/wire.mjs";
|
|
8
|
+
import { z as l } from "zod";
|
|
8
9
|
//#region src/network/spaceEvents.ts
|
|
9
|
-
var
|
|
10
|
+
var u = l.custom((t) => e(t) && typeof t.id == "string", { message: "expected an element with an id" }), d = l.array(u), f = l.custom((t) => e(t) && typeof t.id == "string" && e(t.flat), { message: "expected a component with an id and a flat" }), p = l.custom((t) => e(t) && Array.isArray(t.flat), { message: "expected a schema whose `flat` is a list of elements" }), m = l.custom((t) => e(t) && typeof t.id == "string", { message: "expected a page folder with an id" }), h = l.custom((t) => e(t) && typeof t.name == "string", { message: "expected a variable with a name" }), g = l.custom(t, { message: "expected a flag with a value and its rules" }), _ = l.custom(e, { message: "expected a style attributes object" }), v = l.custom((t) => e(t) && typeof t.family == "string" && typeof t.source == "string", { message: "expected a font with a family and a source" }), y = l.custom((t) => typeof t == "string" || typeof t == "number" || e(t), { message: "expected a style variable value" }), b = l.enum(r), x = l.custom((e) => typeof e == "string", { message: "expected a drop position" }), S = l.custom((e) => typeof e == "string", { message: "expected a style category" }), C = l.enum([
|
|
10
11
|
"class",
|
|
11
12
|
"element",
|
|
12
13
|
"id"
|
|
13
|
-
]),
|
|
14
|
-
componentType:
|
|
15
|
-
styleSelector:
|
|
16
|
-
styleState:
|
|
17
|
-
styleVariant:
|
|
18
|
-
styleAncestor:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
14
|
+
]), w = l.enum(a), T = l.enum(n), E = l.object({
|
|
15
|
+
componentType: l.string().optional(),
|
|
16
|
+
styleSelector: l.string().optional(),
|
|
17
|
+
styleState: w.optional(),
|
|
18
|
+
styleVariant: l.string().optional(),
|
|
19
|
+
styleAncestor: l.string().optional(),
|
|
20
|
+
stylePseudo: l.enum(i).optional(),
|
|
21
|
+
styleCondition: l.string().optional()
|
|
22
|
+
}), D = E.extend({ styleSelector: l.string() }), O = l.object({ variable: h }), k = l.object({
|
|
23
|
+
displayMode: b,
|
|
24
|
+
selector: l.string(),
|
|
25
|
+
category: T,
|
|
26
|
+
name: l.string(),
|
|
27
|
+
value: y
|
|
28
|
+
}), A = l.object({
|
|
29
|
+
displayMode: b,
|
|
30
|
+
selector: l.string(),
|
|
31
|
+
category: T,
|
|
32
|
+
name: l.string()
|
|
33
|
+
}), j = l.object({
|
|
34
|
+
category: T,
|
|
35
|
+
name: l.string(),
|
|
36
|
+
value: y
|
|
37
|
+
}), M = l.object({
|
|
38
|
+
type: l.string(),
|
|
39
|
+
resource: l.string(),
|
|
40
|
+
settings: l.custom(e, { message: "expected a plugin settings object" })
|
|
41
|
+
}), N = {
|
|
42
|
+
SPACE_UPDATED: l.object({ schema: p }),
|
|
43
|
+
STYLE_UPDATED: l.object({
|
|
44
|
+
platform: l.custom(e),
|
|
45
|
+
variables: l.custom(e),
|
|
46
|
+
cache: l.string()
|
|
47
|
+
}),
|
|
48
|
+
SPACE_ADD_PAGE: l.object({ page: u }),
|
|
49
|
+
SPACE_UPDATE_PAGE: l.object({ page: u }),
|
|
50
|
+
SPACE_SET_HOME_PAGE: l.object({ page: u }),
|
|
51
|
+
SPACE_REMOVE_PAGE: l.object({ pageId: l.string() }),
|
|
52
|
+
SPACE_ADD_PAGE_FOLDER: l.object({ pageFolder: m }),
|
|
53
|
+
SPACE_UPDATE_PAGE_FOLDER: l.object({ pageFolder: m }),
|
|
54
|
+
SPACE_REMOVE_PAGE_FOLDER: l.object({ pageFolderId: l.string() }),
|
|
55
|
+
SPACE_ADD_VARIABLE: O,
|
|
56
|
+
SPACE_UPDATE_VARIABLE: O,
|
|
57
|
+
SPACE_REMOVE_VARIABLE: l.object({ name: l.string() }),
|
|
58
|
+
SPACE_SET_FLAG: l.object({
|
|
59
|
+
name: l.string(),
|
|
60
|
+
flag: g
|
|
61
|
+
}),
|
|
62
|
+
SPACE_REMOVE_FLAG: l.object({ name: l.string() }),
|
|
63
|
+
SPACE_ADD_ELEMENT: l.object({
|
|
64
|
+
element: u,
|
|
65
|
+
dropPosition: x,
|
|
66
|
+
to: l.string(),
|
|
67
|
+
initialItems: d.optional(),
|
|
68
|
+
variables: l.array(h).optional()
|
|
69
|
+
}),
|
|
70
|
+
SPACE_UPDATE_ELEMENT: l.object({ element: u }),
|
|
71
|
+
SPACE_RENAME_ELEMENT: l.object({
|
|
72
|
+
elementId: l.string(),
|
|
73
|
+
id: l.string()
|
|
74
|
+
}),
|
|
75
|
+
SPACE_UPDATE_ELEMENTS: l.object({ elements: d }),
|
|
76
|
+
SPACE_REMOVE_ELEMENT: l.object({ elementId: l.string() }),
|
|
77
|
+
SPACE_MOVE_ELEMENT: l.object({
|
|
78
|
+
from: l.string(),
|
|
79
|
+
to: l.string(),
|
|
80
|
+
elementId: l.string(),
|
|
81
|
+
dropPosition: x
|
|
82
|
+
}),
|
|
83
|
+
SPACE_CLONE_ELEMENT: l.object({
|
|
84
|
+
to: l.string(),
|
|
85
|
+
element: u,
|
|
86
|
+
dropPosition: x,
|
|
87
|
+
initialItems: d
|
|
88
|
+
}),
|
|
89
|
+
SPACE_ADD_SNIPPET: l.object({
|
|
90
|
+
element: u,
|
|
91
|
+
style: l.custom(e),
|
|
92
|
+
to: l.string(),
|
|
93
|
+
dropPosition: x,
|
|
94
|
+
initialItems: d.optional(),
|
|
95
|
+
variables: l.array(h).optional()
|
|
96
|
+
}),
|
|
97
|
+
SPACE_ADD_PLUGIN: l.object({ plugin: M }),
|
|
98
|
+
SPACE_UPDATE_PLUGIN: l.object({ plugin: M }),
|
|
99
|
+
SPACE_REMOVE_PLUGIN: l.object({ pluginType: l.string() }),
|
|
100
|
+
SPACE_UPDATE_SETTINGS: l.object({
|
|
101
|
+
path: l.string(),
|
|
102
|
+
value: l.union([
|
|
103
|
+
l.string(),
|
|
104
|
+
l.number(),
|
|
105
|
+
l.boolean()
|
|
103
106
|
])
|
|
104
107
|
}),
|
|
105
|
-
STYLE_ADD_SELECTOR:
|
|
106
|
-
displayMode:
|
|
107
|
-
selector:
|
|
108
|
-
path:
|
|
109
|
-
type:
|
|
110
|
-
style:
|
|
111
|
-
params: T
|
|
112
|
-
}),
|
|
113
|
-
STYLE_UPDATE_SELECTOR: c.object({
|
|
114
|
-
displayMode: y,
|
|
115
|
-
selector: c.string(),
|
|
116
|
-
path: x.optional(),
|
|
117
|
-
style: g.optional(),
|
|
108
|
+
STYLE_ADD_SELECTOR: l.object({
|
|
109
|
+
displayMode: b,
|
|
110
|
+
selector: l.string(),
|
|
111
|
+
path: S.optional(),
|
|
112
|
+
type: C,
|
|
113
|
+
style: _.optional(),
|
|
118
114
|
params: E
|
|
119
115
|
}),
|
|
120
|
-
|
|
121
|
-
displayMode:
|
|
122
|
-
selector:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
116
|
+
STYLE_UPDATE_SELECTOR: l.object({
|
|
117
|
+
displayMode: b,
|
|
118
|
+
selector: l.string(),
|
|
119
|
+
path: S.optional(),
|
|
120
|
+
style: _.optional(),
|
|
121
|
+
params: D
|
|
122
|
+
}),
|
|
123
|
+
STYLE_REMOVE_SELECTOR: l.object({
|
|
124
|
+
displayMode: b,
|
|
125
|
+
selector: l.string()
|
|
126
|
+
}),
|
|
127
|
+
STYLE_REMOVE_SELECTORS: l.object({
|
|
128
|
+
displayMode: b,
|
|
129
|
+
selectors: l.array(l.string())
|
|
130
|
+
}),
|
|
131
|
+
STYLE_ADD_SELECTOR_VARIABLE: k,
|
|
132
|
+
STYLE_UPDATE_SELECTOR_VARIABLE: k,
|
|
133
|
+
STYLE_REMOVE_SELECTOR_VARIABLE: A,
|
|
134
|
+
STYLE_ADD_VARIABLE: j,
|
|
135
|
+
STYLE_UPDATE_VARIABLE: j,
|
|
136
|
+
STYLE_REMOVE_VARIABLE: l.object({
|
|
137
|
+
category: T,
|
|
138
|
+
name: l.string()
|
|
139
|
+
}),
|
|
140
|
+
STYLE_UPDATE_SETTINGS: l.object({
|
|
141
|
+
path: l.string(),
|
|
142
|
+
value: l.string()
|
|
143
|
+
}),
|
|
144
|
+
STYLE_ADD_FONT: l.object({ font: v }),
|
|
145
|
+
STYLE_UPDATE_FONT: l.object({
|
|
146
|
+
family: l.string(),
|
|
147
|
+
font: v
|
|
148
|
+
}),
|
|
149
|
+
STYLE_REMOVE_FONT: l.object({ family: l.string() }),
|
|
150
|
+
SPACE_ADD_COMPONENT: l.object({
|
|
151
|
+
component: f,
|
|
152
|
+
from: l.object({
|
|
153
|
+
elementId: l.string(),
|
|
154
|
+
instanceId: l.string()
|
|
152
155
|
}).optional()
|
|
153
156
|
}),
|
|
154
|
-
SPACE_UPDATE_COMPONENT:
|
|
155
|
-
componentId:
|
|
156
|
-
declaration:
|
|
157
|
+
SPACE_UPDATE_COMPONENT: l.object({
|
|
158
|
+
componentId: l.string(),
|
|
159
|
+
declaration: l.custom(e)
|
|
157
160
|
}),
|
|
158
|
-
SPACE_REMOVE_COMPONENT:
|
|
159
|
-
SPACE_DETACH_INSTANCE:
|
|
160
|
-
},
|
|
161
|
-
let n =
|
|
161
|
+
SPACE_REMOVE_COMPONENT: l.object({ componentId: l.string() }),
|
|
162
|
+
SPACE_DETACH_INSTANCE: l.object({ instanceId: l.string() })
|
|
163
|
+
}, P = Object.fromEntries(Object.keys(N).map((e) => [e, e])), F = (e, t) => {
|
|
164
|
+
let n = N[e];
|
|
162
165
|
if (!n) return {
|
|
163
166
|
ok: !1,
|
|
164
167
|
issues: [{
|
|
@@ -179,4 +182,4 @@ var l = c.custom((t) => e(t) && typeof t.id == "string", { message: "expected an
|
|
|
179
182
|
};
|
|
180
183
|
};
|
|
181
184
|
//#endregion
|
|
182
|
-
export {
|
|
185
|
+
export { P as SpaceEvents, P as default, o as elementFromWire, s as schemaFromWire, c as schemaToWire, N as spaceEventSchemas, F as validateSpaceEvent };
|