@plitzi/sdk-style 0.38.10 → 0.38.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/dist/StyleMap/helpers/isValueValid.mjs +5 -4
  3. package/dist/StyleMap/helpers/utils.mjs +13 -12
  4. package/dist/components/InputEasing/InputEasingButton.mjs +1 -1
  5. package/dist/components/InputEasing/InputEasingList.mjs +5 -5
  6. package/dist/components/Selector/Selector.mjs +2 -1
  7. package/dist/components/Selector/SelectorItem/ItemOptions.mjs +45 -41
  8. package/dist/components/Selector/SelectorItem/SelectorItem.mjs +4 -4
  9. package/dist/components/Selector/SelectorItem/helpers.d.ts +2 -0
  10. package/dist/components/Selector/SelectorItem/helpers.mjs +4 -0
  11. package/dist/components/StyleInspector/Inspector.mjs +185 -171
  12. package/dist/components/StyleInspector/InspectorSearchContext.d.ts +3 -0
  13. package/dist/components/StyleInspector/InspectorSearchContext.mjs +6 -0
  14. package/dist/components/StyleInspector/StyleInspector.mjs +213 -187
  15. package/dist/components/StyleInspector/categories/Background/Background.mjs +84 -177
  16. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.d.ts +8 -0
  17. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.mjs +53 -0
  18. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.d.ts +3 -0
  19. package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.mjs +5 -0
  20. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +159 -153
  21. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.d.ts +11 -0
  22. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.mjs +45 -0
  23. package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.mjs +26 -23
  24. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.mjs +65 -56
  25. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.d.ts +4 -0
  26. package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.mjs +8 -0
  27. package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.mjs +28 -27
  28. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.d.ts +8 -0
  29. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.mjs +28 -0
  30. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.d.ts +3 -0
  31. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.mjs +5 -0
  32. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.d.ts +4 -2
  33. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.mjs +19 -18
  34. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +4 -0
  35. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +48 -80
  36. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +5 -3
  37. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +51 -41
  38. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +5 -1
  39. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +54 -32
  40. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +3 -1
  41. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.mjs +14 -13
  42. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.d.ts +8 -0
  43. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.mjs +8 -0
  44. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.d.ts +8 -0
  45. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +11 -0
  46. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.d.ts +3 -0
  47. package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.mjs +5 -0
  48. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.d.ts +21 -7
  49. package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.mjs +114 -113
  50. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.d.ts +8 -0
  51. package/dist/components/StyleInspector/categories/Background/helpers/layerValues.mjs +11 -0
  52. package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +22 -79
  53. package/dist/components/StyleInspector/categories/Background/modes/ImageMode.mjs +16 -77
  54. package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.mjs +19 -62
  55. package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +58 -98
  56. package/dist/components/StyleInspector/categories/Background/modes/RawMode.d.ts +8 -0
  57. package/dist/components/StyleInspector/categories/Background/modes/RawMode.mjs +22 -0
  58. package/dist/components/StyleInspector/categories/Background/modes/helpers.d.ts +19 -0
  59. package/dist/components/StyleInspector/categories/Background/modes/helpers.mjs +54 -0
  60. package/dist/components/StyleInspector/categories/Border/Border.mjs +26 -43
  61. package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +60 -51
  62. package/dist/components/StyleInspector/categories/Display/Display.mjs +65 -81
  63. package/dist/components/StyleInspector/categories/Display/DisplayGap.d.ts +14 -1
  64. package/dist/components/StyleInspector/categories/Display/DisplayGap.mjs +26 -13
  65. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.mjs +33 -38
  66. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +13 -36
  67. package/dist/components/StyleInspector/categories/Effects/Effects.mjs +120 -204
  68. package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +23 -31
  69. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +9 -5
  70. package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +57 -124
  71. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.d.ts +25 -0
  72. package/dist/components/StyleInspector/categories/Effects/Filters/helpers.mjs +87 -0
  73. package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +18 -28
  74. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +1 -2
  75. package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +52 -76
  76. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts +5 -0
  77. package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs +8 -2
  78. package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +21 -37
  79. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.d.ts +10 -0
  80. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +92 -0
  81. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +4 -4
  82. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +78 -359
  83. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.d.ts +39 -0
  84. package/dist/components/StyleInspector/categories/Effects/Transition/helpers.mjs +268 -0
  85. package/dist/components/StyleInspector/categories/List/List.mjs +21 -70
  86. package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +21 -70
  87. package/dist/components/StyleInspector/categories/Others/Others.mjs +63 -85
  88. package/dist/components/StyleInspector/categories/Position/Position.mjs +67 -75
  89. package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +19 -18
  90. package/dist/components/StyleInspector/categories/Size/Size.mjs +65 -85
  91. package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +18 -27
  92. package/dist/components/StyleInspector/categories/Spacing/SpacingBox.d.ts +15 -0
  93. package/dist/components/StyleInspector/categories/Spacing/SpacingBox.mjs +63 -0
  94. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.d.ts +3 -11
  95. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +18 -70
  96. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.d.ts +3 -7
  97. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +16 -67
  98. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +58 -67
  99. package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +1 -1
  100. package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +1 -1
  101. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +16 -40
  102. package/dist/components/StyleInspector/categories/Variables/Variables.mjs +38 -37
  103. package/dist/components/StyleInspector/categories/blendModes.d.ts +2 -0
  104. package/dist/components/StyleInspector/categories/blendModes.mjs +21 -0
  105. package/dist/components/StyleInspector/categories/listMarkers.d.ts +8 -0
  106. package/dist/components/StyleInspector/categories/listMarkers.mjs +25 -0
  107. package/dist/components/StyleInspector/categoryKeys.d.ts +45 -0
  108. package/dist/components/StyleInspector/categoryKeys.mjs +220 -0
  109. package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +43 -38
  110. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +2 -1
  111. package/dist/components/StyleInspector/components/CategorySection/CategorySection.mjs +30 -15
  112. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.d.ts +8 -0
  113. package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.mjs +23 -0
  114. package/dist/components/StyleInspector/components/ColorSwatch/helpers.d.ts +3 -0
  115. package/dist/components/StyleInspector/components/ColorSwatch/helpers.mjs +9 -0
  116. package/dist/components/StyleInspector/components/ColorSwatch/index.d.ts +3 -0
  117. package/dist/components/StyleInspector/components/ColorSwatch/index.mjs +5 -0
  118. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +1 -0
  119. package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.mjs +11 -11
  120. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.d.ts +11 -0
  121. package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +38 -0
  122. package/dist/components/StyleInspector/components/InspectorFooter/helpers.d.ts +2 -0
  123. package/dist/components/StyleInspector/components/InspectorFooter/helpers.mjs +11 -0
  124. package/dist/components/StyleInspector/components/InspectorFooter/index.d.ts +3 -0
  125. package/dist/components/StyleInspector/components/InspectorFooter/index.mjs +5 -0
  126. package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +34 -31
  127. package/dist/components/StyleInspector/components/InspectorLabel/helpers.d.ts +17 -0
  128. package/dist/components/StyleInspector/components/InspectorLabel/helpers.mjs +16 -0
  129. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.d.ts +7 -0
  130. package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +24 -0
  131. package/dist/components/StyleInspector/components/InspectorSearch/index.d.ts +3 -0
  132. package/dist/components/StyleInspector/components/InspectorSearch/index.mjs +5 -0
  133. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.d.ts +9 -0
  134. package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +110 -0
  135. package/dist/components/StyleInspector/components/ShadowItem/index.d.ts +3 -0
  136. package/dist/components/StyleInspector/components/ShadowItem/index.mjs +5 -0
  137. package/dist/components/StyleInspector/components/ShadowList/ShadowList.d.ts +15 -0
  138. package/dist/components/StyleInspector/components/ShadowList/ShadowList.mjs +25 -0
  139. package/dist/components/StyleInspector/components/ShadowList/index.d.ts +3 -0
  140. package/dist/components/StyleInspector/components/ShadowList/index.mjs +5 -0
  141. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.d.ts +7 -0
  142. package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +24 -0
  143. package/dist/components/StyleInspector/components/TargetSummary/index.d.ts +3 -0
  144. package/dist/components/StyleInspector/components/TargetSummary/index.mjs +5 -0
  145. package/dist/components/StyleInspector/components/ValueList/ValueList.d.ts +12 -0
  146. package/dist/components/StyleInspector/components/ValueList/ValueList.mjs +25 -0
  147. package/dist/components/StyleInspector/components/ValueList/index.d.ts +3 -0
  148. package/dist/components/StyleInspector/components/ValueList/index.mjs +5 -0
  149. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.d.ts +16 -0
  150. package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +71 -0
  151. package/dist/components/StyleInspector/components/ValueListItem/index.d.ts +3 -0
  152. package/dist/components/StyleInspector/components/ValueListItem/index.mjs +5 -0
  153. package/dist/components/StyleInspector/cssValues.d.ts +13 -0
  154. package/dist/components/StyleInspector/cssValues.mjs +23 -0
  155. package/dist/components/StyleInspector/helpers.d.ts +17 -1
  156. package/dist/components/StyleInspector/helpers.mjs +9 -2
  157. package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +42 -45
  158. package/dist/components/StyleInspector/hooks/usePropertyChange.d.ts +6 -0
  159. package/dist/components/StyleInspector/hooks/usePropertyChange.mjs +9 -0
  160. package/dist/components/StyleInspector/search.d.ts +11 -0
  161. package/dist/components/StyleInspector/search.mjs +14 -0
  162. package/dist/components/StyleInspector/shadowValue.d.ts +20 -0
  163. package/dist/components/StyleInspector/shadowValue.mjs +36 -0
  164. package/dist/components/StyleManager/StyleSelectorTag.mjs +1 -1
  165. package/package.json +225 -21
  166. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +0 -8
  167. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.mjs +0 -27
  168. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +0 -8
  169. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +0 -132
  170. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +0 -2
  171. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +0 -18
  172. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +0 -8
  173. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.mjs +0 -83
