@gemboss/ui 0.70.2 → 0.73.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 (141) hide show
  1. package/CHANGELOG.md +633 -3
  2. package/README.md +170 -11
  3. package/catalog/editor.html +1 -1
  4. package/catalog/index.html +48 -46
  5. package/gemboss-ui.css +4 -4
  6. package/package.json +32 -1
  7. package/parts/components.css +3 -3
  8. package/parts/core.css +1 -1
  9. package/parts/shell.css +2 -2
  10. package/src/app-nav.css +1 -1
  11. package/src/app-shell.css +1 -1
  12. package/src/assistant/chat-cards.tsx +118 -19
  13. package/src/assistant/chat.tsx +209 -22
  14. package/src/assistant/composer-menus.tsx +7 -2
  15. package/src/assistant/dock.ts +97 -10
  16. package/src/assistant/figures.tsx +119 -0
  17. package/src/assistant/gallery.tsx +67 -0
  18. package/src/assistant/hold.ts +51 -0
  19. package/src/assistant/host.tsx +258 -137
  20. package/src/assistant/ideas.tsx +90 -0
  21. package/src/assistant/index.ts +12 -3
  22. package/src/assistant/plus.tsx +61 -0
  23. package/src/assistant/provider.tsx +121 -24
  24. package/src/assistant/sessions.tsx +54 -20
  25. package/src/assistant/window-host.tsx +215 -0
  26. package/src/assistant/window.ts +120 -0
  27. package/src/assistant-chat.css +1 -1
  28. package/src/assistant-figures.css +1 -0
  29. package/src/assistant-hold.css +1 -0
  30. package/src/assistant-places.css +1 -0
  31. package/src/assistant-plain.js +1 -1
  32. package/src/assistant-plus.css +1 -0
  33. package/src/assistant-window-plain.js +1 -0
  34. package/src/assistant-window.css +1 -0
  35. package/src/assistant.css +1 -1
  36. package/src/auth-extras.css +1 -1
  37. package/src/auth-footer.css +1 -1
  38. package/src/auth-steps.css +1 -1
  39. package/src/auth.css +1 -1
  40. package/src/board-move.ts +2 -1
  41. package/src/chat-attachments.css +1 -1
  42. package/src/chat-cards-drawn.css +1 -0
  43. package/src/chat-cards-float.css +1 -0
  44. package/src/chat-cards.css +1 -1
  45. package/src/chat-composer-menus.css +1 -1
  46. package/src/chat-composer.css +1 -1
  47. package/src/chat-plain.js +6 -6
  48. package/src/chat-shortcuts.css +1 -0
  49. package/src/chat-voice.css +1 -1
  50. package/src/chat.css +1 -1
  51. package/src/chips-drawn.css +1 -0
  52. package/src/collections.css +1 -1
  53. package/src/collections.tsx +4 -2
  54. package/src/create-shell.css +1 -1
  55. package/src/dialog.css +1 -1
  56. package/src/editor/choice-cards.tsx +8 -5
  57. package/src/editor/controls.tsx +36 -9
  58. package/src/editor/field-control.tsx +17 -3
  59. package/src/editor/field-spec.ts +17 -4
  60. package/src/editor/index.ts +2 -0
  61. package/src/editor/media-words.ts +21 -0
  62. package/src/editor-color.css +1 -1
  63. package/src/editor-empty.css +1 -0
  64. package/src/editor-insert.css +1 -1
  65. package/src/editor-inspector-frame.css +1 -1
  66. package/src/editor-media.css +1 -1
  67. package/src/editor-picker-grid.css +1 -1
  68. package/src/editor-picker.css +1 -1
  69. package/src/editor-popover.css +1 -1
  70. package/src/editor-repeater.css +1 -1
  71. package/src/editor-tiles.css +1 -1
  72. package/src/editor.css +1 -1
  73. package/src/email-canvas.css +1 -0
  74. package/src/email-card.tsx +44 -0
  75. package/src/email-editor/canvas.tsx +109 -0
  76. package/src/email-editor/editor.tsx +45 -4
  77. package/src/email-editor/index.ts +2 -1
  78. package/src/email-editor/model.ts +9 -1
  79. package/src/email-editor.css +1 -1
  80. package/src/email-parts.css +1 -0
  81. package/src/email-parts.tsx +81 -0
  82. package/src/email-thumb.css +1 -0
  83. package/src/email-thumb.tsx +206 -0
  84. package/src/feedback-dialog.css +1 -0
  85. package/src/feedback-dialog.tsx +122 -0
  86. package/src/flow-strip.css +1 -0
  87. package/src/flow-strip.tsx +50 -0
  88. package/src/gemboss-field-drawn.css +1 -0
  89. package/src/gemboss-field.css +1 -1
  90. package/src/gems.css +1 -1
  91. package/src/icon-frame.tsx +31 -0
  92. package/src/icons.tsx +9 -9
  93. package/src/index.ts +12 -0
  94. package/src/job-card.css +1 -1
  95. package/src/kit-plain.css +1 -1
  96. package/src/kit-plain.js +1 -1
  97. package/src/language-switcher.css +1 -1
  98. package/src/list-page.css +1 -1
  99. package/src/list-page.tsx +6 -3
  100. package/src/list-toolbar.css +1 -1
  101. package/src/media-card.css +1 -0
  102. package/src/members.css +1 -1
  103. package/src/menu-extras.css +1 -1
  104. package/src/menu-layer.ts +2 -0
  105. package/src/menu-select.css +1 -1
  106. package/src/menu.css +1 -1
  107. package/src/menu.tsx +9 -4
  108. package/src/narration.css +1 -1
  109. package/src/pager-extras.css +1 -1
  110. package/src/pager.css +1 -1
  111. package/src/picture-actions.css +1 -0
  112. package/src/picture-actions.tsx +23 -0
  113. package/src/portal.css +1 -1
  114. package/src/question-card.css +1 -1
  115. package/src/rail-fold.css +1 -1
  116. package/src/reactions.css +1 -1
  117. package/src/reader-dialog.css +1 -1
  118. package/src/report-charts.css +1 -1
  119. package/src/segmented.tsx +6 -0
  120. package/src/service-switcher.css +1 -1
  121. package/src/session-rail-plain.js +1 -1
  122. package/src/settings-dialog.css +1 -1
  123. package/src/setup-guide.css +1 -1
  124. package/src/sheet.css +1 -1
  125. package/src/shell.css +1 -1
  126. package/src/shell.tsx +9 -2
  127. package/src/site.css +1 -1
  128. package/src/skill-card.css +1 -1
  129. package/src/skill-flow.css +1 -1
  130. package/src/skill-pages.css +1 -1
  131. package/src/skill-view.css +1 -1
  132. package/src/stage-path.css +1 -1
  133. package/src/stat-tile.css +1 -0
  134. package/src/stat-tile.tsx +39 -0
  135. package/src/status-list.css +1 -1
  136. package/src/team-chat.css +1 -1
  137. package/src/tray-plain.js +1 -0
  138. package/src/tray-search.tsx +116 -0
  139. package/src/tray.css +1 -0
  140. package/src/tray.tsx +250 -0
  141. package/src/ui.css +1 -1
@@ -5,12 +5,13 @@
5
5
  */
6
6
  export { EmailEditor, type EmailEditorProps } from "./editor";
7
7
  export { EmailPreview, type EmailDevice, type EmailPreviewProps } from "./preview";
8
+ export { EmailCanvas, EMAIL_CANVAS_CSS, emailCanvasDoc, type EmailCanvasDevice } from "./canvas";
8
9
  export {
9
10
  ADD_KINDS, BLOCK_HINT, BLOCK_NAME, BUILT_IN_VARIABLES, GEMREACH_BLOCK_TYPES, PERSONAL_LINK, PERSONAL_LINK_HOURS, PRODUCTS_SOURCE_NAME,
10
11
  PROPOSED_BLOCK_TYPES, REVIEW_LINK,
11
12
  blockLine, blockTag, checksLine, contrast, emailChecks, fillVariables, insertBlock, insertPlace, isPersonalLink, moveBlock, newBlock,
12
13
  removeBlock, stringsOf, usedVariables, variablesIn,
13
14
  type AddKind, type Align, type EmailBlock, type EmailBlockStyle, type EmailBlockType, type EmailBrand, type EmailCheck, type EmailColumn,
14
- type EmailDraft, type EmailPreviewPerson, type EmailPreviewProduct, type GemReachBlock, type ProductsBlock, type ProductsSource,
15
+ type EmailDraft, type EmailPreviewPerson, type EmailPreviewProduct, type GemReachBlock, type ProductsBlock, type ProductsLayout, type ProductsSource,
15
16
  type ReviewBlock, type Spacing,
16
17
  } from "./model";
