efficient-easel 0.102.0 → 0.104.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.
Files changed (116) hide show
  1. package/README.md +45 -4
  2. package/dist/chunk-4EUWOGZF.js +1 -0
  3. package/dist/chunk-5D2XAZKH.js +62 -0
  4. package/dist/chunk-7755VWRT.js +4 -0
  5. package/dist/chunk-7GVLSNFW.js +1 -0
  6. package/dist/chunk-A2LFBOUF.js +1 -0
  7. package/dist/chunk-BBRY7KI4.js +10 -0
  8. package/dist/chunk-BVN33R76.js +1 -0
  9. package/dist/chunk-D6324C3E.js +5 -0
  10. package/dist/chunk-ERR437B5.js +1 -0
  11. package/dist/chunk-HMWJB3HF.js +1 -0
  12. package/dist/{chunk-KDYIMJTZ.js → chunk-KCOBHPN6.js} +1 -1
  13. package/dist/chunk-KVNRNDUC.js +1 -0
  14. package/dist/chunk-LEGAPYPC.js +1 -0
  15. package/dist/chunk-LRTIMWZG.js +2 -0
  16. package/dist/chunk-LXEOVUAV.js +1 -0
  17. package/dist/{chunk-D7M6IRPJ.js → chunk-NEQIEYYO.js} +1 -1
  18. package/dist/{chunk-6TZTKAB5.js → chunk-O7Q4DDJT.js} +1 -1
  19. package/dist/chunk-PYNQRX56.js +4 -0
  20. package/dist/chunk-Q2HPBMG5.js +1 -0
  21. package/dist/chunk-QCBWT2XE.js +1 -0
  22. package/dist/{chunk-7MU3RJ6S.js → chunk-QDEZQ5A6.js} +1 -1
  23. package/dist/chunk-QOPY2LQM.js +1 -0
  24. package/dist/{chunk-AKFJK65Z.js → chunk-R2MUSGPS.js} +1 -1
  25. package/dist/chunk-RSCMJIWS.js +1 -0
  26. package/dist/{chunk-E7GGVILG.js → chunk-TTENU2HX.js} +1 -1
  27. package/dist/chunk-UB7JVPK4.js +1 -0
  28. package/dist/{chunk-VLSTGOVD.js → chunk-YODRYAZX.js} +2 -2
  29. package/dist/chunk-Z6BAZFSW.js +2 -0
  30. package/dist/chunk-ZOJEFIP4.js +1 -0
  31. package/dist/{host-B-byaQxg.d.ts → host-DJ8Gzsx7.d.ts} +93 -21
  32. package/dist/screen/components/AddBlockRow.js +1 -1
  33. package/dist/screen/components/AddSidePanel.js +1 -1
  34. package/dist/screen/components/MediaSidePanel.d.ts +3 -2
  35. package/dist/screen/components/MediaSidePanel.js +1 -1
  36. package/dist/screen/components/NodeContextMenu.d.ts +47 -2
  37. package/dist/screen/components/NodeContextMenu.js +1 -1
  38. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  39. package/dist/screen/components/ScreenChrome.js +1 -1
  40. package/dist/screen/components/ScreenDocumentContext.d.ts +2 -1
  41. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  42. package/dist/screen/components/ScreenMount.d.ts +9 -5
  43. package/dist/screen/components/ScreenMount.js +1 -1
  44. package/dist/screen/components/ScreenStoreProvider.d.ts +3 -0
  45. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  46. package/dist/screen/components/SectionScreenShell.js +16 -16
  47. package/dist/screen/components/usePartBridge.d.ts +3 -0
  48. package/dist/screen/components/usePartBridge.js +1 -1
  49. package/dist/screen/index.d.ts +6 -3
  50. package/dist/screen/index.js +1 -1
  51. package/dist/screen/lib/admin-bridge.d.ts +2 -0
  52. package/dist/screen/lib/admin-bridge.js +1 -1
  53. package/dist/screen/lib/backend-error.d.ts +20 -5
  54. package/dist/screen/lib/backend-error.js +1 -1
  55. package/dist/screen/lib/document-addressing.d.ts +2 -1
  56. package/dist/screen/lib/document-contract.d.ts +7 -0
  57. package/dist/screen/lib/failure.d.ts +6 -2
  58. package/dist/screen/lib/failure.js +1 -1
  59. package/dist/screen/lib/host-inbound.js +1 -1
  60. package/dist/screen/lib/host.d.ts +3 -2
  61. package/dist/screen/lib/load-error.d.ts +9 -3
  62. package/dist/screen/lib/load-error.js +1 -1
  63. package/dist/screen/lib/media-panel.d.ts +81 -17
  64. package/dist/screen/lib/media-panel.js +1 -1
  65. package/dist/screen/lib/media-picker.d.ts +14 -2
  66. package/dist/screen/lib/media-picker.js +1 -1
  67. package/dist/screen/lib/page-lock.d.ts +45 -1
  68. package/dist/screen/lib/page-lock.js +1 -1
  69. package/dist/screen/lib/puck/content-tree.d.ts +20 -1
  70. package/dist/screen/lib/puck/content-tree.js +1 -1
  71. package/dist/screen/lib/puck/device-fields.d.ts +4 -2
  72. package/dist/screen/lib/puck/section-doc.js +1 -1
  73. package/dist/screen/lib/puck/slot-child-name.d.ts +18 -3
  74. package/dist/screen/lib/puck/slot-child-name.js +1 -1
  75. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  76. package/dist/screen/lib/puck/use-section-ops.d.ts +6 -0
  77. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  78. package/dist/screen/lib/screen-parts.d.ts +171 -4
  79. package/dist/screen/lib/screen-parts.js +1 -1
  80. package/dist/screen/lib/section-templates.d.ts +25 -1
  81. package/dist/screen/lib/section-templates.js +1 -1
  82. package/dist/screen/lib/session-context.d.ts +5 -1
  83. package/dist/screen/lib/session-context.js +1 -1
  84. package/dist/screen/lib/session.d.ts +58 -5
  85. package/dist/screen/lib/session.js +1 -1
  86. package/dist/screen/screen.css +14 -0
  87. package/dist/screen/words.d.ts +65 -0
  88. package/dist/screen/words.js +1 -0
  89. package/dist/strings/catalogue.d.ts +9 -2
  90. package/dist/strings/catalogue.js +1 -1
  91. package/dist/strings/index.d.ts +1 -0
  92. package/dist/strings/index.js +1 -1
  93. package/dist/tree/index.d.ts +4 -142
  94. package/dist/types-DJDBtdB2.d.ts +143 -0
  95. package/package.json +6 -1
  96. package/dist/chunk-3U4GP5VA.js +0 -10
  97. package/dist/chunk-5464H65G.js +0 -4
  98. package/dist/chunk-6FY3PZS3.js +0 -1
  99. package/dist/chunk-7RNTMJER.js +0 -5
  100. package/dist/chunk-A7ZJII7O.js +0 -1
  101. package/dist/chunk-AJBJ74ME.js +0 -1
  102. package/dist/chunk-AKZWUV5Z.js +0 -1
  103. package/dist/chunk-F2FPZIZV.js +0 -62
  104. package/dist/chunk-F6CCTEIX.js +0 -1
  105. package/dist/chunk-FT35FX7D.js +0 -2
  106. package/dist/chunk-FUDHI5I4.js +0 -1
  107. package/dist/chunk-HMX55DYT.js +0 -1
  108. package/dist/chunk-HWW4XJOH.js +0 -1
  109. package/dist/chunk-J4RAY75C.js +0 -1
  110. package/dist/chunk-PP44LCJM.js +0 -1
  111. package/dist/chunk-Q3SQBNJB.js +0 -1
  112. package/dist/chunk-TEZ6V6PA.js +0 -4
  113. package/dist/chunk-UH7TGWHR.js +0 -1
  114. package/dist/chunk-UVWVYMMZ.js +0 -1
  115. package/dist/chunk-VV5ADNBR.js +0 -1
  116. package/dist/chunk-ZZ7VLIHQ.js +0 -1