package/CHANGELOG.md CHANGED
@@ -1,5 +1,294 @@
1
1
  # @plitzi/sdk-style
2
2
 
3
+ ## 0.38.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 1301338: ## Builder
8
+
9
+ - **Icons in the canvas again** (`@plitzi/plitzi-builder`): the canvas inlined the SDK's Font Awesome sheet into its
10
+ `<style>`, where the sheet's `url(webfonts/…)` resolved against the editor's URL — a `srcdoc` frame takes it as its
11
+ base — so every icon was a 404 under `/spaces/<space>/webfonts/` and drew as an empty box. Only the Vite dev server,
12
+ which rewrites the URL, hid it. The canvas and the element preview now link the sheet from where the host serves it:
13
+ a new prop, `sdkIconsStylePath`, the one the host already gives the pages it renders
14
+ (`/sdk-assets/plitzi-sdk-icons.css` for sdk-server). Absent, the canvas links no icon sheet.
15
+
16
+ ## Plugins
17
+ - **A plugin's other elements, hosted by `custom`** (`@plitzi/sdk-elements`): `custom({ renderType: 'jamDisc' })` on a
18
+ space with a plugin installed whose main element is another (`plitzi plugin pack` of several folders: the first is the
19
+ plugin, the rest go in it) rendered "Custom Component jamDisc Not Found" — the page registers only the plugin's main
20
+ element, and a `custom` host looked nowhere else. It now loads the type from the installed plugin that packs it, as
21
+ an element of the type itself always did, so the two ways the docs give to place a plugin's element are the same
22
+ everywhere: in a project `plitzi create` wrote, and once the project is on Plitzi.
23
+ - **One way to place a plugin's element** (`@plitzi/sdk-authoring`, `@plitzi/cli`, docs): from its declaration,
24
+ `const seatPicker = defineElement(declaration)` then `seatPicker({ id, … })` — typed by what it
25
+ declares, and the element the builder adds when somebody drops it. The welcome space `plitzi create` writes, the
26
+ plugin package's preview, `plitzi plugin add` and `plitzi explain` all write it so (the template's
27
+ `PluginHostOptions` now takes the plugin's `type` and `declaration: { from, attributes? }`; `custom`/`element` hosting
28
+ is gone). `pluginFolders(folder)` (`@plitzi/sdk-authoring/node`) reads each plugin with the folder it is in;
29
+ `pluginDeclarations` is built on it. A `custom({ renderType })` naming a plugin the space was handed the declaration
30
+ of is offered the declaration instead — suggestion `plugin-custom-host`. `custom` stays for a component registered
31
+ by name with no declaration. The skills, the CLI README, the MCP guide, `docs/en` and the website say the same.
32
+ - **`definePlugin`** (`@plitzi/sdk-authoring/plugin`, a new entry of 3 KB with nothing else in it): a plugin's
33
+ declaration written from what only it can say —
34
+ `definePlugin<SeatPickerAttributes>()({ type, label, attributes, triggers, callbacks })` — and every other field
35
+ at the default all plugins share (the builder's gestures, the catalogue entry, each attribute bindable, an empty
36
+ style). It answers the whole declaration, branded with its attributes, so `defineElement(declaration)` is typed
37
+ without a generic. `plitzi plugin add` and `create --plugin` write declarations with it (about a third of the lines).
38
+ - **`usePluginTrigger(declaration)`** (`@plitzi/plitzi-sdk`): fires a plugin's declared event on its element — the
39
+ event name and what each hands a flow typed off the declaration's `preview` — on a live page only. The hook every
40
+ plugin wrote for itself (and `plugin add` generated as `use<Name>Events`) is gone from the scaffold.
41
+ - **Attributes as the types their defaults are** (`@plitzi/sdk-elements`): a plugin's attribute bound from text — a
42
+ state, a row, a channel message — reaches its component as the number or the flag its declared default is (`'112'`
43
+ as 112, `'true'` as true). A plugin no longer types its props `number | string` and parses them.
44
+
45
+ ## Server actions and functions
46
+ - **Task params with rules** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): a task declares `required`, a text's
47
+ `maxLength` and a number's `min`/`max`, and the runner refuses a call that breaks any of them — every rule broken at
48
+ once, in the words the page shows (`Title is required; Seconds is at most 300`) — before the code runs. A `text` param
49
+ bound to a number arrives as its digits. The manifest keeps the rules, so the platform's sandbox checks the same.
50
+ - **`taskAction(task, { trigger })`** (`@plitzi/sdk-authoring`): the action that runs one of the space's tasks and
51
+ answers its result, derived from the task — its id (`<namespace>-<action>`), name, description and input (the task's
52
+ params, once). An action of more than one step is still `defineAction`.
53
+ - **`ctx.rateLimit(bucket, { …, refuse })`**: past the limit the call is refused with those words instead of answering
54
+ `allowed: false` for the code to check — natively and in the sandbox.
55
+
56
+ ## Authoring
57
+ - **`runServerActionOrNotify(id, params, fallback)`**: a server action run and the notice the visitor reads when it
58
+ fails — the action's own refusal, or the fallback — as two steps to spread into a flow.
59
+ - **`repeated-shape` reads what copies bind**: copies whose bindings read their data in different forms (a count, a
60
+ total of a quota) and copies holding a provider resolved on the server (found by its own id) are no longer offered
61
+ as one component.
62
+ - **`element-color-inherited`** (suggestion): `elements` giving a heading, a text, a link… `color: inherit` or the
63
+ page's own colour. **A link inherits the page's colour** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-elements`) rather than
64
+ holding the SDK's grey — the same by default, and the space's palette inside a card that is a link. The template
65
+ every space starts from writes its colours once, on the page.
66
+
67
+ ## Fixes
68
+ - **A dialog opened with an id** (`@plitzi/sdk-elements`): `openDialog('dialog', '{{ row.id }}')` reads the id as its
69
+ `content`, as `openModal` already did — a numeric id parsed as the number and the dialog's bindings read nothing.
70
+ - **A select's chevron** (`@plitzi/plitzi-sdk`): a drawn chevron in the field's own colour, sized by its type, in place
71
+ of the `▼` glyph — and laid out in the box, so it ends where the box's padding begins whatever that padding is, and
72
+ the chosen option stops short of it instead of running under it. A disabled select's is faded.
73
+ - **Every element has its settings** (`@plitzi/plitzi-builder`, `@plitzi/sdk-elements`): the builder found none for
74
+ `tabContainerHeader` (registered under a misspelt type), `themeToggle`, `dropdownPopup`, `loading` and `notFound`.
75
+ The theme toggle's panel sets its mode, its labels and whether it offers "System"; the registry is typed by element
76
+ type and must hold one for each.
77
+ - **A plugin's panel** (`@plitzi/cli`): `plitzi doctor` warns of a plugin with no `Settings.tsx`, or one its entry never
78
+ passes as `pluginSettings` (`plugin-settings-missing`); the example `create` writes has its panel, as every element
79
+ `plugin add` writes does, and the panels it generates are laid out as the project's Prettier lays them out.
80
+ - **A refused or failed run reaches `onFlowError` in every mode** (`@plitzi/sdk-interactions`): an awaited server
81
+ action the server refused fired no `onFlowError` on the element that started it, as `detached` and `stream` ones do
82
+ — a board rolling its edits back on a refusal never did; and a run answered `status: 'failed'` fired `onFlowEnd`
83
+ (detached) or nothing (awaited) rather than `onFlowError`.
84
+ - **A source renamed** (`@plitzi/sdk-shared`): the binding picker lists a provider, a form or a modal by the name its
85
+ element has now, not the one it had when it mounted.
86
+ - **A text's words in the builder** (`@plitzi/sdk-elements`): a `paragraph`, `text` or `heading` whose `content` is
87
+ `0` shows `0` while editing too, not its placeholder; one bound to nothing shows nothing rather than `null`.
88
+ - **Built-in declarations** (`@plitzi/sdk-shared`): `elementDeclaration` fills in what every element shares — the
89
+ builder's gestures, Plitzi's catalogue entry, a visible element with no bindings, its style named by its label —
90
+ from the defaults `definePlugin` uses; each element's declaration says only what is its own (a third of the lines).
91
+
92
+ ## Typed for plugins and hosts
93
+ - **`usePlitzi()` and `PlitziProvider`** (`@plitzi/sdk-shared/hooks/usePlitzi`, `@plitzi/plitzi-sdk`): what were
94
+ `usePlitziServiceContext()` and `PlitziServiceProvider` (and `PlitziServiceContextValue`, now `PlitziContextValue`),
95
+ holding only what the host rendering a space knows — `settings`, `root`, `utils`. Its `contexts` and
96
+ `customContexts` are gone: every context it carried is a shared one already, imported from its own module
97
+ (`@plitzi/sdk-interactions/InteractionsContext`, `@plitzi/sdk-shared/network/NetworkContext`…), and
98
+ `PluginsContext` moves to `@plitzi/sdk-shared/plugins/PluginsContext` beside the others.
99
+ - **`InteractionsManagerApi`** (`@plitzi/sdk-shared`): the interactions manager as everything outside
100
+ `@plitzi/sdk-interactions` reaches it, declared where every package can name it and implemented by
101
+ `InteractionsManager`, so `use(InteractionsContext)` is typed — `interactionTrigger`, `createChildManager`… — where it
102
+ was `any`.
103
+ - **`getPathsFromObject`** (`@plitzi/sdk-shared/helpers/utils`), spelt right; `getPathsFromObeject` is gone.
104
+ - **`ElementWords` places itself** (`@plitzi/sdk-elements`): `contentPlacement` and the element's children, so a button
105
+ and a link write their words once.
106
+
107
+ - Updated dependencies [1301338]
108
+ - @plitzi/sdk-event-bridge@0.38.12
109
+ - @plitzi/sdk-shared@0.38.12
110
+ - @plitzi/sdk-variables@0.38.12
111
+
112
+ ## 0.38.11
113
+
114
+ ### Patch Changes
115
+
116
+ - cadf70a: - **`server.cache.invalidate` drops what a page is rendered from** (`@plitzi/sdk-server`): the pages, the RSC answers
117
+ and the schema data they are rendered from go together. It dropped the pages alone, and the next request rendered
118
+ the same page again from the schema still cached under the same key — a publish that invalidated the space changed
119
+ nothing until the schema's TTL ran out. `clear()` and `size` cover the three. A filter on `hostname` drops the schema
120
+ data too, which belongs to no one host. `server.cache` is `null` only when nothing is cached (`cacheTtlMs: 0` and
121
+ `rsc.cacheTtlMs: 0`).
122
+
123
+ ## Style inspector
124
+ - **Finds a property** (`@plitzi/sdk-style`): a search above the categories narrows them to the ones that edit what was
125
+ typed — a CSS name in any order of its words (`border radius` finds the four corners), a category's title, or a
126
+ common word for it (`bg`, `rounded`) — opens them, and shows the advanced rows when the match lives there. Escape
127
+ clears it. The categories' properties live in one list (`categoryKeys.ts`) that the dots, the advanced hint and the
128
+ search all read.
129
+ - **Rows that fit**: a section with more than two controls puts its label above them and lays them out in as many
130
+ columns as the panel is wide, instead of one row where every label was cut (`Appearan…`, `Cell Spaci…`, the five
131
+ scroll-snap controls). A row's label column is 80px.
132
+ - **Where a value comes from, said quietly**: the label's tint keeps its four meanings — set here, from a token, bound
133
+ to data, inherited — without the solid blocks of colour; hovering says which (an inherited one names its selector and
134
+ breakpoint) and that a click resets it, the click shows it by striking the label through. The footer's info icon
135
+ holds the legend, and its arrow folds every category.
136
+ - **What is being edited**: an "Editing … › Hover" line under the pickers whenever the rules being written are not the
137
+ selector's plain ones, with a button back to them. Ancestor, pseudo-element and condition fold behind a toggle —
138
+ never while one is in use.
139
+ - The class being edited is the panel's one strong mark (violet), the element's type defaults a softer one; the tools'
140
+ tabs fit the panel and are reachable from the keyboard.
141
+
142
+ - **Lists edited in a popover, all alike**: box and text shadows, transforms, transitions and filters share one row
143
+ (the CSS it writes, a swatch, a remove button) and one popover (a title, a close button, Escape, the focus moved
144
+ into it). What none of them could read is now kept and edited as text instead of being replaced with a default — a
145
+ token for the whole value, `drop-shadow(…)`, `url(#…)`.
146
+ - **Values read the way CSS writes them**: a shadow with two, three or four lengths and its color on either end;
147
+ `rgba(…)` inside text shadows and filters no longer split; negative shadow offsets accepted; a transition with any
148
+ of its parts left out; brightness, contrast and saturation past 1. Transition presets are written as CSS — the
149
+ preset names (`easeInQuad`) made the browser drop the whole declaration — the curve can be dragged into one of your
150
+ own, and the preview stops with the editor. `font-color` (not CSS) became `color`.
151
+ - **Background layers keep what they hold**: a repeating gradient (now a switch), a radial gradient's explicit size, a
152
+ token or `image-set()` as a layer (a "Custom (CSS)" layer), a one-value position read as CSS reads it (`20%` is
153
+ `20% center`), lists shorter than the layers repeated as CSS repeats them, an unset repeat read as tiling, two-position
154
+ stops, negative angles — every one of them was rewritten on the next edit of any layer. Defaults are no longer
155
+ written back, and "Token values" no longer bakes resolved tokens into the layers.
156
+ - **A layer's editor in two halves** — what it draws, then where it goes (size, position, tile, attachment, clip,
157
+ which now offers `text`). The gradient's stops sit on one bar, each a handle that drags or moves with the arrow keys;
158
+ the stop's color and position below it. Previews and swatches resolve the space's tokens.
159
+ - Spacing tells margin (dashed, outside) from padding; Border's sides are labelled and readable in the dark theme; a
160
+ class's menu says what each action does to whom; the Style Manager opens at a size that holds both columns.
161
+
162
+ ## Builder
163
+ - **Shortcuts**: `?` shows every shortcut the builder answers to — the same list the "Nothing selected" card teaches
164
+ from — and ⌘\ / Ctrl+\ hides both side panels for the canvas alone and brings back the ones that were open. Both
165
+ work with the canvas focused.
166
+ - **Panels keep their width**: each side panel opens at the width it was left at; the right one starts at 380px.
167
+ - **Text no smaller than 11px** across the builder's panels (it went down to 10px in fifty places).
168
+
169
+ ## Realtime
170
+ - **A page hears what it sent when it asks to** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`, `@plitzi/sdk-elements`):
171
+ `publishOn('room', 'react', data, { echo: true })`, `useChannel().publish(type, data, { echo: true })` and the
172
+ channel's `publish` callback (`echo`) hand the message back to the page that sent it too, once the server took it —
173
+ stamped like everyone's, with `echo: true`, its `from` the channel's `me`. Without it a page still never hears its
174
+ own messages, and the docs said "every page on its topic hears it": they now say every OTHER page. Presence never
175
+ echoes.
176
+ - **A topic is opened only once it names one** (`@plitzi/sdk-elements`): `useChannel` — and so the `channel` element —
177
+ opens a topic only when a channel of the space covers it, by the same `matchChannel` the server decides by. A topic
178
+ written from data that has not arrived (`room:` while its provider loads, or its template still as text) asked the
179
+ server for both, was refused with a 403 and a console error on every load, and is now waited for.
180
+ - **Pages that watch** (`@plitzi/sdk-server`, `@plitzi/cli`): a connection whose page carries the `plitzi-observer`
181
+ cookie hears its topics and says nothing on them — no `$join`, no presence, its publishes taken and dropped.
182
+ `page check`, `page shot` and `verify` load pages that way, so checking a live site is no longer a visitor walking
183
+ into a room (`X walked in`, a member more in every picture). `--presence` takes part as a visitor does.
184
+
185
+ ## Authoring
186
+ - **`template-in-value`** (refused): a `{{ }}` inside an attribute that is an object or a list — a provider's
187
+ `input`, a list's `items`, a plugin's settings — is never evaluated: only an attribute that is text is interpolated,
188
+ and the page server reads attributes as saved. A provider's `input` also replaced the route param of the same name
189
+ the action was already given, so `input: { room: '{{ navigation.routeParams.room }}' }` reached the task as `""` and
190
+ the page answered 404; its refusal says the action is handed the page's route and query params already. Anything
191
+ else is a binding on the attribute. `mockData`, a sample, is not held to it.
192
+ - **Rules on top of a class need no `id`** (`class: [card, { gap: '6px' }]`): they are named after the id the element
193
+ is given, written or not. `modifier-without-id` is gone; a one-off tweak no longer needs a name nothing reads.
194
+ - **Typed list rows have `inTemplate`**, as untyped ones do, and `bindTemplate`, `visibleWhen`, `hiddenWhen` and
195
+ `variantFrom` take a typed source's path as well as a name: turning a list typed broke every template of its rows.
196
+ - **`when({ field, operator: 'empty' })`** takes no `value` (nor `notEmpty`), as flows.md recommends; it did not
197
+ type-check.
198
+ - **Data-driven colours**: a style binding on a custom property (`{ to: '--who', category: 'style' }`) is written as
199
+ named — it was camel-cased into `who` — so a class reads `var(--who, var(--muted))`. A style binding's value carrying
200
+ `;` or braces is not written: the page server writes inline styles as text, and such a value added declarations of
201
+ its own. `binding-target-unknown` on `style` or a CSS property says to bind it in the `style` category.
202
+ - `unknown-attribute` for `decorative` on an `svg` or a `fontAwesome` says what it means: without a `label` it is
203
+ already hidden from screen readers.
204
+
205
+ - **A folder nobody declared says where to declare it**: `folder-undeclared` (a page, a layout, a folder's parent)
206
+ ends with `pageFolders: [{ id, name }]` on the space, and with the line of the `pageFamily` that wrote the page. A
207
+ folder starts its pages' addresses (`/docs/quickstart`), so a misspelt one is never declared on the author's behalf.
208
+ The skill's `pageFamily` example declares its folder.
209
+ - **A tag is an element**: a `subType` this element has not but another has — `container({ subType: 'ol' })` — names
210
+ that element (`list({ subType: 'ol' })`) instead of the value two letters away (`dl`). Read off the elements'
211
+ declarations, for every element and tag.
212
+ - **A `pageFamily`'s body is written once**: `repeated-shape` and `repeated-on-pages` no longer count the same part of
213
+ each page of one family as copies — they were offering a component for exactly what the docs recommend. Copies within
214
+ one page, or across pages written one by one, are still offered.
215
+ - **Colour emoji are not text to `page check`**: a character painted in its own colours (🎲, `❤️`, a keycap, a ZWJ
216
+ sequence) is left out of the contrast measure, which compared `color` with the tile behind it and failed `verify`
217
+ in the theme whose text colour was close to the tile. A symbol drawn as text (✓, ★) is still measured.
218
+
219
+ - **`declared-callback-target`** (refused): a value beside `on` in `declaredCallback(…, { on, date })` — written as
220
+ `openModal`'s target reads — was read nowhere, and the step ran without it. Refused, with the `params` it goes in
221
+ (`{ on: 'calendar', params: { date } }`) and whether it is one of the callback's declared params.
222
+ - The skill's list rows show the typed form beside the untyped one: with `items` typed by a sample, `r.item` is a path
223
+ (`from: r.item.title`), not text to put in a template string.
224
+ - **`slot-not-class`** (refused): rules written in place in a slot — `slots: { error: [fieldError, { color }] }`, past
225
+ the type in JavaScript or a spec rebuilt from JSON — were taken for a declaration with no rules, and `authorSpace`
226
+ failed later with `Cannot read properties of undefined (reading 'desktop')`, naming nothing. Refused where the slot
227
+ is written, naming the slot and the element, with the `styles()` declaration to hand instead.
228
+
229
+ ## CLI
230
+ - **`page shot --click` (and `--clip`, `--wait-for`, `--scroll-to`, `--steps`) takes any selector**: a value that is
231
+ not an element's name (letters, digits, `-`, `_`) is a selector, CSS or Playwright's own (`button:has-text("Orbit")`).
232
+ It was wrapped as a name, and an invalid selector ended the command with Playwright's stack trace; it is now refused
233
+ with the reason.
234
+
235
+ - **`plitzi functions add <package>`**: a package the functions use comes with them, as a function carries its
236
+ dependencies. Installed in the project, it is bundled (web APIs only, minified, its licence kept) into
237
+ `src/functions/vendor/<package>.js`, with a `.d.ts` re-exporting the installed package's types, imported as
238
+ `./vendor/<package>.js` and pushed, built and run with the rest — nothing is resolved anywhere else, so the builder,
239
+ the sandbox and the push are unchanged. A package that reaches Node (`fs`, `node:*`) is refused, naming what it
240
+ reached; one past the functions' 1 MB is too; one that reads `process`/`Buffer` is warned about. The build's refusal
241
+ of a package import now names the command.
242
+ - **`page shot` targets**: a bare word is an element's name, or — no element named so — a tag (`textarea`); resolved on
243
+ the loaded page for `--click`, `--clip`, `--scroll-to`, `--wait-for` and `--steps`. In `--steps`, `type` takes a
244
+ quoted element with spaces (`type ".panel textarea" hola`) — it was cut at its first space and typed the rest — and
245
+ fails when the click leaves no field focused, rather than sending the keys to the page's shortcuts.
246
+
247
+ ## Server
248
+ - **`server.listen()` resolves once the port answers** (`@plitzi/sdk-server`) — in a fleet, once the first worker
249
+ does. `serveProject` writes `tmp/dev-server.json` and says `pages on …` after it, not on the line after `listen`:
250
+ for about 0.4 s a tool trusting the line (CI, Playwright's `webServer`, `page check`) was refused. A port it cannot
251
+ take still ends the process, or goes to `onListenError`, and the promise is then never resolved.
252
+ - **Runs set for later** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`, `@plitzi/sdk-authoring`, `@plitzi/plitzi-builder`):
253
+ a turn that runs out, a bot's move, a hold that lapses — one run starting one of the space's actions in N seconds,
254
+ whether or not a page is still open. The action says it may be with a **`later` trigger** (no access rule: the run
255
+ that set it was let in); a flow sets it with `flow.later { action, in, input, key }`, a function with
256
+ `ctx.later({ … })`, and `flow.cancelLater` / `ctx.cancelLater(key)` drops it. A `key` names it: set again under the
257
+ same key, the one still waiting is replaced — the newer of two set at once, on every replica — and a running one is
258
+ left. It is a job of the queue schedules use: due by the store's clock (0 s to 30 days, about a second late at most),
259
+ once across replicas, retried, shown in Automations → Queue. Refused before anything is queued, with why: no `later`
260
+ trigger, one switched off, a time out of range, a key that is not one, a server with no jobs. A plugin's functions
261
+ set none. `ActionJobQueue` gains `cancelPending({ spaceId, key, olderThan? })` and jobs a `key`: the memory, Mongo
262
+ and MySQL queues implement it, and the shared contract tests it. **MySQL**: `action_jobs` gains `job_key` (and the
263
+ `action_jobs_key` index), added on first use; with `createTables: false`, run that statement of
264
+ `mysqlJobSchemaUpgrades()`. A queue of a deployment's own implements `cancelPending` (`09-schedules` shows one).
265
+ - **A project's `kv` file has one holder** (`@plitzi/sdk-server`): `createFileKv` takes `<file>.lock` with its pid;
266
+ a second process — another `npm start`, a `--watch` left running — is refused, naming the first (`the server of
267
+ "orbita", on port 8080`) instead of both writing their whole map over each other's changes, and a lock whose process
268
+ is gone is taken over. `close()` writes what is pending and lets go. A server with `workers` opens the file once, in
269
+ the primary, and its workers reach it through the fleet (`fleetKv`): each used to open a copy of its own.
270
+ - **A self-hosted project's credentials** (`@plitzi/sdk-server`, `@plitzi/cli`): `serveProject` answers
271
+ `getCredential` from `PLITZI_CREDENTIALS` in `.env` — one JSON object, credential id → its keys — so
272
+ `ctx.fetch({ credential })`, a connector and an `http.request` step work on the project's own server, not only in
273
+ `functions dev`. The same variable for both (it was `PLITZI_FUNCTIONS_CREDENTIALS`, read by the CLI alone); a value
274
+ that is not that object is refused with how to write it, instead of every credential going missing.
275
+ - **`HOST` beyond loopback says where to open it**: with `HOST=0.0.0.0`, `serveProject` prints the machine's network
276
+ addresses — what a tablet on the same Wi-Fi opens — and that anyone on that network can. `.env.example` names `HOST`
277
+ and `PLITZI_CREDENTIALS`.
278
+
279
+ ## SDK
280
+ - **`useElementSize(ref)`** (`@plitzi/plitzi-sdk`): the size a plugin's own box is drawn at, followed as it changes —
281
+ what `useDisplayMode()` cannot say: a tablet held upright is `mobile` by the window and still a week wide by the
282
+ plugin's box. `undefined` until measured, so the server's page and the hydrated one agree. The breakpoints are
283
+ unchanged.
284
+ - The functions docs say how a task's `params` types (how the builder edits them: `codemirror-json`) and an action's
285
+ `input` types (what the value is: `json`) correspond.
286
+
287
+ - Updated dependencies [cadf70a]
288
+ - @plitzi/sdk-event-bridge@0.38.11
289
+ - @plitzi/sdk-shared@0.38.11
290
+ - @plitzi/sdk-variables@0.38.11
291
+
3
292
  ## 0.38.10
