@plitzi/sdk-elements 0.38.17 → 0.38.19
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 +106 -0
- package/dist/Element/JsxManager.mjs +1 -1
- package/dist/Element/PluginManager.mjs +1 -1
- package/dist/Element/hooks/useInternalItems.mjs +1 -1
- package/dist/dataSource/GlobalSources.mjs +7 -6
- package/dist/elements/advanced/Custom/Custom.mjs +1 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +1 -1
- package/dist/elements/provider/ApiContainer/Settings.mjs +77 -77
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,111 @@
|
|
|
1
1
|
# @plitzi/sdk-elements
|
|
2
2
|
|
|
3
|
+
## 0.38.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 92a9f1b: ## Security
|
|
8
|
+
|
|
9
|
+
- **The `Origin` fallback tells the ports apart over HTTP/2 too** (`@plitzi/sdk-server`): a browser that sends no
|
|
10
|
+
`Sec-Fetch-Site` (Safari before 16.4, older webviews) is judged by its `Origin`, compared with the authority the
|
|
11
|
+
request was addressed to. HTTP/2 carries no `Host` header — the authority is `:authority` — and the comparison then
|
|
12
|
+
fell back to the host's NAME, so every port and scheme of it counted as this server's own: what 0.38.18 closed for
|
|
13
|
+
`same-site` stayed open there, over TLS, where a Plitzi server speaks HTTP/2. The authority is now `:authority`,
|
|
14
|
+
`Host`, or the `X-Forwarded-Host` a proxy in front wrote — whichever names the host the request is answered as — port
|
|
15
|
+
included; when none does, the origin is not taken as its own. The write guard (`crossSiteWrites`), the sign-in's
|
|
16
|
+
login-CSRF check and `createOriginGuardMiddleware` share it.
|
|
17
|
+
|
|
18
|
+
## Packages
|
|
19
|
+
- **The server evaluates rules without the query editor** (`@plitzi/sdk-shared`, `@plitzi/sdk-auth`,
|
|
20
|
+
`@plitzi/sdk-elements`, `@plitzi/sdk-interactions`, `@plitzi/plitzi-builder`): every evaluation of a `when` rule
|
|
21
|
+
group imports `QueryBuilderEvaluator` from `@plitzi/plitzi-ui/QueryBuilder/evaluator` — the evaluator alone — instead
|
|
22
|
+
of the `QueryBuilder` barrel, which brings the editor's React components, or `QueryBuilder/helpers`, which brings the
|
|
23
|
+
SQL and MongoDB formatters. `@plitzi/sdk-shared/helpers` reads `get` and `omit` from `@plitzi/plitzi-ui/helpers/lodash`.
|
|
24
|
+
Importing `@plitzi/sdk-server` loads 19 modules of `@plitzi/plitzi-ui` (26 before) and neither
|
|
25
|
+
`class-variance-authority` nor `clsx`, and starts in ~125 ms (~150 before). Needs `@plitzi/plitzi-ui` 1.6.34.
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [92a9f1b]
|
|
28
|
+
- @plitzi/sdk-auth@0.38.19
|
|
29
|
+
- @plitzi/sdk-event-bridge@0.38.19
|
|
30
|
+
- @plitzi/sdk-interactions@0.38.19
|
|
31
|
+
- @plitzi/sdk-navigation@0.38.19
|
|
32
|
+
- @plitzi/sdk-schema@0.38.19
|
|
33
|
+
- @plitzi/sdk-shared@0.38.19
|
|
34
|
+
|
|
35
|
+
## 0.38.18
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- b3023c9: ## Security
|
|
40
|
+
|
|
41
|
+
- **A page of the same site on another origin is no longer this server's own** (`@plitzi/sdk-server`): the guard
|
|
42
|
+
against writes another page caused (`crossSiteWrites`, the sign-in's login-CSRF check and `createOriginGuardMiddleware`)
|
|
43
|
+
trusted `Sec-Fetch-Site: same-site` — and a site has no port and spans every sub-domain, so another port of the host
|
|
44
|
+
(where `createAuthoringHost` serves pages an agent wrote) or a sibling sub-domain (every space of a platform on one
|
|
45
|
+
domain) could write as if it were the server's own page. Now only `same-origin` (and `none`, a typed URL) is; `same-site`
|
|
46
|
+
is refused 403 `reason: 'foreign'` unless its origin is named (`crossSiteWrites.origins`, `identity.platformOrigins`),
|
|
47
|
+
and the `Origin` fallback compares host and port. In production an app and its spaces are already on different sites,
|
|
48
|
+
so a deployment that works there needs nothing; one that relied on a sibling sub-domain locally names it.
|
|
49
|
+
`createAuthoringHost`'s docs now say to serve on a host of its own — a cookie belongs to a host whatever its port.
|
|
50
|
+
|
|
51
|
+
## Server
|
|
52
|
+
- **An open page takes a new version of its space where it stands** (`@plitzi/sdk-server`, `@plitzi/plitzi-sdk`):
|
|
53
|
+
`server.updatePages(documents, { draft? })` hands the pages showing that space — or that draft — its new documents,
|
|
54
|
+
and each swaps them in place, its state, scroll and focus kept (`replaceSpace` on what the SDK's `render` returns;
|
|
55
|
+
`false`, and the page loads again, for a page with elements the server draws). The development loop of a project uses
|
|
56
|
+
it: a save to the space no longer reloads the open page. `createAuthoringHost`'s `put` over an id that pages show
|
|
57
|
+
hands them the new version and answers how many took it (`updated`), so a page an agent keeps improving is seen to
|
|
58
|
+
grow instead of reloading — no second iframe needed.
|
|
59
|
+
- **`devReload` is `livePages`** (`@plitzi/sdk-server`): the channel the open pages listen on now carries the space,
|
|
60
|
+
not only "load again", and a host that is not developing uses it too. Its address is `/__plitzi/live`; a draft's page
|
|
61
|
+
listens for its own changes alone (`?__pt=`). A plugin swapped where it is drawn stays a development server's
|
|
62
|
+
(`devMode`). `plitzi upgrade migrations --write` renames the option in a project's code (`livePagesOption`).
|
|
63
|
+
|
|
64
|
+
## Packages
|
|
65
|
+
- **`@plitzi/sdk-server` starts in half the time** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): importing it took
|
|
66
|
+
~310 ms, ~200 of them `date-fns` — 108 modules nothing on the server uses, brought by `@plitzi/sdk-shared/helpers` —
|
|
67
|
+
and loaded the browser's hooks and contexts of every folder of `@plitzi/sdk-shared` it read, `@plitzi/nexus/react`
|
|
68
|
+
with them. Now ~150 ms (`@plitzi/sdk-shared` 139 → 113 modules, `@plitzi/nexus` 53 → 31). What moved, each
|
|
69
|
+
rewritten by `plitzi upgrade migrations --write` (`movedExports`):
|
|
70
|
+
- the dates — `formatDate`, `formatDateUTC`, `formatFromNow`, `formatUTCToLocal`, `getDurationMs`, `isDate`,
|
|
71
|
+
`isValidFormat`, `parseDate`, `toUnixSeconds`, `SupportedLocale` — from `@plitzi/sdk-shared/helpers` to
|
|
72
|
+
`@plitzi/sdk-shared/dates`;
|
|
73
|
+
- React's bindings to an entry of their own beside each area, as `@plitzi/nexus/react` is: `useDisplayMode`,
|
|
74
|
+
`useElementSize` → `@plitzi/sdk-shared/style/react`; `SchemaContext` → `schema/react`; `PluginsContext` →
|
|
75
|
+
`plugins/react`; `DevToolsContext` → `devTools/react`; `useFlagResolution` → `flags/react` (`flagUserFrom` stays
|
|
76
|
+
in `flags`);
|
|
77
|
+
- `PROJECT_DATA_PREFIX` from `@plitzi/sdk-shared/server` to `@plitzi/sdk-shared/project/paths` — the project's
|
|
78
|
+
layout names, an entry a browser imports too (`@plitzi/sdk-shared/project` stays Node only and re-exports them).
|
|
79
|
+
The theme cookie's helpers (`themeFromCookies`…) are also `@plitzi/sdk-shared/theme/cookie`, still exported by
|
|
80
|
+
`@plitzi/sdk-shared/theme`.
|
|
81
|
+
|
|
82
|
+
`yarn check:server-footprint` (in CI after the build) holds what the server's root loads, package by package — Plitzi's
|
|
83
|
+
and every other — to a budget: a heavy library or a folder of hooks coming back fails with what came in.
|
|
84
|
+
|
|
85
|
+
## CLI
|
|
86
|
+
- **`plitzi upgrade migrations --write` writes a file import's new home when it has one** (`@plitzi/cli`): the
|
|
87
|
+
`folderImports` migration of 0.38.17 named every import of a package's FILE and wrote none. It now reads the installed
|
|
88
|
+
declarations with the project's own TypeScript and rewrites each `import` / `export … from` whose every name the folder
|
|
89
|
+
exports under one name — `import usePlitzi from '@plitzi/sdk-shared/hooks/usePlitzi'` →
|
|
90
|
+
`import { usePlitzi } from '@plitzi/sdk-shared/hooks'`, `type` modifiers and aliases kept. What has no one answer is
|
|
91
|
+
said with why (a namespace import, an `import()` or mock, a name the folder does not export, a project with no
|
|
92
|
+
TypeScript). The report says which places `--write` writes (`writable` in `--json`) instead of calling every one
|
|
93
|
+
"yours to change"; a migration now gives each place its own `edit` in place of a whole-file `rewrite`
|
|
94
|
+
(`docs/en/releases.md`).
|
|
95
|
+
- **`plitzi doctor` says an import of a path the installed package does not export** (`@plitzi/cli`):
|
|
96
|
+
`import-not-exported`, an error, at the importing file — what Node otherwise reports at start as an
|
|
97
|
+
`ERR_MODULE_NOT_FOUND` into the package's `dist`, which reads as a broken install rather than a changed API. For a
|
|
98
|
+
`@plitzi` package the fix names `plitzi upgrade migrations --write`; for any other, its `exports`. Asked only of a
|
|
99
|
+
package that is installed.
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [b3023c9]
|
|
102
|
+
- @plitzi/sdk-auth@0.38.18
|
|
103
|
+
- @plitzi/sdk-event-bridge@0.38.18
|
|
104
|
+
- @plitzi/sdk-interactions@0.38.18
|
|
105
|
+
- @plitzi/sdk-navigation@0.38.18
|
|
106
|
+
- @plitzi/sdk-schema@0.38.18
|
|
107
|
+
- @plitzi/sdk-shared@0.38.18
|
|
108
|
+
|
|
3
109
|
## 0.38.17
|
|
4
110
|
|
|
5
111
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@ import { getRemoteSettings as t } from "./helpers/pluginSelector.mjs";
|
|
|
3
3
|
import n from "../elements/internal/NotFound/NotFound.mjs";
|
|
4
4
|
import { memo as r, use as i, useMemo as a } from "react";
|
|
5
5
|
import { ComponentContext as o } from "@plitzi/sdk-shared/elements";
|
|
6
|
-
import { PluginsContext as s } from "@plitzi/sdk-shared/plugins";
|
|
6
|
+
import { PluginsContext as s } from "@plitzi/sdk-shared/plugins/react";
|
|
7
7
|
import { jsx as c } from "react/jsx-runtime";
|
|
8
8
|
var l = r(({ plitziJsxSkipHOC: r = !0, as: l = "", internalProps: u, children: d, ...f }) => {
|
|
9
9
|
let { components: p } = i(o), { plugins: m } = i(s), h = l ? p.current[l] : void 0, g = a(() => h ? void 0 : t({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./helpers/pluginSelector.mjs";
|
|
2
2
|
import { memo as t, use as n } from "react";
|
|
3
3
|
import { ComponentContext as r } from "@plitzi/sdk-shared/elements";
|
|
4
|
-
import { PluginsContext as i } from "@plitzi/sdk-shared/plugins";
|
|
4
|
+
import { PluginsContext as i } from "@plitzi/sdk-shared/plugins/react";
|
|
5
5
|
var a = t(({ plitziElementLayout: t = void 0, type: a = "", internalProps: o }) => {
|
|
6
6
|
let { components: s } = n(r), { plugins: c } = n(i);
|
|
7
7
|
return e({
|
|
@@ -6,7 +6,7 @@ import { useCommonStore as u } from "@plitzi/sdk-shared/store";
|
|
|
6
6
|
import { get as d } from "@plitzi/plitzi-ui/helpers";
|
|
7
7
|
import { ComponentContext as f } from "@plitzi/sdk-shared/elements";
|
|
8
8
|
import { passesFlagGate as p } from "@plitzi/sdk-shared/flags";
|
|
9
|
-
import { PluginsContext as m } from "@plitzi/sdk-shared/plugins";
|
|
9
|
+
import { PluginsContext as m } from "@plitzi/sdk-shared/plugins/react";
|
|
10
10
|
import { jsx as h } from "react/jsx-runtime";
|
|
11
11
|
//#region src/Element/hooks/useInternalItems.tsx
|
|
12
12
|
var g = typeof window > "u", _ = "#layout-body", v = "#children", y = {}, b = () => () => {}, x = () => !0, S = () => !1, C = ({ id: C, definition: w, plitziElementLayout: T, children: E, previewMode: D, visible: O = !0 }) => {
|
|
@@ -6,9 +6,10 @@ import { useCommonStore as c, useCommonStoreSync as l } from "@plitzi/sdk-shared
|
|
|
6
6
|
import { getPathsFromObject as u } from "@plitzi/sdk-shared/helpers";
|
|
7
7
|
import { get as ee } from "@plitzi/plitzi-ui/helpers";
|
|
8
8
|
import { evaluateComputed as d } from "@plitzi/sdk-shared/dataSource";
|
|
9
|
-
import { flagValues as f, undeclaredFlagOverrides as te
|
|
10
|
-
import { SPACE_THEME_AREA as
|
|
11
|
-
import { AuthContext as
|
|
9
|
+
import { flagValues as f, undeclaredFlagOverrides as te } from "@plitzi/sdk-shared/flags";
|
|
10
|
+
import { SPACE_THEME_AREA as p, useTheme as m } from "@plitzi/sdk-shared/theme";
|
|
11
|
+
import { AuthContext as h } from "@plitzi/sdk-auth";
|
|
12
|
+
import { useFlagResolution as g } from "@plitzi/sdk-shared/flags/react";
|
|
12
13
|
//#region src/dataSource/GlobalSources.tsx
|
|
13
14
|
var _ = ({ children: _ }) => {
|
|
14
15
|
let [[v, y, b, x, S, C = ""]] = c([
|
|
@@ -92,7 +93,7 @@ var _ = ({ children: _ }) => {
|
|
|
92
93
|
name: "Navigation",
|
|
93
94
|
fields: k
|
|
94
95
|
}), l("runtime.sources.navigation", O);
|
|
95
|
-
let A = n(
|
|
96
|
+
let A = n(h), { user: j, authenticated: M, state: N, provider: P } = A, F = a(() => P ? {
|
|
96
97
|
isAuthenticated: M,
|
|
97
98
|
...N === void 0 ? {} : { status: N },
|
|
98
99
|
accessToken: j?.accessToken ?? "",
|
|
@@ -119,7 +120,7 @@ var _ = ({ children: _ }) => {
|
|
|
119
120
|
name: "Auth State",
|
|
120
121
|
fields: I
|
|
121
122
|
}), l("runtime.sources.auth", F);
|
|
122
|
-
let L =
|
|
123
|
+
let L = g(A), R = a(() => f(L), [L]), z = r(() => Object.keys(R).map((e) => ({
|
|
123
124
|
path: e,
|
|
124
125
|
name: `flags.${e}`,
|
|
125
126
|
inputType: "checkbox"
|
|
@@ -154,7 +155,7 @@ var _ = ({ children: _ }) => {
|
|
|
154
155
|
name: "Host",
|
|
155
156
|
fields: K
|
|
156
157
|
}), l("runtime.sources.host", G);
|
|
157
|
-
let { theme: q, resolvedTheme: J } =
|
|
158
|
+
let { theme: q, resolvedTheme: J } = m(p), Y = a(() => ({
|
|
158
159
|
mode: q,
|
|
159
160
|
resolved: J
|
|
160
161
|
}), [q, J]), X = r(() => u(Y).map((e) => ({
|
|
@@ -5,7 +5,7 @@ import r from "../../../Element/hooks/useElement.mjs";
|
|
|
5
5
|
import { RootElement as i } from "../../../Element/RootElement.mjs";
|
|
6
6
|
import { use as a, useEffect as o, useMemo as s } from "react";
|
|
7
7
|
import { ComponentContext as c } from "@plitzi/sdk-shared/elements";
|
|
8
|
-
import { PluginsContext as l } from "@plitzi/sdk-shared/plugins";
|
|
8
|
+
import { PluginsContext as l } from "@plitzi/sdk-shared/plugins/react";
|
|
9
9
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
10
|
import f from "clsx";
|
|
11
11
|
//#region src/elements/advanced/Custom/Custom.tsx
|
|
@@ -26,7 +26,7 @@ import Se from "clsx";
|
|
|
26
26
|
import { currentRscLocation as Ce } from "@plitzi/sdk-shared/server";
|
|
27
27
|
import { InteractionsContext as we } from "@plitzi/sdk-interactions";
|
|
28
28
|
import { getSourceName as Te } from "@plitzi/sdk-shared/dataSource/helpers";
|
|
29
|
-
import { QueryBuilderEvaluator as Ee } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
29
|
+
import { QueryBuilderEvaluator as Ee } from "@plitzi/plitzi-ui/QueryBuilder/evaluator";
|
|
30
30
|
import { useServerQuery as De } from "@plitzi/sdk-shared/queries";
|
|
31
31
|
//#region src/elements/provider/ApiContainer/ApiContainer.tsx
|
|
32
32
|
var s = ({ ref: t, className: s = "", children: c, query: l = "", method: u = "get", accessToken: d = "", when: f = a, headers: p = a, mockData: m = "{}", subType: Oe = "", credentials: ke = "same-origin", singleRecord: Ae = !1, pagination: je = "none", pageParam: Me = "page", renderWhileLoading: Ne = !1, loadingSlot: h = "", cache: Pe = !1, staleTime: Fe = 30, gcTime: Ie = 300, refreshSeconds: Le = 0, connector: Re = "", action: ze = "", input: Be }) => {
|
|
@@ -3,24 +3,24 @@ import t from "./components/FiltersInput/index.mjs";
|
|
|
3
3
|
import { useCallback as n, useMemo as r, useState as i } from "react";
|
|
4
4
|
import { useBuilderStore as a, useCommonStore as o, useSdkStore as s } from "@plitzi/sdk-shared/store";
|
|
5
5
|
import { emptyObject as ee } from "@plitzi/sdk-shared/helpers";
|
|
6
|
-
import { get as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useTheme as
|
|
9
|
-
import
|
|
10
|
-
import f from "@plitzi/plitzi-ui/
|
|
11
|
-
import p from "@plitzi/plitzi-ui/
|
|
12
|
-
import m from "@plitzi/plitzi-ui/
|
|
13
|
-
import h from "@plitzi/plitzi-ui/
|
|
6
|
+
import { get as te } from "@plitzi/plitzi-ui/helpers";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { useTheme as ne } from "@plitzi/sdk-shared/theme";
|
|
9
|
+
import d from "@plitzi/plitzi-ui/CodeMirror";
|
|
10
|
+
import f from "@plitzi/plitzi-ui/Input";
|
|
11
|
+
import p from "@plitzi/plitzi-ui/Select";
|
|
12
|
+
import m from "@plitzi/plitzi-ui/KVInput";
|
|
13
|
+
import h from "@plitzi/plitzi-ui/QueryBuilder";
|
|
14
14
|
import g from "@plitzi/plitzi-ui/Switch";
|
|
15
15
|
//#region src/elements/provider/ApiContainer/Settings.tsx
|
|
16
16
|
var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", headers: x = ee, when: S, subType: C = "", mockData: re = "{}", credentials: ie = "same-origin", runtime: ae = "client", connector: w = "", action: T = "", endpoint: oe = "", resource: se = "", limit: ce = "10", singleRecord: E = !1, filters: D = _, pagination: O = "none", pageParam: k = "page", renderWhileLoading: A = !1, loadingSlot: j = "", cache: M = !1, staleTime: N = 30, gcTime: P = 300, refreshSeconds: F = 0, onUpdate: I }) => {
|
|
17
|
-
let { resolvedTheme: L } =
|
|
17
|
+
let { resolvedTheme: L } = ne(), [R] = a("pageDefinitions"), [z] = a("connectors"), [B] = o("actions.catalog"), [V] = a("hasServerRendering"), [H, U] = i(!1), W = ae === "server", G = W ? T && !w ? "action" : "connector" : "client", [[K, q, J]] = s([
|
|
18
18
|
"navigation.routeParams",
|
|
19
19
|
"navigation.queryParams",
|
|
20
20
|
"navigation.currentPageId"
|
|
21
21
|
]), Y = e(I), le = n((e) => I?.("query", e), [I]), ue = n((e) => I?.("when", e), [I]), de = n((e) => I?.("subType", e), [I]), fe = n((e) => I?.("mockData", e), [I]), pe = n((e) => U(e.target.checked), []), me = n((e, t) => I?.("headers", t), [I]), he = n((e) => {
|
|
22
22
|
e === "client" ? I?.("runtime", "client", !0) : (I?.("runtime", "server", !0), I?.(e === "action" ? "connector" : "action", ""));
|
|
23
|
-
}, [I]), ge = n((e) => I?.("singleRecord", e.target.checked), [I]), _e = n((e) => I?.("loadingSlot", e), [I]), ve = n((e) => I?.("renderWhileLoading", e.target.checked), [I]), ye = n((e) => I?.("cache", e.target.checked), [I]), be = n((e) => I?.("filters", e), [I]), X = r(() => Object.values(z), [z]), Z = r(() => X.find((e) => e.identifier === w)?.manifest, [X, w]), xe = r(() => Object.keys(Z?.operators ?? {}), [Z]), Q = r(() => Object.keys(Z?.endpoints.read ?? {}), [Z]), $ = r(() => [...
|
|
23
|
+
}, [I]), ge = n((e) => I?.("singleRecord", e.target.checked), [I]), _e = n((e) => I?.("loadingSlot", e), [I]), ve = n((e) => I?.("renderWhileLoading", e.target.checked), [I]), ye = n((e) => I?.("cache", e.target.checked), [I]), be = n((e) => I?.("filters", e), [I]), X = r(() => Object.values(z), [z]), Z = r(() => X.find((e) => e.identifier === w)?.manifest, [X, w]), xe = r(() => Object.keys(Z?.operators ?? {}), [Z]), Q = r(() => Object.keys(Z?.endpoints.read ?? {}), [Z]), $ = r(() => [...te(R, `${J}.attributes.slug`, "").matchAll(/:[a-z0-9_-]+/gim)].map((e) => e[0].slice(1)), [R, J]), Se = r(() => [
|
|
24
24
|
...Object.keys(K),
|
|
25
25
|
...Object.keys(q),
|
|
26
26
|
...$
|
|
@@ -32,30 +32,30 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
32
32
|
q,
|
|
33
33
|
$
|
|
34
34
|
]);
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ u("div", {
|
|
36
36
|
className: "flex grow flex-col gap-4 py-2",
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ u(p, {
|
|
39
39
|
value: G,
|
|
40
40
|
label: "Data Source",
|
|
41
41
|
onChange: he,
|
|
42
42
|
size: "xs",
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ l("option", {
|
|
45
45
|
value: "client",
|
|
46
46
|
children: "Browser request"
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ l("option", {
|
|
49
49
|
value: "connector",
|
|
50
50
|
children: "Connector (server-side)"
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ l("option", {
|
|
53
53
|
value: "action",
|
|
54
54
|
children: "Server action (server-side)"
|
|
55
55
|
})
|
|
56
56
|
]
|
|
57
57
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ u("span", {
|
|
59
59
|
className: "text-xs text-gray-500 dark:text-zinc-400",
|
|
60
60
|
children: [
|
|
61
61
|
G === "connector" && "The server calls the API and hands the page its records. The endpoint and the credential never reach the browser, and the content is in the HTML search engines see.",
|
|
@@ -63,55 +63,55 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
63
63
|
G === "client" && "The browser calls the URL directly. Anything it needs to authenticate with is visible to the visitor, and the content is not in the initial HTML."
|
|
64
64
|
]
|
|
65
65
|
}),
|
|
66
|
-
G === "action" && /* @__PURE__ */
|
|
66
|
+
G === "action" && /* @__PURE__ */ u(c, { children: [B?.length === 0 && /* @__PURE__ */ l("div", {
|
|
67
67
|
className: "rounded-sm border border-gray-300 p-2 text-xs text-gray-500 dark:border-zinc-600 dark:text-zinc-400",
|
|
68
68
|
children: "No actions yet. Add one in the Actions panel and give it a “While a page renders” trigger — that is the way in this element uses."
|
|
69
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ u(p, {
|
|
70
70
|
value: T,
|
|
71
71
|
label: "Action",
|
|
72
72
|
onChange: Y.text("action"),
|
|
73
73
|
size: "xs",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ l("option", {
|
|
75
75
|
value: "",
|
|
76
76
|
children: "Select an action…"
|
|
77
|
-
}), (B ?? []).map((e) => /* @__PURE__ */
|
|
77
|
+
}), (B ?? []).map((e) => /* @__PURE__ */ l("option", {
|
|
78
78
|
value: e.identifier,
|
|
79
79
|
children: e.name
|
|
80
80
|
}, e.identifier))]
|
|
81
81
|
})] }),
|
|
82
|
-
W && !V && /* @__PURE__ */
|
|
82
|
+
W && !V && /* @__PURE__ */ l("div", {
|
|
83
83
|
className: "rounded-sm border border-yellow-300 bg-yellow-50 p-2 text-xs text-yellow-800 dark:border-yellow-700 dark:bg-yellow-950 dark:text-yellow-200",
|
|
84
84
|
children: "This space has no server-rendered deployment. It resolves here in the builder, but a published page would have no server to resolve it — publish with a Plitzi SSR credential, or read the API from the browser instead."
|
|
85
85
|
}),
|
|
86
|
-
G === "connector" && /* @__PURE__ */
|
|
87
|
-
X.length === 0 && /* @__PURE__ */
|
|
86
|
+
G === "connector" && /* @__PURE__ */ u(c, { children: [
|
|
87
|
+
X.length === 0 && /* @__PURE__ */ l("div", {
|
|
88
88
|
className: "rounded-sm border border-gray-300 p-2 text-xs text-gray-500 dark:border-zinc-600 dark:text-zinc-400",
|
|
89
89
|
children: "No connectors yet. Add one in the Connectors panel — it holds the API endpoints, and the credential stays on the server."
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ u(p, {
|
|
92
92
|
value: w,
|
|
93
93
|
label: "Connector",
|
|
94
94
|
onChange: Y.text("connector"),
|
|
95
95
|
size: "xs",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ l("option", {
|
|
97
97
|
value: "",
|
|
98
98
|
children: "Select a connector…"
|
|
99
|
-
}), X.map((e) => /* @__PURE__ */
|
|
99
|
+
}), X.map((e) => /* @__PURE__ */ l("option", {
|
|
100
100
|
value: e.identifier,
|
|
101
101
|
children: e.name
|
|
102
102
|
}, e.identifier))]
|
|
103
103
|
}),
|
|
104
|
-
Q.length > 1 && /* @__PURE__ */
|
|
104
|
+
Q.length > 1 && /* @__PURE__ */ l(p, {
|
|
105
105
|
value: oe,
|
|
106
106
|
label: "Endpoint",
|
|
107
107
|
onChange: Y.text("endpoint"),
|
|
108
108
|
size: "xs",
|
|
109
|
-
children: Q.map((e) => /* @__PURE__ */
|
|
109
|
+
children: Q.map((e) => /* @__PURE__ */ l("option", {
|
|
110
110
|
value: e,
|
|
111
111
|
children: e
|
|
112
112
|
}, e))
|
|
113
113
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ l(f, {
|
|
115
115
|
value: se,
|
|
116
116
|
label: "Resource",
|
|
117
117
|
placeholder: "posts",
|
|
@@ -119,45 +119,45 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
119
119
|
onChange: Y.text("resource"),
|
|
120
120
|
size: "xs"
|
|
121
121
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ l(t, {
|
|
123
123
|
value: D,
|
|
124
124
|
operators: xe,
|
|
125
125
|
onChange: be
|
|
126
126
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ l(g, {
|
|
128
128
|
checked: E,
|
|
129
129
|
size: "sm",
|
|
130
130
|
label: "Single record (detail page)",
|
|
131
131
|
onChange: ge
|
|
132
132
|
}),
|
|
133
|
-
!E && /* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
133
|
+
!E && /* @__PURE__ */ u(c, { children: [
|
|
134
|
+
/* @__PURE__ */ l(f, {
|
|
135
135
|
value: ce,
|
|
136
136
|
label: "Records per page",
|
|
137
137
|
onChange: Y.text("limit"),
|
|
138
138
|
size: "xs"
|
|
139
139
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ u(p, {
|
|
141
141
|
value: O,
|
|
142
142
|
label: "Pagination",
|
|
143
143
|
onChange: Y.text("pagination"),
|
|
144
144
|
size: "xs",
|
|
145
145
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ l("option", {
|
|
147
147
|
value: "none",
|
|
148
148
|
children: "None"
|
|
149
149
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ l("option", {
|
|
151
151
|
value: "url",
|
|
152
152
|
children: "URL (indexable)"
|
|
153
153
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ l("option", {
|
|
155
155
|
value: "append",
|
|
156
156
|
children: "Load more"
|
|
157
157
|
})
|
|
158
158
|
]
|
|
159
159
|
}),
|
|
160
|
-
O !== "none" && /* @__PURE__ */
|
|
160
|
+
O !== "none" && /* @__PURE__ */ l(f, {
|
|
161
161
|
value: k,
|
|
162
162
|
label: "Page parameter",
|
|
163
163
|
title: "Query-string key this list pages on. Give each list its own so they page independently.",
|
|
@@ -166,10 +166,10 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
166
166
|
})
|
|
167
167
|
] })
|
|
168
168
|
] }),
|
|
169
|
-
!W && /* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
169
|
+
!W && /* @__PURE__ */ u(c, { children: [
|
|
170
|
+
/* @__PURE__ */ u("div", {
|
|
171
171
|
className: "flex flex-col",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ l("label", { children: "Query" }), /* @__PURE__ */ l(d, {
|
|
173
173
|
className: "min-h-6.5 basis-auto rounded-sm border border-gray-300 px-1 text-xs",
|
|
174
174
|
value: v,
|
|
175
175
|
theme: L,
|
|
@@ -180,79 +180,79 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
180
180
|
onChange: le
|
|
181
181
|
})]
|
|
182
182
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ u(p, {
|
|
184
184
|
value: y,
|
|
185
185
|
label: "Method",
|
|
186
186
|
onChange: Y.text("method"),
|
|
187
187
|
size: "xs",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ l("option", {
|
|
189
189
|
value: "get",
|
|
190
190
|
children: "Get"
|
|
191
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ l("option", {
|
|
192
192
|
value: "post",
|
|
193
193
|
children: "Post"
|
|
194
194
|
})]
|
|
195
195
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ l(f, {
|
|
197
197
|
value: b,
|
|
198
198
|
label: "Access Token",
|
|
199
199
|
title: "Bind this to the signed-in visitor's token. A value typed here is saved in the page and served to\n every visitor — put anything secret behind a connector instead.",
|
|
200
200
|
onChange: Y.text("accessToken"),
|
|
201
201
|
size: "xs"
|
|
202
202
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ u(p, {
|
|
204
204
|
value: ie,
|
|
205
205
|
label: "Include Credentials",
|
|
206
206
|
onChange: Y.text("credentials"),
|
|
207
207
|
size: "xs",
|
|
208
208
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ l("option", {
|
|
210
210
|
value: "include",
|
|
211
211
|
children: "Include"
|
|
212
212
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ l("option", {
|
|
214
214
|
value: "omit",
|
|
215
215
|
children: "Omit"
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ l("option", {
|
|
218
218
|
value: "same-origin",
|
|
219
219
|
children: "Same Origin"
|
|
220
220
|
})
|
|
221
221
|
]
|
|
222
222
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ l(g, {
|
|
224
224
|
checked: M,
|
|
225
225
|
size: "sm",
|
|
226
226
|
label: "Cache responses",
|
|
227
227
|
onChange: ye
|
|
228
228
|
}),
|
|
229
|
-
M && /* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
229
|
+
M && /* @__PURE__ */ u(c, { children: [
|
|
230
|
+
/* @__PURE__ */ l(f, {
|
|
231
231
|
value: String(N),
|
|
232
232
|
label: "Fresh for (s)",
|
|
233
233
|
title: "How long an answer is reused without asking again — here and by every provider requesting the\n same thing. Past it, the answer stays on screen while a fresh one is fetched. 0 asks on every mount.",
|
|
234
234
|
onChange: Y.text("staleTime"),
|
|
235
235
|
size: "xs"
|
|
236
236
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ l(f, {
|
|
238
238
|
value: String(P),
|
|
239
239
|
label: "Keep unused for (s)",
|
|
240
240
|
title: "How long an answer nobody is showing is kept, so coming back to it within that time paints at once.",
|
|
241
241
|
onChange: Y.text("gcTime"),
|
|
242
242
|
size: "xs"
|
|
243
243
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ l("div", {
|
|
245
245
|
className: "rounded-sm border border-gray-300 p-2 text-xs text-gray-500 dark:border-zinc-600 dark:text-zinc-400",
|
|
246
246
|
children: "A completed server action refreshes every cached request, in case it changed what they read. On its step, “Refresh cached requests” can name only the containers it affects, or none for an action that only reads. A webhook step can do the same."
|
|
247
247
|
})
|
|
248
248
|
] }),
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ l(g, {
|
|
250
250
|
checked: A,
|
|
251
251
|
size: "sm",
|
|
252
252
|
label: "Render children while loading",
|
|
253
253
|
onChange: ve
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ l(f, {
|
|
256
256
|
value: j,
|
|
257
257
|
label: "Loading slot",
|
|
258
258
|
placeholder: "catalog-skeleton",
|
|
@@ -261,29 +261,29 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
261
261
|
onChange: _e
|
|
262
262
|
})
|
|
263
263
|
] }),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ l(f, {
|
|
265
265
|
value: String(F),
|
|
266
266
|
label: "Refresh every (s)",
|
|
267
267
|
title: "Asks again on its own this often, for a page showing something that keeps moving. Paused while the tab\n is hidden. 0 never does.",
|
|
268
268
|
onChange: Y.text("refreshSeconds"),
|
|
269
269
|
size: "xs"
|
|
270
270
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ l(g, {
|
|
272
272
|
checked: H,
|
|
273
273
|
size: "sm",
|
|
274
274
|
label: "Advanced Settings",
|
|
275
275
|
onChange: pe
|
|
276
276
|
}),
|
|
277
|
-
H && /* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
277
|
+
H && /* @__PURE__ */ u(c, { children: [
|
|
278
|
+
/* @__PURE__ */ l(m, {
|
|
279
279
|
value: Object.entries(x),
|
|
280
280
|
label: "Headers",
|
|
281
281
|
onChange: me,
|
|
282
282
|
size: "xs"
|
|
283
283
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ u("div", {
|
|
285
285
|
className: "flex flex-col",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ l("label", { children: "When to perform query request" }), /* @__PURE__ */ l(h, {
|
|
287
287
|
direction: "vertical",
|
|
288
288
|
className: "w-full",
|
|
289
289
|
size: "xs",
|
|
@@ -292,62 +292,62 @@ var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", header
|
|
|
292
292
|
showBranches: !0
|
|
293
293
|
})]
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ u(p, {
|
|
296
296
|
value: C,
|
|
297
297
|
label: "Container Tag",
|
|
298
298
|
onChange: de,
|
|
299
299
|
size: "xs",
|
|
300
300
|
children: [
|
|
301
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ l("option", {
|
|
302
302
|
value: "",
|
|
303
303
|
children: "None"
|
|
304
304
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ l("option", {
|
|
306
306
|
value: "div",
|
|
307
307
|
children: "Div"
|
|
308
308
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ l("option", {
|
|
310
310
|
value: "header",
|
|
311
311
|
children: "Header"
|
|
312
312
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ l("option", {
|
|
314
314
|
value: "footer",
|
|
315
315
|
children: "Footer"
|
|
316
316
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ l("option", {
|
|
318
318
|
value: "nav",
|
|
319
319
|
children: "Nav"
|
|
320
320
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ l("option", {
|
|
322
322
|
value: "main",
|
|
323
323
|
children: "Main"
|
|
324
324
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ l("option", {
|
|
326
326
|
value: "section",
|
|
327
327
|
children: "Section"
|
|
328
328
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ l("option", {
|
|
330
330
|
value: "article",
|
|
331
331
|
children: "Article"
|
|
332
332
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ l("option", {
|
|
334
334
|
value: "aside",
|
|
335
335
|
children: "Aside"
|
|
336
336
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ l("option", {
|
|
338
338
|
value: "address",
|
|
339
339
|
children: "Address"
|
|
340
340
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ l("option", {
|
|
342
342
|
value: "figure",
|
|
343
343
|
children: "Figure"
|
|
344
344
|
})
|
|
345
345
|
]
|
|
346
346
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ l("div", { className: "my-2 h-px w-full border border-gray-300 bg-gray-300" }),
|
|
348
|
+
/* @__PURE__ */ u("div", {
|
|
349
349
|
className: "flex min-h-50 grow flex-col",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ l("label", { children: "Mock Data (Build Mode)" }), /* @__PURE__ */ l(d, {
|
|
351
351
|
value: re,
|
|
352
352
|
theme: L,
|
|
353
353
|
mode: "json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-elements",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.19",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dr.pogodin/react-helmet": "^3.3.2",
|
|
34
34
|
"@plitzi/nexus": "^1.4.0",
|
|
35
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
36
|
-
"@plitzi/sdk-auth": "0.38.
|
|
37
|
-
"@plitzi/sdk-event-bridge": "0.38.
|
|
38
|
-
"@plitzi/sdk-interactions": "0.38.
|
|
39
|
-
"@plitzi/sdk-navigation": "0.38.
|
|
40
|
-
"@plitzi/sdk-schema": "0.38.
|
|
41
|
-
"@plitzi/sdk-shared": "0.38.
|
|
35
|
+
"@plitzi/plitzi-ui": "^1.6.34",
|
|
36
|
+
"@plitzi/sdk-auth": "0.38.19",
|
|
37
|
+
"@plitzi/sdk-event-bridge": "0.38.19",
|
|
38
|
+
"@plitzi/sdk-interactions": "0.38.19",
|
|
39
|
+
"@plitzi/sdk-navigation": "0.38.19",
|
|
40
|
+
"@plitzi/sdk-schema": "0.38.19",
|
|
41
|
+
"@plitzi/sdk-shared": "0.38.19",
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"immer": "^11.1.21",
|
|
44
44
|
"react-markdown": "^10.1.0",
|