@@ -1,4 +1,5 @@
1
1
  import { Config } from '../../blocks/index.js';
2
+ import { HostFailures } from './backend-error.js';
2
3
  import { EaselChrome } from './host-chrome.js';
3
4
  import { WebsiteEditLock } from './document-contract.js';
4
5
  import { EaselDocumentHooks } from './document-hooks.js';
@@ -9,6 +10,7 @@ import '../../data/index.js';
9
10
  import '../../types-41704JE4.js';
10
11
  import '../../resolve-D68pb3Bx.js';
11
12
  import '../../plan-DChbUXdS.js';
13
+ import '../../edit-lock/index.js';
12
14
  import './links/link-filters.js';
13
15
  import '../../LinkPicker-W2Rtxetz.js';
14
16
  import './puck/content-tree.js';
@@ -38,6 +40,17 @@ import './puck/content-tree.js';
38
40
  * editor's last writes — the autosave's flush on unmount, the lock's release —
39
41
  * on its own backend and token while the next editor is already mounting.
40
42
  *
43
+ * AN EDITOR BESIDE IT (0.103.0). The admin portal mounts the campaign designer
44
+ * in one window while the website editor is open in another, in one page. The
45
+ * designer's session is made with `claimsPage: false`: it never becomes "the
46
+ * editor on this page", so the website's loaders and HTTP client go on reading
47
+ * the website's session (its token, its site, its backend), and the designer
48
+ * reads its own only through its provider and what it is handed to. What used
49
+ * to be one per page and is a host's own — the backend a session falls back on,
50
+ * how a host's client errors read — a session may carry for itself
51
+ * (`defaultBackend`, `hostFailures`), so the second host never has to replace
52
+ * the first host's page-wide registration to bring its own.
53
+ *
41
54
  * WHERE NO EDITOR IS MOUNTED — the shop's own pages, a dev harness, a guard —
42
55
  * there is the AMBIENT session: the EFFICIENT client, no token until somebody
43
56
  * sets one. That is exactly what the old singletons were.