4
293
 
5
294
  ### Patch Changes
@@ -1,9 +1,10 @@
1
1
  import { canonicalCondition as e } from "@plitzi/sdk-shared/style/styleConditions";
2
2
  import { isStylePseudo as t } from "@plitzi/sdk-shared/style/stylePseudos";
3
+ import { isRecord as n } from "@plitzi/sdk-shared/helpers/isRecord";
3
4
  //#region src/StyleMap/helpers/isValueValid.ts
4
- var n = (e) => typeof e == "string" || typeof e == "number" || e === void 0, r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = (e) => r(e) && Object.values(e).every(n), a = (e) => r(e) && Object.values(e).every(i), o = (e) => r(e) && Object.values(e).every((e) => !(!r(e) || "variants" in e || "ancestors" in e || "conditions" in e || "pseudos" in e && e.pseudos && !l(e.pseudos) || "default" in e && e.default && !i(e.default) || "states" in e && e.states && !a(e.states))), s = (e) => r(e) && Object.values(e).every((e) => r(e) && (!e.default || i(e.default)) && (!e.states || a(e.states)) && (!e.variants || o(e.variants))), c = (e) => r(e) && (!e.default || i(e.default)) && (!e.states || a(e.states)), l = (e) => r(e) && Object.entries(e).every(([e, n]) => t(e) && c(n)), u = (t) => r(t) && Object.entries(t).every(([t, n]) => e(t) === t && c(n) && (!n.pseudos || l(n.pseudos))), d = (e) => !(!r(e) || !e.default || !i(e.default) || e.states && !a(e.states) || e.variants && !o(e.variants) || e.ancestors && !s(e.ancestors) || e.pseudos && !l(e.pseudos) || e.conditions && !u(e.conditions)), f = (e) => e === void 0 || r(e) && !Object.keys(e).length || r(e) && "base" in e && Object.values(e).every(d), p = (e, t, s) => {
5
- let { styleSelector: c, styleVariant: l, styleState: u } = s ?? {};
6
- return !e && !c && !l && !u ? f(t) : !e && !c && l && u ? !1 : !e && !c && l ? o(t) : !e && !c && u ? a(t) : e ? n(t) : c ? t === void 0 ? !0 : n(t) || !r(t) ? !1 : i(t) || d(t) || d(t[c]) : !1;
5
+ var r = (e) => typeof e == "string" || typeof e == "number" || e === void 0, i = (e) => n(e), a = (e) => i(e) && Object.values(e).every(r), o = (e) => i(e) && Object.values(e).every(a), s = (e) => i(e) && Object.values(e).every((e) => !(!i(e) || "variants" in e || "ancestors" in e || "conditions" in e || "pseudos" in e && e.pseudos && !u(e.pseudos) || "default" in e && e.default && !a(e.default) || "states" in e && e.states && !o(e.states))), c = (e) => i(e) && Object.values(e).every((e) => i(e) && (!e.default || a(e.default)) && (!e.states || o(e.states)) && (!e.variants || s(e.variants))), l = (e) => i(e) && (!e.default || a(e.default)) && (!e.states || o(e.states)), u = (e) => i(e) && Object.entries(e).every(([e, n]) => t(e) && l(n)), d = (t) => i(t) && Object.entries(t).every(([t, n]) => e(t) === t && l(n) && (!n.pseudos || u(n.pseudos))), f = (e) => !(!i(e) || !e.default || !a(e.default) || e.states && !o(e.states) || e.variants && !s(e.variants) || e.ancestors && !c(e.ancestors) || e.pseudos && !u(e.pseudos) || e.conditions && !d(e.conditions)), p = (e) => e === void 0 || i(e) && !Object.keys(e).length || i(e) && "base" in e && Object.values(e).every(f), m = (e, t, n) => {
6
+ let { styleSelector: c, styleVariant: l, styleState: u } = n ?? {};
7
+ return !e && !c && !l && !u ? p(t) : !e && !c && l && u ? !1 : !e && !c && l ? s(t) : !e && !c && u ? o(t) : e ? r(t) : c ? t === void 0 ? !0 : r(t) || !i(t) ? !1 : a(t) || f(t) || f(t[c]) : !1;
7
8
  };
8
9
  //#endregion
9
- export { p as default, s as isStyleAncestors, f as isStyleAttributes, d as isStyleBlock, u as isStyleConditions, i as isStyleObject, l as isStylePseudos, a as isStyleStates, o as isStyleVariants };
10
+ export { m as default, c as isStyleAncestors, p as isStyleAttributes, f as isStyleBlock, d as isStyleConditions, a as isStyleObject, u as isStylePseudos, o as isStyleStates, s as isStyleVariants };
@@ -1,8 +1,9 @@
1
1
  import { isStyleObject as e } from "./isValueValid.mjs";
2
2
  import { omit as t } from "@plitzi/plitzi-ui/helpers";
3
3
  import { isStyleRules as n, setAtKeys as r, styleTargetKeys as i, valueAtKeys as a } from "@plitzi/sdk-shared/style/styleTarget";
4
+ import { isRecord as o } from "@plitzi/sdk-shared/helpers/isRecord";
4
5
  //#region src/StyleMap/helpers/utils.ts
5
- var o = (t, n, r) => {
6
+ var s = (t, n, r) => {
6
7
  if (t && (typeof n == "string" || typeof n == "number")) return {
7
8
  ...r,
8
9
  [t]: n
@@ -13,36 +14,36 @@ var o = (t, n, r) => {
13
14
  return e;
14
15
  }
15
16
  return r;
16
- }, s = (e) => !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0, c = (e) => typeof e == "object" && !!e && !Array.isArray(e), l = (e) => {
17
+ }, c = (e) => !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0, l = (e) => {
17
18
  let t = [];
18
19
  for (let n = 0; n + 1 < e.length; n += 2) t.push([e[n], e[n + 1]]);
19
20
  return t;
20
21
  }, u = (e) => e.includes("ancestors") || e.includes("conditions") || e.includes("pseudos"), d = (e, t) => Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)), f = (e, t, n) => {
21
22
  let i = a(e, t);
22
- if (!c(i)) return;
23
- let o = d(i, n), l = u(t) && Object.values(o).every((e) => s(e));
24
- if (Object.keys(o).length && !l || t.length === 1) {
25
- r(e, t, o);
23
+ if (!o(i)) return;
24
+ let s = d(i, n), l = u(t) && Object.values(s).every((e) => c(e));
25
+ if (Object.keys(s).length && !l || t.length === 1) {
26
+ r(e, t, s);
26
27
  return;
27
28
  }
28
29
  f(e, t.slice(0, -1), t[t.length - 1]);
29
- }, p = (c = "add", u, d, p, m, h) => {
30
+ }, p = (o = "add", u, d, p, m, h) => {
30
31
  let g = u.attributes, _ = [d, ...i(h)], v = !!h.styleAncestor || !!h.styleCondition, y = _.slice(0, v ? 3 : 1), b = l(_.slice(y.length)).filter(([e]) => e !== "default"), x = b.at(0), S = x ? [...y, x[0]] : void 0;
31
32
  if (m !== void 0) {
32
- if (e(m) && s(m)) {
33
+ if (e(m) && c(m)) {
33
34
  if (v && !b.length) {
34
35
  f(g, y, "default");
35
36
  return;
36
37
  }
37
- if (c === "update" && S && a(g, S) === void 0) return;
38
+ if (o === "update" && S && a(g, S) === void 0) return;
38
39
  r(g, _, {});
39
40
  return;
40
41
  }
41
42
  let t = a(g, _);
42
- r(g, _, o(p, m, n(t) ? t : {}));
43
+ r(g, _, s(p, m, n(t) ? t : {}));
43
44
  return;
44
45
  }
45
- if (c === "add" && !p && S) {
46
+ if (o === "add" && !p && S) {
46
47
  a(g, S) === void 0 && r(g, _, {});
47
48
  return;
48
49
  }
@@ -59,4 +60,4 @@ var o = (t, n, r) => {
59
60
  r(g, _, {});
60
61
  };
61
62
  //#endregion
62
- export { s as isEmptyObject, o as parseValue, p as writeStyle };
63
+ export { c as isEmptyObject, s as parseValue, p as writeStyle };
@@ -5,7 +5,7 @@ var n = ({ children: n, title: r = "", className: i = "", onClick: a }) => /* @_
5
5
  type: "button",
6
6
  title: r,
7
7
  onClick: a,
8
- className: t("m-1 h-6 w-6 rounded-sm p-1 hover:bg-gray-100", i),
8
+ className: t("hover:text-primary-600 dark:hover:text-primary-300 m-0.5 h-7 w-7 cursor-pointer rounded-md p-1 text-zinc-600 hover:bg-gray-100 dark:text-zinc-300 dark:hover:bg-zinc-800", i),
9
9
  children: /* @__PURE__ */ e("svg", {
10
10
  viewBox: "0 0 30 30",
11
11
  className: "overflow-visible",
@@ -6,12 +6,12 @@ import i from "clsx";
6
6
  var a = ({ className: a = "", onChange: o }) => {
7
7
  let s = t((e) => () => o?.(e), [o]);
8
8
  return /* @__PURE__ */ r("div", {
9
- className: i("flex flex-col border-r border-gray-300", a),
9
+ className: i("flex flex-col", a),
10
10
  children: [
11
11
  /* @__PURE__ */ r("div", {
12
12
  className: "flex flex-col",
13
13
  children: [/* @__PURE__ */ n("div", {
14
- className: "bg-blue-400 p-1 text-xs text-white",
14
+ className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
15
15
  children: "Default"
16
16
  }), /* @__PURE__ */ r("div", {
17
17
  className: "flex flex-wrap",
@@ -62,7 +62,7 @@ var a = ({ className: a = "", onChange: o }) => {
62
62
  /* @__PURE__ */ r("div", {
63
63
  className: "flex flex-col",
64
64
  children: [/* @__PURE__ */ n("div", {
65
- className: "bg-blue-400 p-1 text-xs text-white",
65
+ className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
66
66
  children: "Ease In"
67
67
  }), /* @__PURE__ */ r("div", {
68
68
  className: "flex flex-wrap",
@@ -137,7 +137,7 @@ var a = ({ className: a = "", onChange: o }) => {
137
137
  /* @__PURE__ */ r("div", {
138
138
  className: "flex flex-col",
139
139
  children: [/* @__PURE__ */ n("div", {
140
- className: "bg-blue-400 p-1 text-xs text-white",
140
+ className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
141
141
  children: "Ease Out"
142
142
  }), /* @__PURE__ */ r("div", {
143
143
  className: "flex flex-wrap",
@@ -212,7 +212,7 @@ var a = ({ className: a = "", onChange: o }) => {
212
212
  /* @__PURE__ */ r("div", {
213
213
  className: "flex flex-col",
214
214
  children: [/* @__PURE__ */ n("div", {
215
- className: "bg-blue-400 p-1 text-xs text-white",
215
+ className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide text-zinc-500 uppercase dark:text-zinc-400",
216
216
  children: "Ease In Out"
217
217
  }), /* @__PURE__ */ r("div", {
218
218
  className: "flex flex-wrap",
@@ -110,7 +110,8 @@ var S = "Classes apply left to right, in the order the stylesheet lists them: wh
110
110
  allowLeftSide: !0,
111
111
  allowRightSide: !0,
112
112
  placement: "floating",
113
- width: 600
113
+ width: 720,
114
+ height: 640
114
115
  });
115
116
  }, [B, z]), ne = l(() => ({ width: R?.width }), [R]);
116
117
  return /* @__PURE__ */ g("div", {
@@ -1,57 +1,61 @@
1
- import { useCallback as e } from "react";
2
- import { makeId as t } from "@plitzi/sdk-shared/helpers/utils";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import i from "@plitzi/plitzi-ui/ContainerFloating";
5
- import a from "@plitzi/plitzi-ui/Icon";
6
- import o, { useModal as s } from "@plitzi/plitzi-ui/Modal";
1
+ import { ITEM_CLASS as e } from "./helpers.mjs";
2
+ import { useCallback as t } from "react";
3
+ import { makeId as n } from "@plitzi/sdk-shared/helpers/utils";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import a from "@plitzi/plitzi-ui/ContainerFloating";
6
+ import o from "@plitzi/plitzi-ui/Icon";
7
+ import s, { useModal as c } from "@plitzi/plitzi-ui/Modal";
7
8
  //#region src/components/Selector/SelectorItem/ItemOptions.tsx
8
- var c = ({ selector: c = "", type: l = "class", onAction: u }) => {
9
- let { showDialog: d } = s(), f = e(() => u?.("duplicate", {
10
- name: `${c}-${t(4)}`,
11
- type: l
9
+ var l = ({ selector: l = "", type: u = "class", onAction: d }) => {
10
+ let { showDialog: f } = c(), p = t(() => d?.("duplicate", {
11
+ name: `${l}-${n(4)}`,
12
+ type: u
12
13
  }), [
13
- u,
14
- c,
15
- l
16
- ]), p = e(() => u?.("remove"), [u]), m = e(async () => {
17
- await d(/* @__PURE__ */ n(o.Header, { children: /* @__PURE__ */ n("h4", { children: "Remove Selector" }) }), /* @__PURE__ */ n(o.Body, { children: /* @__PURE__ */ n("h4", { children: "Do you want to remove this item ?" }) }), void 0, { size: "sm" }, c) && u?.("delete");
14
+ d,
15
+ l,
16
+ u
17
+ ]), m = t(() => d?.("remove"), [d]), h = t(async () => {
18
+ await f(/* @__PURE__ */ i(s.Header, { children: ["Delete .", l] }), /* @__PURE__ */ r(s.Body, { children: /* @__PURE__ */ r("p", {
19
+ className: "m-0 text-sm",
20
+ children: "The class is deleted from the space, and every element that wears it loses the styles it gives. To take it off this element only, use “Remove from this element”."
21
+ }) }), void 0, { size: "sm" }, l) && d?.("delete");
18
22
  }, [
19
- u,
20
- c,
21
- d
23
+ d,
24
+ l,
25
+ f
22
26
  ]);
23
- return /* @__PURE__ */ r(i, { children: [/* @__PURE__ */ n(i.Trigger, { children: /* @__PURE__ */ n(a, {
27
+ return /* @__PURE__ */ i(a, { children: [/* @__PURE__ */ r(a.Trigger, { children: /* @__PURE__ */ r(o, {
24
28
  icon: "fa-solid fa-ellipsis-vertical",
25
29
  className: "h-4 w-4 !min-w-4"
26
- }) }), /* @__PURE__ */ n(i.Content, {
30
+ }) }), /* @__PURE__ */ r(a.Content, {
27
31
  className: "text-xs text-zinc-700 dark:text-zinc-300",
28
32
  children: /* @__PURE__ */ r("div", {
29
- className: "rounded border border-gray-200 bg-gray-50 py-1 dark:border-zinc-700 dark:bg-zinc-800",
30
- children: [/* @__PURE__ */ n("div", {
31
- className: "mb-1 px-2 font-bold text-zinc-800 dark:text-zinc-200",
32
- children: "Actions"
33
- }), /* @__PURE__ */ r("ul", {
34
- className: "flex flex-col gap-1 px-2",
33
+ className: "min-w-44 rounded-md border border-gray-200 bg-white p-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-800",
34
+ children: /* @__PURE__ */ i("ul", {
35
+ className: "m-0 flex list-none flex-col p-0",
35
36
  children: [
36
- /* @__PURE__ */ n("li", {
37
- onClick: f,
38
- className: "cursor-pointer rounded-sm px-2 py-1 hover:bg-gray-200 dark:hover:bg-zinc-700",
39
- children: "Duplicate"
40
- }),
41
- /* @__PURE__ */ n("li", {
37
+ /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r("button", {
38
+ type: "button",
39
+ className: e,
42
40
  onClick: p,
43
- className: "cursor-pointer rounded-sm px-2 py-1 hover:bg-gray-200 dark:hover:bg-zinc-700",
44
- children: "Remove"
45
- }),
46
- /* @__PURE__ */ n("li", {
41
+ children: "Duplicate class"
42
+ }) }),
43
+ /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r("button", {
44
+ type: "button",
45
+ className: e,
47
46
  onClick: m,
48
- className: "cursor-pointer rounded-sm px-2 py-1 text-red-400 hover:bg-gray-200 dark:hover:bg-zinc-700",
49
- children: "Delete"
50
- })
47
+ children: "Remove from this element"
48
+ }) }),
49
+ /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r("button", {
50
+ type: "button",
51
+ className: `${e} text-red-600 dark:text-red-400`,
52
+ onClick: h,
53
+ children: "Delete from the space…"
54
+ }) })
51
55
  ]
52
- })]
56
+ })
53
57
  })
54
58
  })] });
55
59
  };
56
60
  //#endregion
57
- export { c as default };
61
+ export { l as default };
@@ -23,10 +23,10 @@ var s = ({ className: s = "", selector: c = "", type: l = "class", editable: u =
23
23
  });
24
24
  }, [l, m]);
25
25
  return /* @__PURE__ */ i("div", {
26
- className: a("relative flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 text-white select-none", s, {
27
- "bg-primary-400": l === "element" && d,
28
- "bg-secondary-400": l !== "element" && d,
29
- "bg-gray-500": !d,
26
+ className: a("relative flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 select-none", s, {
27
+ "bg-primary-600 text-white": l !== "element" && d,
28
+ "bg-primary-500/20 text-primary-800 dark:text-primary-200": l === "element" && d,
29
+ "bg-gray-200 text-zinc-700 hover:bg-gray-300 dark:bg-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-600": !d,
30
30
  "max-w-full min-w-0": !u
31
31
  }),
32
32
  onClick: g,
@@ -0,0 +1,2 @@
1
+ /** An entry of a class's actions menu: a full-width button, highlighted under the pointer and the keyboard alike. */
2
+ export declare const ITEM_CLASS = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:outline-none dark:hover:bg-zinc-700 dark:focus-visible:bg-zinc-700";
@@ -0,0 +1,4 @@
1
+ //#region src/components/Selector/SelectorItem/helpers.ts
2
+ var e = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-gray-100 focus-visible:bg-gray-100 focus-visible:outline-none dark:hover:bg-zinc-700 dark:focus-visible:bg-zinc-700";
3
+ //#endregion
4
+ export { e as ITEM_CLASS };