@@ -54,7 +54,15 @@ export type GemReachBlock = EmailBlockStyle & (
54
54
  export type ProductsSource = "order" | "cart" | "viewed";
55
55
 
56
56
  /** PROPOSED for GemReach (#106): the products of this person's order, cart or views, filled when the mail is built. */
57
- export type ProductsBlock = EmailBlockStyle & { type: "products"; source: ProductsSource; count?: number; title?: string; button?: string; url?: string };
57
+ /** How a products block lays its products out (gemreach #183): one under another (the default, never stored), two to a row, or one card each. */
58
+ export type ProductsLayout = "list" | "grid" | "card";
59
+ export type ProductsBlock = EmailBlockStyle & {
60
+ type: "products"; source: ProductsSource; count?: number; title?: string; button?: string; url?: string;
61
+ /** Left out: "list". GemReach refuses any other value (400 invalid_blocks). */
62
+ layout?: Exclude<ProductsLayout, "list">;
63
+ /** "secondary": each product's button outlined, one filled call to action elsewhere in the email (Quiz result, Win back). */
64
+ button_style?: "secondary";
65
+ };
58
66
  /** PROPOSED for GemReach: the GemReview ask. `url` is the review page signed for the buyer (`{{review_url}}`). */
59
67
  export type ReviewBlock = EmailBlockStyle & { type: "review"; title: string; text?: string; button: string; url: string };
60
68
 
@@ -1 +1 @@
1
- .gb-emailed .gemboss-editor-tb-left{gap:8px;min-width:0}.gb-emailed-crumb{max-width:22ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-muted);font-weight:550}.gb-emailed-slash{color:var(--gemboss-divider)}.gb-emailed-name{max-width:28ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-strong)}.gb-emailed-chip,.gb-emailed-tag{flex:none;padding:1px 8px;border-radius:var(--gemboss-radius-sm);background:var(--gemboss-active-bg);font-size:var(--gemboss-fs-caption);font-weight:600;white-space:nowrap}.gb-emailed-tag{padding:1px 6px;background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong);font-size:var(--gemboss-fs-micro)}.gb-emailed-view{display:inline-flex;gap:6px}.gb-emailed-col{display:flex;flex-direction:column;min-height:0}.gb-emailed-chat{flex:1;min-height:0;display:flex;flex-direction:column}.gb-emailed-chat[hidden]{display:none}.gb-emailed-pane{flex:1;min-height:0;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.gb-emailed-pane>.gemboss-ei-head{margin:-12px -12px 4px}.gb-emailed-blocks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gb-emailed-row{display:flex;align-items:stretch;border-radius:10px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);background:var(--gemboss-surface)}.gb-emailed-row.is-sel{background:var(--gemboss-accent-soft);box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-emailed-row.is-hidden{opacity:.55}.gb-emailed-row-main{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:8px 10px;border:0;background:none;font:inherit;color:var(--gemboss-text);text-align:left;cursor:pointer;border-radius:10px}.gb-emailed-row-main:focus-visible,.gb-emailed-row-acts button:focus-visible,.gb-emailed-addend:focus-visible,.gb-emailed-checks:focus-visible,.gb-email-blk:focus-visible,.gb-email-env:focus-visible,.gb-email-add:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-emailed-row-t{flex:1;min-width:0;display:flex;flex-direction:column}.gb-emailed-row-t b{font-weight:550;color:var(--gemboss-text-strong)}.gb-emailed-row-t span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-row-acts{display:flex;align-items:center;gap:2px;padding-right:6px}.gb-emailed-row-acts button{width:26px;height:26px;border:0;border-radius:var(--gemboss-radius-sm);background:none;color:var(--gemboss-text-muted);font:inherit;cursor:pointer}.gb-emailed-row-acts button:hover:not(:disabled){background:var(--gemboss-hover);color:var(--gemboss-text)}.gb-emailed-row-acts button:disabled{opacity:.35;cursor:default}.gb-emailed-addend{min-height:36px;padding:0 12px;border:1.5px dashed var(--gemboss-divider);border-radius:10px;background:transparent;color:var(--gemboss-text);font:inherit;font-weight:550;cursor:pointer}.gb-emailed-addend:hover{border-color:var(--gemboss-accent);color:var(--gemboss-accent-strong)}.gb-emailed-addend span{color:var(--gemboss-text-muted);font-weight:450}.gb-emailed-sum{margin-top:4px;padding:12px;border-radius:10px;background:var(--gemboss-primary-soft);display:flex;flex-direction:column;gap:6px;align-items:flex-start}.gb-emailed-sum b{color:var(--gemboss-text-strong)}.gb-emailed-muted{margin:0;font-size:var(--gemboss-fs-caption);line-height:18px;color:var(--gemboss-text-muted)}.gb-emailed-pick{padding:10px;border-radius:12px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);display:flex;flex-direction:column;gap:8px}.gb-emailed-pick-head{display:flex;align-items:center;gap:8px}.gb-emailed-pick-head span{flex:1;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-emailed-vars{display:flex;flex-wrap:wrap;gap:4px;margin-top:-6px}.gb-emailed-personal{padding:10px 12px;border-radius:10px;background:var(--gemboss-accent-wash);box-shadow:inset 0 0 0 1px var(--gemboss-accent-tint);display:flex;flex-direction:column;align-items:flex-start;gap:4px;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-personal b{font-size:var(--gemboss-fs-body);color:var(--gemboss-text-strong)}.gb-emailed-from{color:var(--gemboss-text-muted)}.gb-emailed-stage{background:var(--gemboss-preview-canvas)}.gb-emailed-scroll{flex:1;min-width:0;overflow:auto;padding:24px}.gb-emailed-meta,.gb-emailed-checklist{max-width:640px;margin:0 auto 12px;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px}.gb-emailed-checklist{display:block;padding:12px;border-radius:12px;background:var(--gemboss-surface)}.gb-emailed-checks,.gb-emailed-as,.gb-emailed-note{padding:4px 10px;border:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-warning-soft);color:var(--gemboss-warning);font:inherit;font-size:var(--gemboss-fs-caption);font-weight:600}.gb-emailed-checks{cursor:pointer}.gb-emailed-checks.is-ok{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.gb-emailed-as,.gb-emailed-note{background:var(--gemboss-surface);color:var(--gemboss-text);font-weight:450}.gb-emailed-addmail{display:block;max-width:640px;width:100%;margin:12px auto 0;background:var(--gemboss-surface)}.gb-emailed-sent{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:8px}.gb-emailed-sent.is-mobile{max-width:375px}.gb-emailed-sent[aria-busy=true]{opacity:.6}.gb-emailed-sent-frame{display:block;width:100%;height:72vh;min-height:480px;border:0;border-radius:var(--gemboss-radius-md);background:var(--gemboss-surface)}.gb-emailed-sent-err{margin:0;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-email-col{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:12px;color:var(--gemboss-text)}.gb-email-col.is-mobile{max-width:375px}.gb-email-env{padding:12px 16px;border-radius:12px;background:var(--gemboss-surface);display:flex;flex-direction:column;gap:2px;cursor:pointer}.gb-email-env[aria-pressed=true]{box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-email-env-k,.gb-email-env-pre{color:var(--gemboss-text-muted)}.gb-email-mail{--gb-ink: var(--gb-email-ink, var(--gemboss-text));--gb-muted: var(--gb-email-muted, var(--gemboss-text-muted));--gb-line: var(--gb-email-line, var(--gemboss-divider-soft));border-radius:12px;background:var(--gb-email-bg, var(--gemboss-surface));color:var(--gb-ink);overflow:hidden;display:flex;flex-direction:column}.is-dark>.gb-email-mail{--gb-ink: var(--gemboss-dark-text);--gb-muted: var(--gemboss-dark-muted);--gb-line: var(--gemboss-dark-divider);background:var(--gemboss-dark-surface)}.gb-email-blk{position:relative;cursor:pointer}.gb-email-blk:hover{box-shadow:inset 0 0 0 1px var(--gemboss-accent-mid)}.gb-email-blk.is-sel{box-shadow:inset 0 0 0 2px var(--gemboss-accent)}.gb-email-addrow{position:relative;height:0;display:flex;justify-content:center;z-index:1}.gb-email-add{position:absolute;top:-14px;width:28px;height:28px;border:0;border-radius:50%;background:var(--gemboss-accent);color:var(--gemboss-on-primary);font:inherit;font-size:18px;line-height:1;cursor:pointer;box-shadow:var(--gemboss-shadow-raised)}.gb-email-logo{height:56px;display:grid;place-items:center;border-bottom:1px solid var(--gb-line);font-weight:700;letter-spacing:.2em;color:var(--gb-ink)}.gb-email-logo img{max-height:32px}.gb-email-al-left{text-align:left;justify-content:flex-start}.gb-email-al-center{text-align:center;justify-content:center}.gb-email-al-right{text-align:right;justify-content:flex-end}.gb-email-img img{display:block;width:100%;height:auto}.gb-email-img.is-empty{height:150px;display:grid;place-items:center;background:var(--gemboss-warning-soft);color:var(--gb-muted);font-size:var(--gemboss-fs-caption)}.gb-email-text{padding:24px 32px 8px;display:flex;flex-direction:column;gap:8px}.gb-email-h{margin:0;font-size:22px;line-height:28px;font-weight:700;color:var(--gb-ink)}.gb-email-p{margin:0;line-height:20px;color:var(--gb-ink)}.gb-email-strong{font-weight:650}.gb-email-muted{color:var(--gb-muted)}.gb-email-link{text-decoration:underline}.gb-email-var{padding:0 2px;border-radius:3px;background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.gb-email-products,.gb-email-review,.gb-email-band{padding:8px 32px;display:flex;flex-direction:column;gap:10px}.gb-email-review{align-items:center;text-align:center;padding-block:16px}.gb-email-pgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.gb-email-pgrid[data-count="1"]{grid-template-columns:minmax(0,1fr)}.gb-email-pgrid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.is-mobile .gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-email-pcard{border:1px solid var(--gb-line);border-radius:10px;overflow:hidden}.gb-email-pcard.is-one{margin:8px 32px;display:flex}.gb-email-pimg{height:80px;background:var(--gemboss-warning-soft)}.gb-email-pimg img{width:100%;height:100%;object-fit:cover}.gb-email-pbody{padding:8px 10px;display:flex;flex-direction:column}.gb-email-pbody span{color:var(--gb-muted)}.gb-email-btnrow{padding:12px 32px 24px;display:flex;justify-content:center}.gb-email-products .gb-email-btnrow,.gb-email-review .gb-email-btnrow,.gb-email-text .gb-email-btnrow,.gb-email-band .gb-email-btnrow{padding:4px 0 8px}.gb-email-btn{padding:12px 24px;border-radius:8px;background:var(--gb-email-btn, var(--gemboss-primary));color:var(--gb-email-btn-ink, var(--gemboss-on-primary));font-weight:600}.gb-email-stars{display:inline-flex;gap:4px;fill:none;stroke:var(--gemboss-warning);stroke-width:1.4}.gb-email-foot{padding:12px 32px 20px;border-top:1px solid var(--gb-line);text-align:center;font-size:var(--gemboss-fs-caption);color:var(--gb-muted)}.gb-email-foot p{margin:0 0 4px}.gb-email-quote{margin:8px 32px;padding:16px;border-radius:8px;background:var(--gemboss-primary-soft);font-style:italic}.gb-email-quote cite{display:block;margin-top:8px;font-style:normal;font-weight:600}.gb-email-list{margin:0;padding:8px 32px 8px 54px}.gb-email-cols{padding:8px 32px;display:grid;grid-template-columns:1fr 1fr;gap:16px}.gb-email-rule{margin:8px 32px;border:0;border-top:1px solid var(--gb-line)}.is-mobile .gb-email-text,.is-mobile .gb-email-products,.is-mobile .gb-email-review,.is-mobile .gb-email-btnrow,.is-mobile .gb-email-foot{padding-inline:20px}@media (max-width: 47.9975em){.gb-emailed-crumb,.gb-emailed-slash{display:none}.gb-emailed-scroll{padding:12px}.gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-emailed-row-main,.gb-emailed-addend,.gb-emailed-row-acts button{min-height:44px}.gb-emailed-row-acts button{min-width:44px}}
1
+ .gb-emailed .gemboss-editor-tb-left{gap:8px;min-width:0}.gb-emailed-crumb{max-width:22ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-muted);font-weight:550}.gb-emailed-slash{color:var(--gemboss-divider)}.gb-emailed-name{max-width:28ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gemboss-text-strong)}.gb-emailed-chip,.gb-emailed-tag{flex:none;padding:1px 8px;border-radius:var(--gemboss-radius-sm);background:var(--gemboss-active-bg);font-size:var(--gemboss-fs-caption);font-weight:600;white-space:nowrap}.gb-emailed-tag{padding:1px 6px;background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong);font-size:var(--gemboss-fs-micro)}.gb-emailed-view{display:inline-flex;gap:6px}.gb-emailed-col{display:flex;flex-direction:column;min-height:0}.gb-emailed-chat{flex:1;min-height:0;display:flex;flex-direction:column}.gb-emailed-chat[hidden]{display:none}.gb-emailed-pane{flex:1;min-height:0;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.gb-emailed-pane>.gemboss-ei-head{margin:-12px -12px 4px}.gb-emailed-blocks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gb-emailed-row{display:flex;align-items:stretch;border-radius:10px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);background:var(--gemboss-surface)}.gb-emailed-row.is-sel{background:var(--gemboss-accent-soft);box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-emailed-row.is-hidden{opacity:.55}.gb-emailed-row-main{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:8px 10px;border:0;background:none;font:inherit;color:var(--gemboss-text);text-align:left;cursor:pointer;border-radius:10px}.gb-emailed-row-main:focus-visible,.gb-emailed-row-acts button:focus-visible,.gb-emailed-addend:focus-visible,.gb-emailed-checks:focus-visible,.gb-email-blk:focus-visible,.gb-email-env:focus-visible,.gb-email-add:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-emailed-row-t{flex:1;min-width:0;display:flex;flex-direction:column}.gb-emailed-row-t b{font-weight:550;color:var(--gemboss-text-strong)}.gb-emailed-row-t span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-row-acts{display:flex;align-items:center;gap:2px;padding-right:6px}.gb-emailed-row-acts button{width:26px;height:26px;border:0;border-radius:var(--gemboss-radius-sm);background:none;color:var(--gemboss-text-muted);font:inherit;cursor:pointer}@media (hover: hover){.gb-emailed-row-acts button:hover:not(:disabled){background:var(--gemboss-hover);color:var(--gemboss-text)}}.gb-emailed-row-acts button:disabled{opacity:.35;cursor:default}.gb-emailed-addend{min-height:36px;padding:0 12px;border:1.5px dashed var(--gemboss-divider);border-radius:10px;background:transparent;color:var(--gemboss-text);font:inherit;font-weight:550;cursor:pointer}@media (hover: hover){.gb-emailed-addend:hover{border-color:var(--gemboss-accent);color:var(--gemboss-accent-strong)}}.gb-emailed-addend span{color:var(--gemboss-text-muted);font-weight:450}.gb-emailed-sum{margin-top:4px;padding:12px;border-radius:10px;background:var(--gemboss-primary-soft);display:flex;flex-direction:column;gap:6px;align-items:flex-start}.gb-emailed-sum b{color:var(--gemboss-text-strong)}.gb-emailed-muted{margin:0;font-size:var(--gemboss-fs-caption);line-height:18px;color:var(--gemboss-text-muted)}.gb-emailed-pick{padding:10px;border-radius:12px;box-shadow:inset 0 0 0 1px var(--gemboss-divider);display:flex;flex-direction:column;gap:8px}.gb-emailed-pick-head{display:flex;align-items:center;gap:8px}.gb-emailed-pick-head span{flex:1;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-emailed-vars{display:flex;flex-wrap:wrap;gap:4px;margin-top:-6px}.gb-emailed-personal{padding:10px 12px;border-radius:10px;background:var(--gemboss-accent-wash);box-shadow:inset 0 0 0 1px var(--gemboss-accent-tint);display:flex;flex-direction:column;align-items:flex-start;gap:4px;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted)}.gb-emailed-personal b{font-size:var(--gemboss-fs-body);color:var(--gemboss-text-strong)}.gb-emailed-from{color:var(--gemboss-text-muted)}.gb-emailed-stage{background:var(--gemboss-preview-canvas)}.gb-emailed-scroll{flex:1;min-width:0;overflow:auto;padding:24px}.gb-emailed-meta,.gb-emailed-checklist{max-width:640px;margin:0 auto 12px;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px}.gb-emailed-checklist{display:block;padding:12px;border-radius:12px;background:var(--gemboss-surface)}.gb-emailed-checks,.gb-emailed-as,.gb-emailed-note{padding:4px 10px;border:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-warning-soft);color:var(--gemboss-warning);font:inherit;font-size:var(--gemboss-fs-caption);font-weight:600}.gb-emailed-checks{cursor:pointer}.gb-emailed-checks.is-ok{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.gb-emailed-as,.gb-emailed-note{background:var(--gemboss-surface);color:var(--gemboss-text);font-weight:450}.gb-emailed-addmail{display:block;max-width:640px;width:100%;margin:12px auto 0;background:var(--gemboss-surface)}.gb-emailed-sent{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:8px}.gb-emailed-sent.is-mobile{max-width:375px}.gb-emailed-sent[aria-busy=true]{opacity:.6}.gb-emailed-sent-frame{display:block;width:100%;height:72vh;min-height:480px;border:0;border-radius:var(--gemboss-radius-md);background:var(--gemboss-surface)}.gb-emailed-sent-err{margin:0;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gb-email-col{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:12px;color:var(--gemboss-text)}.gb-email-col.is-mobile{max-width:375px}.gb-email-env{padding:12px 16px;border-radius:12px;background:var(--gemboss-surface);display:flex;flex-direction:column;gap:2px;cursor:pointer}.gb-email-env[aria-pressed=true]{box-shadow:inset 0 0 0 1.5px var(--gemboss-accent)}.gb-email-env-k,.gb-email-env-pre{color:var(--gemboss-text-muted)}.gb-email-mail{--gb-ink: var(--gb-email-ink, var(--gemboss-text));--gb-muted: var(--gb-email-muted, var(--gemboss-text-muted));--gb-line: var(--gb-email-line, var(--gemboss-divider-soft));border-radius:12px;background:var(--gb-email-bg, var(--gemboss-surface));color:var(--gb-ink);overflow:hidden;display:flex;flex-direction:column}.is-dark>.gb-email-mail{--gb-ink: var(--gemboss-dark-text);--gb-muted: var(--gemboss-dark-muted);--gb-line: var(--gemboss-dark-divider);background:var(--gemboss-dark-surface)}.gb-email-blk{position:relative;cursor:pointer}@media (hover: hover){.gb-email-blk:hover{box-shadow:inset 0 0 0 1px var(--gemboss-accent-mid)}}.gb-email-blk.is-sel{box-shadow:inset 0 0 0 2px var(--gemboss-accent)}.gb-email-addrow{position:relative;height:0;display:flex;justify-content:center;z-index:1}.gb-email-add{position:absolute;top:-14px;width:28px;height:28px;border:0;border-radius:50%;background:var(--gemboss-accent);color:var(--gemboss-on-primary);font:inherit;font-size:18px;line-height:1;cursor:pointer;box-shadow:var(--gemboss-shadow-raised)}.gb-email-logo{height:56px;display:grid;place-items:center;border-bottom:1px solid var(--gb-line);font-weight:700;letter-spacing:.2em;color:var(--gb-ink)}.gb-email-logo img{max-height:32px}.gb-email-al-left{text-align:left;justify-content:flex-start}.gb-email-al-center{text-align:center;justify-content:center}.gb-email-al-right{text-align:right;justify-content:flex-end}.gb-email-img img{display:block;width:100%;height:auto}.gb-email-img.is-empty{height:150px;display:grid;place-items:center;background:var(--gemboss-warning-soft);color:var(--gb-muted);font-size:var(--gemboss-fs-caption)}.gb-email-text{padding:24px 32px 8px;display:flex;flex-direction:column;gap:8px}.gb-email-h{margin:0;font-size:22px;line-height:28px;font-weight:700;color:var(--gb-ink)}.gb-email-p{margin:0;line-height:20px;color:var(--gb-ink)}.gb-email-strong{font-weight:650}.gb-email-muted{color:var(--gb-muted)}.gb-email-link{text-decoration:underline}.gb-email-var{padding:0 2px;border-radius:3px;background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.gb-email-products,.gb-email-review,.gb-email-band{padding:8px 32px;display:flex;flex-direction:column;gap:10px}.gb-email-review{align-items:center;text-align:center;padding-block:16px}.gb-email-pgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.gb-email-pgrid[data-count="1"]{grid-template-columns:minmax(0,1fr)}.gb-email-pgrid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}.is-mobile .gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-email-pcard{border:1px solid var(--gb-line);border-radius:10px;overflow:hidden}.gb-email-pcard.is-one{margin:8px 32px;display:flex}.gb-email-pimg{height:80px;background:var(--gemboss-warning-soft)}.gb-email-pimg img{width:100%;height:100%;object-fit:cover}.gb-email-pbody{padding:8px 10px;display:flex;flex-direction:column}.gb-email-pbody span{color:var(--gb-muted)}.gb-email-btnrow{padding:12px 32px 24px;display:flex;justify-content:center}.gb-email-products .gb-email-btnrow,.gb-email-review .gb-email-btnrow,.gb-email-text .gb-email-btnrow,.gb-email-band .gb-email-btnrow{padding:4px 0 8px}.gb-email-btn{padding:12px 24px;border-radius:8px;background:var(--gb-email-btn, var(--gemboss-primary));color:var(--gb-email-btn-ink, var(--gemboss-on-primary));font-weight:600}.gb-email-stars{display:inline-flex;gap:4px;fill:none;stroke:var(--gemboss-warning);stroke-width:1.4}.gb-email-foot{padding:12px 32px 20px;border-top:1px solid var(--gb-line);text-align:center;font-size:var(--gemboss-fs-caption);color:var(--gb-muted)}.gb-email-foot p{margin:0 0 4px}.gb-email-quote{margin:8px 32px;padding:16px;border-radius:8px;background:var(--gemboss-primary-soft);font-style:italic}.gb-email-quote cite{display:block;margin-top:8px;font-style:normal;font-weight:600}.gb-email-list{margin:0;padding:8px 32px 8px 54px}.gb-email-cols{padding:8px 32px;display:grid;grid-template-columns:1fr 1fr;gap:16px}.gb-email-rule{margin:8px 32px;border:0;border-top:1px solid var(--gb-line)}.is-mobile .gb-email-text,.is-mobile .gb-email-products,.is-mobile .gb-email-review,.is-mobile .gb-email-btnrow,.is-mobile .gb-email-foot{padding-inline:20px}@media (max-width: 47.9975em){.gb-emailed-crumb,.gb-emailed-slash{display:none}.gb-emailed-scroll{padding:12px}.gb-email-pgrid{grid-template-columns:minmax(0,1fr)}.gb-emailed-row-main,.gb-emailed-addend,.gb-emailed-row-acts button{min-height:44px}.gb-emailed-row-acts button{min-width:44px}}
@@ -0,0 +1 @@
1
+ .ui-emailparts{display:flex;flex-direction:column;gap:10px;min-width:0}.ui-emailparts__head{display:flex;align-items:center;gap:8px}.ui-emailparts__title{margin:0;color:var(--ui-text);font-size:14px;line-height:20px;font-weight:650}.ui-emailparts__aside{margin-left:auto;color:var(--ui-text-muted);font-size:var(--ui-fs-caption)}.ui-emailparts__part{position:relative;display:block;width:100%;min-height:40px;overflow:hidden;border-radius:6px;background:#fff;box-shadow:0 0 0 1px var(--ui-border)}.ui-emailparts__part--mark{box-shadow:0 0 0 2px var(--gemboss-warning)}.ui-emailparts__frame{position:absolute;top:0;left:0;display:block;border:0;background:#fff;color-scheme:light;transform-origin:0 0;pointer-events:none}.ui-emailparts__part--wait{height:56px;background:linear-gradient(90deg,var(--ui-surface-2) 25%,var(--ui-border) 37%,var(--ui-surface-2) 63%);background-size:400% 100%;animation:ui-skeleton-sheen 1.4s ease-in-out infinite}.ui-emailparts__part--tall{height:64px}.ui-emailparts__gap{color:var(--ui-text-muted);line-height:8px;text-align:center}.ui-emailparts__note{color:var(--ui-text-muted);font-size:var(--ui-fs-caption);line-height:16px}@media (prefers-reduced-motion: reduce){.ui-emailparts__part--wait{animation:none;background:var(--ui-surface-2)}}
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ /**
3
+ * EmailParts (15/11/2026, unreleased): the email preview panel, what a brand setting puts in EVERY email, read off the real email:
4
+ * its top (the logo or the name) and its foot (the postal address, the unsubscribe links), with "⋯" between. Canvas
5
+ * NqQGmVzRJMjv536LLbMGaT, boards R1 and R2 (GemBoss Settings › Email › Email brand: "In every email · as sent"), so a change to
6
+ * the logo, the button colour or the address is seen as shoppers see it, not described.
7
+ *
8
+ * `html` is one email as sent (GemReach's thumbnail of a store email). Each part is that email in its own sandboxed iframe with
9
+ * every row of its card hidden but the first (`head`) or the last (`foot`), laid out at 600px and scaled to the panel's width.
10
+ * `sandbox="allow-same-origin"` and NOTHING else: no script runs in it; the page reads the part's height once it has drawn, so
11
+ * the box is exactly as tall as the part (an address on two lines). `mark` rings the foot in the warning tone (an address not
12
+ * confirmed yet, R2) and `note` says why under it. Until `html` comes: the kit's skeleton; `null`: the parts are not drawn and
13
+ * `note` says the rest.
14
+ */
15
+ import "./email-parts.css";
16
+ import React, { useState } from "react";
17
+ import { EMAIL_THUMB_FRAME, emailThumbDoc } from "./email-thumb";
18
+
19
+ const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
20
+
21
+ /** A part is laid out at the card's own 600px: GemReach's phone layout (620 and under) only narrows its sides to 20px, which is how
22
+ * the board crops them (R1: the address 11px in from the box's edge at 366px). */
23
+ export const EMAIL_PART_WIDTH = 600;
24
+
25
+ /** GemReach's mail card shown one row at a time: the first row (`head`, its logo in the middle of the box), or the last (`foot`) without its rule above. */
26
+ export const EMAIL_PART_CSS: Record<"head" | "foot", string> = {
27
+ head: ".gr-card>tbody>tr:not(:first-child){display:none!important}.gr-card>tbody>tr:first-child>td{padding-top:20px!important;padding-bottom:20px!important}",
28
+ foot: ".gr-card>tbody>tr:not(:last-child){display:none!important}.gr-card>tbody>tr:last-child>td{border-top:0!important}",
29
+ };
30
+
31
+ function EmailPart({ html, part, label, mark }: { html: string; part: "head" | "foot"; label: string; mark?: boolean }) {
32
+ const [height, setHeight] = useState<number | null>(null);
33
+ const [width, setWidth] = useState<number | null>(null);
34
+ const scale = width ? width / EMAIL_PART_WIDTH : null;
35
+ return (
36
+ <span className={cx("ui-emailparts__part", mark && "ui-emailparts__part--mark")}
37
+ ref={(el) => { if (el && el.clientWidth && el.clientWidth !== width) setWidth(el.clientWidth); }}
38
+ style={height && scale ? { height: Math.ceil(height * scale) } : undefined}>
39
+ <iframe className="ui-emailparts__frame" title={label} sandbox="allow-same-origin" tabIndex={-1}
40
+ srcDoc={emailThumbDoc(html, `${EMAIL_THUMB_FRAME}${EMAIL_PART_CSS[part]}`)}
41
+ style={{ width: EMAIL_PART_WIDTH, height: height ?? 120, ...(scale ? { transform: `scale(${scale})` } : {}) }}
42
+ onLoad={(e) => {
43
+ const doc = e.currentTarget.contentDocument;
44
+ const h = doc?.querySelector(".gr-card")?.getBoundingClientRect().height ?? doc?.documentElement.scrollHeight;
45
+ if (h) setHeight(Math.ceil(h));
46
+ }} />
47
+ </span>
48
+ );
49
+ }
50
+
51
+ export function EmailParts({ html, title = "In every email", aside = "as sent", mark, note, className }: {
52
+ /** One email as sent; undefined while it is asked for; null when it could not be drawn. */
53
+ html: string | null | undefined;
54
+ title?: React.ReactNode;
55
+ aside?: React.ReactNode;
56
+ /** Ring the foot: something in it is not printed yet (R2). */
57
+ mark?: boolean;
58
+ /** One line under the parts. */
59
+ note?: React.ReactNode;
60
+ className?: string;
61
+ }) {
62
+ return (
63
+ <aside className={cx("ui-card ui-emailparts", className)} aria-label={typeof title === "string" ? title : undefined}>
64
+ <div className="ui-emailparts__head"><h2 className="ui-emailparts__title">{title}</h2>{aside ? <span className="ui-emailparts__aside">{aside}</span> : null}</div>
65
+ {html === undefined ? (
66
+ <>
67
+ <span className="ui-emailparts__part ui-emailparts__part--wait" aria-hidden="true" />
68
+ <span className="ui-emailparts__gap" aria-hidden="true">⋯</span>
69
+ <span className="ui-emailparts__part ui-emailparts__part--wait ui-emailparts__part--tall" aria-hidden="true" />
70
+ </>
71
+ ) : html ? (
72
+ <>
73
+ <EmailPart html={html} part="head" label="The top of every email" />
74
+ <span className="ui-emailparts__gap" aria-hidden="true">⋯</span>
75
+ <EmailPart html={html} part="foot" label="The foot of every email" mark={mark} />
76
+ </>
77
+ ) : null}
78
+ {note ? <div className="ui-emailparts__note">{note}</div> : null}
79
+ </aside>
80
+ );
81
+ }
@@ -0,0 +1 @@
1
+ .ui-emailthumb{--ui-emailthumb-scale: .42;position:relative;display:block;width:100%;height:100%;overflow:hidden;background:#fff}.ui-emailthumb--list{--ui-emailthumb-scale: .1446;flex:none;width:96px;height:72px;border-radius:6px;box-shadow:0 0 0 1px var(--ui-border)}.ui-emailthumb--sm{--ui-emailthumb-scale: .0843;flex:none;width:56px;height:42px;border-radius:4px;box-shadow:0 0 0 1px var(--ui-border)}.ui-emailthumb__frame{position:absolute;top:0;left:0;display:block;border:0;background:#fff;color-scheme:light;transform:scale(var(--ui-emailthumb-scale));transform-origin:0 0;pointer-events:none}.ui-emailthumb>.ui-emailthumb__wait{position:absolute;inset:0;display:block;border-radius:inherit;background:linear-gradient(90deg,var(--ui-surface-2) 25%,var(--ui-border) 37%,var(--ui-surface-2) 63%);background-size:400% 100%;animation:ui-skeleton-sheen 1.4s ease-in-out infinite}.ui-emailthumb>.ui-emailthumb__none{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:inherit;background:var(--ui-surface-2);color:var(--ui-text-muted)}@media (prefers-reduced-motion: reduce){.ui-emailthumb>.ui-emailthumb__wait{animation:none;background:var(--ui-surface-2)}}.ui-thumbcell{display:flex;align-items:center;gap:12px;min-width:0}.ui-thumbcell__body{display:flex;flex-direction:column;gap:6px;min-width:0}.ui-thumbcell__title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ui-text-muted)}.ui-thumbcell__title>b{font-weight:600;color:var(--ui-text)}.ui-thumbcell__title>b>a{color:inherit;text-decoration:none}.ui-thumbcell__context{color:var(--ui-text-muted)}@media (hover: hover){.ui-thumbcell__title>b>a:hover{text-decoration:underline}}.ui-thumbcell__line{display:block;min-width:0;color:var(--ui-text-muted)}
@@ -0,0 +1,206 @@
1
+ "use client";
2
+ /**
3
+ * EmailThumb (15/11/2026, unreleased): an email shown as itself, small. The HTML the email is sent as (GemReach's thumbnail,
4
+ * `GET /t/v1/templates/:id/thumbnail`: the store's brand kit, a sample person, the marketing footer) is drawn in a sandboxed iframe
5
+ * (`srcdoc`, `sandbox=""`: no script runs, nothing is read back) and scaled down with a CSS transform, cropped to its box. Canvas
6
+ * NqQGmVzRJMjv536LLbMGaT, board L6 option 1 (Chris 15/11/2026, J2 Q9: "an iframe first, a PNG later"); it replaced a drawn
7
+ * envelope that looked the same for every email (G30).
8
+ *
9
+ * Three sizes, one email:
10
+ * - `fill` (the default): the box it is put in, a MediaCard's 4:3 picture (EmailCard), a Stage window;
11
+ * - `list`: 96×72, the picture of a row or a table cell (ResourceItem's `media`, ThumbCell);
12
+ * - `sm`: 56×42, a small row (an overview's "Needs you", a funnel's email panel).
13
+ *
14
+ * The email is laid out at `width` (664 by default) before it is scaled: GemReach's mail is a 600px column that turns into its phone
15
+ * layout at 620 and under (one column, 20px sides), so it is laid out a little wider than itself to look as it does on a computer,
16
+ * with 32px of white on each side. `frameCss` lays it on white from the top of its card (`EMAIL_THUMB_FRAME`), as a card shows it.
17
+ *
18
+ * Lazy: with `load`, nothing is asked until the box comes within 200px of the screen (an IntersectionObserver), and at most four
19
+ * emails are asked at once on a page. `cacheKey` keeps the answer in the page's memory, so the same email in a second place draws at
20
+ * once. Until it draws: the kit's skeleton sheen. An email that does not draw (`load` answers null, or fails): the box stays, an
21
+ * envelope in it, and the card says the rest.
22
+ *
23
+ * The frame is decoration: the card or the row it sits in names the email, so it is out of the tab order and hidden from a screen
24
+ * reader (`title` is still given, as every iframe should have one).
25
+ */
26
+ import "./email-thumb.css";
27
+ import React, { useEffect, useRef, useState } from "react";
28
+ import { Icon } from "./icons";
29
+
30
+ const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
31
+
32
+ export type EmailThumbSize = "fill" | "list" | "sm";
33
+
34
+ /** The width an email is laid out at before it is scaled (see the module's note). */
35
+ export const EMAIL_THUMB_WIDTH = 664;
36
+
37
+ /**
38
+ * GemReach's mail on white, from the top of its card: the grey around the card and the 24px above it go, so the logo sits near the
39
+ * top of the box as a card's picture shows it. The rest of the email is untouched. `:root` light: a thumbnail is the email as most
40
+ * people open it, whatever the admin's own scheme.
41
+ */
42
+ export const EMAIL_THUMB_FRAME =
43
+ ":root{color-scheme:light!important}html,body{margin:0!important;background:#fff!important;overflow:hidden!important}" +
44
+ ".gr-bg{background-color:#fff!important}body>table.gr-bg>tbody>tr>td{padding:0!important}";
45
+
46
+ /** The iframe's document: the email, with `css` laid over it last (just before `</head>`, else at the very top). */
47
+ export function emailThumbDoc(html: string, css: string | null = EMAIL_THUMB_FRAME): string {
48
+ if (!css) return html;
49
+ const style = `<style data-ui-email-thumb>${css}</style>`;
50
+ const at = html.search(/<\/head\s*>/i);
51
+ return at >= 0 ? `${html.slice(0, at)}${style}${html.slice(at)}` : `${style}${html}`;
52
+ }
53
+
54
+ /** How much the email is scaled to fill a box `box` px wide; the frame's own height so it reaches the box's bottom. */
55
+ export function emailThumbFit(box: { width: number; height: number }, width = EMAIL_THUMB_WIDTH): { scale: number; height: number } {
56
+ if (!(box.width > 0) || !(width > 0)) return { scale: 0, height: 0 };
57
+ const scale = box.width / width;
58
+ return { scale, height: Math.ceil((box.height > 0 ? box.height : (box.width * 3) / 4) / scale) };
59
+ }
60
+
61
+ // ── The page's memory, and four asks at a time ──────────────────────────────────────────────────────────────────────────────
62
+
63
+ const KEEP = 200;
64
+ const kept = new Map<string, Promise<string | null>>();
65
+ let running = 0;
66
+ const waiting: Array<() => void> = [];
67
+
68
+ /** At most four emails are asked at once: a gallery of 40 does not send 40 requests in the same tick. */
69
+ function inTurn<T>(work: () => Promise<T>): Promise<T> {
70
+ return new Promise<T>((resolve, reject) => {
71
+ const go = () => {
72
+ running += 1;
73
+ work().then(resolve, reject).finally(() => {
74
+ running -= 1;
75
+ waiting.shift()?.();
76
+ });
77
+ };
78
+ if (running < 4) go();
79
+ else waiting.push(go);
80
+ });
81
+ }
82
+
83
+ /**
84
+ * The email's HTML, asked once per `key` on this page (the newest 200 kept). A failure is not kept: the next box that shows it asks
85
+ * again. Exported for the tests and for a screen that wants to warm a few before they scroll in.
86
+ */
87
+ export function loadEmailThumb(key: string | undefined, load: () => Promise<string | null>): Promise<string | null> {
88
+ if (!key) return inTurn(load);
89
+ const hit = kept.get(key);
90
+ if (hit) {
91
+ kept.delete(key);
92
+ kept.set(key, hit);
93
+ return hit;
94
+ }
95
+ const asked = inTurn(load);
96
+ kept.set(key, asked);
97
+ asked.catch(() => kept.delete(key));
98
+ while (kept.size > KEEP) kept.delete(kept.keys().next().value!);
99
+ return asked;
100
+ }
101
+
102
+ /** Forget the page's emails (tests; a screen that knows every email changed, like a brand kit saved). */
103
+ export function forgetEmailThumbs(): void {
104
+ kept.clear();
105
+ }
106
+
107
+ export interface EmailThumbProps {
108
+ /** The email's HTML. Given, it draws at once (no `load`). */
109
+ html?: string | null;
110
+ /** Asked for the HTML when the box comes near the screen. Null, or a failure, draws the envelope. */
111
+ load?: () => Promise<string | null>;
112
+ /** Names this email in the page's memory (its id and version, or the answer's ETag). */
113
+ cacheKey?: string;
114
+ /** The frame's title (what the email is). */
115
+ title: string;
116
+ size?: EmailThumbSize;
117
+ /** The width the email is laid out at, before it is scaled. */
118
+ width?: number;
119
+ /** Laid over the email last; `null` draws it as sent, grey around the card. */
120
+ frameCss?: string | null;
121
+ className?: string;
122
+ }
123
+
124
+ type State = "idle" | "loading" | "drawing" | "drawn" | "none";
125
+ // Whole class names, never built from a template (the admin's orphan-rule gate reads them).
126
+ const SIZE: Record<EmailThumbSize, string | null> = { fill: null, list: "ui-emailthumb--list", sm: "ui-emailthumb--sm" };
127
+
128
+ export function EmailThumb({ html, load, cacheKey, title, size = "fill", width = EMAIL_THUMB_WIDTH, frameCss = EMAIL_THUMB_FRAME, className }: EmailThumbProps) {
129
+ const box = useRef<HTMLSpanElement>(null);
130
+ const [got, setGot] = useState<string | null | undefined>(html ?? undefined);
131
+ const [state, setState] = useState<State>(html ? "drawing" : html === null && !load ? "none" : "idle");
132
+ const [fit, setFit] = useState<{ scale: number; height: number } | null>(null);
133
+
134
+ // The HTML: given, or asked once the box is near the screen.
135
+ useEffect(() => {
136
+ if (html !== undefined && html !== null) { setGot(html); setState("drawing"); return; }
137
+ if (!load) { setState("none"); return; }
138
+ const el = box.current;
139
+ let gone = false;
140
+ const ask = () => {
141
+ setState("loading");
142
+ loadEmailThumb(cacheKey, load).then(
143
+ (h) => { if (!gone) { setGot(h); setState(h ? "drawing" : "none"); } },
144
+ () => { if (!gone) setState("none"); },
145
+ );
146
+ };
147
+ if (!el || typeof IntersectionObserver === "undefined") { ask(); return () => { gone = true; }; }
148
+ const io = new IntersectionObserver((seen) => {
149
+ if (seen.some((s) => s.isIntersecting)) { io.disconnect(); ask(); }
150
+ }, { rootMargin: "200px" });
151
+ io.observe(el);
152
+ return () => { gone = true; io.disconnect(); };
153
+ // `load` is a new function on every render of the caller: the email is named by `cacheKey` and `html`.
154
+ // eslint-disable-next-line react-hooks/exhaustive-deps
155
+ }, [html, cacheKey]);
156
+
157
+ // The scale, from the box's own size (a card's width follows the grid).
158
+ useEffect(() => {
159
+ const el = box.current;
160
+ if (!el) return;
161
+ const measure = () => setFit(emailThumbFit({ width: el.clientWidth, height: el.clientHeight }, width));
162
+ measure();
163
+ if (typeof ResizeObserver === "undefined") return;
164
+ const ro = new ResizeObserver(measure);
165
+ ro.observe(el);
166
+ return () => ro.disconnect();
167
+ }, [width]);
168
+
169
+ const style = fit && fit.scale > 0 ? ({ "--ui-emailthumb-scale": String(fit.scale) } as React.CSSProperties) : undefined;
170
+ return (
171
+ <span ref={box} className={cx("ui-emailthumb", SIZE[size], className)} data-state={state} style={style}>
172
+ {got && state !== "none" ? (
173
+ <iframe className="ui-emailthumb__frame" title={title} sandbox="" srcDoc={emailThumbDoc(got, frameCss)} tabIndex={-1} aria-hidden="true"
174
+ loading="lazy" style={{ width, height: fit?.height || Math.ceil((width * 3) / 4) }} onLoad={() => setState("drawn")} />
175
+ ) : null}
176
+ {state === "none" ? <span className="ui-emailthumb__none" aria-hidden="true"><Icon name="inbox" size={size === "sm" ? 14 : size === "list" ? 18 : 24} /></span>
177
+ : state !== "drawn" ? <span className="ui-emailthumb__wait" aria-hidden="true" /> : null}
178
+ </span>
179
+ );
180
+ }
181
+
182
+ /**
183
+ * ThumbCell: a table cell or a row's start that holds a picture and words, the kit's table cells holding text only. The picture (an
184
+ * EmailThumb `list`), then the name in bold with its context muted after a middle dot ("Welcome · Whole store"), then one more line
185
+ * under it: a FlowStrip, a subject, a count. Board N2's Flow column.
186
+ */
187
+ export function ThumbCell({ thumb, title, context, children, className }: {
188
+ thumb: React.ReactNode;
189
+ /** The name: a link to the thing when the row opens it. */
190
+ title: React.ReactNode;
191
+ /** Where it runs, what it is for: muted after a middle dot. */
192
+ context?: React.ReactNode;
193
+ /** The second line. */
194
+ children?: React.ReactNode;
195
+ className?: string;
196
+ }) {
197
+ return (
198
+ <span className={cx("ui-thumbcell", className)}>
199
+ {thumb}
200
+ <span className="ui-thumbcell__body">
201
+ <span className="ui-thumbcell__title"><b>{title}</b>{context ? <span className="ui-thumbcell__context"> · {context}</span> : null}</span>
202
+ {children ? <span className="ui-thumbcell__line">{children}</span> : null}
203
+ </span>
204
+ </span>
205
+ );
206
+ }
@@ -0,0 +1 @@
1
+ .ui-fbd-body{display:flex;flex-direction:column;gap:12px;margin:0}.ui-fbd-field{display:flex;flex-direction:column;gap:4px}.ui-fbd-label{font-size:13px;line-height:20px;font-weight:600;color:var(--ui-text,#303030)}.ui-fbd-field .gemboss-field{width:100%;box-sizing:border-box}.ui-fbd-note,.ui-fbd-said{margin:0;font-size:13px;line-height:20px;color:var(--ui-text-muted,#616161)}.ui-fbd-said{color:var(--ui-text,#303030)}.ui-fbd-error{margin:0;font-size:13px;line-height:20px;color:var(--p-color-text-critical,#8e1f0b)}.ui-fbd-foot{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ // A REQUEST TO SEND, WRITTEN FOR THE PERSON, OPEN IN THE MIDDLE OF THE SCREEN (Chris 13/11/2026: "user thấy có kiểu suggestion trong chat
3
+ // bấm vào thì thấy sẵn cái feedback form bật giữa màn hình kèm nội dung đã tạo sẵn có thể bấm send"). Gem could not do what was asked, or
4
+ // the person wants something the product lacks: the chat's Send feedback button opens this, its title and details already written. The
5
+ // person reads it, changes what they like, and presses Send; the host posts it (GemFeedback, under their name) and says where it went.
6
+ // The kit's Dialog (centred; words changed and not sent: Escape, ✕ and the backdrop ask first, and Cancel is a choice and closes, as in
7
+ // every kit dialog, IdeaDialog's 10/11/2026); the one field family
8
+ // (gemboss-field, ui-textarea); every word English (fleet UI language), the host's `labels` for another.
9
+ import "./feedback-dialog.css";
10
+ import { useEffect, useId, useRef, useState } from "react";
11
+ import { Dialog } from "./dialog";
12
+
13
+ export interface FeedbackDraftValue { title: string; details: string }
14
+ /** How the host's send went: where the request now is, or why it is not there (said in the form, the words kept). `already`: it was
15
+ * sent before (another tab), so nothing new went: said as that, not as sent. */
16
+ export type FeedbackSendResult = { ok: true; url?: string; held?: boolean; already?: boolean } | { ok: false; error: string };
17
+
18
+ export interface FeedbackDialogLabels {
19
+ title: string; titleField: string; detailsField: string; note: string; cancel: string; send: string; sending: string;
20
+ sentTitle: string; sent: string; held: string; view: string; done: string; alreadyTitle: string; already: string;
21
+ }
22
+ export const FEEDBACK_DIALOG_LABELS: FeedbackDialogLabels = {
23
+ title: "Send feedback",
24
+ titleField: "Title",
25
+ detailsField: "Details",
26
+ note: "Posted on GemFeedback under your name. Others can vote and comment, and you hear back by email.",
27
+ cancel: "Cancel",
28
+ send: "Send",
29
+ sending: "Sending…",
30
+ sentTitle: "Feedback sent",
31
+ sent: "Thanks. The GemBoss team reads every request.",
32
+ held: "It shows on the board once the team has had a quick look.",
33
+ view: "View on GemFeedback",
34
+ done: "Done",
35
+ alreadyTitle: "Already sent",
36
+ already: "This request was sent before, so nothing new was posted. To add to it, comment on it on GemFeedback.",
37
+ };
38
+
39
+ export interface FeedbackDialogProps {
40
+ open: boolean;
41
+ /** Every way it closes (Escape, ✕, the backdrop, Cancel, Done). With words changed, Escape, ✕ and the backdrop ask first. */
42
+ onClose: () => void;
43
+ /** The request as written for the person: the form opens on it. */
44
+ draft: FeedbackDraftValue;
45
+ /** Post it. Never throws: a refusal comes back as `{ ok: false, error }` and is said in the form. */
46
+ onSend: (draft: FeedbackDraftValue) => Promise<FeedbackSendResult>;
47
+ /** It was sent: the host remembers it (the button under the answer says Sent). */
48
+ onSent?: (result: Extract<FeedbackSendResult, { ok: true }>, draft: FeedbackDraftValue) => void;
49
+ labels?: Partial<FeedbackDialogLabels>;
50
+ /** GemFeedback's bounds by default (a one-line title of 3 to 120 characters, details up to 5000). */
51
+ titleMax?: number;
52
+ detailsMax?: number;
53
+ }
54
+
55
+ export function FeedbackDialog({ open, onClose, draft, onSend, onSent, labels, titleMax = 120, detailsMax = 5000 }: FeedbackDialogProps) {
56
+ const L = { ...FEEDBACK_DIALOG_LABELS, ...labels };
57
+ const id = useId();
58
+ const [title, setTitle] = useState(draft.title);
59
+ const [details, setDetails] = useState(draft.details);
60
+ const [sending, setSending] = useState(false);
61
+ const [error, setError] = useState<string | null>(null);
62
+ const [sent, setSent] = useState<Extract<FeedbackSendResult, { ok: true }> | null>(null);
63
+ // One send at a time: Enter twice before the button turns off would post it twice.
64
+ const busy = useRef(false);
65
+ // Opened again (or on another draft): the words as written, nothing said.
66
+ useEffect(() => {
67
+ if (!open) return;
68
+ setTitle(draft.title); setDetails(draft.details); setSending(false); setError(null); setSent(null);
69
+ }, [open, draft.title, draft.details]);
70
+ const ready = title.trim().length >= 3 && !sending;
71
+ const dirty = !sent && (title !== draft.title || details !== draft.details);
72
+ const send = async () => {
73
+ if (!ready || busy.current) return;
74
+ busy.current = true;
75
+ setSending(true); setError(null);
76
+ const value = { title: title.trim(), details: details.trim() };
77
+ const r = await onSend(value).catch(() => ({ ok: false as const, error: "It could not be sent. Try again." }));
78
+ busy.current = false;
79
+ setSending(false);
80
+ if (r.ok) { setSent(r); onSent?.(r, value); } else setError(r.error);
81
+ };
82
+
83
+ if (sent) {
84
+ return (
85
+ <Dialog open={open} onClose={onClose} title={sent.already ? L.alreadyTitle : L.sentTitle} className="ui-fbd"
86
+ // Its own key: not Send's button carried over (Send was off while it sent, and Done drew its fade back in).
87
+ footer={<div className="ui-fbd-foot" key="sent"><button type="button" className="ui-btn ui-btn--primary" onClick={onClose}>{L.done}</button></div>}>
88
+ <div className="ui-fbd-body" data-feedback-state={sent.already ? "already" : "sent"}>
89
+ <p className="ui-fbd-said">{sent.already ? L.already : `${L.sent}${sent.held ? ` ${L.held}` : ""}`}</p>
90
+ {sent.url ? <p className="ui-fbd-said"><a href={sent.url} target="_blank" rel="noopener noreferrer">{L.view} →</a></p> : null}
91
+ </div>
92
+ </Dialog>
93
+ );
94
+ }
95
+ return (
96
+ <Dialog open={open} onClose={onClose} title={L.title} className="ui-fbd" dirty={dirty} dismissible={!sending}
97
+ footer={(
98
+ <div className="ui-fbd-foot" key="form">
99
+ <button type="button" className="ui-btn" onClick={onClose} disabled={sending}>{L.cancel}</button>
100
+ <button type="button" className="ui-btn ui-btn--primary" onClick={() => void send()} disabled={!ready} aria-busy={sending || undefined}>
101
+ {sending ? L.sending : L.send}
102
+ </button>
103
+ </div>
104
+ )}>
105
+ <form className="ui-fbd-body" data-feedback-state={sending ? "sending" : error ? "error" : "editing"}
106
+ onSubmit={(e) => { e.preventDefault(); void send(); }}>
107
+ <div className="ui-fbd-field">
108
+ <label className="ui-fbd-label" htmlFor={`${id}-t`}>{L.titleField}</label>
109
+ <input id={`${id}-t`} className="gemboss-field" value={title} maxLength={titleMax} required autoComplete="off"
110
+ onChange={(e) => setTitle(e.target.value.replace(/\n/g, " "))} disabled={sending} />
111
+ </div>
112
+ <div className="ui-fbd-field">
113
+ <label className="ui-fbd-label" htmlFor={`${id}-d`}>{L.detailsField}</label>
114
+ <textarea id={`${id}-d`} className="ui-textarea" rows={8} value={details} maxLength={detailsMax}
115
+ onChange={(e) => setDetails(e.target.value)} disabled={sending} />
116
+ </div>
117
+ <p className="ui-fbd-note">{L.note}</p>
118
+ {error ? <p className="ui-fbd-error" role="alert">{error}</p> : null}
119
+ </form>
120
+ </Dialog>
121
+ );
122
+ }
@@ -0,0 +1 @@
1
+ .ui-flowstrip{display:flex;align-items:center;flex-wrap:nowrap;min-width:0;margin:0;padding:0;list-style:none}.ui-flowstrip__step{position:relative;display:inline-flex;flex:none;align-items:center;gap:4px;height:24px;padding:0 8px;border-radius:999px;background:var(--ui-surface);box-shadow:inset 0 0 0 1px var(--ui-border);color:var(--ui-text);font-size:var(--ui-fs-caption);line-height:16px;white-space:nowrap}.ui-flowstrip__step+.ui-flowstrip__step{margin-left:18px}.ui-flowstrip__step+.ui-flowstrip__step:before{content:"";position:absolute;left:-15px;top:50%;width:12px;height:1px;background:var(--ui-text-muted)}.ui-flowstrip__step+.ui-flowstrip__step:after{content:"";position:absolute;left:-6px;top:calc(50% - 3px);border:3px solid transparent;border-left:4px solid var(--ui-text-muted);border-right-width:0}.ui-flowstrip__step>svg{flex:none}.ui-flowstrip__step--start{background:var(--ui-text);box-shadow:none;color:var(--ui-surface)}.ui-flowstrip__step--wait{background:var(--ui-surface-2)}.ui-flowstrip__step--split{font-weight:450}.ui-flowstrip__step--email{background:var(--gemboss-accent-soft);box-shadow:none;color:var(--gemboss-accent-strong)}.ui-flowstrip__step--more{color:var(--ui-text-muted)}.ui-flowstrip--md .ui-flowstrip__step{height:28px;font-size:var(--ui-fs-body)}.ui-flowstrip--md .ui-flowstrip__step+.ui-flowstrip__step{margin-left:22px}.ui-flowstrip--md .ui-flowstrip__step+.ui-flowstrip__step:before{left:-19px;width:16px}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * FlowStrip (15/11/2026, unreleased): a flow's steps in one row, joined by arrows. Canvas NqQGmVzRJMjv536LLbMGaT, boards N2 (the
3
+ * Email flows table), N3 (a recipe card's foot), U2 (the Ops console's store flows): what starts it, the waits, each email, a split.
4
+ *
5
+ * - `start`: ink, a target, the event ("Checkout", "Signs up");
6
+ * - `wait`: a clock and how long ("1 h", "25 d");
7
+ * - `email`: the accent's soft fill and an envelope; its words are for a screen reader (the row shows the email's picture);
8
+ * - `split`: white, the sliders, the question ("Ordered?").
9
+ * `max` keeps the first steps and ends in "+N" (a card's foot holds three). `md` is a size up, for a page about one flow.
10
+ *
11
+ * An ordered list, named by `label`. Server-renderable; no colour of its own (tokens).
12
+ */
13
+ import "./flow-strip.css";
14
+ import React from "react";
15
+ import { Icon, type IconName } from "./icons";
16
+
17
+ const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
18
+
19
+ export type FlowStepKind = "start" | "wait" | "email" | "split";
20
+ export interface FlowStep { kind: FlowStepKind; label: string }
21
+
22
+ const ICON: Record<FlowStepKind, IconName> = { start: "target", wait: "clock", email: "inbox", split: "sliders" };
23
+ // Whole class names, never built from a template: a class written out is one grep (and the admin's orphan-rule gate) can find.
24
+ const STEP: Record<FlowStepKind, string> = {
25
+ start: "ui-flowstrip__step ui-flowstrip__step--start", wait: "ui-flowstrip__step ui-flowstrip__step--wait",
26
+ email: "ui-flowstrip__step ui-flowstrip__step--email", split: "ui-flowstrip__step ui-flowstrip__step--split",
27
+ };
28
+
29
+ export function FlowStrip({ steps, size = "sm", max, label = "Steps", className }: {
30
+ steps: readonly FlowStep[];
31
+ size?: "sm" | "md";
32
+ /** At most this many steps, then "+N". */
33
+ max?: number;
34
+ label?: string;
35
+ className?: string;
36
+ }) {
37
+ const shown = max && max > 0 && steps.length > max ? steps.slice(0, max) : steps;
38
+ const more = steps.length - shown.length;
39
+ return (
40
+ <ol className={cx("ui-flowstrip", size === "md" && "ui-flowstrip--md", className)} aria-label={label}>
41
+ {shown.map((s, i) => (
42
+ <li key={i} className={STEP[s.kind]}>
43
+ <Icon name={ICON[s.kind]} size={size === "md" ? 16 : 14} />
44
+ {s.kind === "email" ? <span className="ui-sr-only">{s.label}</span> : <span>{s.label}</span>}
45
+ </li>
46
+ ))}
47
+ {more > 0 ? <li className="ui-flowstrip__step ui-flowstrip__step--more"><span aria-hidden="true">+{more}</span><span className="ui-sr-only">{more} more {more === 1 ? "step" : "steps"}</span></li> : null}
48
+ </ol>
49
+ );
50
+ }
@@ -0,0 +1 @@
1
+ @media (pointer: coarse),(max-width: 47.9975em){.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group){--gemboss-field-drawn-inset: 4px;position:relative;isolation:isolate;overflow:visible;-webkit-background-clip:text!important;background-clip:text!important;border-image:linear-gradient(#0000,#0000)!important}.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group):before{content:"";position:absolute;inset:calc(var(--gemboss-field-drawn-inset) - 1px) -1px;z-index:-1;box-sizing:border-box;pointer-events:none;background:inherit;-webkit-background-clip:border-box;background-clip:border-box;border-width:inherit;border-style:inherit;border-color:inherit;border-image:none;border-radius:inherit}.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group):focus-within{outline:none}.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group):focus-within:before{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px}}@media (pointer: coarse) and (min-width: 48em){.gemboss-field--group:not(:has([type=color]),.gemboss-ei-color-group){--gemboss-field-drawn-inset: 6px}}
@@ -1 +1 @@
1
- .gemboss-field,.gemboss-control{box-sizing:border-box;height:32px;min-width:0;padding:0 12px;font:inherit;font-size:var(--p-font-size-325, 13px);line-height:20px;color:var(--p-color-text, var(--gemboss-field-ink));background-color:var(--p-color-input-bg-surface, var(--gemboss-field-bg));border:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:var(--p-border-radius-200, 8px)}input[type=search]:is(.gemboss-field,.gemboss-field__bare){-webkit-appearance:none;appearance:none}.gemboss-field::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field--tall{min-height:44px}.gemboss-field--narrow{padding:0 6px;appearance:textfield;-moz-appearance:textfield}.gemboss-field--narrow::-webkit-outer-spin-button,.gemboss-field--narrow::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gemboss-field:hover:not(:disabled):not(:has(.gemboss-field__bare:disabled)),.gemboss-control:hover:not(:disabled){border-color:var(--p-color-input-border-hover, var(--gemboss-field-line-hover));background-color:var(--p-color-input-bg-surface-hover, var(--gemboss-field-bg-hover))}.gemboss-field:focus-visible,.gemboss-control:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field:disabled,.gemboss-control:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 47.9975em){.gemboss-field,.gemboss-control{font-size:16px;min-height:44px}}textarea.gemboss-field{height:auto;padding:6px 12px;resize:vertical}.gemboss-field--group{display:flex;align-items:center;gap:6px;height:auto;min-height:32px;padding-right:0;overflow:hidden}@media (max-width: 47.9975em){.gemboss-field--group{min-height:44px}}.gemboss-field--group:focus-within{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field--group input[type=color]{flex:none;align-self:stretch;width:44px;min-width:44px;height:auto;min-height:0;margin:-1px 0 -1px -12px;padding:0;border:0;border-right:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:0;background:none;cursor:pointer}.gemboss-field--group input[type=color]::-webkit-color-swatch-wrapper{padding:0}.gemboss-field--group input[type=color]::-webkit-color-swatch{border:0;border-radius:0}.gemboss-field__bare{flex:1;min-width:0;align-self:stretch;margin-block:-1px;padding:0 12px 0 0;border:0;border-radius:0;outline:none;background:transparent;color:inherit;font:inherit}.gemboss-field__bare::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__suffix{flex:none;padding-right:12px;color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__bare:has(+.gemboss-field__suffix){padding-right:0}.gemboss-field--group:has(.gemboss-field__bare:disabled){opacity:.5;cursor:not-allowed}.gemboss-field__bare:disabled{cursor:not-allowed}@media (pointer: coarse){.gemboss-field,.gemboss-control{height:auto;min-height:44px}}.gemboss-control{cursor:pointer}.gemboss-control.gemboss-control--icon{width:32px;flex:0 0 auto;padding:0}@media (pointer: coarse){.gemboss-control.gemboss-control--icon{width:44px;min-width:44px}}.gemboss-field[aria-invalid=true],.gemboss-field--group:has([aria-invalid=true]){border-color:var(--gemboss-danger-strong);background-color:var(--gemboss-danger-soft)}
1
+ .gemboss-field,.gemboss-control{box-sizing:border-box;height:32px;min-width:0;padding:0 12px;font:inherit;font-size:var(--p-font-size-325, 13px);line-height:20px;color:var(--p-color-text, var(--gemboss-field-ink));background-color:var(--p-color-input-bg-surface, var(--gemboss-field-bg));border:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:var(--p-border-radius-200, 8px)}input[type=search]:is(.gemboss-field,.gemboss-field__bare){-webkit-appearance:none;appearance:none}.gemboss-field::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field--tall{min-height:44px}.gemboss-field--narrow{padding:0 6px;appearance:textfield;-moz-appearance:textfield}.gemboss-field--narrow::-webkit-outer-spin-button,.gemboss-field--narrow::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}@media (hover: hover){.gemboss-field:hover:not(:disabled):not(:has(.gemboss-field__bare:disabled)),.gemboss-control:hover:not(:disabled){border-color:var(--p-color-input-border-hover, var(--gemboss-field-line-hover));background-color:var(--p-color-input-bg-surface-hover, var(--gemboss-field-bg-hover))}}.gemboss-field:focus-visible,.gemboss-control:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field:disabled,.gemboss-control:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 47.9975em){.gemboss-field,.gemboss-control{font-size:16px;min-height:44px}}textarea.gemboss-field{height:auto;padding:6px 12px;resize:vertical}.gemboss-field--group{display:flex;align-items:center;gap:6px;height:auto;min-height:32px;padding-right:0;overflow:hidden}@media (max-width: 47.9975em){.gemboss-field--group{min-height:44px}}.gemboss-field--group:focus-within{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--p-color-input-border-active, var(--gemboss-field-line-active))}.gemboss-field--group input[type=color]{flex:none;align-self:stretch;width:44px;min-width:44px;height:auto;min-height:0;margin:-1px 0 -1px -12px;padding:0;border:0;border-right:1px solid var(--p-color-input-border, var(--gemboss-field-line));border-radius:0;background:none;cursor:pointer}.gemboss-field--group input[type=color]::-webkit-color-swatch-wrapper{padding:0}.gemboss-field--group input[type=color]::-webkit-color-swatch{border:0;border-radius:0}.gemboss-field__bare{flex:1;min-width:0;align-self:stretch;margin-block:-1px;padding:0 12px 0 0;border:0;border-radius:0;outline:none;background:transparent;color:inherit;font:inherit}.gemboss-field__bare::placeholder{color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__suffix{flex:none;padding-right:12px;color:var(--p-color-text-secondary, var(--gemboss-field-placeholder))}.gemboss-field__bare:has(+.gemboss-field__suffix){padding-right:0}.gemboss-field--group:has(.gemboss-field__bare:disabled){opacity:.5;cursor:not-allowed}.gemboss-field__bare:disabled{cursor:not-allowed}@media (pointer: coarse){.gemboss-field,.gemboss-control{height:auto;min-height:44px}}.gemboss-control{cursor:pointer}.gemboss-control.gemboss-control--icon{width:32px;flex:0 0 auto;padding:0}@media (pointer: coarse){.gemboss-control.gemboss-control--icon{width:44px;min-width:44px}}.gemboss-field[aria-invalid=true],.gemboss-field--group:has([aria-invalid=true]){border-color:var(--gemboss-danger-strong);background-color:var(--gemboss-danger-soft)}
package/src/gems.css CHANGED
@@ -1 +1 @@
1
- :root{--gemboss-gem-emerald: #0f9d74;--gemboss-gem-ruby: #d81b55;--gemboss-gem-amber: #c27c0e}.gnav-item .gnav-count,.gnav-item.active .gnav-count{background:var(--gemboss-gem-ruby);color:#fff}
1
+ :root{--gemboss-gem-emerald: #0f9d74;--gemboss-gem-ruby: #d81b55;--gemboss-gem-amber: #c27c0e}.gnav-item .gnav-count,.gnav-item.active .gnav-count,.gnav-subitem .gnav-count,.gnav-flyout-sub .gnav-count{background:var(--gemboss-gem-ruby);color:#fff}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * ONE ICON'S FRAME, AND GEM'S GLYPH, WITHOUT THE SET (12/11/2026). `Icon` (./icons.tsx) draws every glyph of the set in this frame;
3
+ * a surface that draws ONE glyph in a first load imports this module instead of the set, whose map of every glyph is ~3 KB brotli.
4
+ * Measured: the admin's top bar drawing the set's `chat` through `Icon` added 3.0 KB to its shell (203.9 → 206.9 KB, gemboss #7341);
5
+ * through `ChatGlyph` it adds the frame and one path.
6
+ *
7
+ * One owner each: this frame is the only <svg>/<g> an icon of the set is drawn in (the rules in icons.tsx's header live here), and
8
+ * `CHAT_D` is the chat glyph's only path (icons.tsx's `chat` is it). Gem's glyph: the chat button, the top bar's Gem, every door to Gem.
9
+ */
10
+ import React from "react";
11
+
12
+ /** The chat glyph's path, on the set's 20px grid: Gem's mark. */
13
+ export const CHAT_D = "M3 4.5h14v9H8.5L5 16.5v-3H3z";
14
+
15
+ export interface IconFrameProps { size?: number; title?: string; className?: string; children?: React.ReactNode }
16
+
17
+ /** The set's frame: 20px grid, 1.5px round strokes in `currentColor`. FILL LIVES ON THE <g>, NOT THE <svg> (icons.tsx). */
18
+ export function IconFrame({ size = 20, title, className, children }: IconFrameProps) {
19
+ return (
20
+ <svg viewBox="0 0 20 20" width={size} height={size} className={className}
21
+ aria-hidden={title ? undefined : true} role={title ? "img" : undefined} focusable="false">
22
+ {title ? <title>{title}</title> : null}
23
+ <g fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">{children}</g>
24
+ </svg>
25
+ );
26
+ }
27
+
28
+ /** Gem's glyph, as `<Icon name="chat" />` draws it, without the set. */
29
+ export function ChatGlyph(p: Omit<IconFrameProps, "children">) {
30
+ return <IconFrame {...p}><path d={CHAT_D} /></IconFrame>;
31
+ }