@@ -141,6 +154,28 @@ interface EaselSession {
141
154
  * blocks — or null when it does nothing. Read once, with the backend.
142
155
  */
143
156
  readonly documentHooks: EaselDocumentHooks | null;
157
+ /**
158
+ * Whether this session is THE EDITOR ON THIS PAGE while it is mounted
159
+ * (0.103.0): the one {@link currentEaselSession} answers, which code outside
160
+ * the editor's React tree reads — a host's loaders, its HTTP client — and
161
+ * the holder of what the page has one of (the tab's block clipboard,
162
+ * components/NodeContextMenu). True, as every session was before.
163
+ *
164
+ * False for an editor mounted BESIDE the page's (the campaign designer in
165
+ * the admin, beside the website editor): mounting it leaves the page's
166
+ * current session as it was, it is read only through its provider
167
+ * (`useEaselSession`) and what it is handed to, and it keeps a block
168
+ * clipboard of its own registry's.
169
+ */
170
+ readonly claimsPage: boolean;
171
+ /**
172
+ * How the host's own client errors read, for this session's editor alone
173
+ * (lib/backend-error `HostFailures`, 0.103.0) — or null, and it reads them
174
+ * as the page's host said (`provideHostFailures`), as before. A host
175
+ * mounted beside another brings its own here rather than replacing the
176
+ * page's: the two are told apart by whose editor a failure happened in.
177
+ */
178
+ readonly hostFailures: HostFailures | null;
144
179
  /** The console's sign-in: the admin JWT and the legacy brand scope. */
145
180
  readonly auth: {
146
181
  token: string | null;
@@ -172,13 +207,16 @@ type DefaultBackend = (session: EaselSession) => SessionBackend;
172
207
  * A registration rather than an import, because the direction matters: the
173
208
  * editor is the builder's and a host's client is the host's (doc/adr/0002).
174
209
  * It is one default for the app, not a choice per editor — an embedder that
175
- * wants another backend for one editor passes `backend`, as before.
210
+ * wants another backend for one editor passes `backend`, as before, or a
211
+ * default of that session's own (`createEaselSession({ defaultBackend })`,
212
+ * 0.103.0), which this one never replaces and is never replaced by.
176
213
  */
177
214
  declare function provideDefaultBackend(make: DefaultBackend): void;
178
215
  /**
179
216
  * The backend one editor session talks to: the embedder's own when it supplied
180
- * one, else the host's default — one client per session, built the first time
181
- * it is asked for and bound to THAT session's token and website.
217
+ * one, else the session's own default when it was made with one, else the
218
+ * host's page-wide default — one client per session, built the first time it
219
+ * is asked for and bound to THAT session's token and website.
182
220
  *
183
221
  * Throws when there is neither: an editor with no backend can load and save
184
222
  * nothing, and falling back to "no pages" would look like an empty website.
@@ -200,18 +238,33 @@ declare function createEaselSession(options?: {
200
238
  registry?: Config | null;
201
239
  chrome?: EaselChrome | null;
202
240
  documentHooks?: EaselDocumentHooks | null;
241
+ /** Is this the editor on this page while it is mounted? Default true; see
242
+ * {@link EaselSession.claimsPage}. */
243
+ claimsPage?: boolean;
244
+ /** What makes this session's backend when `backend` is not given, in
245
+ * place of the page's (`provideDefaultBackend`), bound to this session.
246
+ * Default: the page's. A backend it makes waits for the console's token
247
+ * only when it is the EFFICIENT client (`EFFICIENT_BACKEND`). */
248
+ defaultBackend?: DefaultBackend | null;
249
+ /** How this session's host client errors read; default the page's. See
250
+ * {@link EaselSession.hostFailures}. */
251
+ hostFailures?: HostFailures | null;
203
252
  }): EaselSession;
204
253
  /** Record the website a session's open document belongs to. */
205
254
  declare function setSessionDocumentSite(session: EaselSession, siteId: string | null | undefined): void;
206
255
  /** Record the website the host bridged in with an auth grant. */
207
256
  declare function setSessionBridgedSite(session: EaselSession, siteId: string | null | undefined): void;
208
- /** The session of the editor mounted on this page — the ambient one when none is. */
257
+ /** The session of the editor mounted on this page — the ambient one when none is.
258
+ * Never a session made with `claimsPage: false`, mounted or not. */
209
259
  declare function currentEaselSession(): EaselSession;
210
260
  /**
211
261
  * Make `session` the page's current one. IDEMPOTENT, and called from two places
212
262
  * on purpose: while the editor RENDERS (so a child's effect — which runs before
213
263
  * its parent's — already reads the right session) and from the editor's own
214
264
  * effect (which is what survives React StrictMode's mount, unmount, mount).
265
+ *
266
+ * A session that does not claim the page (`claimsPage: false`) is left out,
267
+ * whoever asks: the editor beside the page's never takes its place.
215
268
  */
216
269
  declare function activateEaselSession(session: EaselSession): void;
217
270
  /**
@@ -252,4 +305,4 @@ declare function efficientClientOpen(): boolean;
252
305
  /** Start the ambient session again from nothing (tests; a guard between cases). */
253
306
  declare function resetAmbientEaselSession(): void;
254
307
 
255
- export { EFFICIENT_BACKEND, type EaselSession, type SessionBackend, type SessionBlocks, activateEaselSession, backendOf, createEaselSession, currentEaselSession, deactivateEaselSession, efficientClientOpen, isEfficientBackend, provideDefaultBackend, resetAmbientEaselSession, sessionRegistry, setSessionBridgedSite, setSessionDocumentSite };
308
+ export { type DefaultBackend, EFFICIENT_BACKEND, type EaselSession, type SessionBackend, type SessionBlocks, activateEaselSession, backendOf, createEaselSession, currentEaselSession, deactivateEaselSession, efficientClientOpen, isEfficientBackend, provideDefaultBackend, resetAmbientEaselSession, sessionRegistry, setSessionBridgedSite, setSessionDocumentSite };
@@ -1 +1 @@
1
- export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../../chunk-AJBJ74ME.js";
1
+ export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../../chunk-RSCMJIWS.js";
@@ -8,6 +8,11 @@
8
8
  * the screen (that repo's doc/adr/0004): a rule is here when every `sf-` class
9
9
  * it names is drawn by the screen, so every host that mounts the screen gets
10
10
  * it; a rule that names a class only a host draws stays in that host's sheet.
11
+ * A `data-sf-*` marker the screen's own modules paint counts the same way: the
12
+ * rule that gives it its meaning is here (0.103.0), since a marker no sheet
13
+ * reads is a box that still takes its space. `tests/screen-css-closure` mounts
14
+ * the screen with easel's sheets alone and holds every class and marker it
15
+ * draws to a rule in them.
11
16
  * The `sf-` names are kept: the hosts' sheets and their guards address them.
12
17
  *
13
18
  * Load it after the other easel sheets and before a host's own sheet, which is
@@ -953,6 +958,15 @@
953
958
  line-height: 1;
954
959
  }
955
960
 
