efficient-easel 25.1.0 → 26.1.0
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/README.md +3 -4
- package/dist/chunk-2T22IY3J.js +2 -0
- package/dist/chunk-4FFDGEWA.js +1 -0
- package/dist/{chunk-KFV7N2DJ.js → chunk-56ID6FKZ.js} +1 -1
- package/dist/chunk-5OKOCRXT.js +11 -0
- package/dist/{chunk-ITIVCER6.js → chunk-5QUIXGQU.js} +1 -1
- package/dist/{chunk-6WTWYHC2.js → chunk-6BOOYHHK.js} +4 -4
- package/dist/{chunk-OXOUGEAT.js → chunk-7GGNFLHT.js} +1 -1
- package/dist/{chunk-XTDOSL2M.js → chunk-7PGO4K5M.js} +8 -8
- package/dist/chunk-BA5X67LQ.js +1 -0
- package/dist/chunk-BYONFJVQ.js +2 -0
- package/dist/chunk-CLAADE4J.js +14 -0
- package/dist/chunk-IMAN6IP5.js +4 -0
- package/dist/{chunk-LUHGBFOD.js → chunk-LSGKADNV.js} +3 -3
- package/dist/{chunk-UDWXBS46.js → chunk-O4DQ6O6W.js} +1 -1
- package/dist/{chunk-S6YOIRXQ.js → chunk-Q3VAJMXS.js} +1 -1
- package/dist/{chunk-KF3LT7J2.js → chunk-QAVA4V2C.js} +1 -1
- package/dist/{chunk-U3LTJSBU.js → chunk-R76XMEKT.js} +11 -11
- package/dist/{chunk-FEP6XMNX.js → chunk-STQDOTHF.js} +1 -1
- package/dist/{chunk-62UGN7VM.js → chunk-TOEJCZUO.js} +1 -1
- package/dist/chunk-TTCUC2Q3.js +1 -0
- package/dist/{chunk-IW5QXREH.js → chunk-VXAGXHKI.js} +40 -40
- package/dist/{chunk-XLC7HWW3.js → chunk-WOA775T4.js} +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +63 -2
- package/dist/panel/index.js +1 -1
- package/dist/panel/panel.css +46 -0
- package/dist/pick/index.d.ts +16 -195
- package/dist/pick/index.js +1 -1
- package/dist/pick/pick.css +6 -196
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/block-set-host.js +1 -1
- package/dist/screen/lib/document/box-fields.d.ts +44 -6
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/button-fields.d.ts +97 -0
- package/dist/screen/lib/document/button-fields.js +1 -0
- package/dist/screen/lib/document/device-fields.js +1 -1
- package/dist/screen/lib/document/image-fields.d.ts +118 -0
- package/dist/screen/lib/document/image-fields.js +5 -0
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/style-fields.d.ts +109 -0
- package/dist/screen/lib/document/style-fields.js +1 -0
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/words.d.ts +22 -1
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.d.ts +12 -9
- package/dist/strings/index.js +2 -2
- package/dist/text-styles/index.d.ts +3 -3
- package/dist/text-styles/index.js +37 -37
- package/dist/{words-fbR9IwxH.d.ts → words-BrN08Fup.d.ts} +16 -1
- package/package.json +19 -1
- package/dist/chunk-ERB6FAZT.js +0 -2
- package/dist/chunk-H6BER2EU.js +0 -1
- package/dist/chunk-KVIEUWTX.js +0 -11
- package/dist/chunk-OFBZOI6W.js +0 -1
- package/dist/chunk-SC6E3UUS.js +0 -13
- package/dist/chunk-U6LJ5UKD.js +0 -6
- package/dist/words-DWvCJXwR.d.ts +0 -51
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{BORDER_WIDTH_MAX,CORNER_RADIUS_MAX,CORNER_SIDES,borderField,colourField,cornersField,keptByRow,styleFieldBuilders}from"../../../chunk-IMAN6IP5.js";import"../../../chunk-5OKOCRXT.js";import"../../../chunk-CLAADE4J.js";import"../../../chunk-2T22IY3J.js";import"../../../chunk-7GGNFLHT.js";import"../../../chunk-22I55W37.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-Q3VAJMXS.js";import"../../../chunk-CWELHADJ.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-E52W3M5I.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-BBD3FLU3.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-OECWLNKJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-WOA775T4.js";import"../../../chunk-LSGKADNV.js";import"../../../chunk-NCXYC7WI.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-TCAAOYQY.js";import"../../../chunk-BBD3FLU3.js";import"../../../chunk-JQQFB7EZ.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-R76XMEKT.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-ZEH6QLBH.js";import"../../../chunk-WHS6Y55E.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-56ID6FKZ.js";import"../../../chunk-K53PQAMP.js";import"../../../chunk-FIVU2COQ.js";import"../../../chunk-QTHQPJWA.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-PMRN5Z3T.js";import"../../../chunk-Y2T3JX7K.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-MIX7EGRG.js";import"../../../chunk-DX3VILZ3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-3XECMGXX.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-TOKMFZPB.js";import"../../../chunk-FR7EEKFF.js";import"../../../chunk-7UFKEX72.js";import"../../../chunk-EUFDQ4KL.js";import"../../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-
|
|
1
|
+
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-LSGKADNV.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-BBD3FLU3.js";import"../../chunk-JQQFB7EZ.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-R76XMEKT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-56ID6FKZ.js";import"../../chunk-K53PQAMP.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-QTHQPJWA.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-PMRN5Z3T.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-MIX7EGRG.js";import"../../chunk-DX3VILZ3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-3XECMGXX.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-TOKMFZPB.js";import"../../chunk-FR7EEKFF.js";import"../../chunk-7UFKEX72.js";import"../../chunk-EUFDQ4KL.js";import"../../chunk-KXM6YRG2.js";
|
package/dist/screen/words.d.ts
CHANGED
|
@@ -395,5 +395,26 @@ type ScreenWords = {
|
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
397
|
declare const DEFAULT_SCREEN_WORDS: ScreenWords;
|
|
398
|
+
/**
|
|
399
|
+
* THE IMAGE ROW's own words (`ImageRow`, `screen/lib/document/image-fields`;
|
|
400
|
+
* group `imageRow` of `efficient-easel/strings`). The row reads them with
|
|
401
|
+
* `useWords('imageRow', …)`. Its label, its bin's name and its kind hint are
|
|
402
|
+
* the host's; the box's own words are the shell's `MediaUploadField`'s.
|
|
403
|
+
*/
|
|
404
|
+
type ImageRowWords = {
|
|
405
|
+
/** The focus control's name and the ↺'s label. */
|
|
406
|
+
focus: string;
|
|
407
|
+
/** The ↺'s tooltip detail: where the phone's point goes back to. */
|
|
408
|
+
onDesktop: (value: string) => string;
|
|
409
|
+
/** The link that opens the paste box. */
|
|
410
|
+
pasteLink: string;
|
|
411
|
+
/** The paste box's name. */
|
|
412
|
+
pasteName: string;
|
|
413
|
+
/** The note a template draws in place of the box. */
|
|
414
|
+
template: string;
|
|
415
|
+
/** The same note for a video row. */
|
|
416
|
+
templateVideo: string;
|
|
417
|
+
};
|
|
418
|
+
declare const DEFAULT_IMAGE_ROW_WORDS: ImageRowWords;
|
|
398
419
|
|
|
399
|
-
export { DEFAULT_SCREEN_ADD_WORDS, DEFAULT_SCREEN_SAVE_STATUS_WORDS, DEFAULT_SCREEN_SHARED_WORDS, DEFAULT_SCREEN_WORDS, type ScreenAddWords, type ScreenBarWords, type ScreenLeaveWords, type ScreenMenuWords, type ScreenSaveStatusWords, type ScreenSharedWords, type ScreenWords };
|
|
420
|
+
export { DEFAULT_IMAGE_ROW_WORDS, DEFAULT_SCREEN_ADD_WORDS, DEFAULT_SCREEN_SAVE_STATUS_WORDS, DEFAULT_SCREEN_SHARED_WORDS, DEFAULT_SCREEN_WORDS, type ImageRowWords, type ScreenAddWords, type ScreenBarWords, type ScreenLeaveWords, type ScreenMenuWords, type ScreenSaveStatusWords, type ScreenSharedWords, type ScreenWords };
|
package/dist/screen/words.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_SHARED_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-
|
|
1
|
+
export{DEFAULT_IMAGE_ROW_WORDS,DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_SHARED_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-Q3VAJMXS.js";
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -6,9 +6,8 @@ import { LockWords } from '../edit-lock/index.js';
|
|
|
6
6
|
import { F as FieldsWords } from '../words-CFkb8XtN.js';
|
|
7
7
|
import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
8
8
|
import { P as PageCopyWords } from '../words-Dl8Qja4K.js';
|
|
9
|
-
import { P as PanelWords } from '../words-
|
|
10
|
-
import {
|
|
11
|
-
import { ScreenWords } from '../screen/words.js';
|
|
9
|
+
import { P as PanelWords, C as ColourRowWords } from '../words-BrN08Fup.js';
|
|
10
|
+
import { ImageRowWords, ScreenWords } from '../screen/words.js';
|
|
12
11
|
export { ScreenAddWords, ScreenSharedWords } from '../screen/words.js';
|
|
13
12
|
import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
|
|
14
13
|
import { T as TextStylesWords } from '../words-B5Gb7KFq.js';
|
|
@@ -73,8 +72,8 @@ type RailWords = {
|
|
|
73
72
|
* lane (`tests/*-leaf-safety`), and several are held to a bundle that never
|
|
74
73
|
* spells a browser global — while one sentence below does ("another tab or
|
|
75
74
|
* window"). So a module owns its group and its defaults, and this file only
|
|
76
|
-
* puts the groups side by side. `DEFAULT_EASEL_STRINGS.
|
|
77
|
-
* own default object, not a copy of it.
|
|
75
|
+
* puts the groups side by side. `DEFAULT_EASEL_STRINGS.colourRow` IS the
|
|
76
|
+
* colour row's own default object, not a copy of it.
|
|
78
77
|
*
|
|
79
78
|
* ── Framework-free ────────────────────────────────────────────────────────
|
|
80
79
|
* No React, no browser global, nothing run at import but object literals
|
|
@@ -102,8 +101,12 @@ interface EaselStrings {
|
|
|
102
101
|
panel: PanelWords;
|
|
103
102
|
/** `efficient-easel/fields` — the number box, the dropdown, the list field. */
|
|
104
103
|
fields: FieldsWords;
|
|
105
|
-
/** `efficient-easel/
|
|
106
|
-
|
|
104
|
+
/** `efficient-easel/panel` — the colour row (`SettingsColour`): its hex
|
|
105
|
+
* box's name and its empty word. Hook-free: a host hands it in. */
|
|
106
|
+
colourRow: ColourRowWords;
|
|
107
|
+
/** `efficient-easel/screen/lib/document/image-fields` — the image row
|
|
108
|
+
* (`ImageRow`): focus, the paste box, the template note. */
|
|
109
|
+
imageRow: ImageRowWords;
|
|
107
110
|
/** `efficient-easel/drag` — the Add panel and the canvas layer. */
|
|
108
111
|
drag: DragWords;
|
|
109
112
|
/** `efficient-easel/node-ops` — the right-click rows. */
|
|
@@ -164,7 +167,7 @@ interface EaselStringsProviderProps {
|
|
|
164
167
|
* them. With no provider the engine speaks English, exactly as before 0.95.0.
|
|
165
168
|
*
|
|
166
169
|
* The hook-free leaves do NOT read it — the rail, the settings-panel
|
|
167
|
-
* primitives
|
|
170
|
+
* primitives (the colour row too), the Layers tree, the Add panel, the canvas layer —
|
|
168
171
|
* and neither do the plain functions (`editNotice`, `saveIndicator`,
|
|
169
172
|
* `nodeMenuItems`, …). Each takes its group as a prop or an argument instead;
|
|
170
173
|
* a host hands it `useEaselStrings()`'s.
|
|
@@ -175,4 +178,4 @@ declare function useEaselStrings(): EaselStrings;
|
|
|
175
178
|
/** The nearest provider's locale, or `'en'`. */
|
|
176
179
|
declare function useEaselLocale(): string;
|
|
177
180
|
|
|
178
|
-
export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, EaselStringsProvider, type EaselStringsProviderProps, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PageCopyWords, PanelWords,
|
|
181
|
+
export { type CanvasWords, ChromeWords, ColourRowWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, EaselStringsProvider, type EaselStringsProviderProps, FieldsWords, ImageRowWords, LockWords, NodeMenuWords, NoticeWords, PageCopyWords, PanelWords, type RailWords, SaveWords, ScreenWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings, useEaselLocale, useEaselStrings };
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_TEXT_STYLES_WORDS as
|
|
2
|
-
return
|
|
1
|
+
import{DEFAULT_TEXT_STYLES_WORDS as o}from"../chunk-OGH6CC3E.js";import{DEFAULT_SCREEN_WORDS as r,DEFAULT_IMAGE_ROW_WORDS as n}from"../chunk-Q3VAJMXS.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"../chunk-6WY6ZXJG.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_COLOUR_ROW_WORDS as m,DEFAULT_PANEL_WORDS as i}from"../chunk-56ID6FKZ.js";import{DEFAULT_NODE_MENU_WORDS as s}from"../chunk-WK3AFPXY.js";import{DEFAULT_PAGE_COPY_WORDS as u}from"../chunk-CEC5XLN4.js";import{DEFAULT_SAVE_WORDS as f}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as l}from"../chunk-AJSDWWJW.js";import{DEFAULT_RAIL_WORDS as h}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as j}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as a}from"../chunk-PMRN5Z3T.js";import{DEFAULT_FIELDS_WORDS as k}from"../chunk-JACEEVVF.js";import{stringsContext as y}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as Y}from"../chunk-TQ5Y6S2X.js";import{useContext as C,useMemo as W}from"react";import{jsx as d}from"react/jsx-runtime";var g={notice:l,lock:j,save:f,chrome:p,rail:h,tree:e,panel:i,fields:k,colourRow:m,imageRow:n,drag:Y,menu:s,styleClipboard:t,copy:a,canvas:c,textStyles:o,screen:r,pageCopy:u},v=o=>"object"==typeof o&&null!==o;function D(o,r){const n={};for(const t of Object.keys(o)){const c=o[t],e=r[t];null==e?n[t]=c:v(c)?n[t]=v(e)?D(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function F(o,r){return r?D(o,r):o}function J({value:o,locale:r,children:n}){const t=y(),c=C(t),e=c?.strings??g,m=r??c?.locale??"en",i=W(()=>({strings:F(e,o),locale:m}),[e,o,m]);/* @__PURE__ */
|
|
2
|
+
return d(t.Provider,{value:i,children:n})}function S(){return C(y())?.strings??g}function A(){return C(y())?.locale??"en"}export{g as DEFAULT_EASEL_STRINGS,J as EaselStringsProvider,F as mergeEaselStrings,A as useEaselLocale,S as useEaselStrings};
|
|
@@ -131,7 +131,8 @@ interface ColourSwatchRowProps {
|
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* THE COLOR ROW — theme's colours in a row, then Any color, which opens
|
|
134
|
-
* the one colour window
|
|
134
|
+
* the one colour window, the shell's `ColorPickerPanel` (`es-pick-window` is
|
|
135
|
+
* this row's hook on it).
|
|
135
136
|
* Exported so a second host draws the same row instead of a copy (plan S2:
|
|
136
137
|
* the website's part panel; design final 2026-10-06). The text-styles list
|
|
137
138
|
* draws it through this export, unchanged.
|
|
@@ -141,8 +142,7 @@ interface ColourSwatchRowProps {
|
|
|
141
142
|
* (duplicate audit 2026-10-29, U21): its trigger wears the swatch's look
|
|
142
143
|
* (`colorSwatchClasses`, painted with the hue wheel, ringed while the colour
|
|
143
144
|
* is a hex), and the window under it is placed, closed by Escape or a press
|
|
144
|
-
* outside, and hands focus back as every kit popup is
|
|
145
|
-
* (`ColourPicker`) included. The row's name, the readout and the swatch group
|
|
145
|
+
* outside, and hands focus back as every kit popup is. The row's name, the readout and the swatch group
|
|
146
146
|
* stay this row's.
|
|
147
147
|
*
|
|
148
148
|
* What a press means is the host's: a swatch writes its key, the window a
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import{hexReadout as e,
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
return
|
|
9
|
-
return
|
|
10
|
-
return
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
return
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
return
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
return
|
|
22
|
-
return
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
return
|
|
25
|
-
return
|
|
26
|
-
return
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
return
|
|
30
|
-
return
|
|
31
|
-
return
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
return
|
|
35
|
-
return
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
1
|
+
import{hexReadout as e,typedHex as s}from"../chunk-4FFDGEWA.js";import{DEFAULT_TEXT_STYLES_WORDS as t}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{FieldSlider as a}from"../chunk-ZEH6QLBH.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as n,isDefaultTextStyle as r,CAMPAIGN_TEXT_STYLE_SETTINGS as o,TEXT_STYLE_SETTINGS as d,textStyleRowSize as c,describeTextStyle as u,updateTextStyle as m,textStyleCaseCss as h,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as f,TEXT_STYLE_RANGES as y}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-KFWNGPW3.js";import{SettingsSegmented as S}from"../chunk-DX3VILZ3.js";import"../chunk-JACEEVVF.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as N}from"../chunk-P2VEMZH5.js";import{hsvToHex as C,Tooltip as T,ColorSwatch as k,Popover as x,ColorPickerPanel as w,colorSwatchClasses as z,IconButton as E,Button as O}from"efficient-shell/ui";import{useId as _,useState as L,useRef as A,useEffect as j,Fragment as M}from"react";import{TrashIcon as $,ChevronIcon as W,BoldIcon as Y,ItalicIcon as X,CaseLowerIcon as F,CaseCapitalizedIcon as G,CaseUpperIcon as H,CaseNormalIcon as I}from"efficient-shell/icons/efficient";import{jsxs as P,jsx as B,Fragment as D}from"react/jsx-runtime";var R=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>C({h:e,s:1,v:1})).join(", ")})`;function V({value:s,hex:t,colours:a,label:l,followsWord:i,anyWord:n,onChange:r,readOnly:o=!1}){const d=void 0!==s&&a.some(e=>e.key===s),c=void 0!==s&&!d;/* @__PURE__ */
|
|
2
|
+
return P("div",{className:"es-ts-set","data-ts-setting":"color",children:[
|
|
3
|
+
/* @__PURE__ */P("div",{className:"es-ts-top",children:[
|
|
4
|
+
/* @__PURE__ */B("span",{className:"es-ts-sub",children:l}),
|
|
5
|
+
/* @__PURE__ */B("span",{className:"es-ts-colour-read",children:t?e(t):i})]}),
|
|
6
|
+
/* @__PURE__ */P("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[a.map(t=>/* @__PURE__ */B(T,{content:`${t.name} · ${e(t.value)}`,children:/* @__PURE__ */B(k,{color:t.value,size:"sm",className:"es-ts-swatch","aria-label":t.name,selected:s===t.key,disabled:o,onClick:()=>r(t.key)})},t.key)),
|
|
7
|
+
/* @__PURE__ */B(T,{content:n,children:/* @__PURE__ */B(x,{trigger:/* @__PURE__ */B("span",{"aria-hidden":"true",className:"absolute inset-0",style:{background:R}}),triggerLabel:n,triggerClassName:z({size:"sm",selected:c,className:"es-ts-swatch es-ts-swatch--any"}),"aria-label":l,disabled:o,children:/* @__PURE__ */B(w,{className:"es-pick-window",value:t??"",onChange:e=>r(e),label:l,disabled:o})})})]})]})}function Z({styles:e,onChange:s,fonts:a,colours:d=[],settings:c=o,auto:u=[],fallback:m,sample:h,openId:p,defaultOpenId:y=null,onOpenChange:g,onAdd:S,rowActions:C,onRemove:T,max:k=n,device:x="desktop",readOnly:w=!1}){const z=b("textStyles",t),M=_(),[W,Y]=L(y),X=void 0!==p?p:W,F=e=>{void 0===p&&Y(e),g?.(e)},G=A(null),[H,I]=L(null);j(()=>{if(!H||!G.current)return;const e=[...G.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===H.id),s=e?e.querySelector(".es-ts-row"):G.current.querySelector(`.es-ts-add[data-ts-kind="${H.kind}"]`);s?.focus(),I(null)},[H]);/* @__PURE__ */
|
|
8
|
+
return B("div",{className:"es-ts",ref:G,children:l.map(t=>{const l=e.filter(e=>e.kind===t),n=!i(e,t,k),o=!w&&!n;/* @__PURE__ */
|
|
9
|
+
return P(q,{label:z.groups[t],children:[l.map(t=>{const l=C?.(t),i=null!=l&&!1!==l,n=Boolean(T)&&!w&&!r(t);/* @__PURE__ */
|
|
10
|
+
return B(U,{style:t,fonts:a,colours:d,settings:c,auto:u,fallback:m,sample:h,device:x,readOnly:w,open:X===t.id,onOpenChange:e=>F(e?t.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:n||i?/* @__PURE__ */P(D,{children:[n?N(z.remove,/* @__PURE__ */B(E,{variant:"ghost-danger",size:"sm",className:"es-ts-del","aria-label":z.removeNamed({name:t.name}),onClick:()=>(t=>{if(w||!T)return;const a=f(e,t.id,{name:z.styleName});if(!a)return;const l=e.filter(e=>e.kind===t.kind),i=l[l.indexOf(t)+1];X===t.id&&F(null),s(a.styles),T(a.removed),I({id:i?.id??null,kind:t.kind})})(t),children:/* @__PURE__ */B($,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},t.id)}),N(!w&&n?z.full({kind:t,max:k}):void 0,/* @__PURE__ */P(O,{variant:"link",className:"es-ts-add","data-ts-kind":t,disabled:w,"aria-disabled":!(w||!n)||void 0,"aria-describedby":!w&&n?`${M}-full-${t}`:void 0,onClick:()=>{o&&(t=>{if(w)return;const a=v(e,t,{max:k,name:z.styleName,make:S});a&&s(a.styles)})(t)},children:[
|
|
11
|
+
/* @__PURE__ */B("span",{className:"es-ts-add-word",children:z.add[t]}),
|
|
12
|
+
/* @__PURE__ */B("span",{className:"es-ts-count",children:z.count({n:l.length,max:k})})]})),w||!n?null:/* @__PURE__ */B("span",{id:`${M}-full-${t}`,className:"es-vh",children:z.full({kind:t,max:k})})]},t)})})}function q({label:e,children:s}){const t=_();/* @__PURE__ */
|
|
13
|
+
return P("section",{className:"es-ts-section","aria-labelledby":t,children:[
|
|
14
|
+
/* @__PURE__ */B("div",{className:"es-ts-group",id:t,children:e}),s]})}function U({style:e,fonts:s,colours:a=[],settings:l=o,auto:i=[],fallback:n,sample:r,open:h,onOpenChange:p,onChange:v,actions:f,device:y="desktop",readOnly:g=!1}){const S=b("textStyles",t),N=`${_()}-open-${e.id}`,C=new Set(i),T=d.filter(e=>l.includes(e)),k={...n?.(e)??{},...e.values},x="phone"===y,w=x&&void 0!==e.values.sizePhone?{...k,size:e.values.sizePhone}:k,z=s.find(e=>e.value===k.font),E={fontFamily:z?.family,fontSize:`${c(w.size??16)}px`,fontWeight:k.weight,fontStyle:k.italic?"italic":void 0};/* @__PURE__ */
|
|
15
|
+
return P(M,{children:[
|
|
16
|
+
/* @__PURE__ */P("div",{className:"es-ts-item","data-ts-id":e.id,children:[
|
|
17
|
+
/* @__PURE__ */P("button",{type:"button",className:"es-ts-row","aria-expanded":h,"aria-controls":h?N:void 0,onClick:()=>p(!h),children:[
|
|
18
|
+
/* @__PURE__ */B("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */B(W,{size:12})}),
|
|
19
|
+
/* @__PURE__ */B("span",{className:"es-ts-name",style:E,children:e.name}),
|
|
20
|
+
/* @__PURE__ */B("span",{className:"es-ts-meta",children:u(w,s,S,{autoSize:C.has("size")&&w===k&&void 0===e.values.size})})]}),f?/* @__PURE__ */B("div",{className:"es-ts-actions",children:f}):null]}),h?/* @__PURE__ */B("div",{className:"es-ts-open",id:N,children:/* @__PURE__ */B(J,{style:e,values:k,fonts:s,colours:a,settings:T,autoSet:C,sample:r??S.sample,words:S,phone:x,readOnly:g,set:s=>v(m([e],e.id,s)[0])})}):null]})}var K={none:I,upper:H,capitalize:G,lower:F};function J({style:e,values:t,fonts:l,colours:i,settings:n,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const p=e.values,v=l.find(e=>e.value===t.font),f=function(e,t){return e?t.find(s=>s.key===e)?.value??s(e)??void 0:void 0}(t.color,i),g=e=>"largestSize"===e||r.has(e),S=e=>g(e)?p[e]:t[e],b=S("size"),C=c&&void 0!==p.sizePhone?p.sizePhone:b,T=S("lineSpacing"),k=S("letterSpacing"),x=g("letterCase")?p.letterCase:t.letterCase,w={fontFamily:v?.family,fontSize:void 0===C?void 0:`${C}px`,fontWeight:t.weight,fontStyle:t.italic?"italic":void 0,lineHeight:void 0===T?void 0:String(T/100),letterSpacing:void 0===k?void 0:`${k}px`,color:f,textTransform:h(x)},z=e=>{const s=y[e],l=g(e);/* @__PURE__ */
|
|
21
|
+
return B("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */B(a,{label:d.settings[e],value:p[e],onChange:s=>m({[e]:s}),min:s.min,max:s.max,step:s.step,shiftStep:s.shiftStep,sliderMin:s.sliderMin,sliderMax:s.sliderMax,unit:s.unit||void 0,styleValue:l?void 0:t[e],auto:l?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
|
|
22
|
+
return P(D,{children:[
|
|
23
|
+
/* @__PURE__ */B("div",{className:"es-ts-preview",style:w,"aria-label":d.preview,children:o}),n.map(s=>{switch(s){case"font":/* @__PURE__ */
|
|
24
|
+
return B(Q,{value:p.font,fonts:l,words:d,readOnly:u,set:m},s);case"color":/* @__PURE__ */
|
|
25
|
+
return B(ee,{value:p.color,hex:f,colours:i,words:d,readOnly:u,set:m},s);case"emphasis":{const e=(t.weight??400)>=600,a=!1!==v?.italic;/* @__PURE__ */
|
|
26
|
+
return P("div",{className:"es-ts-set","data-ts-setting":s,children:[
|
|
27
|
+
/* @__PURE__ */B("span",{className:"es-ts-sub",children:d.settings.emphasis}),
|
|
28
|
+
/* @__PURE__ */P("div",{className:"es-ts-icons",children:[N(d.bold,/* @__PURE__ */B(E,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */B(Y,{size:16})})),u||a?N(d.italic,/* @__PURE__ */B(E,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),disabled:u,onClick:()=>m({italic:!t.italic||void 0}),children:/* @__PURE__ */B(X,{size:16})})):/* @__PURE__ */B(E,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */B(X,{size:16})})]})]},s)}case"letterCase":/* @__PURE__ */
|
|
29
|
+
return B(se,{value:p.letterCase??t.letterCase,auto:g("letterCase"),words:d,readOnly:u,set:m},s);case"largestSize":return"heading"===e.kind?z(s):null;case"size":return c?(()=>{const e=y.size;/* @__PURE__ */
|
|
30
|
+
return B("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */B(a,{label:d.settings.size,value:p.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():z(s);default:return z(s)}})]})}function Q({value:e,fonts:s,words:t,readOnly:a,set:l}){const i=_();/* @__PURE__ */
|
|
31
|
+
return P("div",{className:"es-ts-set","data-ts-setting":"font",children:[
|
|
32
|
+
/* @__PURE__ */B("span",{className:"es-ts-sub",id:i,children:t.settings.font}),
|
|
33
|
+
/* @__PURE__ */B(g,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>l({font:e}),ariaLabelledBy:i,readOnly:a})]})}function ee({value:e,hex:s,colours:t,words:a,readOnly:l,set:i}){/* @__PURE__ */
|
|
34
|
+
return B(V,{value:e,hex:s,colours:t,label:a.settings.color,followsWord:a.colour.follows,anyWord:a.colour.any,readOnly:l,onChange:e=>i({color:e})})}function se({value:e,auto:s,words:t,readOnly:a,set:l}){const i=p.map(e=>{const s=K[e];return{id:e,label:/* @__PURE__ */B(s,{size:16}),title:t.case[e]}}),n=s?[{id:"auto",label:/* @__PURE__ */B("span",{children:t.case.auto}),title:t.case.autoTitle},...i]:i;/* @__PURE__ */
|
|
35
|
+
return P("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
|
|
36
|
+
/* @__PURE__ */B("span",{className:"es-ts-sub",children:t.settings.letterCase}),
|
|
37
|
+
/* @__PURE__ */B(S,{options:n,value:e??(s?"auto":"none"),ariaLabel:t.settings.letterCase,disabled:a,onChange:e=>l({letterCase:"auto"===e?void 0:e})})]})}export{V as ColourSwatchRow,U as TextStyleItem,q as TextStylesGroup,Z as TextStylesList};
|
|
@@ -47,5 +47,20 @@ type PanelWords = {
|
|
|
47
47
|
detail: string;
|
|
48
48
|
}) => string;
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* THE COLOUR ROW's own words (`SettingsColour`, group `colourRow` of
|
|
52
|
+
* `efficient-easel/strings`). The row is hook-free like the rest of `panel`, so
|
|
53
|
+
* a host hands them in: `words={useEaselStrings().colourRow}`, and the ↺'s as
|
|
54
|
+
* `resetWords={useEaselStrings().panel}`. The row's name (`label`) and a theme
|
|
55
|
+
* colour's name are the host's.
|
|
56
|
+
*/
|
|
57
|
+
type ColourRowWords = {
|
|
58
|
+
/** The hex box's accessible name, from the row's label. */
|
|
59
|
+
hexCode: (p: {
|
|
60
|
+
label: string;
|
|
61
|
+
}) => string;
|
|
62
|
+
/** What the empty hex box says while nothing is set and nothing is followed. */
|
|
63
|
+
notSet: string;
|
|
64
|
+
};
|
|
50
65
|
|
|
51
|
-
export type { PanelWords as P };
|
|
66
|
+
export type { ColourRowWords as C, PanelWords as P };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.1.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -96,10 +96,13 @@
|
|
|
96
96
|
"./screen/lib/document/block-choice",
|
|
97
97
|
"./screen/lib/document/block-types-in",
|
|
98
98
|
"./screen/lib/document/block-set-host",
|
|
99
|
+
"./screen/lib/document/button-fields",
|
|
100
|
+
"./screen/lib/document/style-fields",
|
|
99
101
|
"./screen/lib/document/box-fields",
|
|
100
102
|
"./screen/lib/document/device-fields",
|
|
101
103
|
"./screen/lib/document/field-buckets",
|
|
102
104
|
"./screen/lib/document/field-markers",
|
|
105
|
+
"./screen/lib/document/image-fields",
|
|
103
106
|
"./screen/lib/document/palette-sections",
|
|
104
107
|
"./screen/lib/document/panel-fields",
|
|
105
108
|
"./screen/lib/document/panel-no-control-mark",
|
|
@@ -435,6 +438,16 @@
|
|
|
435
438
|
"import": "./dist/screen/lib/document/content-tree.js",
|
|
436
439
|
"default": "./dist/screen/lib/document/content-tree.js"
|
|
437
440
|
},
|
|
441
|
+
"./screen/lib/document/button-fields": {
|
|
442
|
+
"types": "./dist/screen/lib/document/button-fields.d.ts",
|
|
443
|
+
"import": "./dist/screen/lib/document/button-fields.js",
|
|
444
|
+
"default": "./dist/screen/lib/document/button-fields.js"
|
|
445
|
+
},
|
|
446
|
+
"./screen/lib/document/style-fields": {
|
|
447
|
+
"types": "./dist/screen/lib/document/style-fields.d.ts",
|
|
448
|
+
"import": "./dist/screen/lib/document/style-fields.js",
|
|
449
|
+
"default": "./dist/screen/lib/document/style-fields.js"
|
|
450
|
+
},
|
|
438
451
|
"./screen/lib/document/block-set-host": {
|
|
439
452
|
"types": "./dist/screen/lib/document/block-set-host.d.ts",
|
|
440
453
|
"import": "./dist/screen/lib/document/block-set-host.js",
|
|
@@ -445,6 +458,11 @@
|
|
|
445
458
|
"import": "./dist/screen/lib/document/box-fields.js",
|
|
446
459
|
"default": "./dist/screen/lib/document/box-fields.js"
|
|
447
460
|
},
|
|
461
|
+
"./screen/lib/document/image-fields": {
|
|
462
|
+
"types": "./dist/screen/lib/document/image-fields.d.ts",
|
|
463
|
+
"import": "./dist/screen/lib/document/image-fields.js",
|
|
464
|
+
"default": "./dist/screen/lib/document/image-fields.js"
|
|
465
|
+
},
|
|
448
466
|
"./screen/lib/document/device-fields": {
|
|
449
467
|
"types": "./dist/screen/lib/document/device-fields.d.ts",
|
|
450
468
|
"import": "./dist/screen/lib/document/device-fields.js",
|
package/dist/chunk-ERB6FAZT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{routeSharedHostMessage as e}from"./chunk-QZJKWKGH.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GR3XRILS.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-6ATIYLUL.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-KO47WAWR.js";import{useAdminBridge as l}from"./chunk-NQW6XCAY.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-YM4UEGBV.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-SNF5764Q.js";import{useEaselHost as k}from"./chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-S6YOIRXQ.js";import{useAutosave as g}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as b,CLAIM_FAIL_OPEN_MS as S,holderOf as I}from"./chunk-YYD257TD.js";import{useWords as P}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as E,useMemo as B,useCallback as T,useEffect as A,useRef as C}from"react";import{jsx as H}from"react/jsx-runtime";var L={content:[],root:{},zones:{}};var O=j(null);function D(){const e=R(O);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function N({target:j,addressing:R=o,onHostMessage:D,children:N}){const Y=R,{homeSlug:F,entryMayBounce:M,entryBounce:W,onSwitch:K,tellsHost:U,adapterFor:V,migrateRenamedProps:X,describeMissing:G,onLoadFailed:Q}=Y,[x,Z]=E(j),z=k(),J=d(),_=B(()=>f(J),[J]),q=B(()=>t(J),[J]),$="template"===x.kind,ee="template"===x.kind?x.id:null,re="template"===x.kind?x.pageSlug??F??"":"document"===x.kind?x.slug??"":x.slug,ne="page"===x.kind?x.siteId??null:null,te=J.blocks,oe=B(()=>V(x,_,te),[V,_,te,x.kind,"template"===x.kind?x.id:"document"===x.kind?x.record:x.siteId]),ue=oe.capabilities,ae=T(e=>J.documentHooks?.stored?.(e)??e,[J]);A(()=>{m(J,ne)},[J,ne]);const se=C(x);A(()=>{se.current=x},[x]);const{token:ie,tokenRef:le,capabilities:ce}=l({onMessage:r=>{if(D?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Er(e.target)}}}),de=!J.usesBridgedToken||null!==ie,fe=oe.lock,me=Boolean(_.lock),[ke,ve]=E(null),[ge,pe]=E(null),[he,ye]=E(null),[we,be]=E(null),Se=P("screen",v),Ie=we?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(we,Se):null,[Pe,je]=E(null),Re=C(null),Ee=C(null),[Be,Te]=E(!1),Ae=C(null),[Ce,He]=E(null),Le=C(null),[Oe,De]=E(null),[Ne,Ye]=E(!1),Fe=C(null);A(()=>{Fe.current=Oe},[Oe]);const[Me,We]=E(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Ke=C(Me);A(()=>{Ke.current=Me},[Me]);const Ue=C(()=>Promise.resolve(!1)),Ve=T(e=>{Ee.current=e,Te(!0)},[]),Xe=g({save:async({id:e,data:r})=>{if(p(Ke.current)){if(!await Ue.current(e,r)){if(!p(Ke.current))return void Ve({id:e,data:r});throw new Error("page save did not land")}}else Ve({id:e,data:r})},onFailure:(e,r)=>{0===r&&z.send("storefront-editor:save-failed")}}),{state:Ge,push:Qe,flush:xe,pause:Ze,resume:ze,stop:Je,reset:_e,retryNow:qe,hasPending:$e}=Xe,er=C(Ge);A(()=>{er.current=Ge},[Ge]);const rr=u(Ge),nr=T(()=>{const e=Ee.current;e&&(Ee.current=null,Te(!1),Qe(e))},[Qe]),tr=C("");tr.current||(tr.current=h());const[or,ur]=E(0),ar=C(!1),[sr,ir]=E(M(j)),lr=C(!1);A(()=>{if(lr.current)return;lr.current=!0;const e=z.address.search(),r=W(j,e);r?z.address.load(r):M(j)&&ir(!1)},[j,z]);const cr=z.send;A(()=>{if(!de)return;let e=!1;const t=se.current,o=oe.resolve(re),u=J.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==F&&re!==F?void z.address.load({kind:"page",slug:F,siteId:ne??void 0}):(be({target:t,slug:re,missing:!0,sentence:G?.(t)??null}),void Q?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;Re.current=n,je(n),ve(r.id),pe(r.kind??null),Le.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:L,s=X(a),i=u?await u(s):s;e||ye(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),be({target:t,slug:re,missing:!1,sentence:n(o,{slug:re},J),cause:r(o,J)}),Q?.(t,o))}),()=>{e=!0}},[de,ie,$,oe,re]);const dr=T(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=le.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),fr=T(async e=>{const r=le.current;if(!r&&J.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,J)){cr("storefront-editor:auth-expired");const n=r?await dr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[cr,dr,J]),mr=T(async e=>{const r=le.current?await fr(e):{ok:!1};return r.ok||cr("storefront-editor:save-failed"),r.ok},[cr,fr]),kr=T(async(e,r,n=!1)=>{if(null!==Re.current)return!1;if(!p(Ke.current))return!1;if(Fe.current)return!1;const t=await fr(()=>oe.saveLayout(e,r,Le.current,tr.current));if(t.ok)return Le.current=t.value.version??Le.current,Ye(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Ke.current=e,We(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await fr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Le.current=n.value,Ue.current(e,r,!0)}Je(),Fe.current=u,De(u)}return Ye(i(t.error,J)?.status===c),!1},[oe,fr,Je,J]);A(()=>{Ue.current=kr},[kr]);const vr=T(e=>{if(null!==Re.current)return;if(cr("storefront-editor:dirty"),!ke)return;const r=ae(e);Ae.current=r,p(Ke.current)?Qe({id:ke,data:r}):Ve({id:ke,data:r})},[ke,cr,Ve,Qe,ae]),gr=T(async()=>{p(Ke.current)&&nr();return await xe()&&null==Ee.current},[nr,xe]),pr=C(gr);A(()=>{pr.current=gr},[gr]);const hr=C(fr);A(()=>{hr.current=fr},[fr]);const yr=T(()=>{z.address.reload()},[z]),wr=C(()=>Promise.resolve(!1));A(()=>{wr.current=()=>{const e=oe.rereadVersion;return ke&&e?y({ours:Le.current,stored:async()=>{const r=await hr.current(()=>e(ke));return r.ok?r.value:null},hasPending:()=>null!=Ee.current||$e(),reload:yr}):Promise.resolve(!1)}},[oe,ke,$e,yr]);const br=null!==Pe;A(()=>{if(!fe||!ke||!de||br)return;let e=!1,r=null,n=null;const t=tr.current,o={claim:async e=>{const r=await hr.current(()=>fe.claim(ke,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Ke.current,heldWrite:()=>({pending:null!=Ee.current||$e(),autoSaveEnabled:!er.current.paused,saveConflict:null!=Fe.current}),setAccess:e=>{Ke.current=e,We(e)},releaseHeldWrite:()=>{pr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{wr.current()}},u=q.makeClaimBeat(o),a=ar.current;return ar.current=!1,a||(We({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(b)},S)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),fe.release(ke,t).catch(()=>{})}},[ke,fe,de,ie,or,br]);const Sr=T(()=>{fe&&ke&&(ar.current=!0,ur(e=>e+1))},[ke,fe]),Ir=T(()=>{We(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Pr=T(()=>{er.current.paused?(p(Ke.current)&&nr(),ze()):Ze()},[nr,Ze,ze]),jr=T(()=>{qe()},[qe]),Rr=T(e=>{Ae.current=null,a("template"!==e.kind&&me,{resetAutosave:()=>{_e(),Ee.current=null,Te(!1)},setVersion:e=>{Le.current=e},setSaveConflict:De,setAccess:We}),K(e),Z(e),Re.current=null,je(null),ve(null),pe(null),ye(null),be(null),z.address.show(e),"document"!==e.kind&&U(e)&&z.send("storefront-editor:navigated",{target:e})},[_e,z,me,K,U]),Er=T(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,se.current,F))return;const r=null!=Ee.current;if(!r&&!$e())return void Rr(e);const n=er.current;r||n.paused||n.failed||n.stopped?He(e):xe().then(r=>{r?Rr(e):He(e)})},[Rr,$e,xe,F]),Br=T(()=>He(null),[]),Tr=T(()=>{He(e=>(e&&Rr(e),null))},[Rr]),Ar=T(async()=>{const e=Ce;if(!e)return;await gr()&&(He(null),Rr(e))},[Ce,gr,Rr]),Cr=T(async e=>{if(null!==Re.current)return;if(!ke)return;if(!p(Ke.current)||Fe.current)return;const r=ae(e);if(!await kr(ke,r))return void(Fe.current||cr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void cr("storefront-editor:saved");const t=await fr(()=>n(ke,Le.current??void 0));if(!t.ok){const{error:e}=t;return void cr("storefront-editor:publish-failed",{reason:e instanceof Error&&e.message?e.message:null})}Le.current=t.value.version??Le.current,cr("storefront-editor:published")},[ke,oe,ue.canPublish,cr,kr,fr,ae]);/* @__PURE__ */
|
|
2
|
-
return H(O.Provider,{value:{target:x,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:ge,siteId:ne,ready:de,token:ie,tokenRef:le,notifyParent:cr,bridgeCapabilities:ce,runAuthed:mr,docId:ke,data:he,getLiveData:()=>Ae.current??he,error:Ie,redirecting:sr,saveStatus:rr,saveState:Ge,autoSaveEnabled:!Ge.paused,autoSaveStoppedByConflict:Ge.stopped,hasUnsavedEdits:Ge.pending||Be,toggleAutoSave:Pr,retrySave:jr,onChange:vr,flushSave:gr,onPublish:Cr,access:Me,readOnly:null!==I(Me)||null!==Pe||null!==Oe,readOnlyReason:Pe,takeOverEditing:Sr,viewReadOnly:Ir,saveConflict:Oe,saveUnreachable:Ne,reloadFromServer:yr,navigate:Er,pendingNav:Ce,cancelPendingNav:Br,discardAndNavigate:Tr,saveAndNavigate:Ar},children:N})}export{O as ScreenDocumentContext,N as ScreenDocumentProvider,D as useScreenDocument};
|
package/dist/chunk-H6BER2EU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DESIGN_GROUP_KEY as t,BUCKET_KEY as o}from"./chunk-3QB2ZQXK.js";import{panelFieldsOf as n}from"./chunk-5XL2RXFU.js";import{withoutDeviceGate as e}from"./chunk-OXOUGEAT.js";import{STYLE_KIND as r,fieldKind as s,copyStyle as c,heldStyle as i,planPaste as p,pasteMessage as u}from"./chunk-CWELHADJ.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as a,MEDIA_FIELD_MARKER as l,TEXT_FIELD_MARKER as m,LINK_FIELD_MARKER as h}from"./chunk-ANPOR6EY.js";import{deviceMetaOf as y}from"./chunk-YCSZAP7T.js";var j=/* @__PURE__ */new Set([t.Size,t.Design,t.Layout,t.Position]),w=new Set(Object.values(t)),b=new Set(Object.values(o)),S=new Set(f),k=/* @__PURE__ */new Set(["focal","imageFocal"]),g=[l,m,h];function A(t){return`site:${t??""}`}function O(t){if(!t||"object"!=typeof t)return null;const o=t,n=e(t)??t,c=o[r]??n[r];if("string"==typeof c)return c;const i=o.options??n.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return s(n)}function v(t){const o=t,n=e(t);return g.some(t=>t in o||n&&t in n)}function L(t,e){const r=n(t,e)??{},s=[];let c=!0,i=!1;for(const[t,n]of Object.entries(r))b.has(t)?(c=t===o.Design,i=!1):w.has(t)?c&&(i=j.has(t)):i&&n&&"object"==typeof n&&!t.startsWith("_")&&(a(n)||S.has(t)||k.has(t)||v(n)||"slot"!==n.type&&s.push({path:[t],kind:O(n),counted:"mobile"!==y(n)?.tier}));return s}function X(t,o,n,e,r){c({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function d(t,o,n,e,r,s){const c=i(n);if(!c)return null;const f=p(c,{type:e.type,rows:t(o,e),props:e.props});return{...f,message:u(f,c.sourceLabel,r,s)}}function D(t,o,n,e){X(L,t,o,n,e)}function E(t,o,n,e,r){return d(L,t,o,n,e,r)}var P={scope:t=>A(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,e)=>D(e,t,o,n),plan:(t,o,n,e)=>E(e,t,o,n)};function C(t,o){if(!t&&!o)return P;const n=t?.rows,e=n?(t,o)=>n(t,o):L;return{scope:t?.scope??P.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>X(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>d(e,s,t,n,r,o))}}export{D as copyNodeStyle,L as nodeStyleRows,E as planNodePaste,O as shopFieldKind,A as siteStyleScope,C as styleClipboardOf};
|
package/dist/chunk-KVIEUWTX.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{SettingsDefaultReset as e,sidesStartEach as n,SidesInput as t,SidesEachToggle as o}from"./chunk-SC6E3UUS.js";import{deviceField as l}from"./chunk-OXOUGEAT.js";import{noControlField as a,NoControlMark as i}from"./chunk-22I55W37.js";import{describedAs as r}from"./chunk-LX23TCTP.js";import{withStyleKind as u}from"./chunk-CWELHADJ.js";import{phoneKey as s}from"./chunk-E52W3M5I.js";import{foldMetaOf as c,FOLD_FIELD_MARKER as d}from"./chunk-ANPOR6EY.js";import{useEasel as p,useSelectedHost as f,useEaselApi as m}from"./chunk-BBD3FLU3.js";import{DEFAULT_PANEL_WORDS as b}from"./chunk-KFV7N2DJ.js";import{SettingsSwitch as h}from"./chunk-OECWLNKJ.js";import{FieldSelect as g}from"./chunk-KFWNGPW3.js";import{SettingsField as v}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as y}from"./chunk-DX3VILZ3.js";import{useWords as k}from"./chunk-MFIRYGHW.js";import{useState as C}from"react";import{AlignmentIcon as w,BoxJustifyIcon as x,WrapIcon as j,GapIcon as F,WidthIcon as L,PlacementIcon as O,NudgeIcon as S,DesktopIcon as E,BoxXEndIcon as P,BoxXCenterIcon as I,BoxXStartIcon as B,PaddingAllIcon as A,BoxYBetweenIcon as K,BoxYStretchIcon as W,BoxYEndIcon as M,BoxYCenterIcon as N,BoxYStartIcon as G,BoxXBetweenIcon as R,BoxXStretchIcon as T,BoxItemAlignmentIcon as V}from"efficient-shell/icons/efficient";import{Slider as D,textAlignOptions as $,AlignmentGrid as J,PositionInput as U}from"efficient-shell/ui";import{jsx as X,Fragment as _,jsxs as z}from"react/jsx-runtime";var Y=e=>e;function H(){return null}function Z(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
|
|
2
|
-
return X(H,{},e)}function q(e){return e.type===H}function Q(e){return q(e)?void 0:e}function ee(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!c(t)&&u(t,`section:${n}`);return e}function ne(e,n){return{type:"custom",[d]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */X(_,{})}}function te(e){return ne(e,2)}function oe(e){return ne(e,1)}var le=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],ae=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],ie="Wrap",re=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],ue="Direction",se=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],ce={min:-32,max:64,step:2,builtIn:0},de={min:30,max:100,step:5,fallback:60},pe=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],fe="bottom-left",me={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},be=pe.map(e=>({value:e,label:me[e]}));function he(e,n=fe){return pe.includes(e)?e:n}var ge=40,ve=e=>"number"==typeof e?e:null;function ye(e,n,t){const o={};for(const l of["x","y"])t[l]!==n[l]&&(o[e[l]]=t[l]??void 0);return o}var ke=["top","right","bottom","left"],Ce={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},we=e=>"number"==typeof e?e:null;function xe(e,n,t){const o={};for(const l of ke)t[l]!==n[l]&&(o[e[l]]=t[l]??void 0);return o}function je(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(ke.map(e=>[e,we(n[e])]))}function Fe(e){const n={};for(const t of ke)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}var Le={fieldKey:s,ownField:!0,read:(e,n)=>e[s(n)],write:(e,n,t)=>({[s(n)]:t})};function Oe(e){const n=n=>{const t=n[e];return t&&"object"==typeof t?t:{}};return{fieldKey:n=>`_${e}_${n}`,read:(e,t)=>n(e)[t],write:(t,o,l)=>{const a={...n(t)};return void 0===l?delete a[o]:a[o]=l,{[e]:Object.keys(a).length?a:void 0}}}}function Se({row:e,desktopKey:n,access:t,props:o}){const l=f(),a=function(){try{return m()}catch{return null}}(),i=l?.values??{},r=i[n];if(t.ownField)return e.render({...o,follows:r});const u=t.read(i,n);return e.render({...o,value:u,storedValue:u,follows:r,onChange:e=>{if(!l)return;const o=a?.getState(),r=o?"root"===l.id?o.appState.data.root.props:o.getItemById(l.id)?.props:void 0;l.onChangeMany(t.write(r??i,n,e))}})}function Ee(e,n,t=Le){const o={...n,render:o=>/* @__PURE__ */X(Se,{row:n,desktopKey:e,access:t,props:o})};return{[e]:l("desktop",n),[t.fieldKey(e)]:l("mobile",o)}}var Pe=["left","center","right"];function Ie(e,{options:n,value:t,onChange:o,ariaLabel:l,disabled:a=!1}){/* @__PURE__ */
|
|
3
|
-
return X(y,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:o,ariaLabel:e(l),disabled:a})}function Be(e,{label:n,value:t,onChange:o,points:l}){const a=l.find(e=>e.disabled),i=l.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
|
|
4
|
-
return X(v,{label:e(n),icon:/* @__PURE__ */X(O,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */X(J,{label:e(n),value:t,points:i,onChange:o})})}function Ae({say:e,label:n,value:t,onChange:o,pointsFor:l}){const{appState:a,selectedItem:i}=p(e=>e),r=i?.props?.id?String(i.props.id):void 0;return Be(e,{label:n,value:t,onChange:o,points:l(a?.data,r)})}function Ke({say:n,o:t}){const o=f(),l=k("panel",b),a=o?.values??{},i={x:ve(a[t.keys.x]),y:ve(a[t.keys.y])},r=n(t.label??"Position"),u=Boolean(i.x||i.y),s=e=>{const n=ye(t.keys,i,e);Object.keys(n).length&&o?.onChangeMany(n)},c=/* @__PURE__ */X(U,{label:r,value:i,onChange:s,words:{x:n("Left and right"),y:n("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:t.min,max:t.max,step:t.step??1}),d=/* @__PURE__ */X(e,{words:l,label:r,changed:u,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return null===t.label?/* @__PURE__ */z("div",{className:"sf-position-line",children:[c,d]}):/* @__PURE__ */X(v,{label:r,icon:/* @__PURE__ */X(S,{}),changed:u,action:d,children:c})}var We={x:{start:/* @__PURE__ */X(B,{}),center:/* @__PURE__ */X(I,{}),end:/* @__PURE__ */X(P,{}),stretch:/* @__PURE__ */X(T,{}),between:/* @__PURE__ */X(R,{})},y:{start:/* @__PURE__ */X(G,{}),center:/* @__PURE__ */X(N,{}),end:/* @__PURE__ */X(M,{}),stretch:/* @__PURE__ */X(W,{}),between:/* @__PURE__ */X(K,{})}},Me=e=>"row"===e?"row":"column";function Ne({say:e,kind:n,label:t,options:o,value:l,onChange:a,o:i}){const r=f(),u="justify"===n==("row"===(i.runs??Me)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return Ie(e,{options:o.map(e=>({label:e.label,value:e.value,picture:We[u][e.value]})),value:l,onChange:a,ariaLabel:t})}function Ge({say:e,tier:n,o:t}){const o=f(),l=o?.values??{},a="mobile"===n?t.phoneKeys:t.keys,i=Object.fromEntries(ke.map(e=>[e,we(l[a[e]])])),r="mobile"===n?Object.fromEntries(ke.map(e=>[e,we(l[t.keys[e]])])):null;/* @__PURE__ */
|
|
5
|
-
return X(Te,{say:e,o:t,value:i,follows:r,onChange:e=>{const n=xe(a,i,e);Object.keys(n).length&&o?.onChangeMany(n)}})}function Re({say:e,o:n,props:t}){/* @__PURE__ */
|
|
6
|
-
return X(Te,{say:e,o:n,value:je(t.value),follows:"follows"in t?je(t.follows):null,readOnly:t.readOnly,onChange:e=>t.onChange(Fe(e))})}function Te({say:e,o:l,value:a,follows:i,readOnly:r,onChange:u}){const s=Object.fromEntries(ke.map(e=>[e,String(i?.[e]??l.fallback[e])])),[c,d]=C(()=>n(a,s));/* @__PURE__ */
|
|
7
|
-
return X(v,{label:e("Padding"),icon:/* @__PURE__ */X(A,{}),action:/* @__PURE__ */X(o,{each:c,label:e("Each side"),onChange:d,disabled:r}),children:/* @__PURE__ */X(t,{label:e("Padding"),each:c,value:a,placeholder:s,min:l.min,max:l.max,step:l.step,readOnly:r,onChange:u,words:{sides:{top:e("Padding top"),right:e("Padding right"),bottom:e("Padding bottom"),left:e("Padding left")},vertical:e("Top and bottom"),horizontal:e("Left and right"),unit:"px"}})})}function Ve(n=Y){function t(t,o,l,a,i,u,s="",c){const d="function"==typeof c?{action:c}:c??{},{action:p,clear:f}=d;return{type:"custom",...r({},{type:"number",label:t}),render:r=>{const c="storedValue"in r?r.storedValue:r.value,m="follows"in r,b=m||void 0!==f,h="number"==typeof r.value,g=m&&"number"==typeof r.follows?r.follows:void 0===f?u:"function"==typeof f.hint?f.hint(r):f.hint,y=h?r.value:b?null:u,k=""===s||"px"===s?s:` ${s}`,C=!f?.emptyLabel||m&&"number"==typeof r.follows?void 0:f.emptyLabel,w=C??`${g}${k}`,x=m?n("{value} on desktop").replace("{value}",w):w,j=!0===r.readOnly;/* @__PURE__ */
|
|
8
|
-
return X(v,{label:n(t),icon:Q(o),action:b?/* @__PURE__ */X(e,{label:n(t),changed:h,detail:x,disabled:j,onReset:()=>r.onChange(void 0)}):p?p(c,r.onChange):void 0,children:/* @__PURE__ */X("div",{className:"sf-slider",children:/* @__PURE__ */X(D,{min:l,max:a,step:i,value:y,suffix:s||void 0,showInput:!0,label:n(t),disabled:j,...b?{placeholderValue:g}:{},...C?{emptyLabel:C}:{},...void 0!==d.inputMax?{inputMax:d.inputMax}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?b&&h&&r.onChange(void 0):e!==y&&r.onChange(e)}})})})}}}function o(e){return Ie(n,e)}function u(e,t,l,a){const i=l.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...r({},{type:"radio",label:e,options:i.map(e=>({value:e.value,label:e.label}))}),render:({value:l,onChange:r,field:u})=>/* @__PURE__ */X(v,{label:n(e),icon:Q(t),children:o({options:i,value:i.some(e=>e.value===l)?l:l||u?.currentValue||a,onChange:r,ariaLabel:e})})}}function c(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */X(E,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function d(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function p(e,n,t){return{[e]:l("desktop",n(t)),[s(e)]:l("mobile",n({...t,phone:!0},""))}}function f(e){return c($(e.allow??Pe).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function m(e={},n=e.fallback??"left"){return d(u(e.label??"Text alignment",/* @__PURE__ */X(w,{}),f(e),n),e)}function b(e){const n={left:We.x.start,center:We.x.center,right:We.x.end};return c($((e.allow??Pe).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function y(e={},n=e.fallback??"left"){return d(u(e.label??"Block alignment",/* @__PURE__ */X(x,{}),b(e),n),e)}function k(e,t,o,l,a,i){return{type:"custom",options:l,fallback:a,...r({},{type:"radio",label:t,options:l.map(e=>({value:e.value,label:e.label}))}),render:({value:r,onChange:u,field:s})=>{const c=s.options??l,d=s.fallback??a,p=c.some(e=>e.value===r)?r:d;/* @__PURE__ */
|
|
9
|
-
return X(v,{label:n(t),icon:Q(o),children:/* @__PURE__ */X(Ne,{say:n,kind:e,label:t,options:c,value:p,onChange:u,o:i})})}}}function C(e={}){return k("justify","Justify",/* @__PURE__ */X(x,{}),le,le[0].value,e)}function O(e={}){return k("align","Item alignment",/* @__PURE__ */X(V,{}),ae,"stretch",e)}function S(){const e=ie;return{type:"custom",options:re,fallback:re[1].value,...r({},{type:"radio",label:e,options:re.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:o,id:l,name:a})=>{const i=`${l??a??e}-label`;/* @__PURE__ */
|
|
10
|
-
return X(v,{label:n(e),labelId:i,icon:/* @__PURE__ */X(j,{}),action:/* @__PURE__ */X(h,{checked:(r=t,!0===r||"wrap"===r),onChange:e=>o(e?re[0].value:re[1].value),ariaLabelledBy:i})});var r}}}function P({offered:e,fallback:n,resolve:t}){const o=t??(t=>e.some(e=>e.value===t)?t:n),l=u(ue,Z("`Direction` names how a container’s children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; the shell’s own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),e.map(e=>({label:e.label,value:e.value})),o(void 0));return{type:"custom",render:e=>l.render({...e,value:o(e.value),onChange:n=>e.onChange(n)})}}function I({min:e,max:n,step:o,builtIn:l,resolve:a,action:i,mark:r}){const u=t("Gap",/* @__PURE__ */X(F,{}),e,n,o,l,"px",i),s=a??(e=>"number"==typeof e?e:l);return{...r,type:"custom",render:e=>u.render({...e,value:s(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function B(e,{fallback:t=fe,pointsFor:o}={}){return{type:"custom",render:({value:l,onChange:a})=>{const i=he(l,t);return o?/* @__PURE__ */X(Ae,{say:n,label:e,value:i,onChange:a,pointsFor:o}):Be(n,{label:e,value:i,onChange:a,points:be})}}}function A(e){return{[e.keys.x]:{type:"custom",render:()=>/* @__PURE__ */X(Ke,{say:n,o:e})},[e.keys.y]:{...a({type:"custom",render:()=>/* @__PURE__ */X(i,{})},"always"),reachedBy:e.keys.x}}}function K(e={}){const t={...Ce,...e.keys},o={keys:t,phoneKeys:Object.fromEntries(ke.map(e=>[e,s(t[e])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},r=!1!==e.phone,u=!1===e.group?{}:{_gSpacing:te("Padding")};if(e.object){const t={type:"custom",render:e=>/* @__PURE__ */X(Re,{say:n,o:o,props:e})};return ee({...u,...r?Ee(e.object.key,t,e.object.phone):{[e.object.key]:t}})}const c=e=>{const t={type:"custom",render:()=>/* @__PURE__ */X(Ge,{say:n,tier:e,o:o})};return r?l(e,t):t},d=()=>a({type:"custom",render:()=>/* @__PURE__ */X(i,{})},"always"),p=ke.filter(e=>"top"!==e);return ee({...u,[o.keys.top]:c("desktop"),...r?{[o.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[o.keys[e],{...d(),reachedBy:o.keys.top}])),...r?Object.fromEntries(p.map(e=>[o.phoneKeys[e],l("mobile",d())])):{}})}return{slider:t,select:function(e,t,o,l,a){return{type:"custom",options:o,fallback:l,...a?{note:a}:{},...r({},{type:"select",label:e}),render:({value:i,onChange:r,field:u})=>{const s=u.options??o,c=u.fallback??l,d=s.some(e=>e.value===i)?i:c;/* @__PURE__ */
|
|
11
|
-
return X(v,{label:n(e),icon:Q(t),children:/* @__PURE__ */X(g,{value:d,ariaLabel:n(e),onChange:r,options:[...a?[{label:n(a),value:"\0note",disabled:!0}]:[],...s.map(e=>({label:n(e.label),value:e.value}))]})})}}},Segmented:o,segmented:u,boxJustifyField:C,boxAlignField:O,boxWrapField:S,directionField:P,gapField:I,placementField:B,PlacementGridView:function(e){return Be(n,e)},positionFields:A,sidesPaddingFields:K,alignmentField:m,alignmentFields:function(e="align",n={}){return p(e,m,n)},AlignmentStrip:function({opts:e={},value:n,onChange:t,ariaLabel:l,disabled:a=!1}){return o({options:f(e),value:n,onChange:t,ariaLabel:l,disabled:a})},blockAlignmentField:y,blockAlignmentFields:function(e="align",n={}){return p(e,y,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:t,ariaLabel:l,disabled:a=!1}){return o({options:b(e),value:n,onChange:t,ariaLabel:l,disabled:a})},boxFieldSet:function(e={}){const n=e.width??de,o=e.nudge?.limit??40,l=e.direction??{offered:se,fallback:"column"},a=l.resolve??(e=>l.offered.some(n=>n.value===e)?e:l.fallback),i={runs:e=>"row"===a(e)?"row":"column"};return{_gLayout:te("Layout"),placement:B("Placement",e.placement),width:t("Width",/* @__PURE__ */X(L,{}),n.min,n.max,n.step,n.fallback,"%"),direction:P(l),gap:I(e.gap??ce),justify:C(i),align:O(i),wrap:S(),_gNudge:te("Nudge"),...A({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-o,max:o,label:null}),...K(e.padding)}}}}var{slider:De,select:$e,Segmented:Je,segmented:Ue,boxJustifyField:Xe,boxAlignField:_e,boxWrapField:ze,directionField:Ye,gapField:He,placementField:Ze,PlacementGridView:qe,positionFields:Qe,sidesPaddingFields:en,alignmentField:nn,alignmentFields:tn,AlignmentStrip:on,blockAlignmentField:ln,blockAlignmentFields:an,BlockAlignmentStrip:rn,boxFieldSet:un}=Ve();export{me as ANCHOR_LABELS,on as AlignmentStrip,ae as BOX_ALIGN_POINTS,se as BOX_DIRECTIONS,ue as BOX_DIRECTION_LABEL,ce as BOX_GAP,le as BOX_JUSTIFY_POINTS,ge as BOX_NUDGE_LIMIT,pe as BOX_PLACEMENTS,fe as BOX_PLACEMENT_DEFAULT,de as BOX_WIDTH,ie as BOX_WRAP_LABEL,re as BOX_WRAP_POINTS,rn as BlockAlignmentStrip,be as OPEN_PLACEMENT_POINTS,Le as PHONE_KEY_ACCESS,qe as PlacementGridView,Ce as SIDE_PAD_KEYS,Je as Segmented,nn as alignmentField,tn as alignmentFields,ln as blockAlignmentField,an as blockAlignmentFields,_e as boxAlignField,Ve as boxFieldBuilders,un as boxFieldSet,Xe as boxJustifyField,ze as boxWrapField,Ye as directionField,He as gapField,te as group,Q as iconOf,q as isNoGlyph,Z as noGlyph,he as normaliseBoxPlacement,Oe as phoneObjectAccess,Ee as phoneTwinFields,Ze as placementField,Qe as positionFields,ye as positionPatch,oe as section,Ue as segmented,$e as select,ee as sharedStyleKinds,je as sidesFromObject,en as sidesPaddingFields,xe as sidesPaddingPatch,Fe as sidesToObject,De as slider};
|
package/dist/chunk-OFBZOI6W.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={colour:{notSet:"Not set",swatch:({label:e,shown:t})=>`${e}: ${t}`,dialog:({label:e})=>`${e} colour`,theme:"Theme colours",themeSwatchTitle:({name:e,hex:t})=>`${e} · ${t}`,themeSwatch:({name:e,hex:t})=>`${e} ${t}`,square:"Saturation and brightness",squareValue:({saturation:e,brightness:t})=>`Saturation ${e}, brightness ${t}`,hue:"Hue",hex:({label:e})=>`${e} hex code`}};export{e as DEFAULT_PICK_WORDS};
|
package/dist/chunk-SC6E3UUS.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_PANEL_WORDS as e}from"./chunk-KFV7N2DJ.js";import{SettingsField as l}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as n}from"./chunk-DX3VILZ3.js";import{AccordionHeading as a,SettingReset as i,Tooltip as t,Button as s,toast as d}from"efficient-shell/ui";export{AlignmentGrid,BorderInput,CornersInput,SidesEachToggle,SidesInput,borderSides,borderStartEach,sidesStartEach}from"efficient-shell/ui";import{jsx as o,jsxs as c,Fragment as r}from"react/jsx-runtime";import{BackgroundIcon as u,WidthIcon as b}from"efficient-shell/icons/efficient";function h({title:e,level:l=3,id:n,className:i}){/* @__PURE__ */
|
|
2
|
-
return o(a,{title:e,level:l,id:n,className:i?`es-panel-band ${i}`:"es-panel-band"})}function m({title:e,level:l=4,id:n,className:i}){/* @__PURE__ */
|
|
3
|
-
return o(a,{tier:"row",title:e,level:l,id:n,className:i})}function f({label:l,changed:n,onReset:a,detail:t,disabled:s,defaultAction:d,words:c,className:r}){const u={...e,...c},b=u.resetName({label:l});/* @__PURE__ */
|
|
4
|
-
return o(i,{label:l,changed:n,onReset:a,detail:t,disabled:s,defaultAction:d,name:b,tip:t?u.resetTitle({label:l,detail:t}):b,className:r})}function p({name:e,preview:l,offPage:n,status:a,onOpen:i,id:s,className:d}){const u=null!=l;/* @__PURE__ */
|
|
5
|
-
return c("button",{type:"button",id:s,className:d?`es-drill ${d}`:"es-drill",onClick:i,children:[
|
|
6
|
-
/* @__PURE__ */c(t,{content:u?/* @__PURE__ */c(r,{children:[e,
|
|
7
|
-
/* @__PURE__ */o("br",{}),l]}):e,describe:!1,className:"es-drill-text",children:[
|
|
8
|
-
/* @__PURE__ */o("span",{className:"es-drill-name",children:e}),u?/* @__PURE__ */o("span",{className:n?"es-drill-preview is-offpage":"es-drill-preview",children:l}):null]}),a?/* @__PURE__ */o("span",{className:"es-drill-status",children:a}):null,
|
|
9
|
-
/* @__PURE__ */o("span",{className:"es-drill-chev","aria-hidden":"true"})]})}function N({label:e,onPress:l,disabled:n,note:a,doneLabel:i,icon:t,id:r,className:u}){const b=null!=a,h=b&&r?`${r}-note`:void 0;/* @__PURE__ */
|
|
10
|
-
return c("div",{className:u?`es-action-wrap ${u}`:"es-action-wrap",children:[
|
|
11
|
-
/* @__PURE__ */o(s,{variant:"secondary",size:"lg",block:!0,id:r,disabled:n,"aria-describedby":h,onClick:()=>{const e=l();e&&"function"==typeof e.then?e.then(()=>{d.success(i)}):d.success(i)},leftIcon:t?/* @__PURE__ */o("span",{className:"es-action-icon","aria-hidden":"true",children:t}):void 0,children:/* @__PURE__ */o("span",{className:"es-action-label",children:e})}),b?/* @__PURE__ */o("p",{id:h,className:"es-action-note",children:a}):null]})}var v=["full","content"],g={label:"Background",full:"Full width",content:"Content width"};function w({value:e,changed:a,detail:i,onChange:t,onReset:s,disabled:d=!1,hint:c,labelId:r,words:b,resetWords:h}){const m={...g,...b};/* @__PURE__ */
|
|
12
|
-
return o(l,{label:m.label,labelId:r,icon:/* @__PURE__ */o(u,{}),changed:a,hint:c,action:/* @__PURE__ */o(f,{words:h,label:m.label,changed:a,detail:i,onReset:s}),children:/* @__PURE__ */o(n,{options:v.map(e=>({id:e,label:"full"===e?m.full:m.content})),value:e,onChange:t,ariaLabel:m.label,disabled:d})})}var C={label:"Content",full:"Full width",content:"Content width"};function I({mode:e,onMode:a,number:i,changed:t,detail:s,onReset:d,fullClosed:r=!1,disabled:u=!1,hint:h,labelId:m,words:p,resetWords:N}){const g={...C,...p},w=void 0!==e&&a?/* @__PURE__ */o(n,{options:v.map(e=>({id:e,label:"full"===e?g.full:g.content,disabled:"full"===e&&r})),value:e,onChange:a,ariaLabel:g.label,disabled:u}):null;/* @__PURE__ */
|
|
13
|
-
return o(l,{label:g.label,labelId:m,icon:/* @__PURE__ */o(b,{}),changed:t,hint:h,action:/* @__PURE__ */o(f,{words:N,label:g.label,changed:t,detail:s,onReset:d}),children:w&&i?/* @__PURE__ */c("div",{className:"es-width-stack",children:[w,i]}):w??i??null})}export{v as BACKGROUND_WIDTHS,g as DEFAULT_BACKGROUND_WIDTH_WORDS,C as DEFAULT_CONTENT_WIDTH_WORDS,N as SettingsAction,w as SettingsBackgroundWidth,I as SettingsContentWidth,f as SettingsDefaultReset,p as SettingsDrill,h as SettingsGroupHead,m as SettingsGroupSub};
|
package/dist/chunk-U6LJ5UKD.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_PICK_WORDS as e}from"./chunk-OFBZOI6W.js";import{parseHexColor as t,Popover as n,colorSwatchClasses as r,colorFill as l,ColorPickerPanel as i}from"efficient-shell/ui";export{hexToHsv,hsvToHex}from"efficient-shell/ui";import{useRef as a,useState as s,useLayoutEffect as o,useEffect as c}from"react";import{jsx as u,jsxs as p}from"react/jsx-runtime";var d=t,h=7,m=e=>e.toUpperCase(),g=(e,t,n)=>Math.min(n,Math.max(t,e));function f(e,t,n){return{s:n.width>0?g((e-n.left)/n.width,0,1):0,v:n.height>0?1-g((t-n.top)/n.height,0,1):0}}function v(e,t){return t.width>0?360*g((e-t.left)/t.width,0,1):0}function w({value:t,onChange:i,label:h,theme:g,caption:f,inherited:v,after:w,id:x,readOnly:C,words:y=e.colour}){const E=a(null),L=a(null),N=()=>{const e=E.current?.parentElement;return e?.classList.contains("es-field-head")?e.querySelector(":scope > .es-field-name .es-field-label"):e?.classList.contains("es-pick-line")?e.querySelector(":scope > .es-pick-line-label"):null},O=()=>L.current?.querySelector(".es-pick-hexwrap > *")??null,B=e=>e.scrollWidth>e.clientWidth+1,R=e=>{e&&(B(e)?e.dataset.clipped="true":delete e.dataset.clipped)},D=a(()=>{});D.current=()=>{R(N()),W||R(O())};const[T,S]=s(null),[W,M]=s(null);o(()=>D.current()),c(()=>{const e=E.current?.parentElement,t=e?.ownerDocument.defaultView;if(!e||!t?.ResizeObserver)return;const n=new t.ResizeObserver(()=>D.current());return n.observe(e),()=>n.disconnect()},[]),c(()=>{const e=E.current?.parentElement;if(!e)return;const t=e=>{const t=e;if(!t)return null;const n=N(),r=O();return n&&(t===n||n.contains(t))?n:r&&t===r?r:null},n=e=>{const n=t(e.target),r=P();if(!n||!r||n.ownerDocument.activeElement===n||!B(n))return;const l=n.getBoundingClientRect(),i=r.getBoundingClientRect(),a="INPUT"===n.tagName?n.value:n.textContent??"";S({text:a,left:l.left-i.left,top:l.top-i.top})},r=e=>{t(e.target)&&S(null)};return e.addEventListener("pointerover",n),e.addEventListener("pointerout",r),()=>{e.removeEventListener("pointerover",n),e.removeEventListener("pointerout",r)}},[]);const P=()=>{const e=E.current?.parentElement;return e&&(e.classList.contains("es-field-head")||e.classList.contains("es-pick-line"))?e:L.current},q=t?null:d(v??""),F=void 0===f||t&&d(f)===d(t)?null:f,U=F??(t?m(t):q?m(q):y.notSet);/* @__PURE__ */
|
|
2
|
-
return u("div",{ref:E,className:"es-pick-colour",children:/* @__PURE__ */p("div",{ref:L,className:"es-pick-colour-row","data-editing":W??void 0,onFocus:e=>{const t=e.target,n=P();if(!n||!t.classList.contains("es-pick-hex"))return;S(null),t.style.setProperty("--es-pick-edit-room",n.getBoundingClientRect().right-t.getBoundingClientRect().left+"px");const r=t.parentElement?.nextElementSibling,l=!!r&&t.getBoundingClientRect().right>r.getBoundingClientRect().left-2;M(l?"over":"room")},onBlur:e=>{const t=e.target;t.classList.contains("es-pick-hex")&&(t.style.removeProperty("--es-pick-edit-room"),M(null))},children:[
|
|
3
|
-
/* @__PURE__ */u(n,{id:x,className:"es-pick-swatch-wrap",trigger:/* @__PURE__ */u("span",{"aria-hidden":"true",style:{position:"absolute",inset:0,...l(t||q)}}),triggerLabel:y.swatch({label:h,shown:U}),triggerClassName:r({className:t?"es-pick-swatch":q?"es-pick-swatch is-inherited":"es-pick-swatch is-unset"}),"aria-label":y.dialog({label:h}),disabled:C,children:/* @__PURE__ */u(k,{value:t,onChange:i,label:h,theme:g,inherited:v,readOnly:C})}),
|
|
4
|
-
/* @__PURE__ */u("span",{className:"es-pick-hexwrap",children:null===F?/* @__PURE__ */u(b,{value:t,follows:q?m(q):void 0,onChange:e=>{C||e===t||i(e)},name:y.hex({label:h}),readOnly:C}):/* @__PURE__ */u("span",{className:"es-pick-caption",children:F})}),w,T?/* @__PURE__ */u("span",{className:"es-pick-tag","aria-hidden":"true",style:{left:T.left,top:T.top},children:T.text}):null]})})}function k({value:e,onChange:t,label:n,theme:r,onClose:l,id:a,inherited:s,readOnly:o,words:c,swatch:p,dragWrites:d="live"}){/* @__PURE__ */
|
|
5
|
-
return u(i,{id:a,className:"es-pick-window",value:e,onChange:t,label:n,presets:r?.map(e=>({value:e.value,label:e.name})),fallback:s,dragWrites:d,disabled:o,onClose:l})}function b({value:e,follows:t,onChange:n,name:r,readOnly:l}){const[i,o]=s(null),c=a(!1);/* @__PURE__ */
|
|
6
|
-
return u("input",{type:"text",className:!e&&t?"es-pick-hex is-inherited":"es-pick-hex",value:i??(e?m(e):t??""),"aria-label":r,maxLength:7,spellCheck:!1,autoComplete:"off",readOnly:l,onChange:t=>{o(t.target.value);const r=d(t.target.value);null!==r&&r!==e&&n(r)},onFocus:e=>e.currentTarget.select(),onMouseDown:e=>{c.current=e.currentTarget.ownerDocument.activeElement!==e.currentTarget},onMouseUp:e=>{c.current&&e.preventDefault(),c.current=!1},onKeyDown:e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),o(null),e.currentTarget.blur())},onBlur:()=>o(null)})}export{w as ColourPicker,k as ColourWindow,h as HEX_MAX_LENGTH,m as hexReadout,v as hueFromPoint,f as svFromPoint,d as typedHex};
|
package/dist/words-DWvCJXwR.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The pickers' own words (`efficient-easel/strings`, 0.95.0). The row's name
|
|
3
|
-
* (`label`) and a theme colour's name are the host's.
|
|
4
|
-
*
|
|
5
|
-
* A plain module with no import, in the pickers' own folder: they may reach
|
|
6
|
-
* nothing else (`tests/pick-leaf-safety.test.ts`), so they do NOT read the
|
|
7
|
-
* strings provider. `ColourPicker` takes its group as `words`, and a host
|
|
8
|
-
* passes `useEaselStrings().pick.colour`.
|
|
9
|
-
*/
|
|
10
|
-
type PickWords = {
|
|
11
|
-
colour: {
|
|
12
|
-
/** What the row says while the setting has no colour. */
|
|
13
|
-
notSet: string;
|
|
14
|
-
/** The swatch's accessible name. `shown` is the hex, the caption or `notSet`. */
|
|
15
|
-
swatch: (v: {
|
|
16
|
-
label: string;
|
|
17
|
-
shown: string;
|
|
18
|
-
}) => string;
|
|
19
|
-
/** The accessible name of the box the swatch opens. */
|
|
20
|
-
dialog: (v: {
|
|
21
|
-
label: string;
|
|
22
|
-
}) => string;
|
|
23
|
-
/** The group of theme colours at the top of that box. */
|
|
24
|
-
theme: string;
|
|
25
|
-
/** A theme colour's tooltip. */
|
|
26
|
-
themeSwatchTitle: (v: {
|
|
27
|
-
name: string;
|
|
28
|
-
hex: string;
|
|
29
|
-
}) => string;
|
|
30
|
-
/** A theme colour's accessible name. */
|
|
31
|
-
themeSwatch: (v: {
|
|
32
|
-
name: string;
|
|
33
|
-
hex: string;
|
|
34
|
-
}) => string;
|
|
35
|
-
/** The square's accessible name. */
|
|
36
|
-
square: string;
|
|
37
|
-
/** The square's value, read out. Both are percentages: "40%". */
|
|
38
|
-
squareValue: (v: {
|
|
39
|
-
saturation: string;
|
|
40
|
-
brightness: string;
|
|
41
|
-
}) => string;
|
|
42
|
-
/** The strip's accessible name. */
|
|
43
|
-
hue: string;
|
|
44
|
-
/** The hex box's accessible name. */
|
|
45
|
-
hex: (v: {
|
|
46
|
-
label: string;
|
|
47
|
-
}) => string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type { PickWords as P };
|