@plitzi/sdk-elements 0.38.11 → 0.38.13
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 +125 -0
- package/dist/Element/ElementWords.d.ts +6 -2
- package/dist/Element/ElementWords.mjs +18 -11
- package/dist/Element/JsxManager.mjs +8 -8
- package/dist/Element/PluginManager.mjs +4 -4
- package/dist/Element/ReplicaProvider.mjs +9 -9
- package/dist/Element/RootElement.mjs +60 -60
- package/dist/Element/helpers/declaredAttributes.d.ts +10 -0
- package/dist/Element/helpers/declaredAttributes.mjs +22 -0
- package/dist/Element/hocs/withElement.mjs +101 -100
- package/dist/Element/hooks/useEditableContent.d.ts +12 -0
- package/dist/Element/hooks/useEditableContent.mjs +21 -0
- package/dist/Element/hooks/useElementDataSource.mjs +9 -9
- package/dist/Element/hooks/useElementVisible.mjs +1 -1
- package/dist/Element/hooks/useInternalItems.mjs +22 -23
- package/dist/Element/hooks/useIntervalTriggers.d.ts +2 -3
- package/dist/Element/hooks/useKeyTriggers.d.ts +2 -3
- package/dist/Element/hooks/usePluginTrigger.d.ts +21 -0
- package/dist/Element/hooks/usePluginTrigger.mjs +18 -0
- package/dist/Element/hooks/useRootElementInteractions.d.ts +2 -4
- package/dist/Element/hooks/useRootElementInteractions.mjs +79 -76
- package/dist/Element/hooks/useScrollInteractions.d.ts +2 -3
- package/dist/canvas/useAnimationFrame.mjs +1 -1
- package/dist/dataSource/GlobalSources.mjs +1 -1
- package/dist/dataSource/pathFields.mjs +1 -1
- package/dist/dataSource/sourceStore.d.ts +7 -0
- package/dist/dataSource/sourceStore.mjs +5 -0
- package/dist/elements/advanced/BlockHtml/BlockHtml.mjs +1 -1
- package/dist/elements/advanced/BlockHtml/declaration.d.ts +2 -27
- package/dist/elements/advanced/BlockHtml/declaration.mjs +2 -25
- package/dist/elements/advanced/BlockHtml/index.d.ts +2 -25
- package/dist/elements/advanced/BlockJsx/Settings.mjs +37 -37
- package/dist/elements/advanced/BlockJsx/declaration.d.ts +2 -27
- package/dist/elements/advanced/BlockJsx/declaration.mjs +2 -25
- package/dist/elements/advanced/BlockJsx/index.d.ts +2 -25
- package/dist/elements/advanced/Custom/Custom.mjs +52 -42
- package/dist/elements/advanced/Custom/Settings.mjs +41 -40
- package/dist/elements/advanced/Custom/declaration.d.ts +2 -26
- package/dist/elements/advanced/Custom/declaration.mjs +2 -22
- package/dist/elements/advanced/Custom/index.d.ts +2 -24
- package/dist/elements/advanced/NodeHtml/Settings.mjs +3 -3
- package/dist/elements/advanced/NodeHtml/declaration.d.ts +19 -44
- package/dist/elements/advanced/NodeHtml/declaration.mjs +2 -23
- package/dist/elements/advanced/NodeHtml/index.d.ts +19 -42
- package/dist/elements/advanced/PlitziSdk/Settings.mjs +4 -4
- package/dist/elements/advanced/Reference/Reference.mjs +1 -1
- package/dist/elements/advanced/Reference/declaration.d.ts +3 -27
- package/dist/elements/advanced/Reference/declaration.mjs +2 -22
- package/dist/elements/advanced/Reference/index.d.ts +3 -25
- package/dist/elements/basic/Button/Button.mjs +24 -31
- package/dist/elements/basic/Button/declaration.d.ts +4 -27
- package/dist/elements/basic/Button/declaration.mjs +2 -25
- package/dist/elements/basic/Button/index.d.ts +4 -25
- package/dist/elements/basic/Dropdown/Dropdown.mjs +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +3 -19
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +2 -16
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +3 -17
- package/dist/elements/basic/Dropdown/declaration.d.ts +3 -26
- package/dist/elements/basic/Dropdown/declaration.mjs +16 -41
- package/dist/elements/basic/Dropdown/index.d.ts +5 -42
- package/dist/elements/basic/Dropdown/useDropdown.mjs +23 -29
- package/dist/elements/basic/Heading/Heading.mjs +15 -17
- package/dist/elements/basic/Heading/Settings.mjs +4 -4
- package/dist/elements/basic/Heading/declaration.d.ts +2 -27
- package/dist/elements/basic/Heading/declaration.mjs +2 -23
- package/dist/elements/basic/Heading/index.d.ts +2 -25
- package/dist/elements/basic/Link/Link.mjs +52 -59
- package/dist/elements/basic/Link/Settings.mjs +52 -51
- package/dist/elements/basic/Link/declaration.d.ts +6 -26
- package/dist/elements/basic/Link/declaration.mjs +8 -32
- package/dist/elements/basic/Link/index.d.ts +6 -24
- package/dist/elements/basic/Markdown/Markdown.mjs +1 -1
- package/dist/elements/basic/Markdown/declaration.d.ts +2 -25
- package/dist/elements/basic/Markdown/declaration.mjs +2 -25
- package/dist/elements/basic/Markdown/index.d.ts +2 -23
- package/dist/elements/basic/Paragraph/Paragraph.mjs +15 -17
- package/dist/elements/basic/Paragraph/declaration.d.ts +2 -27
- package/dist/elements/basic/Paragraph/declaration.mjs +5 -28
- package/dist/elements/basic/Paragraph/index.d.ts +2 -25
- package/dist/elements/basic/RichText/RichText.mjs +1 -1
- package/dist/elements/basic/RichText/Settings.mjs +4 -4
- package/dist/elements/basic/RichText/declaration.d.ts +4 -27
- package/dist/elements/basic/RichText/declaration.mjs +2 -23
- package/dist/elements/basic/RichText/index.d.ts +4 -25
- package/dist/elements/basic/Text/Text.mjs +16 -18
- package/dist/elements/basic/Text/declaration.d.ts +3 -28
- package/dist/elements/basic/Text/declaration.mjs +2 -25
- package/dist/elements/basic/Text/index.d.ts +3 -26
- package/dist/elements/basic/ThemeToggle/Settings.d.ts +6 -0
- package/dist/elements/basic/ThemeToggle/Settings.mjs +49 -0
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +40 -39
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +3 -26
- package/dist/elements/basic/ThemeToggle/declaration.mjs +2 -23
- package/dist/elements/basic/ThemeToggle/index.d.ts +3 -24
- package/dist/elements/declarations/index.d.ts +139 -1061
- package/dist/elements/form/Form/Form.mjs +65 -64
- package/dist/elements/form/Form/declaration.d.ts +3 -28
- package/dist/elements/form/Form/declaration.mjs +2 -25
- package/dist/elements/form/Form/index.d.ts +17 -25
- package/dist/elements/form/FormControl/FormControl.mjs +106 -105
- package/dist/elements/form/FormControl/declaration.d.ts +2 -22
- package/dist/elements/form/FormControl/declaration.mjs +4 -23
- package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +1 -1
- package/dist/elements/form/FormControl/index.d.ts +16 -20
- package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +1 -1
- package/dist/elements/internal/LayoutContainer/declaration.d.ts +3 -25
- package/dist/elements/internal/LayoutContainer/declaration.mjs +3 -23
- package/dist/elements/internal/LayoutContainer/index.d.ts +3 -23
- package/dist/elements/internal/Loading/Settings.d.ts +2 -0
- package/dist/elements/internal/Loading/Settings.mjs +5 -0
- package/dist/elements/internal/Loading/declaration.d.ts +2 -24
- package/dist/elements/internal/Loading/declaration.mjs +3 -25
- package/dist/elements/internal/Loading/index.d.ts +2 -22
- package/dist/elements/internal/NotFound/NotFound.mjs +1 -1
- package/dist/elements/internal/NotFound/Settings.d.ts +2 -0
- package/dist/elements/internal/NotFound/Settings.mjs +5 -0
- package/dist/elements/internal/NotFound/declaration.d.ts +2 -24
- package/dist/elements/internal/NotFound/declaration.mjs +7 -29
- package/dist/elements/internal/NotFound/index.d.ts +2 -22
- package/dist/elements/internal/Page/Page.mjs +17 -16
- package/dist/elements/internal/Page/Settings.mjs +102 -101
- package/dist/elements/internal/Page/declaration.d.ts +3 -23
- package/dist/elements/internal/Page/declaration.mjs +14 -32
- package/dist/elements/internal/Page/index.d.ts +3 -21
- package/dist/elements/media/Embed/Embed.mjs +1 -1
- package/dist/elements/media/Embed/Settings.mjs +7 -7
- package/dist/elements/media/Embed/declaration.d.ts +2 -27
- package/dist/elements/media/Embed/declaration.mjs +10 -33
- package/dist/elements/media/Embed/index.d.ts +2 -25
- package/dist/elements/media/FontAwesome/Settings.mjs +8 -8
- package/dist/elements/media/FontAwesome/declaration.d.ts +2 -27
- package/dist/elements/media/FontAwesome/declaration.mjs +5 -28
- package/dist/elements/media/FontAwesome/index.d.ts +2 -25
- package/dist/elements/media/Image/Image.mjs +1 -1
- package/dist/elements/media/Image/Settings.mjs +47 -46
- package/dist/elements/media/Image/declaration.d.ts +2 -27
- package/dist/elements/media/Image/declaration.mjs +7 -30
- package/dist/elements/media/Image/index.d.ts +2 -25
- package/dist/elements/media/Svg/Settings.mjs +4 -4
- package/dist/elements/media/Svg/Svg.mjs +1 -1
- package/dist/elements/media/Svg/declaration.d.ts +3 -27
- package/dist/elements/media/Svg/declaration.mjs +2 -22
- package/dist/elements/media/Svg/index.d.ts +3 -25
- package/dist/elements/media/Video/Settings.mjs +7 -7
- package/dist/elements/media/Video/Video.mjs +1 -1
- package/dist/elements/media/Video/declaration.d.ts +2 -27
- package/dist/elements/media/Video/declaration.mjs +6 -29
- package/dist/elements/media/Video/index.d.ts +2 -25
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +151 -150
- package/dist/elements/provider/ApiContainer/Settings.mjs +135 -134
- package/dist/elements/provider/ApiContainer/declaration.d.ts +3 -28
- package/dist/elements/provider/ApiContainer/declaration.mjs +2 -23
- package/dist/elements/provider/ApiContainer/index.d.ts +3 -26
- package/dist/elements/provider/Channel/Channel.mjs +40 -39
- package/dist/elements/provider/Channel/declaration.d.ts +3 -28
- package/dist/elements/provider/Channel/declaration.mjs +3 -24
- package/dist/elements/provider/Channel/index.d.ts +3 -26
- package/dist/elements/settings.mjs +70 -62
- package/dist/elements/structure/Carousel/Carousel.mjs +36 -35
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.d.ts +3 -25
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs +6 -28
- package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +3 -23
- package/dist/elements/structure/Carousel/Settings.mjs +40 -39
- package/dist/elements/structure/Carousel/declaration.d.ts +4 -29
- package/dist/elements/structure/Carousel/declaration.mjs +2 -25
- package/dist/elements/structure/Carousel/index.d.ts +6 -51
- package/dist/elements/structure/Container/Settings.mjs +40 -39
- package/dist/elements/structure/Container/declaration.d.ts +3 -28
- package/dist/elements/structure/Container/declaration.mjs +2 -23
- package/dist/elements/structure/Container/index.d.ts +3 -26
- package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +8 -8
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +54 -173
- package/dist/elements/structure/DialogContainer/Settings.mjs +24 -23
- package/dist/elements/structure/DialogContainer/declaration.d.ts +8 -31
- package/dist/elements/structure/DialogContainer/declaration.mjs +2 -23
- package/dist/elements/structure/DialogContainer/index.d.ts +8 -29
- package/dist/elements/structure/List/ListItem/declaration.d.ts +4 -26
- package/dist/elements/structure/List/ListItem/declaration.mjs +3 -25
- package/dist/elements/structure/List/ListItem/index.d.ts +4 -24
- package/dist/elements/structure/List/Settings.mjs +6 -6
- package/dist/elements/structure/List/declaration.d.ts +3 -28
- package/dist/elements/structure/List/declaration.mjs +2 -23
- package/dist/elements/structure/List/index.d.ts +6 -51
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +13 -12
- package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.mjs +6 -6
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +27 -121
- package/dist/elements/structure/ModalContainer/Settings.mjs +15 -14
- package/dist/elements/structure/ModalContainer/declaration.d.ts +3 -26
- package/dist/elements/structure/ModalContainer/declaration.mjs +2 -23
- package/dist/elements/structure/ModalContainer/index.d.ts +3 -24
- package/dist/elements/structure/Overlay/OverlayShell.d.ts +24 -0
- package/dist/elements/structure/Overlay/OverlayShell.mjs +64 -0
- package/dist/elements/structure/Overlay/metadataOf.d.ts +8 -0
- package/dist/elements/structure/{ModalContainer/metadataFromText.mjs → Overlay/metadataOf.mjs} +5 -2
- package/dist/elements/structure/{ModalContainer → Overlay}/useModalDialog.mjs +1 -1
- package/dist/elements/structure/Overlay/useOverlay.d.ts +40 -0
- package/dist/elements/structure/Overlay/useOverlay.mjs +83 -0
- package/dist/elements/structure/Pagination/Pagination.mjs +28 -27
- package/dist/elements/structure/Pagination/Settings.mjs +10 -10
- package/dist/elements/structure/Pagination/declaration.d.ts +3 -26
- package/dist/elements/structure/Pagination/declaration.mjs +2 -23
- package/dist/elements/structure/Pagination/index.d.ts +3 -24
- package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +3 -3
- package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.mjs +10 -32
- package/dist/elements/structure/TabContainer/TabContainerBody/declaration.d.ts +4 -22
- package/dist/elements/structure/TabContainer/TabContainerBody/declaration.mjs +3 -17
- package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +4 -20
- package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +3 -3
- package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.mjs +10 -34
- package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.d.ts +4 -22
- package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.mjs +3 -17
- package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +4 -20
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +4 -26
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +7 -27
- package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +4 -24
- package/dist/elements/structure/TabContainer/declaration.d.ts +4 -26
- package/dist/elements/structure/TabContainer/declaration.mjs +3 -23
- package/dist/elements/structure/TabContainer/index.d.ts +15 -89
- package/dist/elements/structure/TabContainer/useTabItems.d.ts +7 -0
- package/dist/elements/structure/TabContainer/useTabItems.mjs +35 -0
- package/dist/elements/useSettingsUpdate.d.ts +12 -0
- package/dist/elements/useSettingsUpdate.mjs +8 -0
- package/dist/index.d.ts +163 -984
- package/package.json +57 -13
- package/dist/elements/structure/ModalContainer/metadataFromText.d.ts +0 -7
- /package/dist/elements/structure/{ModalContainer → Overlay}/useModalDialog.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,130 @@
|
|
|
1
1
|
# @plitzi/sdk-elements
|
|
2
2
|
|
|
3
|
+
## 0.38.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- v0.38.13
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @plitzi/sdk-auth@0.38.13
|
|
10
|
+
- @plitzi/sdk-event-bridge@0.38.13
|
|
11
|
+
- @plitzi/sdk-interactions@0.38.13
|
|
12
|
+
- @plitzi/sdk-navigation@0.38.13
|
|
13
|
+
- @plitzi/sdk-schema@0.38.13
|
|
14
|
+
- @plitzi/sdk-shared@0.38.13
|
|
15
|
+
|
|
16
|
+
## 0.38.12
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 1301338: ## Builder
|
|
21
|
+
|
|
22
|
+
- **Icons in the canvas again** (`@plitzi/plitzi-builder`): the canvas inlined the SDK's Font Awesome sheet into its
|
|
23
|
+
`<style>`, where the sheet's `url(webfonts/…)` resolved against the editor's URL — a `srcdoc` frame takes it as its
|
|
24
|
+
base — so every icon was a 404 under `/spaces/<space>/webfonts/` and drew as an empty box. Only the Vite dev server,
|
|
25
|
+
which rewrites the URL, hid it. The canvas and the element preview now link the sheet from where the host serves it:
|
|
26
|
+
a new prop, `sdkIconsStylePath`, the one the host already gives the pages it renders
|
|
27
|
+
(`/sdk-assets/plitzi-sdk-icons.css` for sdk-server). Absent, the canvas links no icon sheet.
|
|
28
|
+
|
|
29
|
+
## Plugins
|
|
30
|
+
- **A plugin's other elements, hosted by `custom`** (`@plitzi/sdk-elements`): `custom({ renderType: 'jamDisc' })` on a
|
|
31
|
+
space with a plugin installed whose main element is another (`plitzi plugin pack` of several folders: the first is the
|
|
32
|
+
plugin, the rest go in it) rendered "Custom Component jamDisc Not Found" — the page registers only the plugin's main
|
|
33
|
+
element, and a `custom` host looked nowhere else. It now loads the type from the installed plugin that packs it, as
|
|
34
|
+
an element of the type itself always did, so the two ways the docs give to place a plugin's element are the same
|
|
35
|
+
everywhere: in a project `plitzi create` wrote, and once the project is on Plitzi.
|
|
36
|
+
- **One way to place a plugin's element** (`@plitzi/sdk-authoring`, `@plitzi/cli`, docs): from its declaration,
|
|
37
|
+
`const seatPicker = defineElement(declaration)` then `seatPicker({ id, … })` — typed by what it
|
|
38
|
+
declares, and the element the builder adds when somebody drops it. The welcome space `plitzi create` writes, the
|
|
39
|
+
plugin package's preview, `plitzi plugin add` and `plitzi explain` all write it so (the template's
|
|
40
|
+
`PluginHostOptions` now takes the plugin's `type` and `declaration: { from, attributes? }`; `custom`/`element` hosting
|
|
41
|
+
is gone). `pluginFolders(folder)` (`@plitzi/sdk-authoring/node`) reads each plugin with the folder it is in;
|
|
42
|
+
`pluginDeclarations` is built on it. A `custom({ renderType })` naming a plugin the space was handed the declaration
|
|
43
|
+
of is offered the declaration instead — suggestion `plugin-custom-host`. `custom` stays for a component registered
|
|
44
|
+
by name with no declaration. The skills, the CLI README, the MCP guide, `docs/en` and the website say the same.
|
|
45
|
+
- **`definePlugin`** (`@plitzi/sdk-authoring/plugin`, a new entry of 3 KB with nothing else in it): a plugin's
|
|
46
|
+
declaration written from what only it can say —
|
|
47
|
+
`definePlugin<SeatPickerAttributes>()({ type, label, attributes, triggers, callbacks })` — and every other field
|
|
48
|
+
at the default all plugins share (the builder's gestures, the catalogue entry, each attribute bindable, an empty
|
|
49
|
+
style). It answers the whole declaration, branded with its attributes, so `defineElement(declaration)` is typed
|
|
50
|
+
without a generic. `plitzi plugin add` and `create --plugin` write declarations with it (about a third of the lines).
|
|
51
|
+
- **`usePluginTrigger(declaration)`** (`@plitzi/plitzi-sdk`): fires a plugin's declared event on its element — the
|
|
52
|
+
event name and what each hands a flow typed off the declaration's `preview` — on a live page only. The hook every
|
|
53
|
+
plugin wrote for itself (and `plugin add` generated as `use<Name>Events`) is gone from the scaffold.
|
|
54
|
+
- **Attributes as the types their defaults are** (`@plitzi/sdk-elements`): a plugin's attribute bound from text — a
|
|
55
|
+
state, a row, a channel message — reaches its component as the number or the flag its declared default is (`'112'`
|
|
56
|
+
as 112, `'true'` as true). A plugin no longer types its props `number | string` and parses them.
|
|
57
|
+
|
|
58
|
+
## Server actions and functions
|
|
59
|
+
- **Task params with rules** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): a task declares `required`, a text's
|
|
60
|
+
`maxLength` and a number's `min`/`max`, and the runner refuses a call that breaks any of them — every rule broken at
|
|
61
|
+
once, in the words the page shows (`Title is required; Seconds is at most 300`) — before the code runs. A `text` param
|
|
62
|
+
bound to a number arrives as its digits. The manifest keeps the rules, so the platform's sandbox checks the same.
|
|
63
|
+
- **`taskAction(task, { trigger })`** (`@plitzi/sdk-authoring`): the action that runs one of the space's tasks and
|
|
64
|
+
answers its result, derived from the task — its id (`<namespace>-<action>`), name, description and input (the task's
|
|
65
|
+
params, once). An action of more than one step is still `defineAction`.
|
|
66
|
+
- **`ctx.rateLimit(bucket, { …, refuse })`**: past the limit the call is refused with those words instead of answering
|
|
67
|
+
`allowed: false` for the code to check — natively and in the sandbox.
|
|
68
|
+
|
|
69
|
+
## Authoring
|
|
70
|
+
- **`runServerActionOrNotify(id, params, fallback)`**: a server action run and the notice the visitor reads when it
|
|
71
|
+
fails — the action's own refusal, or the fallback — as two steps to spread into a flow.
|
|
72
|
+
- **`repeated-shape` reads what copies bind**: copies whose bindings read their data in different forms (a count, a
|
|
73
|
+
total of a quota) and copies holding a provider resolved on the server (found by its own id) are no longer offered
|
|
74
|
+
as one component.
|
|
75
|
+
- **`element-color-inherited`** (suggestion): `elements` giving a heading, a text, a link… `color: inherit` or the
|
|
76
|
+
page's own colour. **A link inherits the page's colour** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-elements`) rather than
|
|
77
|
+
holding the SDK's grey — the same by default, and the space's palette inside a card that is a link. The template
|
|
78
|
+
every space starts from writes its colours once, on the page.
|
|
79
|
+
|
|
80
|
+
## Fixes
|
|
81
|
+
- **A dialog opened with an id** (`@plitzi/sdk-elements`): `openDialog('dialog', '{{ row.id }}')` reads the id as its
|
|
82
|
+
`content`, as `openModal` already did — a numeric id parsed as the number and the dialog's bindings read nothing.
|
|
83
|
+
- **A select's chevron** (`@plitzi/plitzi-sdk`): a drawn chevron in the field's own colour, sized by its type, in place
|
|
84
|
+
of the `▼` glyph — and laid out in the box, so it ends where the box's padding begins whatever that padding is, and
|
|
85
|
+
the chosen option stops short of it instead of running under it. A disabled select's is faded.
|
|
86
|
+
- **Every element has its settings** (`@plitzi/plitzi-builder`, `@plitzi/sdk-elements`): the builder found none for
|
|
87
|
+
`tabContainerHeader` (registered under a misspelt type), `themeToggle`, `dropdownPopup`, `loading` and `notFound`.
|
|
88
|
+
The theme toggle's panel sets its mode, its labels and whether it offers "System"; the registry is typed by element
|
|
89
|
+
type and must hold one for each.
|
|
90
|
+
- **A plugin's panel** (`@plitzi/cli`): `plitzi doctor` warns of a plugin with no `Settings.tsx`, or one its entry never
|
|
91
|
+
passes as `pluginSettings` (`plugin-settings-missing`); the example `create` writes has its panel, as every element
|
|
92
|
+
`plugin add` writes does, and the panels it generates are laid out as the project's Prettier lays them out.
|
|
93
|
+
- **A refused or failed run reaches `onFlowError` in every mode** (`@plitzi/sdk-interactions`): an awaited server
|
|
94
|
+
action the server refused fired no `onFlowError` on the element that started it, as `detached` and `stream` ones do
|
|
95
|
+
— a board rolling its edits back on a refusal never did; and a run answered `status: 'failed'` fired `onFlowEnd`
|
|
96
|
+
(detached) or nothing (awaited) rather than `onFlowError`.
|
|
97
|
+
- **A source renamed** (`@plitzi/sdk-shared`): the binding picker lists a provider, a form or a modal by the name its
|
|
98
|
+
element has now, not the one it had when it mounted.
|
|
99
|
+
- **A text's words in the builder** (`@plitzi/sdk-elements`): a `paragraph`, `text` or `heading` whose `content` is
|
|
100
|
+
`0` shows `0` while editing too, not its placeholder; one bound to nothing shows nothing rather than `null`.
|
|
101
|
+
- **Built-in declarations** (`@plitzi/sdk-shared`): `elementDeclaration` fills in what every element shares — the
|
|
102
|
+
builder's gestures, Plitzi's catalogue entry, a visible element with no bindings, its style named by its label —
|
|
103
|
+
from the defaults `definePlugin` uses; each element's declaration says only what is its own (a third of the lines).
|
|
104
|
+
|
|
105
|
+
## Typed for plugins and hosts
|
|
106
|
+
- **`usePlitzi()` and `PlitziProvider`** (`@plitzi/sdk-shared/hooks/usePlitzi`, `@plitzi/plitzi-sdk`): what were
|
|
107
|
+
`usePlitziServiceContext()` and `PlitziServiceProvider` (and `PlitziServiceContextValue`, now `PlitziContextValue`),
|
|
108
|
+
holding only what the host rendering a space knows — `settings`, `root`, `utils`. Its `contexts` and
|
|
109
|
+
`customContexts` are gone: every context it carried is a shared one already, imported from its own module
|
|
110
|
+
(`@plitzi/sdk-interactions/InteractionsContext`, `@plitzi/sdk-shared/network/NetworkContext`…), and
|
|
111
|
+
`PluginsContext` moves to `@plitzi/sdk-shared/plugins/PluginsContext` beside the others.
|
|
112
|
+
- **`InteractionsManagerApi`** (`@plitzi/sdk-shared`): the interactions manager as everything outside
|
|
113
|
+
`@plitzi/sdk-interactions` reaches it, declared where every package can name it and implemented by
|
|
114
|
+
`InteractionsManager`, so `use(InteractionsContext)` is typed — `interactionTrigger`, `createChildManager`… — where it
|
|
115
|
+
was `any`.
|
|
116
|
+
- **`getPathsFromObject`** (`@plitzi/sdk-shared/helpers/utils`), spelt right; `getPathsFromObeject` is gone.
|
|
117
|
+
- **`ElementWords` places itself** (`@plitzi/sdk-elements`): `contentPlacement` and the element's children, so a button
|
|
118
|
+
and a link write their words once.
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [1301338]
|
|
121
|
+
- @plitzi/sdk-auth@0.38.12
|
|
122
|
+
- @plitzi/sdk-event-bridge@0.38.12
|
|
123
|
+
- @plitzi/sdk-interactions@0.38.12
|
|
124
|
+
- @plitzi/sdk-navigation@0.38.12
|
|
125
|
+
- @plitzi/sdk-schema@0.38.12
|
|
126
|
+
- @plitzi/sdk-shared@0.38.12
|
|
127
|
+
|
|
3
128
|
## 0.38.11
|
|
4
129
|
|
|
5
130
|
### Patch Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export type IconPlacement = 'before' | 'after';
|
|
2
3
|
export type ElementWordsProps = {
|
|
3
4
|
/** The element's own words. */
|
|
@@ -7,10 +8,13 @@ export type ElementWordsProps = {
|
|
|
7
8
|
iconPlacement?: IconPlacement;
|
|
8
9
|
/** What the element's `icon` slot carries. */
|
|
9
10
|
iconClassName?: string;
|
|
11
|
+
/** Where the words go beside the element's children. */
|
|
12
|
+
contentPlacement?: 'before' | 'after';
|
|
13
|
+
children?: ReactNode;
|
|
10
14
|
};
|
|
11
15
|
/**
|
|
12
16
|
* What a button or a link says itself — its words and an icon beside them, one element instead of a `text` and a
|
|
13
|
-
* `fontAwesome` inside it
|
|
17
|
+
* `fontAwesome` inside it — placed before or after the element's children, as its `contentPlacement` says.
|
|
14
18
|
*/
|
|
15
|
-
declare const ElementWords: ({ content, icon, iconPlacement, iconClassName }: ElementWordsProps) => import('react').JSX.Element;
|
|
19
|
+
declare const ElementWords: ({ content, icon, iconPlacement, iconClassName, contentPlacement, children }: ElementWordsProps) => import('react').JSX.Element;
|
|
16
20
|
export default ElementWords;
|
|
@@ -4,16 +4,23 @@ import r from "clsx";
|
|
|
4
4
|
var i = ({ icon: e, className: n }) => e ? /* @__PURE__ */ t("i", {
|
|
5
5
|
className: r("plitzi-element-icon", e, n),
|
|
6
6
|
"aria-hidden": "true"
|
|
7
|
-
}) : null, a = ({ content: r = "", icon: a = "", iconPlacement: o = "before", iconClassName: s
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
}) : null, a = ({ content: r = "", icon: a = "", iconPlacement: o = "before", iconClassName: s, contentPlacement: c = "after", children: l }) => {
|
|
8
|
+
let u = /* @__PURE__ */ n(e, { children: [
|
|
9
|
+
o === "before" && /* @__PURE__ */ t(i, {
|
|
10
|
+
icon: a,
|
|
11
|
+
className: s
|
|
12
|
+
}),
|
|
13
|
+
r,
|
|
14
|
+
o === "after" && /* @__PURE__ */ t(i, {
|
|
15
|
+
icon: a,
|
|
16
|
+
className: s
|
|
17
|
+
})
|
|
18
|
+
] });
|
|
19
|
+
return /* @__PURE__ */ n(e, { children: [
|
|
20
|
+
c === "before" && u,
|
|
21
|
+
l,
|
|
22
|
+
c === "after" && u
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
18
25
|
//#endregion
|
|
19
26
|
export { a as default };
|
|
@@ -2,25 +2,25 @@ import e from "./PluginRemote.mjs";
|
|
|
2
2
|
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
|
-
import o from "@plitzi/sdk-shared/
|
|
6
|
-
import s from "@plitzi/sdk-shared/
|
|
5
|
+
import o from "@plitzi/sdk-shared/elements/ComponentContext";
|
|
6
|
+
import s from "@plitzi/sdk-shared/plugins/PluginsContext";
|
|
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
|
-
let {
|
|
9
|
+
let { components: p } = i(o), { plugins: m } = i(s), h = l ? p.current[l] : void 0, g = a(() => h ? void 0 : t({
|
|
10
10
|
type: l,
|
|
11
|
-
plugins:
|
|
11
|
+
plugins: m
|
|
12
12
|
}), [
|
|
13
|
-
g,
|
|
14
13
|
h,
|
|
14
|
+
m,
|
|
15
15
|
l
|
|
16
16
|
]);
|
|
17
|
-
return l ? !
|
|
17
|
+
return l ? !h && g ? /* @__PURE__ */ c(e, {
|
|
18
18
|
internalProps: u,
|
|
19
|
-
url:
|
|
19
|
+
url: g.url,
|
|
20
20
|
type: l,
|
|
21
21
|
plitziJsxSkipHOC: r,
|
|
22
22
|
plitziJsxProps: f
|
|
23
|
-
}) : (
|
|
23
|
+
}) : (h ||= n, /* @__PURE__ */ c(h, {
|
|
24
24
|
plitziJsxSkipHOC: r,
|
|
25
25
|
...f,
|
|
26
26
|
internalProps: u,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "./helpers/pluginSelector.mjs";
|
|
2
2
|
import { memo as t, use as n } from "react";
|
|
3
|
-
import r from "@plitzi/sdk-shared/
|
|
4
|
-
import i from "@plitzi/sdk-shared/
|
|
3
|
+
import r from "@plitzi/sdk-shared/elements/ComponentContext";
|
|
4
|
+
import i from "@plitzi/sdk-shared/plugins/PluginsContext";
|
|
5
5
|
var a = t(({ plitziElementLayout: t = void 0, type: a = "", internalProps: o }) => {
|
|
6
|
-
let { components: s } = n(
|
|
6
|
+
let { components: s } = n(r), { plugins: c } = n(i);
|
|
7
7
|
return e({
|
|
8
8
|
type: a,
|
|
9
9
|
internalProps: {
|
|
@@ -12,7 +12,7 @@ var a = t(({ plitziElementLayout: t = void 0, type: a = "", internalProps: o })
|
|
|
12
12
|
},
|
|
13
13
|
plitziElementLayout: t,
|
|
14
14
|
components: s.current,
|
|
15
|
-
plugins:
|
|
15
|
+
plugins: c
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
//#endregion
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { use as e, useEffect as t, useMemo as n } from "react";
|
|
2
|
-
import r from "
|
|
3
|
-
import
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import i from "@plitzi/sdk-interactions/InteractionsContext";
|
|
4
4
|
//#region src/Element/ReplicaProvider.tsx
|
|
5
5
|
var a = ({ children: a }) => {
|
|
6
|
-
let
|
|
7
|
-
...
|
|
8
|
-
interactionsManager:
|
|
9
|
-
}), [
|
|
6
|
+
let o = e(i), s = n(() => o.interactionsManager.createChildManager(), [o]), c = n(() => ({
|
|
7
|
+
...o,
|
|
8
|
+
interactionsManager: s
|
|
9
|
+
}), [o, s]);
|
|
10
10
|
return t(() => () => {
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
value:
|
|
11
|
+
o.interactionsManager.removeChildManager(s);
|
|
12
|
+
}, [o, s]), /* @__PURE__ */ r(i, {
|
|
13
|
+
value: c,
|
|
14
14
|
children: a
|
|
15
15
|
});
|
|
16
16
|
};
|
|
@@ -2,77 +2,77 @@ import e from "./hooks/useElement.mjs";
|
|
|
2
2
|
import t from "./helpers/parseStyle.mjs";
|
|
3
3
|
import n from "./helpers/renderStaticTag.mjs";
|
|
4
4
|
import r from "./hooks/useRootElementInteractions.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { use as i, useMemo as a } from "react";
|
|
6
|
+
import o from "@plitzi/sdk-shared/hooks/usePlitzi";
|
|
7
|
+
import s from "@plitzi/sdk-interactions/InteractionsContext";
|
|
8
|
+
import { motionAttributes as c } from "@plitzi/sdk-shared/schema/motion";
|
|
8
9
|
//#region src/Element/RootElement.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
if (
|
|
12
|
-
tag:
|
|
13
|
-
refProp:
|
|
14
|
-
style:
|
|
15
|
-
className:
|
|
16
|
-
otherProps:
|
|
17
|
-
children:
|
|
10
|
+
var l = ({ ref: l, children: u, tag: d = "div", className: f = "", interactionTriggers: p, interactionCallbacks: m, style: h, ...g }) => {
|
|
11
|
+
let _ = a(() => t(h), [h]), v = e(), y = o(), b = y.settings.previewMode ?? !0, x = !!y.settings.debugMode;
|
|
12
|
+
if (v.plitziJsxSkipHOC) return n({
|
|
13
|
+
tag: d,
|
|
14
|
+
refProp: l,
|
|
15
|
+
style: _,
|
|
16
|
+
className: f,
|
|
17
|
+
otherProps: g,
|
|
18
|
+
children: u
|
|
18
19
|
});
|
|
19
|
-
let { root: { baseElementId:
|
|
20
|
-
"data-plitzi-el":
|
|
21
|
-
...
|
|
22
|
-
},
|
|
23
|
-
"data-id":
|
|
24
|
-
"data-name":
|
|
25
|
-
"data-root-id":
|
|
26
|
-
"data-type":
|
|
20
|
+
let { root: { baseElementId: S } } = y, C = !!i(s).interactionsManager, { id: w, rootId: T, style: E, plitziElementLayout: D, definition: { type: O, label: k, runtime: A, anchor: j, parentId: M, motion: N } } = v, P = c(N), F = A === "server" ? { "data-rsc-id": w } : void 0, I = D?.type === "component" && !M && D.rootId !== w ? D.rootId : void 0, L = y.settings.testAttributes === !1 ? void 0 : {
|
|
21
|
+
"data-plitzi-el": w,
|
|
22
|
+
...I === void 0 ? {} : { "data-plitzi-instance": I }
|
|
23
|
+
}, R = !x && (b || !O || T !== S) ? {} : {
|
|
24
|
+
"data-id": w,
|
|
25
|
+
"data-name": k || O || "unknown",
|
|
26
|
+
"data-root-id": T,
|
|
27
|
+
"data-type": O || "unknown",
|
|
27
28
|
"data-root-render-element": !0
|
|
28
29
|
};
|
|
29
|
-
if (!
|
|
30
|
-
tag:
|
|
31
|
-
refProp:
|
|
30
|
+
if (!C) return n({
|
|
31
|
+
tag: d,
|
|
32
|
+
refProp: l,
|
|
32
33
|
style: {
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
...
|
|
34
|
+
...E,
|
|
35
|
+
..._,
|
|
36
|
+
...P.style
|
|
36
37
|
},
|
|
37
|
-
className:
|
|
38
|
-
otherProps:
|
|
39
|
-
anchor:
|
|
40
|
-
params:
|
|
41
|
-
serverMarker:
|
|
42
|
-
motion:
|
|
43
|
-
testMarker:
|
|
44
|
-
children:
|
|
38
|
+
className: f,
|
|
39
|
+
otherProps: g,
|
|
40
|
+
anchor: j,
|
|
41
|
+
params: R,
|
|
42
|
+
serverMarker: F,
|
|
43
|
+
motion: P.attributes,
|
|
44
|
+
testMarker: L,
|
|
45
|
+
children: u
|
|
45
46
|
});
|
|
46
|
-
let
|
|
47
|
-
elementContext:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
ref: s
|
|
47
|
+
let z = r({
|
|
48
|
+
elementContext: v,
|
|
49
|
+
previewMode: b,
|
|
50
|
+
debugMode: x,
|
|
51
|
+
baseElementId: S,
|
|
52
|
+
className: f,
|
|
53
|
+
interactionTriggers: p,
|
|
54
|
+
interactionCallbacks: m,
|
|
55
|
+
otherProps: g,
|
|
56
|
+
ref: l
|
|
57
57
|
});
|
|
58
58
|
return n({
|
|
59
|
-
tag:
|
|
60
|
-
refProp:
|
|
59
|
+
tag: d,
|
|
60
|
+
refProp: z.nodeRef,
|
|
61
61
|
style: {
|
|
62
|
-
...
|
|
63
|
-
...
|
|
64
|
-
...
|
|
62
|
+
...E,
|
|
63
|
+
..._,
|
|
64
|
+
...P.style
|
|
65
65
|
},
|
|
66
|
-
className:
|
|
67
|
-
otherProps:
|
|
68
|
-
anchor:
|
|
69
|
-
params:
|
|
70
|
-
serverMarker:
|
|
71
|
-
motion:
|
|
72
|
-
testMarker:
|
|
73
|
-
events:
|
|
74
|
-
children:
|
|
66
|
+
className: z.className,
|
|
67
|
+
otherProps: g,
|
|
68
|
+
anchor: j,
|
|
69
|
+
params: R,
|
|
70
|
+
serverMarker: F,
|
|
71
|
+
motion: P.attributes,
|
|
72
|
+
testMarker: L,
|
|
73
|
+
events: z.events,
|
|
74
|
+
children: u
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
78
|
-
export {
|
|
78
|
+
export { l as RootElement, l as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin's attributes as the types its declaration's defaults are: a value bound from text — a state, a row, what a
|
|
3
|
+
* channel said — arrives as the number or the flag its default is (`'112'` as 112, `'true'` as true), so the component
|
|
4
|
+
* reads the type it declares and never writes `Number(…)`. Anything else, and every attribute it has no default for,
|
|
5
|
+
* as it is.
|
|
6
|
+
*
|
|
7
|
+
* Only a plugin carries its declaration on the component this wraps (`Object.assign(Component, declaration)`); a
|
|
8
|
+
* built-in element is handed its attributes untouched.
|
|
9
|
+
*/
|
|
10
|
+
export declare const declaredAttributes: (component: unknown, attributes: Record<string, unknown>) => Record<string, unknown>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isRecord as e } from "@plitzi/sdk-shared/helpers/isRecord";
|
|
2
|
+
//#region src/Element/helpers/declaredAttributes.ts
|
|
3
|
+
var t = (e, t) => {
|
|
4
|
+
if (typeof t != "string") return t;
|
|
5
|
+
if (typeof e == "number") {
|
|
6
|
+
let e = Number(t.trim());
|
|
7
|
+
return t.trim() !== "" && Number.isFinite(e) ? e : t;
|
|
8
|
+
}
|
|
9
|
+
return typeof e == "boolean" && (t === "true" || t === "false") ? t === "true" : t;
|
|
10
|
+
}, n = (n, r) => {
|
|
11
|
+
if (typeof n != "function" || !("content" in n) || !e(n.content)) return r;
|
|
12
|
+
let i = n.content.attributes;
|
|
13
|
+
if (!e(i)) return r;
|
|
14
|
+
let a = !1, o = { ...r };
|
|
15
|
+
for (let [e, n] of Object.entries(r)) {
|
|
16
|
+
let r = t(i[e], n);
|
|
17
|
+
r !== n && (o[e] = r, a = !0);
|
|
18
|
+
}
|
|
19
|
+
return a ? o : r;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as declaredAttributes };
|