961
+ /* ── Device-aware fields (lib/puck/device-fields.tsx) ─────────────────────────
962
+ A control that belongs to a device the canvas is not showing paints a
963
+ zero-size marker instead of itself, and its row (efficient-easel's public
964
+ `.es-insp-row`, blueprint 4.4) collapses when it holds one, so no gap is left.
965
+ One declarative rule; the row's own "nothing drawn" case is `:empty`. */
966
+ .es-insp-row:has(> [data-sf-device-hidden]) {
967
+ display: none !important;
968
+ }
969
+
956
970
  /* ── NO DIVIDER HAIRLINES IN THIS PANEL (card 66334) ──────────────────────────
957
971
  The owner asked for these lines to go twice. Deleting our own was only part of
958
972
  it: the rule below is drawn by a PACKAGE, it is the majority of what is
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The assembled screen's own words (`efficient-easel/strings`, group
3
+ * `screen`): what it says while a document opens, what it says when one will
4
+ * not, the word it calls the document in the edit notice, and the words of
5
+ * the Layers tree's frame round the document's nodes (0.103.0): its first
6
+ * row, the pinned groups, the band of sections and the band's "+".
7
+ *
8
+ * They came with the screen from the website editor, written into the
9
+ * provider, the mount and the notice; a second host (the campaign designer)
10
+ * opens campaigns, not storefront pages, and says so in its own words. So the
11
+ * defaults are the website's English, word for word, and a host lays its own
12
+ * over them with `EaselStringsProvider`.
13
+ *
14
+ * A plain module with no import: the catalogue reads it, and the catalogue
15
+ * imports nothing (`tests/strings-leaf-safety.test.ts`). Anything with a value
16
+ * in it is a function.
17
+ *
18
+ * What a sentence for a MISSING document is can also depend on the target, and
19
+ * that is the layer's to say (`DocumentAddressing.describeMissing`): these are
20
+ * the words the screen says when the layer says none.
21
+ */
22
+ type ScreenWords = {
23
+ /** While the document is on its way, and while an entry may still bounce. */
24
+ loading: string;
25
+ /** Before the console's sign-in has reached an editor that needs it. */
26
+ waitingForAuthorization: string;
27
+ /** A website template's page that could not be opened. */
28
+ missingTemplatePage: string;
29
+ /** A website page that is not there, by the slug it was asked for. */
30
+ missingPage: (v: {
31
+ slug: string;
32
+ }) => string;
33
+ /** A host's own document (`{ kind: "document" }`) that is not there. */
34
+ missingDocument: string;
35
+ /** A load that failed: the plain lead-in, then what came back (`cause`). */
36
+ loadFailed: (v: {
37
+ cause: string;
38
+ }) => string;
39
+ /** What the document is called in the edit notice's sentences ("this page"). */
40
+ noun: string;
41
+ /** The Layers tree's first row: the document's own settings, with nothing
42
+ * selected. */
43
+ pageSettings: string;
44
+ /** The group label over the node pinned first, and the name of its row
45
+ * where the layer names it none. */
46
+ header: string;
47
+ /** …and over the node pinned last. */
48
+ footer: string;
49
+ /** The label over the band of sections on a document with the edit guard
50
+ * (a website's page), where the layer gives the band none of its own. */
51
+ pageSections: string;
52
+ /** …and on a document without it (a website's template). */
53
+ templateSections: string;
54
+ /** The row that ends a band which offers one (`band.addAtEnd`). */
55
+ addSection: string;
56
+ /** The "+" in the gap above a section, named by the section it lands before. */
57
+ addSectionBefore: (v: {
58
+ name: string;
59
+ }) => string;
60
+ /** …and in a gap with no section after it. */
61
+ addSectionHere: string;
62
+ };
63
+ declare const DEFAULT_SCREEN_WORDS: ScreenWords;
64
+
65
+ export { DEFAULT_SCREEN_WORDS, type ScreenWords };
@@ -0,0 +1 @@
1
+ export{DEFAULT_SCREEN_WORDS}from"../chunk-LEGAPYPC.js";
@@ -7,6 +7,7 @@ import { F as FieldsWords } from '../words-D8kf071T.js';
7
7
  import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
8
8
  import { P as PanelWords } from '../words-BGrHZAJJ.js';
9
9
  import { P as PickWords } from '../words-is_Vy6hn.js';
10
+ import { ScreenWords } from '../screen/words.js';
10
11
  import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
11
12
  import { T as TextStylesWords } from '../words-CRYvAiHX.js';
12
13
  import { T as TreeWords } from '../words-DgHcY5qB.js';
@@ -51,7 +52,10 @@ type RailWords = {
51
52
  * Every word and sentence this package itself draws or returns — visible text,
52
53
  * `aria-label`s, tooltips, placeholders — is an entry here, grouped by the
53
54
  * module that says it. What a HOST supplies (a block's name, a field's label, a
54
- * tile's caption, the document's noun) was never the engine's and is not here.
55
+ * tile's caption, the document's noun) was never the engine's and is not here —
56
+ * with one exception: the assembled screen (`efficient-easel/screen`) draws the
57
+ * edit notice itself, so the noun it says it with is a word of its own group,
58
+ * the website's "page" until a host says another.
55
59
  *
56
60
  * - A plain word is a `string`.
57
61
  * - Anything with a value in it, or a count that can be one or many, is a
@@ -106,6 +110,9 @@ interface EaselStrings {
106
110
  canvas: CanvasWords;
107
111
  /** `efficient-easel/text-styles` — the Email styles / Site styles list (E6). */
108
112
  textStyles: TextStylesWords;
113
+ /** `efficient-easel/screen` — a document opening, one that will not, and the
114
+ * notice's word for the document. */
115
+ screen: ScreenWords;
109
116
  }
110
117
  /** Today's English, word for word. */
111
118
  declare const DEFAULT_EASEL_STRINGS: EaselStrings;
@@ -124,4 +131,4 @@ type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends ob
124
131
  */
125
132
  declare function mergeEaselStrings(defaults: EaselStrings, partial?: DeepPartial<EaselStrings> | null): EaselStrings;
126
133
 
127
- export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings };
134
+ export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, ScreenWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings };
@@ -1 +1 @@
1
- export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-UH7TGWHR.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-O2NLQBFX.js";
1
+ export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-QCBWT2XE.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-LEGAPYPC.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
@@ -11,6 +11,7 @@ export { N as NodeMenuWords } from '../words-DMG4dYq2.js';
11
11
  export { P as PanelWords } from '../words-BGrHZAJJ.js';
