@plitzi/sdk-shared 0.36.2 → 0.37.1
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 +61 -0
- package/dist/index.mjs +26 -25
- package/dist/network/spaceEvents.d.ts +16 -4
- package/dist/network/spaceEvents.mjs +219 -224
- package/dist/store/index.d.ts +23 -23
- package/dist/style/index.d.ts +1 -0
- package/dist/style/index.mjs +2 -1
- package/dist/style/styleConstants.d.ts +9 -2
- package/dist/style/styleConstants.mjs +16 -0
- package/dist/style/styleStates.d.ts +17 -0
- package/dist/style/styleStates.mjs +31 -0
- package/dist/types/SchemaTypes.d.ts +5 -1
- package/dist/types/StoreTypes.d.ts +2 -0
- package/dist/types/StyleTypes.d.ts +17 -2
- package/package.json +5 -1
package/dist/style/index.d.ts
CHANGED
package/dist/style/index.mjs
CHANGED
|
@@ -3,4 +3,5 @@ import { fontLinkAssets as a } from "./fontAssets.mjs";
|
|
|
3
3
|
import { SYSTEM_FONTS as o, availableFonts as s, familiesInCss as c, fontFamilyStack as l, fontUrlResolver as u, fontsToHead as d, googleCss2Url as f, googleTextSubsetUrl as p, isSafeFontUrl as m, primaryFamily as h } from "./fonts.mjs";
|
|
4
4
|
import { FontValidationError as g, parseSpaceFont as _ } from "./fontValidation.mjs";
|
|
5
5
|
import { fallbackForFamily as v, fontsFromCss as y } from "./fontsFromCss.mjs";
|
|
6
|
-
|
|
6
|
+
import { STYLE_STATES as b, STYLE_STATE_LABELS as x, inCascadeOrder as S, isKnownState as C } from "./styleStates.mjs";
|
|
7
|
+
export { t as EMPTY_STYLE_SCHEMA, g as FontValidationError, b as STYLE_STATES, x as STYLE_STATE_LABELS, o as SYSTEM_FONTS, n as StyleBindingsAllowed, s as availableFonts, r as baseDefaultValue, v as fallbackForFamily, c as familiesInCss, l as fontFamilyStack, a as fontLinkAssets, u as fontUrlResolver, y as fontsFromCss, d as fontsToHead, f as googleCss2Url, p as googleTextSubsetUrl, S as inCascadeOrder, i as inheritableAttributesBase, C as isKnownState, m as isSafeFontUrl, _ as parseSpaceFont, h as primaryFamily, e as styleConstants };
|
|
@@ -78,6 +78,8 @@ declare const styleConstants: {
|
|
|
78
78
|
readonly ANIMATION_DIRECTION: "animation-direction";
|
|
79
79
|
readonly ANIMATION_FILL_MODE: "animation-fill-mode";
|
|
80
80
|
readonly ANIMATION_PLAY_STATE: "animation-play-state";
|
|
81
|
+
readonly ANIMATION_TIMELINE: "animation-timeline";
|
|
82
|
+
readonly ANIMATION_RANGE: "animation-range";
|
|
81
83
|
readonly BOX_SHADOW: "box-shadow";
|
|
82
84
|
readonly FILTER: "filter";
|
|
83
85
|
readonly BACKDROP_FILTER: "backdrop-filter";
|
|
@@ -121,6 +123,8 @@ declare const styleConstants: {
|
|
|
121
123
|
readonly OVERFLOW: "overflow";
|
|
122
124
|
readonly OVERFLOW_X: "overflow-x";
|
|
123
125
|
readonly OVERFLOW_Y: "overflow-y";
|
|
126
|
+
readonly SCROLLBAR_WIDTH: "scrollbar-width";
|
|
127
|
+
readonly SCROLLBAR_COLOR: "scrollbar-color";
|
|
124
128
|
readonly OBJECT_FIT: "object-fit";
|
|
125
129
|
readonly OBJECT_POSITION: "object-position";
|
|
126
130
|
readonly COLUMN_WIDTH: "column-width";
|
|
@@ -141,6 +145,8 @@ declare const styleConstants: {
|
|
|
141
145
|
readonly TEXT_ALIGN: "text-align";
|
|
142
146
|
readonly FONT_STYLE: "font-style";
|
|
143
147
|
readonly FONT_VARIANT: "font-variant";
|
|
148
|
+
readonly FONT_VARIANT_NUMERIC: "font-variant-numeric";
|
|
149
|
+
readonly FONT_FEATURE_SETTINGS: "font-feature-settings";
|
|
144
150
|
readonly TEXT_DECORATION: "text-decoration";
|
|
145
151
|
readonly TEXT_DECORATION_LINE: "text-decoration-line";
|
|
146
152
|
readonly TEXT_DECORATION_COLOR: "text-decoration-color";
|
|
@@ -163,14 +169,15 @@ declare const styleConstants: {
|
|
|
163
169
|
readonly LINE_CLAMP: "line-clamp";
|
|
164
170
|
readonly WEBKIT_LINE_CLAMP: "-webkit-line-clamp";
|
|
165
171
|
readonly WEBKIT_BOX_ORIENT: "-webkit-box-orient";
|
|
172
|
+
readonly WEBKIT_TEXT_FILL_COLOR: "-webkit-text-fill-color";
|
|
166
173
|
readonly FILL: "fill";
|
|
167
174
|
readonly STROKE: "stroke";
|
|
168
175
|
readonly STROKE_WIDTH: "stroke-width";
|
|
169
176
|
};
|
|
170
177
|
export declare const inheritableAttributesBase: StyleCategory[];
|
|
171
178
|
export declare const StyleBindingsAllowed: {
|
|
172
|
-
path: "filter" | "fill" | "color" | "cursor" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "stroke" | "stroke-width";
|
|
173
|
-
label: "filter" | "fill" | "color" | "cursor" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "stroke" | "stroke-width";
|
|
179
|
+
path: "filter" | "fill" | "color" | "cursor" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "animation-timeline" | "animation-range" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "scrollbar-width" | "scrollbar-color" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "font-variant-numeric" | "font-feature-settings" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "-webkit-text-fill-color" | "stroke" | "stroke-width";
|
|
180
|
+
label: "filter" | "fill" | "color" | "cursor" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "animation-timeline" | "animation-range" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "scrollbar-width" | "scrollbar-color" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "font-variant-numeric" | "font-feature-settings" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "-webkit-text-fill-color" | "stroke" | "stroke-width";
|
|
174
181
|
}[];
|
|
175
182
|
export declare const baseDefaultValue: Record<StyleCategory, StyleValue>;
|
|
176
183
|
export default styleConstants;
|
|
@@ -91,6 +91,8 @@ var e = {
|
|
|
91
91
|
ANIMATION_DIRECTION: "animation-direction",
|
|
92
92
|
ANIMATION_FILL_MODE: "animation-fill-mode",
|
|
93
93
|
ANIMATION_PLAY_STATE: "animation-play-state",
|
|
94
|
+
ANIMATION_TIMELINE: "animation-timeline",
|
|
95
|
+
ANIMATION_RANGE: "animation-range",
|
|
94
96
|
BOX_SHADOW: "box-shadow",
|
|
95
97
|
FILTER: "filter",
|
|
96
98
|
BACKDROP_FILTER: "backdrop-filter",
|
|
@@ -134,6 +136,8 @@ var e = {
|
|
|
134
136
|
OVERFLOW: "overflow",
|
|
135
137
|
OVERFLOW_X: "overflow-x",
|
|
136
138
|
OVERFLOW_Y: "overflow-y",
|
|
139
|
+
SCROLLBAR_WIDTH: "scrollbar-width",
|
|
140
|
+
SCROLLBAR_COLOR: "scrollbar-color",
|
|
137
141
|
OBJECT_FIT: "object-fit",
|
|
138
142
|
OBJECT_POSITION: "object-position",
|
|
139
143
|
COLUMN_WIDTH: "column-width",
|
|
@@ -154,6 +158,8 @@ var e = {
|
|
|
154
158
|
TEXT_ALIGN: "text-align",
|
|
155
159
|
FONT_STYLE: "font-style",
|
|
156
160
|
FONT_VARIANT: "font-variant",
|
|
161
|
+
FONT_VARIANT_NUMERIC: "font-variant-numeric",
|
|
162
|
+
FONT_FEATURE_SETTINGS: "font-feature-settings",
|
|
157
163
|
TEXT_DECORATION: "text-decoration",
|
|
158
164
|
TEXT_DECORATION_LINE: "text-decoration-line",
|
|
159
165
|
TEXT_DECORATION_COLOR: "text-decoration-color",
|
|
@@ -176,6 +182,7 @@ var e = {
|
|
|
176
182
|
LINE_CLAMP: "line-clamp",
|
|
177
183
|
WEBKIT_LINE_CLAMP: "-webkit-line-clamp",
|
|
178
184
|
WEBKIT_BOX_ORIENT: "-webkit-box-orient",
|
|
185
|
+
WEBKIT_TEXT_FILL_COLOR: "-webkit-text-fill-color",
|
|
179
186
|
FILL: "fill",
|
|
180
187
|
STROKE: "stroke",
|
|
181
188
|
STROKE_WIDTH: "stroke-width"
|
|
@@ -184,6 +191,8 @@ var e = {
|
|
|
184
191
|
t.FONT_SIZE,
|
|
185
192
|
t.FONT_STYLE,
|
|
186
193
|
t.FONT_VARIANT,
|
|
194
|
+
t.FONT_VARIANT_NUMERIC,
|
|
195
|
+
t.FONT_FEATURE_SETTINGS,
|
|
187
196
|
t.FONT_WEIGHT,
|
|
188
197
|
t.COLOR,
|
|
189
198
|
t.LINE_HEIGHT,
|
|
@@ -281,6 +290,8 @@ var e = {
|
|
|
281
290
|
[t.ANIMATION_DIRECTION]: "normal",
|
|
282
291
|
[t.ANIMATION_FILL_MODE]: "none",
|
|
283
292
|
[t.ANIMATION_PLAY_STATE]: "running",
|
|
293
|
+
[t.ANIMATION_TIMELINE]: "auto",
|
|
294
|
+
[t.ANIMATION_RANGE]: "normal",
|
|
284
295
|
[t.BOX_SHADOW]: "1px 1px 3px 1px black",
|
|
285
296
|
[t.FILTER]: "blur(5px)",
|
|
286
297
|
[t.BACKDROP_FILTER]: "blur(5px)",
|
|
@@ -324,6 +335,8 @@ var e = {
|
|
|
324
335
|
[t.OVERFLOW]: "visible",
|
|
325
336
|
[t.OVERFLOW_X]: "visible",
|
|
326
337
|
[t.OVERFLOW_Y]: "visible",
|
|
338
|
+
[t.SCROLLBAR_WIDTH]: "auto",
|
|
339
|
+
[t.SCROLLBAR_COLOR]: "auto",
|
|
327
340
|
[t.OBJECT_FIT]: "fill",
|
|
328
341
|
[t.OBJECT_POSITION]: "50% 50%",
|
|
329
342
|
[t.COLUMN_WIDTH]: "auto",
|
|
@@ -344,6 +357,8 @@ var e = {
|
|
|
344
357
|
[t.TEXT_ALIGN]: "left",
|
|
345
358
|
[t.FONT_STYLE]: "normal",
|
|
346
359
|
[t.FONT_VARIANT]: "normal",
|
|
360
|
+
[t.FONT_VARIANT_NUMERIC]: "normal",
|
|
361
|
+
[t.FONT_FEATURE_SETTINGS]: "normal",
|
|
347
362
|
[t.TEXT_DECORATION]: "none",
|
|
348
363
|
[t.TEXT_DECORATION_LINE]: "none",
|
|
349
364
|
[t.TEXT_DECORATION_COLOR]: "currentColor",
|
|
@@ -366,6 +381,7 @@ var e = {
|
|
|
366
381
|
[t.LINE_CLAMP]: "none",
|
|
367
382
|
[t.WEBKIT_LINE_CLAMP]: "none",
|
|
368
383
|
[t.WEBKIT_BOX_ORIENT]: "horizontal",
|
|
384
|
+
[t.WEBKIT_TEXT_FILL_COLOR]: "currentcolor",
|
|
369
385
|
[t.FILL]: "currentColor",
|
|
370
386
|
[t.STROKE]: "none",
|
|
371
387
|
[t.STROKE_WIDTH]: "1"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The states a selector can react to — one list, read by the type, the style editor, the event schema and authoring.
|
|
3
|
+
*
|
|
4
|
+
* It used to be written out in each of those, and the copies drifted: the editor's `checked` and `visited` options had
|
|
5
|
+
* their label and value swapped, so choosing one stored a state nothing else recognised.
|
|
6
|
+
*
|
|
7
|
+
* `focus-visible` is the focus ring a keyboard user needs and a mouse user does not; `focus-within` dresses a
|
|
8
|
+
* container while anything inside it has focus — a field wrapper around its input.
|
|
9
|
+
*/
|
|
10
|
+
export declare const STYLE_STATES: readonly ["hover", "focus", "focus-visible", "focus-within", "active", "disabled", "checked", "visited"];
|
|
11
|
+
export declare const STYLE_STATE_LABELS: Record<(typeof STYLE_STATES)[number], string>;
|
|
12
|
+
export declare const isKnownState: (state: string) => state is (typeof STYLE_STATES)[number];
|
|
13
|
+
/**
|
|
14
|
+
* A rule's states in the order they have to be written for the right one to win, whatever order they were added in.
|
|
15
|
+
* A state outside the list keeps its place after the known ones.
|
|
16
|
+
*/
|
|
17
|
+
export declare const inCascadeOrder: <T>(states: Record<string, T>) => [string, T][];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/style/styleStates.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"hover",
|
|
4
|
+
"focus",
|
|
5
|
+
"focus-visible",
|
|
6
|
+
"focus-within",
|
|
7
|
+
"active",
|
|
8
|
+
"disabled",
|
|
9
|
+
"checked",
|
|
10
|
+
"visited"
|
|
11
|
+
], t = {
|
|
12
|
+
hover: "Hover",
|
|
13
|
+
focus: "Focus",
|
|
14
|
+
"focus-visible": "Focus visible",
|
|
15
|
+
"focus-within": "Focus within",
|
|
16
|
+
active: "Active",
|
|
17
|
+
disabled: "Disabled",
|
|
18
|
+
checked: "Checked",
|
|
19
|
+
visited: "Visited"
|
|
20
|
+
}, n = {
|
|
21
|
+
visited: 0,
|
|
22
|
+
checked: 1,
|
|
23
|
+
"focus-within": 2,
|
|
24
|
+
hover: 3,
|
|
25
|
+
focus: 4,
|
|
26
|
+
"focus-visible": 5,
|
|
27
|
+
active: 6,
|
|
28
|
+
disabled: 7
|
|
29
|
+
}, r = (e) => Object.hasOwn(n, e), i = (t) => r(t) ? n[t] : e.length, a = (e) => Object.entries(e).sort(([e], [t]) => i(e) - i(t));
|
|
30
|
+
//#endregion
|
|
31
|
+
export { e as STYLE_STATES, t as STYLE_STATE_LABELS, a as inCascadeOrder, r as isKnownState };
|
|
@@ -29,7 +29,11 @@ export type DropPosition = 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'cus
|
|
|
29
29
|
export type BindingCategory = 'attributes' | 'style' | 'initialState';
|
|
30
30
|
export type BindingTransformer = {
|
|
31
31
|
action: string;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Mostly text, and not only: a param the builder draws as a checkbox (`styleVariant`'s `append`) is stored as the
|
|
34
|
+
* boolean it is, and the transformer reads it as one — `if (!append)`. Writing `"false"` there would read as true.
|
|
35
|
+
*/
|
|
36
|
+
params: Record<string, string | number | boolean>;
|
|
33
37
|
enabled?: boolean;
|
|
34
38
|
};
|
|
35
39
|
export type ElementBinding = {
|
|
@@ -202,6 +202,8 @@ export type BuilderState = CommonState & {
|
|
|
202
202
|
styleSelector?: string;
|
|
203
203
|
styleVariant?: string;
|
|
204
204
|
styleState?: StyleState;
|
|
205
|
+
/** The ancestor class being edited under: `styleState`/`styleVariant` are then its, and neither means always. */
|
|
206
|
+
styleAncestor?: string;
|
|
205
207
|
elementHovered?: string;
|
|
206
208
|
elementSelected?: string;
|
|
207
209
|
setHovered: (elementId?: string) => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ColorScheme, Theme } from './ThemeTypes';
|
|
2
2
|
import { default as styleConstants } from '../style/styleConstants';
|
|
3
|
+
import { STYLE_STATES } from '../style/styleStates';
|
|
3
4
|
export type TagType = 'class' | 'element' | 'id';
|
|
4
5
|
export type DisplayMode = 'desktop' | 'tablet' | 'mobile';
|
|
5
6
|
export type StyleMode = 'mobile-first' | 'desktop-first';
|
|
6
|
-
export type StyleState =
|
|
7
|
+
export type StyleState = (typeof STYLE_STATES)[number];
|
|
7
8
|
export type StyleValue = number | string;
|
|
8
9
|
export type StyleCategory = (typeof styleConstants)[keyof typeof styleConstants];
|
|
9
10
|
export declare enum StyleVariableCategory {
|
|
@@ -18,11 +19,25 @@ export type StyleVariableGroup = Record<string, StyleVariableValue>;
|
|
|
18
19
|
export type StyleVariables = Record<StyleVariableCategory, StyleVariableGroup>;
|
|
19
20
|
export type StyleObject = Partial<Record<StyleCategory, StyleValue>>;
|
|
20
21
|
export type StyleStates = Partial<Record<StyleState, StyleObject>>;
|
|
21
|
-
export type StyleVariants = Record<string, Omit<StyleBlock, 'variants'>>;
|
|
22
|
+
export type StyleVariants = Record<string, Omit<StyleBlock, 'variants' | 'ancestors'>>;
|
|
23
|
+
export type StyleAncestor = {
|
|
24
|
+
default?: StyleObject;
|
|
25
|
+
states?: StyleStates;
|
|
26
|
+
variants?: StyleVariants;
|
|
27
|
+
};
|
|
28
|
+
export type StyleAncestors = Record<string, StyleAncestor>;
|
|
22
29
|
export type StyleBlock = {
|
|
23
30
|
default?: StyleObject;
|
|
24
31
|
states?: StyleStates;
|
|
25
32
|
variants?: StyleVariants;
|
|
33
|
+
ancestors?: StyleAncestors;
|
|
34
|
+
};
|
|
35
|
+
export type StyleTarget = {
|
|
36
|
+
componentType?: string;
|
|
37
|
+
styleSelector?: string;
|
|
38
|
+
styleState?: StyleState;
|
|
39
|
+
styleVariant?: string;
|
|
40
|
+
styleAncestor?: string;
|
|
26
41
|
};
|
|
27
42
|
export type StyleAttributes = Record<string, StyleBlock>;
|
|
28
43
|
export type StyleItem = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -1136,6 +1136,10 @@
|
|
|
1136
1136
|
"types": "./dist/style/styleConstants.d.ts",
|
|
1137
1137
|
"import": "./dist/style/styleConstants.mjs"
|
|
1138
1138
|
},
|
|
1139
|
+
"./style/styleStates": {
|
|
1140
|
+
"types": "./dist/style/styleStates.d.ts",
|
|
1141
|
+
"import": "./dist/style/styleStates.mjs"
|
|
1142
|
+
},
|
|
1139
1143
|
"./theme": {
|
|
1140
1144
|
"types": "./dist/theme/index.d.ts",
|
|
1141
1145
|
"import": "./dist/theme/index.mjs"
|