@plitzi/sdk-elements 0.38.9 → 0.38.10
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 +88 -0
- package/dist/Element/hooks/useElementInternal.mjs +67 -59
- package/dist/elements/advanced/BlockHtml/index.mjs +3 -3
- package/dist/elements/advanced/BlockJsx/index.mjs +3 -3
- package/dist/elements/advanced/Custom/index.mjs +3 -3
- package/dist/elements/basic/Button/index.mjs +3 -3
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +13 -13
- package/dist/elements/declarations/index.d.ts +22 -16
- package/dist/elements/declarations/index.mjs +6 -6
- package/dist/elements/form/Form/Form.mjs +19 -19
- package/dist/elements/form/FormControl/FormControl.mjs +10 -10
- package/dist/elements/form/FormControl/declaration.mjs +1 -1
- package/dist/elements/internal/NotFound/index.mjs +3 -3
- package/dist/elements/internal/Page/Page.d.ts +5 -0
- package/dist/elements/internal/Page/Page.mjs +26 -25
- package/dist/elements/internal/Page/PageHead.d.ts +12 -0
- package/dist/elements/internal/Page/PageHead.mjs +29 -0
- package/dist/elements/internal/Page/declaration.d.ts +2 -0
- package/dist/elements/internal/Page/declaration.mjs +5 -0
- package/dist/elements/internal/Page/index.d.ts +2 -0
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +187 -187
- package/dist/elements/provider/ApiContainer/declaration.d.ts +10 -9
- package/dist/elements/provider/ApiContainer/declaration.mjs +1 -0
- package/dist/elements/provider/ApiContainer/index.d.ts +10 -9
- package/dist/elements/provider/Channel/Channel.mjs +15 -15
- package/dist/elements/provider/Channel/declaration.d.ts +1 -1
- package/dist/elements/provider/Channel/index.d.ts +1 -1
- package/dist/elements/structure/Carousel/Carousel.mjs +72 -72
- package/dist/elements/structure/Carousel/CarouselTrack/index.mjs +3 -3
- package/dist/elements/structure/Carousel/declaration.d.ts +1 -1
- package/dist/elements/structure/Carousel/index.d.ts +1 -1
- package/dist/elements/structure/Container/Container.mjs +8 -8
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +14 -14
- package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -2
- package/dist/elements/structure/DialogContainer/declaration.mjs +1 -2
- package/dist/elements/structure/DialogContainer/index.d.ts +1 -2
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +8 -8
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +16 -16
- package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -3
- package/dist/elements/structure/ModalContainer/declaration.mjs +2 -3
- package/dist/elements/structure/ModalContainer/index.d.ts +2 -3
- package/dist/elements/structure/Pagination/Pagination.mjs +10 -10
- package/dist/index.d.ts +17 -16
- package/package.json +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,93 @@
|
|
|
1
1
|
# @plitzi/sdk-elements
|
|
2
2
|
|
|
3
|
+
## 0.38.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 200da2f: - **`focus-on-field-box`** (`@plitzi/sdk-authoring`): a warning for a `focus` or `focus-visible` state on a text
|
|
8
|
+
field's or a select's `input` slot. That slot is the box the field is drawn in, a `<div>` that never takes focus, so
|
|
9
|
+
the rule was never seen and a keyboard user tabbing to the field found no ring. The fix it names: `'focus-within'` on
|
|
10
|
+
the same class, or the state on the `field` slot.
|
|
11
|
+
- **`modalContainer` says how it is laid out** (`@plitzi/sdk-elements`): its description now names its slots and how
|
|
12
|
+
they sit — the dim layer and the dialog side by side, not one inside the other; the dialog centred by `top`/`left`
|
|
13
|
+
50% and a `translate`. A space styled the dim layer as a flex container to place the dialog, which moved nothing.
|
|
14
|
+
- **A field shows where the keyboard is** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-elements`): a text field's or a select's
|
|
15
|
+
box is ringed (`2px solid currentColor`) while the field inside has keyboard focus, and a textarea while it has. No
|
|
16
|
+
text field or select showed any focus at all: the box had `outline: none`, and the field inherited it. One class of
|
|
17
|
+
specificity, so whatever a space writes about the outline wins; never in the builder's canvas, where the selection is
|
|
18
|
+
the ring. The field no longer inherits the box's outline — the box draws it.
|
|
19
|
+
- **The dim layer of a modal and a dialog is `rgb(0 0 0 / 50%)`** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-elements`), not
|
|
20
|
+
black at `opacity: 0.5`: the default looks the same, and a colour a space gives the layer is drawn as it is — it was
|
|
21
|
+
halved. A space that set its own colour sees it darker: the one it wrote.
|
|
22
|
+
- **`required-message-unused`** (`@plitzi/sdk-authoring`): a warning for a `requiredMessage` on a field nothing requires —
|
|
23
|
+
since 0.38.9 a field is optional unless `required: true`, so the message is never shown and an empty answer is sent.
|
|
24
|
+
The formControl's description, the cheat sheet and the forms recipe say the default.
|
|
25
|
+
- **A page's title can say its record** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`, `@plitzi/sdk-elements`,
|
|
26
|
+
`@plitzi/sdk-authoring`): `seoTitle` and `seoDescription` may be templates over the page's `runtime: 'server'`
|
|
27
|
+
providers (its layouts' too) and `navigation` — `'{{ apiContainer_post.title }} — Blog'`. The server evaluates them
|
|
28
|
+
as it writes the head, from the answers it already has; the browser evaluates the same over `rsc.data`, so the tab
|
|
29
|
+
follows a navigation from record to record. One that reads anything else — a browser provider, `state` — is refused
|
|
30
|
+
(`page-template`): it was written into the head as it was, braces included. A declaration's `serverTemplates` names
|
|
31
|
+
the attributes the page server evaluates against a context of its own (a page's title and description, a provider's
|
|
32
|
+
`notFound`): the element runtime leaves them as written — interpolated where the page renders, a `|default(…)`
|
|
33
|
+
resolved to its fallback before the head could read the providers — and the authoring lint reads the same list.
|
|
34
|
+
- **A page says when its address shows nothing** (`@plitzi/sdk-server`, `@plitzi/sdk-authoring`): `notFound` on the
|
|
35
|
+
page, one expression over the same answers its title reads — `"{{ not (apiContainer_feed.topics|find('slug',
|
|
36
|
+
navigation.routeParams.slug)) }}"` — sends it with status 404, rendered as written. A provider's own `notFound` reads
|
|
37
|
+
only its answer, and one in a layout is every page's: a record read from the layout had no way to say it was not
|
|
38
|
+
there, and the page answered 200.
|
|
39
|
+
- **The Export keeps the flows of a plugin hosted by `custom`** (`@plitzi/sdk-authoring`): `specFromSpace` judged such
|
|
40
|
+
an element by `custom`'s own triggers and callbacks, and dropped a flow on the component's event (`onChange` on an
|
|
41
|
+
editor) as one "a custom never fires" — the space read back was not the space written.
|
|
42
|
+
- **`page check` reads every word on the page, in the colour the browser paints it** (`@plitzi/sdk-authoring`): what a
|
|
43
|
+
plugin draws inside an element of the space is measured too, named by the element and a selector; the measure is
|
|
44
|
+
WCAG's contrast (under 2:1 is unreadable), not "nearly the same colour"; and a colour the browser answers as
|
|
45
|
+
`oklch()`, `oklab()` or `color(srgb …)` — every token and every `color-mix()` — is read as that, where it was read as
|
|
46
|
+
`rgb()` numbers and came out near black. A plugin's dark-on-dark status line passed as "nothing wrong".
|
|
47
|
+
- **`verify` checks every theme the space can be painted in** (`@plitzi/cli`): light and dark, unless the space says
|
|
48
|
+
light only — "48 checks at 1440 and 390 px, light and dark". A page unreadable in the dark theme passed in the light
|
|
49
|
+
one; a failure names the theme it was found in.
|
|
50
|
+
- **`plitzi upgrade` says where fields became optional** (`@plitzi/cli`): for a project last upgraded before 0.38.9,
|
|
51
|
+
each `formControl(…)` with no `required`, at its file and line — said, never written. And a `.gitkeep` is asked for
|
|
52
|
+
only in a folder with nothing else in it: `upgrade` wrote one beside code, and `doctor` called it missing once deleted
|
|
53
|
+
as AGENTS.md asks ("nothing unused") — the three now say the same.
|
|
54
|
+
- **`devMode` and `devReload` are the project's** (`@plitzi/sdk-server`): `src/config/serverOptions.ts` may set them,
|
|
55
|
+
over `NODE_ENV`, which they still follow when left out. A deployment started without `NODE_ENV` (a container's `CMD`)
|
|
56
|
+
says `devMode: false`, and a public action answers with its output alone.
|
|
57
|
+
- **`page shot --from load`** (`@plitzi/cli`): `--frames` start as soon as the page's HTML is in, not once it settles —
|
|
58
|
+
an entrance that plays while the page loads had ended before the first picture.
|
|
59
|
+
- **`heavy-animation` says where each animation is** (`@plitzi/sdk-authoring`): the class and its variant, state or
|
|
60
|
+
slot — or the `customCss` rule — and writes the fix against that selector. It said "in `customCss`" for an animation
|
|
61
|
+
declared on a class's variant, and offered `.glow`, a class no space has.
|
|
62
|
+
- **`page shot --steps`** (`@plitzi/cli`): an interaction played step by step — `click`, `type`, `press`, `wait`,
|
|
63
|
+
`wait-for`, `shot [label]`, `frames <n> [ms]`, separated by `;` or written in a file (`@file`) — each picture labelled
|
|
64
|
+
with its step and the time since the first, and said when nothing changed since the one before. A queue filling, a
|
|
65
|
+
restart, an opening frame by frame took a Playwright script of the project's own. Targets take Playwright's selectors
|
|
66
|
+
too (`text=Saved`).
|
|
67
|
+
- **A space's task may take a `number` param** (`@plitzi/sdk-server`): saved functions refused it ("a type the builder
|
|
68
|
+
cannot draw") while a project's server ran it, so code that worked self-hosted failed on the platform — and the
|
|
69
|
+
builder draws one, a callback's. A step's params now arrive as the types the task declares, on every server: a
|
|
70
|
+
`number` written as text is the number, a `boolean` written `'true'` is `true`, as the browser reads a callback's.
|
|
71
|
+
- **`page shot --as <username>`** (`@plitzi/cli`): signs in first, as `page check --as` does, the password from
|
|
72
|
+
`PLITZI_CHECK_PASSWORD` in `.env`. A page for signed-in visitors was pictured as the sign-in page it sent the browser
|
|
73
|
+
to, without a word; `page shot` now says when the page sent it elsewhere, and that the picture is of that page.
|
|
74
|
+
- **A capture is of the page at rest** (`@plitzi/sdk-mcp`): the local screenshot client takes every picture with
|
|
75
|
+
`prefers-reduced-motion: reduce`, as the browser pod now does — the declared motion and a space's own keyframes that
|
|
76
|
+
honour the query are shown finished. A splash still covering its page, or an arrival caught halfway, was what a
|
|
77
|
+
thumbnail or a `plitzi_look` showed of a page that animates as it loads.
|
|
78
|
+
- **The server renders in the visitor's theme, not only the class** (`@plitzi/sdk-shared`): `ThemeProvider` set the
|
|
79
|
+
starting theme from a layout effect, which never runs on a server, so a page was drawn from the theme store's own
|
|
80
|
+
start — `{{ theme.resolved }}` was `light` under a `<html class="dark">`, and whatever named the scheme (a picture's
|
|
81
|
+
address, a `when` rule) was swapped for the other one as the page hydrated. The theme a host supplies (the cookie) is
|
|
82
|
+
now the server's snapshot of the store, and the hydration's; the shared store is never written on the server.
|
|
83
|
+
- Updated dependencies [200da2f]
|
|
84
|
+
- @plitzi/sdk-shared@0.38.10
|
|
85
|
+
- @plitzi/sdk-auth@0.38.10
|
|
86
|
+
- @plitzi/sdk-event-bridge@0.38.10
|
|
87
|
+
- @plitzi/sdk-interactions@0.38.10
|
|
88
|
+
- @plitzi/sdk-navigation@0.38.10
|
|
89
|
+
- @plitzi/sdk-schema@0.38.10
|
|
90
|
+
|
|
3
91
|
## 0.38.9
|
|
4
92
|
|
|
5
93
|
### Patch Changes
|
|
@@ -3,15 +3,16 @@ import { omitKeys as t } from "../helpers/omitKeys.mjs";
|
|
|
3
3
|
import n from "./useElementDataSource.mjs";
|
|
4
4
|
import r from "./useElementState.mjs";
|
|
5
5
|
import i from "./useInternalItems.mjs";
|
|
6
|
-
import a from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import l from "@plitzi/
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
6
|
+
import { serverTemplatesByType as a } from "../../elements/declarations/index.mjs";
|
|
7
|
+
import o from "../helpers/parseStyleSelectors.mjs";
|
|
8
|
+
import { useMemo as s } from "react";
|
|
9
|
+
import { useCommonStore as c } from "@plitzi/sdk-shared/store";
|
|
10
|
+
import { get as l } from "@plitzi/plitzi-ui/helpers";
|
|
11
|
+
import u from "@plitzi/sdk-shared/dataSource/getBindingsDetails";
|
|
12
|
+
import { hasValidToken as d, processTwig as f, templatePaths as p } from "@plitzi/sdk-shared/helpers/twigWrapper";
|
|
13
|
+
import { COMPONENT_PROPS_SOURCE as m } from "@plitzi/sdk-shared/schema/schemaConstants";
|
|
13
14
|
//#region src/Element/hooks/useElementInternal.ts
|
|
14
|
-
var
|
|
15
|
+
var h = { settled: /* @__PURE__ */ new Set([m]) }, g = (e, t, n) => {
|
|
15
16
|
let { queryParams: r = {}, routeParams: i = {}, variables: a = {}, origin: o = "", navigation: s, ...c } = n, l = {
|
|
16
17
|
...a,
|
|
17
18
|
...i,
|
|
@@ -24,43 +25,43 @@ var m = { settled: /* @__PURE__ */ new Set([p]) }, h = (e, t, n) => {
|
|
|
24
25
|
origin: o
|
|
25
26
|
}
|
|
26
27
|
}, u = { ...e };
|
|
27
|
-
for (let n of t) u[n] =
|
|
28
|
+
for (let n of t) u[n] = f(e[n], l, h);
|
|
28
29
|
return u;
|
|
29
|
-
},
|
|
30
|
-
let
|
|
31
|
-
n.attributes && (
|
|
32
|
-
...
|
|
30
|
+
}, _ = (e) => !!e && Object.values(e).some((e) => Array.isArray(e) && e.length > 0), v = (e, n, r = {}, i = {}) => {
|
|
31
|
+
let s, { attributes: c, definition: f } = e, { rootId: p, plitziElementLayout: m } = n;
|
|
32
|
+
n.attributes && (c = {
|
|
33
|
+
...c,
|
|
33
34
|
...n.attributes
|
|
34
35
|
});
|
|
35
|
-
let
|
|
36
|
+
let h = c;
|
|
36
37
|
if (Object.keys(r).length > 0) {
|
|
37
|
-
if (
|
|
38
|
-
let t =
|
|
38
|
+
if (_(f.bindings)) {
|
|
39
|
+
let t = u(r, {
|
|
39
40
|
...e,
|
|
40
|
-
attributes:
|
|
41
|
-
},
|
|
42
|
-
({attributes:
|
|
43
|
-
} else
|
|
41
|
+
attributes: c
|
|
42
|
+
}, s);
|
|
43
|
+
({attributes: c, definition: f, style: s} = t);
|
|
44
|
+
} else s = {};
|
|
44
45
|
}
|
|
45
|
-
let
|
|
46
|
-
let t =
|
|
47
|
-
return typeof t == "string" && t ===
|
|
46
|
+
let v = a[f.type] ?? [], y = Object.keys(c).filter((e) => {
|
|
47
|
+
let t = c[e];
|
|
48
|
+
return typeof t == "string" && t === h[e] && d(t) && !v.includes(e);
|
|
48
49
|
});
|
|
49
|
-
return
|
|
50
|
-
...
|
|
50
|
+
return y.length > 0 && (c = g(c, y, r)), c = {
|
|
51
|
+
...c,
|
|
51
52
|
...t(i, ["visibility", "styleSelectors"])
|
|
52
|
-
},
|
|
53
|
-
...
|
|
53
|
+
}, f = {
|
|
54
|
+
...f,
|
|
54
55
|
styleSelectors: {
|
|
55
|
-
...
|
|
56
|
-
...
|
|
56
|
+
...f.styleSelectors,
|
|
57
|
+
...f.initialState?.styleSelectors,
|
|
57
58
|
...i.styleSelectors ?? {}
|
|
58
59
|
}
|
|
59
|
-
},
|
|
60
|
+
}, f.styleSelectors = o(f), {
|
|
60
61
|
...n,
|
|
61
|
-
rootId:
|
|
62
|
+
rootId: l(m, "rootId", p),
|
|
62
63
|
attributes: {
|
|
63
|
-
...
|
|
64
|
+
...c,
|
|
64
65
|
...t(n, [
|
|
65
66
|
"id",
|
|
66
67
|
"rootId",
|
|
@@ -69,49 +70,56 @@ var m = { settled: /* @__PURE__ */ new Set([p]) }, h = (e, t, n) => {
|
|
|
69
70
|
"plitziElementLayout"
|
|
70
71
|
])
|
|
71
72
|
},
|
|
72
|
-
definition:
|
|
73
|
+
definition: f,
|
|
73
74
|
elementState: {
|
|
74
|
-
...
|
|
75
|
+
...f.initialState,
|
|
75
76
|
...i
|
|
76
77
|
},
|
|
77
|
-
style:
|
|
78
|
+
style: s
|
|
78
79
|
};
|
|
79
|
-
},
|
|
80
|
+
}, y = (e, t) => {
|
|
81
|
+
let n = a[t] ?? [];
|
|
82
|
+
return Object.entries(e ?? {}).flatMap(([e, t]) => typeof t == "string" && d(t) && !n.includes(e) ? [t] : []);
|
|
83
|
+
}, b = (e) => ["variables", ...new Set(e.flatMap((e) => p(e)))], x = ({ element: a, children: o, internalProps: l, previewMode: u = !1, parentVisible: d = !0 }) => {
|
|
80
84
|
let { id: f } = l, { state: p, setElementState: m } = r({
|
|
81
85
|
id: f,
|
|
82
86
|
bindings: a.definition.bindings,
|
|
83
87
|
previewMode: u
|
|
84
|
-
}), h =
|
|
85
|
-
let e = [...
|
|
86
|
-
return e.length > 0 ?
|
|
87
|
-
}, [
|
|
88
|
+
}), { type: h } = a.definition, g = s(() => {
|
|
89
|
+
let e = [...y(a.attributes, h), ...y(l.attributes, h)];
|
|
90
|
+
return e.length > 0 ? b(e) : void 0;
|
|
91
|
+
}, [
|
|
92
|
+
a.attributes,
|
|
93
|
+
h,
|
|
94
|
+
l.attributes
|
|
95
|
+
]), [[_, x, S]] = c([
|
|
88
96
|
"navigation.routeParams",
|
|
89
97
|
"navigation.queryParams",
|
|
90
98
|
"navigation.origin"
|
|
91
|
-
], { enabled:
|
|
99
|
+
], { enabled: g !== void 0 }), C = n({
|
|
92
100
|
bindings: a.definition.bindings,
|
|
93
|
-
sources:
|
|
94
|
-
}),
|
|
95
|
-
...
|
|
96
|
-
...
|
|
97
|
-
routeParams:
|
|
98
|
-
queryParams:
|
|
99
|
-
origin:
|
|
101
|
+
sources: g
|
|
102
|
+
}), w = s(() => ({
|
|
103
|
+
...v(a, l, {
|
|
104
|
+
...C,
|
|
105
|
+
routeParams: _,
|
|
106
|
+
queryParams: x,
|
|
107
|
+
origin: S
|
|
100
108
|
}, p),
|
|
101
109
|
setElementState: m
|
|
102
110
|
}), [
|
|
103
111
|
a,
|
|
104
112
|
l,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
b,
|
|
113
|
+
C,
|
|
114
|
+
_,
|
|
108
115
|
x,
|
|
116
|
+
S,
|
|
109
117
|
p,
|
|
110
118
|
m
|
|
111
119
|
]);
|
|
112
120
|
return {
|
|
113
|
-
internalProps:
|
|
114
|
-
customProps:
|
|
121
|
+
internalProps: w,
|
|
122
|
+
customProps: s(() => t(w, [
|
|
115
123
|
"id",
|
|
116
124
|
"rootId",
|
|
117
125
|
"plitziElementLayout",
|
|
@@ -120,16 +128,16 @@ var m = { settled: /* @__PURE__ */ new Set([p]) }, h = (e, t, n) => {
|
|
|
120
128
|
"style",
|
|
121
129
|
"elementState",
|
|
122
130
|
"setElementState"
|
|
123
|
-
]), [
|
|
131
|
+
]), [w]),
|
|
124
132
|
children: i({
|
|
125
133
|
id: f,
|
|
126
|
-
definition:
|
|
127
|
-
plitziElementLayout:
|
|
128
|
-
children:
|
|
134
|
+
definition: w.definition,
|
|
135
|
+
plitziElementLayout: w.plitziElementLayout,
|
|
136
|
+
children: o,
|
|
129
137
|
previewMode: u,
|
|
130
|
-
visible: d && e(
|
|
138
|
+
visible: d && e(w.elementState.visibility)
|
|
131
139
|
})
|
|
132
140
|
};
|
|
133
141
|
};
|
|
134
142
|
//#endregion
|
|
135
|
-
export {
|
|
143
|
+
export { x as default, v as getProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./BlockHtml.mjs";
|
|
3
3
|
//#region src/elements/advanced/BlockHtml/index.ts
|
|
4
|
-
var n = Object.assign(
|
|
4
|
+
var n = Object.assign(t, e);
|
|
5
5
|
//#endregion
|
|
6
6
|
export { n as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./BlockJsx.mjs";
|
|
3
3
|
//#region src/elements/advanced/BlockJsx/index.ts
|
|
4
|
-
var n = Object.assign(
|
|
4
|
+
var n = Object.assign(t, e);
|
|
5
5
|
//#endregion
|
|
6
6
|
export { n as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./Custom.mjs";
|
|
3
3
|
//#region src/elements/advanced/Custom/index.ts
|
|
4
|
-
var n = Object.assign(
|
|
4
|
+
var n = Object.assign(t, e);
|
|
5
5
|
//#endregion
|
|
6
6
|
export { n as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./Button.mjs";
|
|
3
3
|
//#region src/elements/basic/Button/index.ts
|
|
4
|
-
var n = Object.assign(
|
|
4
|
+
var n = Object.assign(t, e);
|
|
5
5
|
//#endregion
|
|
6
6
|
export { n as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
|
+
import n from "../../../Element/hooks/useElement.mjs";
|
|
4
|
+
import { RootElement as r } from "../../../Element/RootElement.mjs";
|
|
5
5
|
import { use as i, useCallback as a, useEffect as o, useMemo as s, useRef as c, useSyncExternalStore as l } from "react";
|
|
6
6
|
import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
7
7
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -36,8 +36,8 @@ var h = () => () => {}, g = () => !0, _ = () => !1, v = () => /* @__PURE__ */ f(
|
|
|
36
36
|
strokeLinejoin: "round",
|
|
37
37
|
d: "M20.5 14.3A8.6 8.6 0 0 1 9.7 3.5a8.6 8.6 0 1 0 10.8 10.8Z"
|
|
38
38
|
})
|
|
39
|
-
}), b = ({ ref:
|
|
40
|
-
let { theme: E, resolvedTheme: D, setTheme: O, toggleTheme: k } = m(), { id: A, definition: { styleSelectors: j } } =
|
|
39
|
+
}), b = ({ ref: t, className: b = "", subType: x = "switch", lightLabel: S = "Light", darkLabel: C = "Dark", systemLabel: w = "System", showSystem: T = !1 }) => {
|
|
40
|
+
let { theme: E, resolvedTheme: D, setTheme: O, toggleTheme: k } = m(), { id: A, definition: { styleSelectors: j } } = n(), { settings: { previewMode: M }, contexts: { InteractionsContext: N } } = u(), { interactionsManager: P } = i(N), F = l(h, g, _), I = a((e) => (t) => {
|
|
41
41
|
t.preventDefault(), M && O(e);
|
|
42
42
|
}, [M, O]), L = a((e) => {
|
|
43
43
|
e.preventDefault(), M && k();
|
|
@@ -70,13 +70,13 @@ var h = () => () => {}, g = () => !0, _ = () => !1, v = () => /* @__PURE__ */ f(
|
|
|
70
70
|
E,
|
|
71
71
|
P,
|
|
72
72
|
A
|
|
73
|
-
]), x === "segmented" ? /* @__PURE__ */ d(
|
|
74
|
-
ref:
|
|
73
|
+
]), x === "segmented" ? /* @__PURE__ */ d(r, {
|
|
74
|
+
ref: t,
|
|
75
75
|
tag: "div",
|
|
76
76
|
role: "group",
|
|
77
77
|
"aria-label": `${S} / ${C}`,
|
|
78
78
|
className: p("plitzi-component__theme-toggle plitzi-component__theme-toggle--segmented", b),
|
|
79
|
-
interactionTriggers:
|
|
79
|
+
interactionTriggers: e.triggers,
|
|
80
80
|
children: R.map((e) => /* @__PURE__ */ f("button", {
|
|
81
81
|
type: "button",
|
|
82
82
|
className: p("plitzi-component__theme-toggle-option", j.option),
|
|
@@ -86,11 +86,11 @@ var h = () => () => {}, g = () => !0, _ = () => !1, v = () => /* @__PURE__ */ f(
|
|
|
86
86
|
onClick: I(e.value),
|
|
87
87
|
children: [e.icon, /* @__PURE__ */ d("span", { children: e.label })]
|
|
88
88
|
}, e.value))
|
|
89
|
-
}) : /* @__PURE__ */ f(
|
|
90
|
-
ref:
|
|
89
|
+
}) : /* @__PURE__ */ f(r, {
|
|
90
|
+
ref: t,
|
|
91
91
|
tag: "button",
|
|
92
92
|
className: p("plitzi-component__theme-toggle plitzi-component__theme-toggle--switch", b),
|
|
93
|
-
interactionTriggers:
|
|
93
|
+
interactionTriggers: e.triggers,
|
|
94
94
|
type: "button",
|
|
95
95
|
onClick: L,
|
|
96
96
|
"aria-label": `${S} / ${C}`,
|
|
@@ -107,6 +107,6 @@ var h = () => () => {}, g = () => !0, _ = () => !1, v = () => /* @__PURE__ */ f(
|
|
|
107
107
|
children: /* @__PURE__ */ d(y, {})
|
|
108
108
|
})]
|
|
109
109
|
});
|
|
110
|
-
}, x =
|
|
110
|
+
}, x = t(b);
|
|
111
111
|
//#endregion
|
|
112
112
|
export { b as ThemeToggle, x as default };
|
|
@@ -48,6 +48,7 @@ export declare const elementDeclarations: {
|
|
|
48
48
|
readonly pagination: readonly string[];
|
|
49
49
|
};
|
|
50
50
|
readonly sourceType: "apiContainer";
|
|
51
|
+
readonly serverTemplates: readonly ["notFound"];
|
|
51
52
|
readonly triggers: {
|
|
52
53
|
readonly onApiError: {
|
|
53
54
|
readonly action: "onApiError";
|
|
@@ -211,25 +212,25 @@ export declare const elementDeclarations: {
|
|
|
211
212
|
headers?: Record<string, string> | undefined;
|
|
212
213
|
notFound?: string | undefined;
|
|
213
214
|
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
215
|
+
credentials?: RequestCredentials | undefined;
|
|
216
|
+
staleTime?: number | string | undefined;
|
|
217
|
+
gcTime?: number | string | undefined;
|
|
218
|
+
pageParam?: string | undefined;
|
|
214
219
|
query?: string | undefined;
|
|
215
220
|
accessToken?: string | undefined;
|
|
216
221
|
mockData?: (Record<string, unknown> | string) | undefined;
|
|
217
|
-
|
|
222
|
+
singleRecord?: boolean | undefined;
|
|
223
|
+
pagination?: import('../provider/ApiContainer/hooks/useProviderPagination').ProviderPagination | undefined;
|
|
224
|
+
renderWhileLoading?: boolean | undefined;
|
|
225
|
+
loadingSlot?: string | undefined;
|
|
226
|
+
refreshSeconds?: number | string | undefined;
|
|
218
227
|
connector?: string | undefined;
|
|
219
228
|
limit?: string | undefined;
|
|
220
|
-
singleRecord?: boolean | undefined;
|
|
221
229
|
filters?: {
|
|
222
230
|
field: string;
|
|
223
231
|
operator: string;
|
|
224
232
|
value: string;
|
|
225
233
|
}[] | undefined;
|
|
226
|
-
pagination?: import('../provider/ApiContainer/hooks/useProviderPagination').ProviderPagination | undefined;
|
|
227
|
-
pageParam?: string | undefined;
|
|
228
|
-
renderWhileLoading?: boolean | undefined;
|
|
229
|
-
loadingSlot?: string | undefined;
|
|
230
|
-
staleTime?: number | string | undefined;
|
|
231
|
-
gcTime?: number | string | undefined;
|
|
232
|
-
refreshSeconds?: number | string | undefined;
|
|
233
234
|
}>>;
|
|
234
235
|
readonly BlockHtml: {
|
|
235
236
|
readonly type: "blockHtml";
|
|
@@ -602,8 +603,8 @@ export declare const elementDeclarations: {
|
|
|
602
603
|
items?: unknown[] | undefined;
|
|
603
604
|
speed?: number | undefined;
|
|
604
605
|
loop?: boolean | undefined;
|
|
605
|
-
autoplay?: number | undefined;
|
|
606
606
|
pauseOnHover?: boolean | undefined;
|
|
607
|
+
autoplay?: number | undefined;
|
|
607
608
|
transition?: import('../structure/Carousel/CarouselContext').CarouselTransition | undefined;
|
|
608
609
|
itemKey?: string | undefined;
|
|
609
610
|
}>>;
|
|
@@ -786,9 +787,9 @@ export declare const elementDeclarations: {
|
|
|
786
787
|
};
|
|
787
788
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
788
789
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
789
|
-
topic?: string | undefined;
|
|
790
790
|
grant?: string | undefined;
|
|
791
791
|
presence?: unknown;
|
|
792
|
+
topic?: string | undefined;
|
|
792
793
|
keep?: number | string | undefined;
|
|
793
794
|
}>>;
|
|
794
795
|
readonly Container: {
|
|
@@ -1061,8 +1062,7 @@ export declare const elementDeclarations: {
|
|
|
1061
1062
|
readonly top: "0";
|
|
1062
1063
|
readonly position: "absolute";
|
|
1063
1064
|
readonly 'z-index': "210";
|
|
1064
|
-
readonly 'background-color': "
|
|
1065
|
-
readonly opacity: "0.5";
|
|
1065
|
+
readonly 'background-color': "rgb(0 0 0 / 50%)";
|
|
1066
1066
|
};
|
|
1067
1067
|
};
|
|
1068
1068
|
readonly rootContainer: {
|
|
@@ -3036,7 +3036,7 @@ export declare const elementDeclarations: {
|
|
|
3036
3036
|
readonly definition: {
|
|
3037
3037
|
readonly label: "Modal Container";
|
|
3038
3038
|
readonly type: "modalContainer";
|
|
3039
|
-
readonly description:
|
|
3039
|
+
readonly description: string;
|
|
3040
3040
|
readonly items: readonly [];
|
|
3041
3041
|
readonly bindings: {};
|
|
3042
3042
|
readonly loadStrategy: "lazy";
|
|
@@ -3093,8 +3093,7 @@ export declare const elementDeclarations: {
|
|
|
3093
3093
|
readonly top: "0";
|
|
3094
3094
|
readonly position: "absolute";
|
|
3095
3095
|
readonly 'z-index': "210";
|
|
3096
|
-
readonly 'background-color': "
|
|
3097
|
-
readonly opacity: "0.5";
|
|
3096
|
+
readonly 'background-color': "rgb(0 0 0 / 50%)";
|
|
3098
3097
|
};
|
|
3099
3098
|
};
|
|
3100
3099
|
readonly rootContainer: {
|
|
@@ -3579,6 +3578,7 @@ export declare const elementDeclarations: {
|
|
|
3579
3578
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<unknown>;
|
|
3580
3579
|
readonly Page: {
|
|
3581
3580
|
readonly type: "page";
|
|
3581
|
+
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
3582
3582
|
readonly triggers: {
|
|
3583
3583
|
readonly onPageLoad: {
|
|
3584
3584
|
readonly action: "onPageLoad";
|
|
@@ -3659,6 +3659,7 @@ export declare const elementDeclarations: {
|
|
|
3659
3659
|
};
|
|
3660
3660
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
3661
3661
|
layout?: string | undefined;
|
|
3662
|
+
notFound?: string | undefined;
|
|
3662
3663
|
layoutContainer?: string | undefined;
|
|
3663
3664
|
seoEnabled?: boolean | undefined;
|
|
3664
3665
|
seoPageTitle?: string | undefined;
|
|
@@ -4443,3 +4444,8 @@ export declare const elementDeclarations: {
|
|
|
4443
4444
|
};
|
|
4444
4445
|
export type ElementDeclarationName = keyof typeof elementDeclarations;
|
|
4445
4446
|
export { ApiContainerDeclaration, BlockHtmlDeclaration, BlockJsxDeclaration, ButtonDeclaration, CarouselDeclaration, CarouselTrackDeclaration, ChannelDeclaration, ContainerDeclaration, CustomDeclaration, DialogContainerDeclaration, DropdownDeclaration, DropdownPopupDeclaration, EmbedDeclaration, FontAwesomeDeclaration, FormControlDeclaration, FormDeclaration, HeadingDeclaration, ImageDeclaration, LayoutContainerDeclaration, LinkDeclaration, ListDeclaration, ListItemDeclaration, LoadingDeclaration, MarkdownDeclaration, ModalContainerDeclaration, NodeHtmlDeclaration, NotFoundDeclaration, PageDeclaration, PaginationDeclaration, ParagraphDeclaration, ReferenceDeclaration, RichTextDeclaration, SvgDeclaration, TabContainerBodyDeclaration, TabContainerDeclaration, TabContainerHeaderDeclaration, TabContainerItemDeclaration, TextDeclaration, ThemeToggleDeclaration, VideoDeclaration };
|
|
4447
|
+
/**
|
|
4448
|
+
* Each type's `serverTemplates`, by the type a document names: the attributes the page server evaluates against a
|
|
4449
|
+
* context of its own, which the element runtime leaves as written and the authoring lint holds to that context.
|
|
4450
|
+
*/
|
|
4451
|
+
export declare const serverTemplatesByType: Readonly<Record<string, readonly string[]>>;
|
|
@@ -26,8 +26,8 @@ import w from "../media/Svg/declaration.mjs";
|
|
|
26
26
|
import T from "../media/Video/declaration.mjs";
|
|
27
27
|
import E from "../provider/ApiContainer/declaration.mjs";
|
|
28
28
|
import D from "../provider/Channel/declaration.mjs";
|
|
29
|
-
import O from "../structure/Carousel/declaration.mjs";
|
|
30
|
-
import k from "../structure/Carousel/
|
|
29
|
+
import O from "../structure/Carousel/CarouselTrack/declaration.mjs";
|
|
30
|
+
import k from "../structure/Carousel/declaration.mjs";
|
|
31
31
|
import A from "../structure/Container/declaration.mjs";
|
|
32
32
|
import j from "../structure/DialogContainer/declaration.mjs";
|
|
33
33
|
import M from "../structure/List/declaration.mjs";
|
|
@@ -44,8 +44,8 @@ var B = {
|
|
|
44
44
|
BlockHtml: e,
|
|
45
45
|
BlockJsx: t,
|
|
46
46
|
Button: a,
|
|
47
|
-
Carousel:
|
|
48
|
-
CarouselTrack:
|
|
47
|
+
Carousel: k,
|
|
48
|
+
CarouselTrack: O,
|
|
49
49
|
Channel: D,
|
|
50
50
|
Container: A,
|
|
51
51
|
Custom: n,
|
|
@@ -80,6 +80,6 @@ var B = {
|
|
|
80
80
|
Text: p,
|
|
81
81
|
ThemeToggle: m,
|
|
82
82
|
Video: T
|
|
83
|
-
};
|
|
83
|
+
}, V = Object.fromEntries(Object.values(B).flatMap((e) => "serverTemplates" in e ? [[e.type, e.serverTemplates]] : []));
|
|
84
84
|
//#endregion
|
|
85
|
-
export { E as ApiContainerDeclaration, e as BlockHtmlDeclaration, t as BlockJsxDeclaration, a as ButtonDeclaration,
|
|
85
|
+
export { E as ApiContainerDeclaration, e as BlockHtmlDeclaration, t as BlockJsxDeclaration, a as ButtonDeclaration, k as CarouselDeclaration, O as CarouselTrackDeclaration, D as ChannelDeclaration, A as ContainerDeclaration, n as CustomDeclaration, j as DialogContainerDeclaration, o as DropdownDeclaration, s as DropdownPopupDeclaration, x as EmbedDeclaration, S as FontAwesomeDeclaration, g as FormControlDeclaration, h as FormDeclaration, c as HeadingDeclaration, C as ImageDeclaration, _ as LayoutContainerDeclaration, l as LinkDeclaration, M as ListDeclaration, N as ListItemDeclaration, v as LoadingDeclaration, u as MarkdownDeclaration, P as ModalContainerDeclaration, r as NodeHtmlDeclaration, y as NotFoundDeclaration, b as PageDeclaration, F as PaginationDeclaration, d as ParagraphDeclaration, i as ReferenceDeclaration, f as RichTextDeclaration, w as SvgDeclaration, L as TabContainerBodyDeclaration, I as TabContainerDeclaration, R as TabContainerHeaderDeclaration, z as TabContainerItemDeclaration, p as TextDeclaration, m as ThemeToggleDeclaration, T as VideoDeclaration, B as elementDeclarations, V as serverTemplatesByType };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
|
+
import n from "../../../Element/hooks/useElement.mjs";
|
|
4
|
+
import { RootElement as r } from "../../../Element/RootElement.mjs";
|
|
5
5
|
import { use as i, useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
6
6
|
import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
7
7
|
import { get as d, omit as f } from "@plitzi/plitzi-ui/helpers";
|
|
@@ -13,8 +13,8 @@ import { produce as _ } from "immer";
|
|
|
13
13
|
import v from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
14
14
|
import y from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
15
15
|
//#region src/elements/form/Form/Form.tsx
|
|
16
|
-
var b = ({ ref:
|
|
17
|
-
let [O, k] = l({}), A = c(/* @__PURE__ */ new Map()), j = c(!1), { id: M, definition: { label: N = "Form" }, setElementState: P } =
|
|
16
|
+
var b = ({ ref: t, className: b = "", children: x, method: S = "get", actionUrl: C = "", managedByInteractions: w = !1, noValidate: T = !1, errors: E = m, values: D = m }) => {
|
|
17
|
+
let [O, k] = l({}), A = c(/* @__PURE__ */ new Map()), j = c(!1), { id: M, definition: { label: N = "Form" }, setElementState: P } = n(), F = v(e.sourceType, M), { settings: { previewMode: I }, contexts: { InteractionsContext: L } } = u(), { interactionsManager: R } = i(L), z = a((e) => k((t) => ({
|
|
18
18
|
...t,
|
|
19
19
|
[e.name]: e
|
|
20
20
|
})), [k]);
|
|
@@ -106,9 +106,9 @@ var b = ({ ref: e, className: b = "", children: x, method: S = "get", actionUrl:
|
|
|
106
106
|
fields: G
|
|
107
107
|
});
|
|
108
108
|
let q = s(() => ({ onSubmit: {
|
|
109
|
-
...
|
|
109
|
+
...e.triggers.onSubmit,
|
|
110
110
|
preview: {
|
|
111
|
-
...
|
|
111
|
+
...e.triggers.onSubmit.preview,
|
|
112
112
|
values: Object.values(O).reduce((e, t) => ({
|
|
113
113
|
...e,
|
|
114
114
|
[t.name]: ""
|
|
@@ -162,36 +162,36 @@ var b = ({ ref: e, className: b = "", children: x, method: S = "get", actionUrl:
|
|
|
162
162
|
let { name: t, error: n } = e;
|
|
163
163
|
W(t, n);
|
|
164
164
|
}, [W]), Q = s(() => {
|
|
165
|
-
let { performReset:
|
|
165
|
+
let { performReset: t, setFieldValue: n, setFieldError: r } = e.callbacks, i = Object.values(O).map((e) => ({
|
|
166
166
|
value: e.name,
|
|
167
167
|
label: e.name
|
|
168
168
|
}));
|
|
169
169
|
return {
|
|
170
170
|
performReset: {
|
|
171
|
-
...
|
|
171
|
+
...t,
|
|
172
172
|
title: `Reset ${N}`,
|
|
173
173
|
callback: Y
|
|
174
174
|
},
|
|
175
175
|
setFieldValue: {
|
|
176
|
-
...
|
|
176
|
+
...n,
|
|
177
177
|
title: `Set Field Value ${N}`,
|
|
178
178
|
callback: X,
|
|
179
179
|
params: {
|
|
180
|
-
...
|
|
180
|
+
...n.params,
|
|
181
181
|
name: {
|
|
182
|
-
...
|
|
182
|
+
...n.params.name,
|
|
183
183
|
options: i
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
187
|
setFieldError: {
|
|
188
|
-
...
|
|
188
|
+
...r,
|
|
189
189
|
title: `Set Field Error ${N}`,
|
|
190
190
|
callback: Z,
|
|
191
191
|
params: {
|
|
192
|
-
...
|
|
192
|
+
...r.params,
|
|
193
193
|
name: {
|
|
194
|
-
...
|
|
194
|
+
...r.params.name,
|
|
195
195
|
options: i
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -204,9 +204,9 @@ var b = ({ ref: e, className: b = "", children: x, method: S = "get", actionUrl:
|
|
|
204
204
|
O,
|
|
205
205
|
Z
|
|
206
206
|
]);
|
|
207
|
-
return /* @__PURE__ */ h(
|
|
207
|
+
return /* @__PURE__ */ h(r, {
|
|
208
208
|
tag: "form",
|
|
209
|
-
ref:
|
|
209
|
+
ref: t,
|
|
210
210
|
noValidate: T,
|
|
211
211
|
method: S,
|
|
212
212
|
className: g("plitzi-component__form", b),
|
|
@@ -222,6 +222,6 @@ var b = ({ ref: e, className: b = "", children: x, method: S = "get", actionUrl:
|
|
|
222
222
|
children: x
|
|
223
223
|
})
|
|
224
224
|
});
|
|
225
|
-
}, x =
|
|
225
|
+
}, x = t(b);
|
|
226
226
|
//#endregion
|
|
227
227
|
export { b as Form, x as default };
|