12
12
  export { P as PickWords } from '../words-is_Vy6hn.js';
13
13
  export { S as SaveWords } from '../words-D_Lnw1Gr.js';
14
+ export { ScreenWords } from '../screen/words.js';
14
15
  export { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
15
16
  export { T as TextStylesWords } from '../words-CRYvAiHX.js';
16
17
  export { T as TreeWords } from '../words-DgHcY5qB.js';
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-UH7TGWHR.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-UH7TGWHR.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
1
+ import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-QCBWT2XE.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-QCBWT2XE.js";import"../chunk-M6F6LS3H.js";import"../chunk-6WY6ZXJG.js";import"../chunk-LEGAPYPC.js";import"../chunk-AELNNAFM.js";import"../chunk-3EDSDPIP.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZJEBF4NB.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-UH7IGZKF.js";import"../chunk-ZAOM6PFH.js";import"../chunk-FPOKPNO4.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
2
  return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
@@ -1,145 +1,7 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, HTMLAttributes, ButtonHTMLAttributes } from 'react';
3
- import { T as TreeWords } from '../words-DgHcY5qB.js';
4
-
5
- type LayersTreeProps = {
6
- /** Extra classes — a host's scroll-bar class, for instance. */
7
- className?: string;
8
- children?: ReactNode;
9
- /** Attributes for the tree's root — `efficient-easel/drag`'s `rootProps()`. */
10
- rootProps?: HTMLAttributes<HTMLDivElement>;
11
- };
12
- type TreeGroupLabelProps = {
13
- children: ReactNode;
14
- };
15
- type SubtreeProps = {
16
- children?: ReactNode;
17
- };
18
- type TreeRowFold = {
19
- /** Whether the row's subtree is showing. */
20
- open: boolean;
21
- /** What folds, in lower case — "section", "column". The caret reads "Collapse section". */
22
- label: string;
23
- onToggle: () => void;
24
- };
25
- type TreeRowProps = {
26
- /** A 13px glyph for the row's type. */
27
- icon: ReactNode;
28
- /** The row's name — the type's label, or a name the person gave it. */
29
- name: ReactNode;
30
- /**
31
- * The thing's own first words, drawn quieter after the name — "Text BACK IN
32
- * STOCK NOW". NEW in 0.42.0: a tree of fifteen rows called "Section" cannot be
33
- * searched by eye. The host decides the words and shortens them.
34
- */
35
- preview?: ReactNode;
36
- selected?: boolean;
37
- /** Hidden from the page: the name is struck through and the eye stays showing. */
38
- hidden?: boolean;
39
- /**
40
- * The row can be picked up — whole, by `efficient-easel/drag` (0.74.0). It says
41
- * so four ways: a faint ⋮ at its left on hover, the grab cursor, a hint after
42
- * 0.7 s ("Drag to move · ⌥↑ ⌥↓"), and the row lifted with a shadow while it
43
- * moves. A draggable row draws no `handle`: the row IS the handle.
44
- */
45
- draggable?: boolean;
46
- /** The hint a draggable row shows after 0.7 s. Default `words.dragHint`: "Drag to move · ⌥↑ ⌥↓". */
47
- dragHint?: string;
48
- /** This row is being dragged. */
49
- dragging?: boolean;
50
- /** Where a drop would land relative to this row, while a drag is over it. */
51
- drop?: 'before' | 'after' | 'into';
52
- /** Present when the row folds; the row leads with its caret. Absent: the caret column is held open. */
53
- fold?: TreeRowFold;
54
- /**
55
- * Props for the drag handle button (the host's drag-and-drop wiring). Absent:
56
- * no handle. The handle is the ONLY drag source, so it is hidden with opacity
57
- * and never made unreachable.
58
- *
59
- * @deprecated since 0.74.0 — a row driven by `efficient-easel/drag` is picked
60
- * up whole (`draggable`), and a draggable row draws no handle. Kept until both
61
- * editors have moved (blueprint 3.3 / 3.4).
62
- */
63
- handle?: ButtonHTMLAttributes<HTMLButtonElement>;
64
- /** `TreeRowAction`s — laid over the END of the name, shown on hover and focus. */
65
- actions?: ReactNode;
66
- /** Stands in for the name — a rename box. It must not move the row by a pixel. */
67
- nameSlot?: ReactNode;
68
- /**
69
- * Selects the row. Present: the name box becomes a real <button> — Enter and
70
- * Space select from the keyboard — and a selected row says `aria-current`.
71
- * Absent: the row selects through `rowProps.onClick`, as 0.42.0 did.
72
- */
73
- onSelect?: () => void;
74
- /** Named state glyphs drawn right after the name — "Hidden on phones". */
75
- marks?: ReadonlyArray<TreeRowMark>;
76
- /** A count or position pill after the name — "1 of 2". */
77
- badge?: ReactNode;
78
- /** A non-interactive mark at the row's end — the Lock on a pinned section. */
79
- trailing?: {
80
- label: string;
81
- icon: ReactNode;
82
- };
83
- /** Drawn inside the row after everything else: overlays such as a drop line. */
84
- children?: ReactNode;
85
- /** Attributes for the row itself: onClick, drag-over handlers, data-*. */
86
- rowProps?: HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string | number | undefined>;
87
- /**
88
- * The row's own words — the drag hint and the caret's — in the host's
89
- * language: `useEaselStrings().tree` (0.95.0). Left out, English. `dragHint`
90
- * above still wins for its one line.
91
- */
92
- words?: TreeWords;
93
- };
94
- type TreeRowMark = {
95
- key: string;
96
- /** Tooltip and accessible name — the mark is a picture of a state. */
97
- label: string;
98
- icon: ReactNode;
99
- };
100
- type TreeRowActionProps = {
101
- /**
102
- * `delete` is the red trash; `eye` shows or hides; `plain` is any other action
103
- * (a phone toggle, "Duplicate column") in the neutral colour.
104
- */
105
- kind: 'delete' | 'eye' | 'plain';
106
- /** For a toggle: whether it is on. Adds aria-pressed and keeps it visible at rest. */
107
- pressed?: boolean;
108
- disabled?: boolean;
109
- /** Tooltip and accessible name — "Delete Text", "Show Section". */
110
- label: string;
111
- onClick: () => void;
112
- children: ReactNode;
113
- };
114
- type TreeEmptySlotProps = {
115
- /** A drag is over the slot and may land in it: it lights up and says "Drop here". */
116
- drop?: boolean;
117
- /** Present: the box is a button that adds here (it opens the Add panel at this place). */
118
- onAdd?: () => void;
119
- /**
120
- * What the box says at rest. Default `words.addBlock` ("Add a block") with
121
- * `onAdd`, `words.emptySlot` ("No blocks yet") without.
122
- */
123
- label?: string;
124
- /**
125
- * The drag handlers — `efficient-easel/drag`'s
126
- * `seam({ place: { ...list, index: 0 } }).seamProps`: an empty list has one
127
- * place, its start.
128
- */
129
- seamProps?: HTMLAttributes<HTMLDivElement>;
130
- /** The box's own words in the host's language: `useEaselStrings().tree`. Left out, English. */
131
- words?: TreeWords;
132
- };
133
- type TreeSeamProps = {
134
- /** A drag is over this gap and may land in it: draw the drop line. */
135
- drop?: boolean;
136
- /** Present: the gap offers a "+" that adds here (it opens the Add panel at this place). */
137
- onAdd?: () => void;
138
- /** The "+"'s accessible name and tooltip — "Add block here". Required with `onAdd`. */
139
- label?: string;
140
- /** The drag handlers — `efficient-easel/drag`'s `seam(…).seamProps`. */
141
- seamProps?: HTMLAttributes<HTMLDivElement>;
142
- };
2
+ import { L as LayersTreeProps, S as SubtreeProps, a as TreeGroupLabelProps, b as TreeEmptySlotProps, c as TreeRowProps, d as TreeRowActionProps, e as TreeSeamProps } from '../types-DJDBtdB2.js';
3
+ export { f as TreeRowFold, T as TreeRowMark } from '../types-DJDBtdB2.js';
4
+ export { T as TreeWords } from '../words-DgHcY5qB.js';
143
5
 
144
6
  /**
145
7
  * The Layers tree's container. It declares the TREE's own rhythm — 10px above a
@@ -211,4 +73,4 @@ declare function TreeSeam({ drop, onAdd, label, seamProps }: TreeSeamProps): rea
211
73
  */
212
74
  declare function TreeEmptySlot({ drop, onAdd, label, seamProps, words }: TreeEmptySlotProps): react.JSX.Element;
213
75
 
214
- export { LayersTree, type LayersTreeProps, Subtree, type SubtreeProps, TREE_DRAG_HINT, TreeEmptySlot, type TreeEmptySlotProps, TreeGroupLabel, type TreeGroupLabelProps, TreeRow, TreeRowAction, type TreeRowActionProps, type TreeRowFold, type TreeRowMark, type TreeRowProps, TreeSeam, type TreeSeamProps, TreeWords };
76
+ export { LayersTree, LayersTreeProps, Subtree, SubtreeProps, TREE_DRAG_HINT, TreeEmptySlot, TreeEmptySlotProps, TreeGroupLabel, TreeGroupLabelProps, TreeRow, TreeRowAction, TreeRowActionProps, TreeRowProps, TreeSeam, TreeSeamProps };
@@ -0,0 +1,143 @@
1
+ import { ReactNode, HTMLAttributes, ButtonHTMLAttributes } from 'react';
2
+ import { T as TreeWords } from './words-DgHcY5qB.js';
3
+
4
+ type LayersTreeProps = {
5
+ /** Extra classes — a host's scroll-bar class, for instance. */
6
+ className?: string;
7
+ children?: ReactNode;
8
+ /** Attributes for the tree's root — `efficient-easel/drag`'s `rootProps()`. */
9
+ rootProps?: HTMLAttributes<HTMLDivElement>;
10
+ };
11
+ type TreeGroupLabelProps = {
12
+ children: ReactNode;
13
+ };
14
+ type SubtreeProps = {
15
+ children?: ReactNode;
16
+ };
17
+ type TreeRowFold = {
18
+ /** Whether the row's subtree is showing. */
19
+ open: boolean;
20
+ /** What folds, in lower case — "section", "column". The caret reads "Collapse section". */
21
+ label: string;
22
+ onToggle: () => void;
23
+ };
24
+ type TreeRowProps = {
25
+ /** A 13px glyph for the row's type. */
26
+ icon: ReactNode;
27
+ /** The row's name — the type's label, or a name the person gave it. */
28
+ name: ReactNode;
29
+ /**
30
+ * The thing's own first words, drawn quieter after the name — "Text BACK IN
31
+ * STOCK NOW". NEW in 0.42.0: a tree of fifteen rows called "Section" cannot be
32
+ * searched by eye. The host decides the words and shortens them.
33
+ */
34
+ preview?: ReactNode;
35
+ selected?: boolean;
36
+ /** Hidden from the page: the name is struck through and the eye stays showing. */
37
+ hidden?: boolean;
38
+ /**
39
+ * The row can be picked up — whole, by `efficient-easel/drag` (0.74.0). It says
40
+ * so four ways: a faint ⋮ at its left on hover, the grab cursor, a hint after
41
+ * 0.7 s ("Drag to move · ⌥↑ ⌥↓"), and the row lifted with a shadow while it
42
+ * moves. A draggable row draws no `handle`: the row IS the handle.
43
+ */
44
+ draggable?: boolean;
45
+ /** The hint a draggable row shows after 0.7 s. Default `words.dragHint`: "Drag to move · ⌥↑ ⌥↓". */
46
+ dragHint?: string;
47
+ /** This row is being dragged. */
48
+ dragging?: boolean;
49
+ /** Where a drop would land relative to this row, while a drag is over it. */
50
+ drop?: 'before' | 'after' | 'into';
51
+ /** Present when the row folds; the row leads with its caret. Absent: the caret column is held open. */
52
+ fold?: TreeRowFold;
53
+ /**
54
+ * Props for the drag handle button (the host's drag-and-drop wiring). Absent:
55
+ * no handle. The handle is the ONLY drag source, so it is hidden with opacity
56
+ * and never made unreachable.
57
+ *
58
+ * @deprecated since 0.74.0 — a row driven by `efficient-easel/drag` is picked
59
+ * up whole (`draggable`), and a draggable row draws no handle. Kept until both
60
+ * editors have moved (blueprint 3.3 / 3.4).
61
+ */
62
+ handle?: ButtonHTMLAttributes<HTMLButtonElement>;
63
+ /** `TreeRowAction`s — laid over the END of the name, shown on hover and focus. */
64
+ actions?: ReactNode;
65
+ /** Stands in for the name — a rename box. It must not move the row by a pixel. */
66
+ nameSlot?: ReactNode;
67
+ /**
68
+ * Selects the row. Present: the name box becomes a real <button> — Enter and
69
+ * Space select from the keyboard — and a selected row says `aria-current`.
70
+ * Absent: the row selects through `rowProps.onClick`, as 0.42.0 did.
71
+ */
72
+ onSelect?: () => void;
73
+ /** Named state glyphs drawn right after the name — "Hidden on phones". */
74
+ marks?: ReadonlyArray<TreeRowMark>;
75
+ /** A count or position pill after the name — "1 of 2". */
76
+ badge?: ReactNode;
77
+ /** A non-interactive mark at the row's end — the Lock on a pinned section. */
78
+ trailing?: {
79
+ label: string;
80
+ icon: ReactNode;
81
+ };
82
+ /** Drawn inside the row after everything else: overlays such as a drop line. */
83
+ children?: ReactNode;
84
+ /** Attributes for the row itself: onClick, drag-over handlers, data-*. */
85
+ rowProps?: HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string | number | undefined>;
86
+ /**
87
+ * The row's own words — the drag hint and the caret's — in the host's
88
+ * language: `useEaselStrings().tree` (0.95.0). Left out, English. `dragHint`
89
+ * above still wins for its one line.
90
+ */
91
+ words?: TreeWords;
92
+ };
93
+ type TreeRowMark = {
94
+ key: string;
95
+ /** Tooltip and accessible name — the mark is a picture of a state. */
96
+ label: string;
97
+ icon: ReactNode;
98
+ };
99
+ type TreeRowActionProps = {
100
+ /**
101
+ * `delete` is the red trash; `eye` shows or hides; `plain` is any other action
102
+ * (a phone toggle, "Duplicate column") in the neutral colour.
103
+ */
104
+ kind: 'delete' | 'eye' | 'plain';
105
+ /** For a toggle: whether it is on. Adds aria-pressed and keeps it visible at rest. */
106
+ pressed?: boolean;
107
+ disabled?: boolean;
108
+ /** Tooltip and accessible name — "Delete Text", "Show Section". */
109
+ label: string;
110
+ onClick: () => void;
111
+ children: ReactNode;
112
+ };
113
+ type TreeEmptySlotProps = {
114
+ /** A drag is over the slot and may land in it: it lights up and says "Drop here". */
115
+ drop?: boolean;
116
+ /** Present: the box is a button that adds here (it opens the Add panel at this place). */
117
+ onAdd?: () => void;
118
+ /**
119
+ * What the box says at rest. Default `words.addBlock` ("Add a block") with
120
+ * `onAdd`, `words.emptySlot` ("No blocks yet") without.
121
+ */
122
+ label?: string;
123
+ /**
124
+ * The drag handlers — `efficient-easel/drag`'s
125
+ * `seam({ place: { ...list, index: 0 } }).seamProps`: an empty list has one
126
+ * place, its start.
127
+ */
128
+ seamProps?: HTMLAttributes<HTMLDivElement>;
129
+ /** The box's own words in the host's language: `useEaselStrings().tree`. Left out, English. */
130
+ words?: TreeWords;
131
+ };
132
+ type TreeSeamProps = {
133
+ /** A drag is over this gap and may land in it: draw the drop line. */
134
+ drop?: boolean;
135
+ /** Present: the gap offers a "+" that adds here (it opens the Add panel at this place). */
136
+ onAdd?: () => void;
137
+ /** The "+"'s accessible name and tooltip — "Add block here". Required with `onAdd`. */
138
+ label?: string;
139
+ /** The drag handlers — `efficient-easel/drag`'s `seam(…).seamProps`. */
140
+ seamProps?: HTMLAttributes<HTMLDivElement>;
141
+ };
142
+
143
+ export type { LayersTreeProps as L, SubtreeProps as S, TreeRowMark as T, TreeGroupLabelProps as a, TreeEmptySlotProps as b, TreeRowProps as c, TreeRowActionProps as d, TreeSeamProps as e, TreeRowFold as f };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "0.102.0",
3
+ "version": "0.104.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",
@@ -506,6 +506,11 @@
506
506
  "types": "./dist/screen/lib/session-context.d.ts",
507
507
  "import": "./dist/screen/lib/session-context.js",
508
508
  "default": "./dist/screen/lib/session-context.js"
509
+ },
510
+ "./screen/words": {
511
+ "types": "./dist/screen/words.d.ts",
512
+ "import": "./dist/screen/words.js",
513
+ "default": "./dist/screen/words.js"
509
514
  }
510
515
  },
511
516
  "files": [
@@ -1,10 +0,0 @@
1
- import{clientOnly as e}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-F2FPZIZV.js";import{ScreenDocumentProvider as t,useScreenDocument as a}from"./chunk-FT35FX7D.js";import{ScreenStoreProvider as i}from"./chunk-VLSTGOVD.js";import{documentPermissions as r}from"./chunk-JUQ6YJCG.js";import{useMemo as s}from"react";import{jsx as d,jsxs as o,Fragment as c}from"react/jsx-runtime";var l=e(i),m=e(n);function g({saving:e,onCancel:n,onDiscard:t,onSave:a}){/* @__PURE__ */
2
- return d("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/30 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"sf-leave-title",children:/* @__PURE__ */o("div",{className:"w-full max-w-sm rounded-lg bg-white p-5 shadow-xl",children:[
3
- /* @__PURE__ */d("h2",{id:"sf-leave-title",className:"text-[15px] font-semibold text-zinc-900",children:"Unsaved changes"}),
4
- /* @__PURE__ */d("p",{className:"mt-2 text-[13px] leading-relaxed text-zinc-600",children:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them."}),
5
- /* @__PURE__ */o("div",{className:"mt-4 flex justify-end gap-2",children:[
6
- /* @__PURE__ */d("button",{type:"button",onClick:n,className:"rounded-md border border-zinc-300 px-3 py-[7px] text-[13px] font-medium text-zinc-700 transition-colors hover:bg-zinc-100",children:"Cancel"}),
7
- /* @__PURE__ */d("button",{type:"button",onClick:t,className:"rounded-md border border-red-200 px-3 py-[7px] text-[13px] font-medium text-red-600 transition-colors hover:bg-red-50",children:"Discard & leave"}),
8
- /* @__PURE__ */d("button",{type:"button",onClick:a,disabled:e,className:"rounded-md bg-blue-600 px-3 py-[7px] text-[13px] font-medium text-white transition-colors hover:bg-blue-700 disabled:opacity-60",children:e?"Saving…":"Save & leave"})]})]})})}function h({target:e,addressing:n,onHostMessage:a,children:i}){/* @__PURE__ */
9
- return d(t,{target:e,addressing:n,onHostMessage:a,children:i})}var p=(e,n)=>/* @__PURE__ */o(c,{children:[e,n]});function u({config:e,parts:n,wrap:t=p}){const{data:i,error:o,redirecting:c,ready:h,saveStatus:u,readOnly:v,onChange:f,pendingNav:x,cancelPendingNav:b,discardAndNavigate:N,saveAndNavigate:y}=a(),C=s(()=>r(!v),[v]);return c?/* @__PURE__ */d("div",{className:"sf-msg",children:"Loading…"}):o?/* @__PURE__ */d("div",{className:"sf-msg sf-msg--error",children:o}):h?i?t(
10
- /* @__PURE__ */d(l,{config:e,data:i,onChange:f,permissions:C,parts:n,children:/* @__PURE__ */d(m,{})}),x&&/* @__PURE__ */d(g,{saving:"saving"===u,onCancel:b,onDiscard:N,onSave:()=>{y()}})):/* @__PURE__ */d("div",{className:"sf-msg",children:"Loading…"}):/* @__PURE__ */d("div",{className:"sf-msg",children:"Waiting for editor authorization…"})}export{u as DocumentScreen,h as ScreenMount};
@@ -1,4 +0,0 @@
1
- import{EaselCanvas as n,useSelectedFields as e}from"./chunk-P67FP7PG.js";import{Inspector as t}from"./chunk-BXZ6WLHC.js";import{DesktopIcon as r}from"./chunk-L5KW4HG5.js";import{createContext as o,useContext as i}from"react";import{jsx as u}from"react/jsx-runtime";var l={kind:"puck"};function s(n,e){const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}var c={},a=()=>c,d=()=>"",f=()=>{},p={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},k={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},h={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */u(r,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},m={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},v={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function b(){/* @__PURE__ */
2
- return u(n,{height:"fill"})}function g(){const{id:n,fields:r,values:o,readOnly:i,onChange:l}=e();/* @__PURE__ */
3
- return u("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */u(t,{fields:r,values:o,onChange:l,readOnly:i,idPrefix:n})})}var O=o({});function j({parts:n,children:e}){/* @__PURE__ */
4
- return u(O.Provider,{value:n,children:e})}function y(){return i(O)}function P(){return(y().useOwnerName??d)()}function w(n,e,t,r){return(y().useBridges??a)(n,e,t,r)}function G(n){return(y().useStandaloneBridges??a)(n)}function L(n,e){(y().useDocumentPass??f)(n,e)}function B(){return y().blockRules??p}function S(){return y().blockLook??k}function x(){return y().devices??h}function C(){return y().leftView??m}function N(){return y().pinned??v}function D(){return y().Canvas??b}function I(){return y().Inspector??g}export{l as SELECTION_MODE,j as ScreenPartsProvider,s as sameInspectorMode,S as useScreenBlockLook,B as useScreenBlockRules,w as useScreenBridges,D as useScreenCanvasFrame,x as useScreenDevices,L as useScreenDocumentPass,I as useScreenInspectorPanel,C as useScreenLeftView,P as useScreenOwnerName,y as useScreenParts,N as useScreenPinned,G as useStandaloneScreenBridges};
@@ -1 +0,0 @@
1
- import{hasMediaPanel as e,requestPanelPick as t}from"./chunk-ZZ7VLIHQ.js";var n=/* @__PURE__ */new Map,r=0;function i(i,o){if(!i.connected)return Promise.resolve(null);const c=(r+=1,`mp-${"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():String(r)}`);return e()?t({requestId:c,accept:o.accept,title:o.title,file:o.file??null}):new Promise(e=>{n.set(c,e),i.send("storefront-editor:open-media-picker",{requestId:c,accept:o.accept,title:o.title,...o.file?{file:o.file}:{}})})}function o(e,t){const r=n.get(e);r&&(n.delete(e),r(t))}export{i as requestMediaPick,o as resolveMediaPick};