@perkyzz/emvb 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/package.json +72 -4
  4. package/src/admin/access/RequireEditor.tsx +39 -0
  5. package/src/admin/access/role.ts +36 -0
  6. package/src/admin/access/sidebar-shim.ts +108 -0
  7. package/src/admin/api.ts +48 -0
  8. package/src/admin/content-api.ts +147 -0
  9. package/src/admin/editor/Editor.tsx +457 -0
  10. package/src/admin/editor/EditorOverlay.tsx +54 -0
  11. package/src/admin/editor/ShortcutsDialog.tsx +30 -0
  12. package/src/admin/editor/SmallScreenNotice.tsx +20 -0
  13. package/src/admin/editor/TopBar.tsx +179 -0
  14. package/src/admin/editor/canvas/CanvasFrame.tsx +355 -0
  15. package/src/admin/editor/canvas/CanvasTextEdit.tsx +87 -0
  16. package/src/admin/editor/canvas/DeviceBar.tsx +50 -0
  17. package/src/admin/editor/canvas/EmptyCanvas.tsx +49 -0
  18. package/src/admin/editor/canvas/SelectionOverlay.tsx +185 -0
  19. package/src/admin/editor/canvas/canvas-events.ts +232 -0
  20. package/src/admin/editor/canvas/state-preview.ts +19 -0
  21. package/src/admin/editor/canvas/tab-reveal.ts +35 -0
  22. package/src/admin/editor/canvas/vnode-react.tsx +49 -0
  23. package/src/admin/editor/clipboard-store.ts +44 -0
  24. package/src/admin/editor/dialogs.tsx +125 -0
  25. package/src/admin/editor/dnd/drag-stash.ts +27 -0
  26. package/src/admin/editor/dnd/drop-target.ts +101 -0
  27. package/src/admin/editor/dnd/new-element.ts +32 -0
  28. package/src/admin/editor/editor-css.ts +539 -0
  29. package/src/admin/editor/exit.ts +27 -0
  30. package/src/admin/editor/panels/AddPanel.tsx +142 -0
  31. package/src/admin/editor/panels/ClassesSection.tsx +334 -0
  32. package/src/admin/editor/panels/ColorControl.tsx +230 -0
  33. package/src/admin/editor/panels/ConditionsEditor.tsx +201 -0
  34. package/src/admin/editor/panels/ElementPanel.tsx +629 -0
  35. package/src/admin/editor/panels/LayersPanel.tsx +336 -0
  36. package/src/admin/editor/panels/LeftPanel.tsx +77 -0
  37. package/src/admin/editor/panels/PageSettings.tsx +126 -0
  38. package/src/admin/editor/panels/SettingsPanel.tsx +101 -0
  39. package/src/admin/editor/panels/SiteStylesDrawer.tsx +392 -0
  40. package/src/admin/editor/panels/TriggerSettings.tsx +132 -0
  41. package/src/admin/editor/panels/TriggersEditor.tsx +197 -0
  42. package/src/admin/editor/panels/VariableSection.tsx +492 -0
  43. package/src/admin/editor/panels/settings/BackgroundControls.tsx +320 -0
  44. package/src/admin/editor/panels/settings/ClassChip.tsx +167 -0
  45. package/src/admin/editor/panels/settings/ClassChipInput.tsx +349 -0
  46. package/src/admin/editor/panels/settings/DraftTextField.tsx +201 -0
  47. package/src/admin/editor/panels/settings/EffectsControls.tsx +347 -0
  48. package/src/admin/editor/panels/settings/FieldBindControl.tsx +83 -0
  49. package/src/admin/editor/panels/settings/FieldControl.tsx +150 -0
  50. package/src/admin/editor/panels/settings/FormBindControl.tsx +97 -0
  51. package/src/admin/editor/panels/settings/IconPicker.tsx +109 -0
  52. package/src/admin/editor/panels/settings/LengthRow.tsx +181 -0
  53. package/src/admin/editor/panels/settings/LoopItemBindControl.tsx +124 -0
  54. package/src/admin/editor/panels/settings/MediaPicker.tsx +218 -0
  55. package/src/admin/editor/panels/settings/NumberRow.tsx +154 -0
  56. package/src/admin/editor/panels/settings/StateSwitcher.tsx +87 -0
  57. package/src/admin/editor/panels/settings/StyleRow.tsx +480 -0
  58. package/src/admin/editor/panels/settings/VariableBinding.tsx +167 -0
  59. package/src/admin/editor/panels/settings/class-suggest.ts +51 -0
  60. package/src/admin/editor/panels/settings/length-units.ts +83 -0
  61. package/src/admin/editor/panels/settings/node-props.ts +11 -0
  62. package/src/admin/editor/panels/settings/style-sections.ts +291 -0
  63. package/src/admin/editor/panels/site-list.tsx +206 -0
  64. package/src/admin/editor/panels/variable-values.ts +73 -0
  65. package/src/admin/editor/section-templates.ts +50 -0
  66. package/src/admin/editor/shortcuts.ts +20 -0
  67. package/src/admin/editor/store.ts +212 -0
  68. package/src/admin/editor/useClipboardActions.ts +136 -0
  69. package/src/admin/editor/useEditorCommands.ts +142 -0
  70. package/src/admin/editor/useEditorData.ts +167 -0
  71. package/src/admin/editor/useEditorShortcuts.ts +148 -0
  72. package/src/admin/editor/useMediaQuery.ts +20 -0
  73. package/src/admin/editor/useNodeActions.ts +122 -0
  74. package/src/admin/editor/useSave.ts +185 -0
  75. package/src/admin/forms-api.ts +73 -0
  76. package/src/admin/index.tsx +20 -0
  77. package/src/admin/media-api.ts +68 -0
  78. package/src/admin/pages/CreateDialog.tsx +150 -0
  79. package/src/admin/pages/EditorPage.tsx +57 -0
  80. package/src/admin/pages/NewPageDialog.tsx +83 -0
  81. package/src/admin/pages/NewThemePartDialog.tsx +61 -0
  82. package/src/admin/pages/PageList.tsx +71 -0
  83. package/src/admin/pages/PagesPage.tsx +25 -0
  84. package/src/admin/pages/SetupShell.tsx +90 -0
  85. package/src/admin/pages/ThemeBuilderPage.tsx +25 -0
  86. package/src/admin/pages/ThemePartList.tsx +202 -0
  87. package/src/admin/pages/list-kit.tsx +75 -0
  88. package/src/admin/setup/plan.ts +150 -0
  89. package/src/admin/setup/run.ts +61 -0
  90. package/src/admin/setup/spec.ts +100 -0
  91. package/src/admin/setup/useSetupStatus.ts +62 -0
  92. package/src/admin/theme-api.ts +186 -0
  93. package/src/admin/ui.ts +231 -0
  94. package/src/admin/widgets/LayoutField.tsx +67 -0
  95. package/src/astro/EmVBPage.astro +37 -0
  96. package/src/astro/env.d.ts +5 -0
  97. package/src/astro/forms/EmVBFormsRuntime.astro +9 -0
  98. package/src/astro/forms/index.ts +1 -0
  99. package/src/astro/forms-definitions.ts +104 -0
  100. package/src/astro/index.ts +15 -0
  101. package/src/astro/popups/EmVBPopupsRuntime.astro +9 -0
  102. package/src/astro/popups/index.ts +1 -0
  103. package/src/astro/popups/runtime.ts +246 -0
  104. package/src/astro/render.ts +74 -0
  105. package/src/astro/resolve-theme.ts +371 -0
  106. package/src/astro/resolve.ts +65 -0
  107. package/src/astro/tabs/EmVBTabsRuntime.astro +10 -0
  108. package/src/astro/tabs/index.ts +1 -0
  109. package/src/astro/tabs/runtime.ts +111 -0
  110. package/src/astro/theme-context.ts +81 -0
  111. package/src/astro/theme-posts.ts +84 -0
  112. package/src/constants.ts +12 -0
  113. package/src/core/arrange.ts +360 -0
  114. package/src/core/clipboard.ts +422 -0
  115. package/src/core/css/generate.ts +219 -0
  116. package/src/core/css/scope.ts +88 -0
  117. package/src/core/design/cascade.ts +28 -0
  118. package/src/core/design/classes.ts +138 -0
  119. package/src/core/design/devices.ts +56 -0
  120. package/src/core/design/states.ts +49 -0
  121. package/src/core/design/transfer.ts +33 -0
  122. package/src/core/design/variables.ts +319 -0
  123. package/src/core/elements/definition.ts +12 -0
  124. package/src/core/elements/dynamic-elements.ts +173 -0
  125. package/src/core/elements/form-elements.ts +204 -0
  126. package/src/core/elements/index.ts +742 -0
  127. package/src/core/elements/plain-text.ts +32 -0
  128. package/src/core/forms/binding.ts +61 -0
  129. package/src/core/forms/definition.ts +34 -0
  130. package/src/core/forms/success-layout.ts +63 -0
  131. package/src/core/icons/catalog.ts +273 -0
  132. package/src/core/index.ts +316 -0
  133. package/src/core/limits.ts +7 -0
  134. package/src/core/migrate/index.ts +76 -0
  135. package/src/core/render/context.ts +14 -0
  136. package/src/core/render/dynamic-post.ts +147 -0
  137. package/src/core/render/extras.ts +79 -0
  138. package/src/core/render/form.ts +137 -0
  139. package/src/core/render/index.ts +274 -0
  140. package/src/core/render/loop.ts +36 -0
  141. package/src/core/render/section.ts +33 -0
  142. package/src/core/render/tabs.ts +72 -0
  143. package/src/core/render/vnode.ts +87 -0
  144. package/src/core/sanitize/css.ts +591 -0
  145. package/src/core/sanitize/embed-url.ts +103 -0
  146. package/src/core/sanitize/escape.ts +10 -0
  147. package/src/core/sanitize/href.ts +6 -0
  148. package/src/core/sanitize/media-url.ts +7 -0
  149. package/src/core/sanitize/svg.ts +293 -0
  150. package/src/core/sanitize/url.ts +31 -0
  151. package/src/core/schema/descriptors.ts +33 -0
  152. package/src/core/schema/design.ts +88 -0
  153. package/src/core/schema/layout.ts +817 -0
  154. package/src/core/schema/state-names.ts +4 -0
  155. package/src/core/schema/style.ts +257 -0
  156. package/src/core/stats.ts +18 -0
  157. package/src/core/tabs/presence.ts +16 -0
  158. package/src/core/theme/conditions.ts +321 -0
  159. package/src/core/theme/dynamic.ts +133 -0
  160. package/src/core/theme/parse-doc.ts +36 -0
  161. package/src/core/theme/part-types.ts +79 -0
  162. package/src/core/theme/popup-markup.ts +39 -0
  163. package/src/core/theme/popup-rules.ts +61 -0
  164. package/src/core/theme/triggers.ts +104 -0
  165. package/src/core/tree-ops.ts +139 -0
  166. package/src/core/validate.ts +185 -0
  167. package/src/index.ts +18 -0
  168. package/src/server/design-routes.ts +125 -0
  169. package/src/server/hooks.ts +98 -0
  170. package/src/server/plugin.ts +39 -0
@@ -0,0 +1,539 @@
1
+ /**
2
+ * Editor chrome styles (DESIGN.md). The admin's Tailwind build is precompiled, so EmVB ships its
3
+ * own rules, scoped to the editor root and built only from Kumo variables. Panels keep their
4
+ * 1 px borders inside their width, so the canvas gets exactly the space between them (D-025).
5
+ * Density is compact (28 px controls, 44 px top bar, 256/288 panels) with near-opaque
6
+ * elevated cards (hairline rings, soft lift shadows, light blur); the canvas stage stays clear.
7
+ */
8
+ import { UI_CSS } from "../ui.ts";
9
+
10
+ export const EDITOR_CSS = `${UI_CSS}
11
+ [data-emvb-editor] {
12
+ --emvb-control: 28px;
13
+ --emvb-topbar: 44px;
14
+ --emvb-panel-left: 256px;
15
+ --emvb-panel-right: 288px;
16
+ --emvb-glass-blur: 6px;
17
+ --emvb-glass: color-mix(in oklab, var(--color-kumo-base) 97%, transparent);
18
+ --emvb-glass-strong: var(--color-kumo-base);
19
+ --emvb-glass-elevated: color-mix(in oklab, var(--color-kumo-elevated) 98%, transparent);
20
+ --emvb-elevation-s: 0 0 0 1px var(--color-kumo-hairline), 0 1px 2px var(--color-kumo-shadow-edge), 0 1px 3px var(--color-kumo-shadow-drop);
21
+ --emvb-elevation-m: 0 0 0 1px var(--color-kumo-line), 0 2px 4px var(--color-kumo-shadow-edge), 0 8px 20px var(--color-kumo-shadow-drop);
22
+ display: grid;
23
+ grid-template-rows: var(--emvb-topbar) minmax(0, 1fr);
24
+ background: var(--color-kumo-canvas);
25
+ color: var(--text-color-kumo-default);
26
+ font-family: var(--font-sans);
27
+ font-size: 13px;
28
+ line-height: 18px;
29
+ }
30
+ [data-emvb-editor] *, [data-emvb-editor] *::before, [data-emvb-editor] *::after { box-sizing: border-box; }
31
+ .emvb-topbar {
32
+ display: grid;
33
+ grid-template-columns: minmax(0, 1fr) auto max-content;
34
+ align-items: center;
35
+ gap: 16px;
36
+ min-height: 44px;
37
+ height: var(--emvb-topbar);
38
+ overflow: hidden;
39
+ padding: 8px 16px;
40
+ min-width: 0;
41
+ background: var(--emvb-glass);
42
+ -webkit-backdrop-filter: blur(var(--emvb-glass-blur));
43
+ backdrop-filter: blur(var(--emvb-glass-blur));
44
+ border-bottom: 1px solid var(--color-kumo-hairline);
45
+ box-shadow: 0 1px 0 var(--color-kumo-shadow-edge), 0 1px 2px var(--color-kumo-shadow-drop);
46
+ z-index: 1;
47
+ }
48
+ .emvb-topbar-title { min-width: 0; font-size: 14px; line-height: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
49
+ .emvb-topbar-start { display: flex; align-items: center; gap: 8px; min-width: 0; }
50
+ .emvb-topbar-end,
51
+ .emvb-topbar-tools,
52
+ .emvb-topbar-actions {
53
+ display: flex !important;
54
+ flex-direction: row !important;
55
+ flex-wrap: nowrap !important;
56
+ align-items: center;
57
+ }
58
+ .emvb-topbar-end { justify-content: flex-end; gap: 6px; min-width: max-content; flex-shrink: 0; }
59
+ .emvb-topbar-tools { gap: 2px; flex-shrink: 0; }
60
+ .emvb-topbar-actions { gap: 8px; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--color-kumo-hairline); flex-shrink: 0; }
61
+ .emvb-topbar-actions > * { flex: 0 0 auto !important; width: auto !important; max-width: none !important; }
62
+ .emvb-save-status { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--text-color-kumo-subtle); white-space: nowrap; }
63
+ .emvb-danger-icon { color: var(--color-kumo-danger); }
64
+ .emvb-link-button { border: 0; padding: 0; background: none; color: var(--text-color-kumo-default); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
65
+ .emvb-save-button { position: relative; }
66
+ .emvb-unsaved-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 9999px; background: var(--text-color-kumo-default); }
67
+ .emvb-danger-text.emvb-danger-text { color: var(--text-color-kumo-danger); }
68
+ .emvb-frame { display: grid; grid-template-columns: var(--emvb-panel-left) minmax(0, 1fr) var(--emvb-panel-right); min-height: 0; }
69
+ .emvb-panel {
70
+ min-height: 0;
71
+ overflow: auto;
72
+ padding: 10px 12px;
73
+ background: var(--emvb-glass);
74
+ -webkit-backdrop-filter: blur(var(--emvb-glass-blur));
75
+ backdrop-filter: blur(var(--emvb-glass-blur));
76
+ }
77
+ .emvb-panel-left {
78
+ border-right: 1px solid var(--color-kumo-hairline);
79
+ box-shadow: 1px 0 0 var(--color-kumo-shadow-edge), 4px 0 12px var(--color-kumo-shadow-drop);
80
+ }
81
+ .emvb-panel-right {
82
+ border-left: 1px solid var(--color-kumo-hairline);
83
+ box-shadow: -1px 0 0 var(--color-kumo-shadow-edge), -4px 0 12px var(--color-kumo-shadow-drop);
84
+ }
85
+ .emvb-panel-title { margin: 0; font-size: 14px; line-height: 18px; font-weight: 600; }
86
+ .emvb-panel-body, .emvb-field-group, .emvb-new-variable, .emvb-section-body { display: flex; flex-direction: column; gap: 10px; }
87
+ .emvb-field-group, .emvb-new-variable { gap: 8px; }
88
+ .emvb-section-header { display: flex; align-items: center; justify-content: space-between; width: 100%; height: var(--emvb-control); margin-top: 4px; padding: 0; border: 0; border-top: 1px solid var(--color-kumo-hairline); background: none; color: var(--text-color-kumo-strong, var(--text-color-kumo-default)); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; }
89
+ .emvb-section-header:focus-visible, .emvb-layer-row:focus-visible, .emvb-empty-prompt:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: 2px; }
90
+ .emvb-count { margin-left: 4px; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-color-kumo-subtle); }
91
+ .emvb-section-body { padding-top: 4px; padding-bottom: 4px; }
92
+ .emvb-tabs { width: 100%; }
93
+ .emvb-tabs [role="tablist"] {
94
+ width: 100%;
95
+ min-height: var(--emvb-control);
96
+ gap: 0;
97
+ padding-bottom: 0;
98
+ margin-bottom: 2px;
99
+ border-bottom: 1px solid var(--color-kumo-hairline);
100
+ }
101
+ .emvb-tabs [role="tab"] {
102
+ flex: 1 1 0;
103
+ justify-content: center;
104
+ gap: 4px;
105
+ height: var(--emvb-control);
106
+ min-height: var(--emvb-control);
107
+ padding: 0 8px 2px;
108
+ color: var(--text-color-kumo-subtle);
109
+ font-size: 13px;
110
+ line-height: 18px;
111
+ font-weight: 400;
112
+ border-radius: 0;
113
+ }
114
+ .emvb-tabs [role="tab"][aria-selected="true"] {
115
+ color: var(--text-color-kumo-default);
116
+ font-weight: 600;
117
+ box-shadow: inset 0 -2px 0 0 var(--color-kumo-brand);
118
+ }
119
+ .emvb-tabs [role="tab"][aria-selected="true"] svg { color: var(--color-kumo-brand); }
120
+ .emvb-tabs [role="tab"]:hover { color: var(--text-color-kumo-default); }
121
+ .emvb-panel .emvb-field { width: 100%; }
122
+ .emvb-state-switch { display: flex; flex-direction: column; gap: 6px; }
123
+ .emvb-state-tabs { width: 100%; }
124
+ .emvb-state-tabs [role="tablist"] { width: 100%; height: var(--emvb-control); min-height: var(--emvb-control); }
125
+ .emvb-state-tabs [role="tab"] { flex: 1 1 0; justify-content: center; gap: 4px; height: 100%; font-size: 13px; line-height: 18px; }
126
+ .emvb-state-dot { display: inline-block; flex: none; width: 6px; height: 6px; margin-left: 6px; border-radius: 999px; background: var(--color-kumo-brand); vertical-align: middle; }
127
+ .emvb-style-row[data-inherited] [role="combobox"] { color: var(--text-color-kumo-subtle); }
128
+ .emvb-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--color-kumo-line); vertical-align: -1px; }
129
+ .emvb-row-actions { display: flex; justify-content: flex-end; gap: 8px; }
130
+ .emvb-layers { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px; }
131
+ .emvb-layer-row { display: flex; align-items: center; gap: 6px; width: 100%; height: var(--emvb-control); padding-right: 4px; border-radius: 6px; color: var(--text-color-kumo-default); font-size: 13px; }
132
+ .emvb-layer-select { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; height: var(--emvb-control); padding: 0 4px 0 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
133
+ .emvb-layer-row:hover, .emvb-layer-row:hover .emvb-layer-select { background: var(--color-kumo-tint); }
134
+ .emvb-layers:empty::after, .emvb-panel-body > .emvb-helper { color: var(--text-color-kumo-subtle); }
135
+ .emvb-layer-select[aria-current="true"] { background: var(--color-kumo-brand); color: #fff; }
136
+ .emvb-layer-select:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: -2px; }
137
+ .emvb-layer-select[aria-current="true"]:focus-visible { outline-color: #fff; }
138
+ .emvb-layer-preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-color-kumo-subtle); }
139
+ .emvb-layer-select[aria-current="true"] .emvb-layer-preview { color: inherit; }
140
+ .emvb-canvas { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--color-kumo-canvas); }
141
+ .emvb-device-bar { display: flex; flex: none; align-items: center; justify-content: center; gap: 12px; height: 36px; border-bottom: 1px solid var(--color-kumo-line); background: var(--color-kumo-surface); }
142
+ .emvb-device-tabs { width: 240px; }
143
+ .emvb-device-hide { display: inline-flex; align-items: center; gap: 6px; color: var(--text-color-kumo-default); font-size: 13px; }
144
+ .emvb-stage { position: relative; display: flex; flex: 1 1 auto; justify-content: center; min-height: 0; width: 100%; overflow: hidden; }
145
+ .emvb-stage-frame { position: relative; width: 100%; height: 100%; }
146
+ .emvb-canvas iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
147
+ .emvb-canvas-text {
148
+ position: absolute;
149
+ z-index: 6;
150
+ box-sizing: border-box;
151
+ margin: 0;
152
+ border: 0;
153
+ overflow: hidden;
154
+ resize: none;
155
+ background: transparent;
156
+ outline: 1px solid var(--color-kumo-brand);
157
+ outline-offset: -1px;
158
+ }
159
+ .emvb-overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
160
+ .emvb-outline-hover, .emvb-outline-selected { position: absolute; box-shadow: inset 0 0 0 1px var(--color-kumo-brand); }
161
+ .emvb-outline-selected { box-shadow: inset 0 0 0 1.5px var(--color-kumo-brand), 0 0 0 1px color-mix(in oklab, var(--color-kumo-brand) 25%, transparent); }
162
+ .emvb-overlay-label {
163
+ position: absolute;
164
+ display: inline-flex;
165
+ align-items: center;
166
+ gap: 0;
167
+ height: 26px;
168
+ padding: 1px 1px 1px 6px;
169
+ border-radius: 5px;
170
+ background: var(--color-kumo-brand);
171
+ color: #fff;
172
+ font-size: 11px;
173
+ line-height: 14px;
174
+ font-weight: 600;
175
+ letter-spacing: 0.01em;
176
+ white-space: nowrap;
177
+ box-shadow: 0 1px 2px var(--color-kumo-shadow-edge), 0 2px 6px var(--color-kumo-shadow-drop);
178
+ pointer-events: none;
179
+ }
180
+ .emvb-overlay-label > span { padding: 0 4px; }
181
+ .emvb-overlay-action { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; pointer-events: auto; }
182
+ .emvb-overlay-action:hover { background: var(--color-kumo-brand-hover); }
183
+ .emvb-overlay-action:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
184
+ .emvb-empty-canvas { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; }
185
+ .emvb-empty-prompt { display: inline-flex; align-items: center; gap: 8px; padding: 24px; border: 1px dashed var(--color-kumo-line); border-radius: 6px; background: var(--emvb-glass-strong); -webkit-backdrop-filter: blur(var(--emvb-glass-blur)); backdrop-filter: blur(var(--emvb-glass-blur)); color: var(--text-color-kumo-default); font: inherit; cursor: pointer; box-shadow: var(--emvb-elevation-s); }
186
+ .emvb-state { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 24px; background: var(--color-kumo-elevated); }
187
+ .emvb-small-screen { grid-row: 1 / -1; }
188
+ .emvb-shortcuts { width: 100%; border-collapse: collapse; font-size: 13px; }
189
+ .emvb-shortcuts td { padding: 6px 0; border-bottom: 1px solid var(--color-kumo-hairline); }
190
+ .emvb-shortcuts td:last-child { text-align: right; font-family: var(--font-mono); color: var(--text-color-kumo-subtle); }
191
+
192
+ .emvb-add-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
193
+ .emvb-element-tile {
194
+ display: flex;
195
+ flex-direction: column;
196
+ align-items: center;
197
+ justify-content: center;
198
+ gap: 6px;
199
+ min-height: 60px;
200
+ padding: 10px 8px;
201
+ border: 1px solid var(--color-kumo-hairline);
202
+ border-radius: 6px;
203
+ background: var(--emvb-glass-strong);
204
+ color: var(--text-color-kumo-subtle);
205
+ font: inherit;
206
+ font-size: 11px;
207
+ line-height: 14px;
208
+ font-weight: 500;
209
+ cursor: grab;
210
+ box-shadow: var(--emvb-elevation-s);
211
+ }
212
+ .emvb-element-tile svg {
213
+ width: 20px;
214
+ height: 20px;
215
+ color: var(--text-color-kumo-default);
216
+ flex: 0 0 auto;
217
+ }
218
+ .emvb-element-tile:hover {
219
+ background: var(--color-kumo-base);
220
+ border-color: var(--color-kumo-line);
221
+ color: var(--text-color-kumo-default);
222
+ box-shadow: 0 0 0 1px var(--color-kumo-line), 0 2px 6px var(--color-kumo-shadow-drop);
223
+ }
224
+ .emvb-element-tile:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: 2px; }
225
+ .emvb-element-tile:active { cursor: grabbing; }
226
+ .emvb-drop-line { position: absolute; background: var(--color-kumo-brand); pointer-events: none; z-index: 2; }
227
+
228
+ .emvb-left-panel { gap: 12px; }
229
+ .emvb-add-group { display: flex; flex-direction: column; gap: 8px; }
230
+ .emvb-add-group-title { margin: 0; font-size: 11px; line-height: 14px; font-weight: 600; color: var(--text-color-kumo-subtle); text-transform: uppercase; letter-spacing: 0.05em; }
231
+ .emvb-layer-caret { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: 0 0 16px; }
232
+ .emvb-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
233
+
234
+ .emvb-outline-invalid { position: absolute; box-shadow: inset 0 0 0 1px var(--color-kumo-danger); outline: 1px dashed var(--color-kumo-danger); outline-offset: -1px; pointer-events: none; }
235
+ .emvb-invalid-label { position: absolute; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px; border-radius: 4px; background: var(--emvb-glass-strong); -webkit-backdrop-filter: blur(var(--emvb-glass-blur)); backdrop-filter: blur(var(--emvb-glass-blur)); color: var(--text-color-kumo-danger); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; box-shadow: var(--emvb-elevation-s); pointer-events: none; z-index: 3; }
236
+ .emvb-overlay-move { cursor: grab; }
237
+ .emvb-overlay-move:active { cursor: grabbing; }
238
+ @media (prefers-reduced-motion: reduce) {
239
+ .emvb-drop-line { transition: none !important; }
240
+ }
241
+
242
+ .emvb-layer-menu { position: relative; margin-left: auto; }
243
+ .emvb-layer-menu-btn { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; border-radius: 4px; line-height: 1; min-width: 24px; min-height: 24px; }
244
+ .emvb-layer-menu-btn:hover { background: var(--color-kumo-tint); }
245
+ .emvb-layer-menu-list {
246
+ position: absolute;
247
+ right: 0;
248
+ top: 100%;
249
+ z-index: 5;
250
+ min-width: 140px;
251
+ padding: 4px;
252
+ border-radius: 6px;
253
+ background: var(--emvb-glass-strong);
254
+ -webkit-backdrop-filter: blur(var(--emvb-glass-blur));
255
+ backdrop-filter: blur(var(--emvb-glass-blur));
256
+ box-shadow: var(--emvb-elevation-m);
257
+ display: flex;
258
+ flex-direction: column;
259
+ }
260
+ .emvb-layer-menu-list button { border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 4px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-color-kumo-default); min-height: 28px; }
261
+ .emvb-layer-menu-list button:hover { background: var(--color-kumo-tint); }
262
+ .emvb-layer-menu-list button:disabled { color: var(--text-color-kumo-subtle); cursor: not-allowed; background: transparent; }
263
+ .emvb-menu-hint { margin: 4px 8px 2px; max-width: 200px; font-size: 12px; line-height: 16px; color: var(--text-color-kumo-subtle); }
264
+ .emvb-layer-menu-hint { margin: 4px 8px 2px; max-width: 180px; font-size: 12px; line-height: 16px; color: var(--text-color-kumo-subtle); }
265
+
266
+ .emvb-element-header { display: flex; align-items: center; gap: 8px; }
267
+ .emvb-element-header svg { color: var(--color-kumo-brand); flex: 0 0 auto; }
268
+ .emvb-breadcrumb { margin: 0; font-size: 12px; line-height: 16px; color: var(--text-color-kumo-subtle); }
269
+ .emvb-breadcrumb-part { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: none; border-radius: 2px; }
270
+ .emvb-breadcrumb-part:hover { color: var(--text-color-kumo-default); text-decoration: underline; text-underline-offset: 2px; }
271
+ .emvb-breadcrumb-part:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: 2px; }
272
+ .emvb-style-row { display: flex; align-items: flex-start; gap: 4px; }
273
+ .emvb-shadow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
274
+ .emvb-add-shadow { align-self: flex-start; }
275
+ .emvb-style-row[data-emvb-style="boxShadow"] > .emvb-reset-btn { margin-top: -4px; }
276
+ .emvb-filters { display: flex; flex-direction: column; gap: 10px; }
277
+ .emvb-sub-label { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-color-kumo-default); }
278
+ .emvb-style-row > :first-child { flex: 1 1 auto; min-width: 0; }
279
+ .emvb-style-row[data-set="true"] .emvb-reset-btn { opacity: 1; }
280
+ .emvb-reset-btn { flex: 0 0 auto; margin-top: 28px; opacity: 0.4; }
281
+ /* Unit menu inside a length field (W-088): 24 px inside a 28 px field, radii nest (6 = 4 + 2). */
282
+ .emvb-length .emvb-unit-addon.emvb-unit-addon { padding-right: 2px; }
283
+ .emvb-unit-btn {
284
+ display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 6px; border: 0; border-radius: 4px;
285
+ background: transparent; color: var(--text-color-kumo-subtle); font-family: var(--font-mono); font-size: 12px; line-height: 16px; cursor: pointer;
286
+ }
287
+ .emvb-unit-btn:hover, .emvb-unit-btn[data-popup-open] { background: var(--color-kumo-tint); color: var(--text-color-kumo-default); }
288
+ .emvb-unit-btn:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: -2px; }
289
+ /* Variable button and bound-variable chip (W-087, DESIGN.md "variable chip") */
290
+ .emvb-var-btn {
291
+ display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
292
+ width: 28px; height: 28px; margin-top: 28px; padding: 0; border: 0; border-radius: 6px;
293
+ background: transparent; color: var(--text-color-kumo-subtle); cursor: pointer;
294
+ }
295
+ .emvb-var-btn:hover, .emvb-var-btn[data-popup-open] { background: var(--color-kumo-tint); color: var(--text-color-kumo-default); }
296
+ .emvb-var-btn[data-active="true"] { color: var(--color-kumo-brand); }
297
+ .emvb-var-btn:focus-visible, .emvb-var-chip-x:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: 1px; }
298
+ .emvb-var-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
299
+ .emvb-var-field-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-color-kumo-default); }
300
+ .emvb-var-chip {
301
+ display: flex; align-items: center; gap: 6px; min-width: 0; height: 28px; padding: 0 2px 0 8px;
302
+ border-radius: 6px; background: var(--color-kumo-tint); color: var(--text-color-kumo-default);
303
+ box-shadow: inset 0 0 0 1px var(--color-kumo-line); font-family: var(--font-mono); font-size: 13px;
304
+ }
305
+ .emvb-var-chip > svg { flex: 0 0 auto; color: var(--color-kumo-brand); }
306
+ .emvb-var-chip[data-missing="true"] { box-shadow: inset 0 0 0 1px var(--text-color-kumo-danger); }
307
+ .emvb-var-chip[data-missing="true"] > svg { color: var(--text-color-kumo-danger); }
308
+ .emvb-var-chip-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
309
+ .emvb-var-chip-value { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-color-kumo-subtle); }
310
+ .emvb-var-chip-x {
311
+ display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
312
+ width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer;
313
+ }
314
+ .emvb-var-chip-x:hover { background: var(--color-kumo-recessed); }
315
+ .emvb-var-option { display: flex; align-items: center; gap: 8px; min-width: 176px; max-width: 256px; }
316
+ .emvb-var-option-sample { flex: 0 0 20px; text-align: center; font-size: 13px; color: var(--text-color-kumo-subtle); }
317
+ .emvb-var-option-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
318
+ .emvb-var-option-value { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; color: var(--text-color-kumo-subtle); }
319
+ [data-emvb-var-option][data-selected="true"] .emvb-var-option-name { font-weight: 600; }
320
+ .emvb-textarea { min-height: 72px; height: auto; padding: 8px; resize: vertical; font: inherit; }
321
+ .emvb-field-label { font-size: 12px; font-weight: 500; color: var(--text-color-kumo-subtle); }
322
+ .emvb-panel [data-emvb-panel] .emvb-helper { margin-top: -2px; }
323
+
324
+ .emvb-media-actions { display: flex; flex-wrap: wrap; gap: 8px; }
325
+ .emvb-media-preview { display: flex; flex-direction: column; gap: 4px; }
326
+ .emvb-media-thumb { display: block; max-width: 100%; max-height: 96px; border-radius: 6px; object-fit: contain; background: var(--color-kumo-canvas); }
327
+ .emvb-media-dialog {
328
+ display: flex;
329
+ flex-direction: column;
330
+ gap: 8px;
331
+ padding: 8px;
332
+ border: 1px solid var(--color-kumo-hairline);
333
+ border-radius: 6px;
334
+ background: var(--emvb-glass-elevated);
335
+ -webkit-backdrop-filter: blur(var(--emvb-glass-blur));
336
+ backdrop-filter: blur(var(--emvb-glass-blur));
337
+ box-shadow: var(--emvb-elevation-m);
338
+ }
339
+ .emvb-media-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
340
+ .emvb-media-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 256px; overflow: auto; }
341
+ .emvb-media-card { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 4px; border: 1px solid var(--color-kumo-hairline); border-radius: 6px; background: var(--emvb-glass-strong); color: var(--text-color-kumo-default); font: inherit; font-size: 11px; line-height: 14px; text-align: left; cursor: pointer; }
342
+ .emvb-media-card:hover { background: var(--color-kumo-tint); }
343
+ .emvb-media-card img { display: block; width: 100%; height: 64px; object-fit: cover; border-radius: 4px; background: var(--color-kumo-canvas); }
344
+ .emvb-media-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
345
+
346
+ .emvb-icon-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-height: 256px; overflow: auto; }
347
+ .emvb-icon-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 8px 4px; border: 1px solid var(--color-kumo-hairline); border-radius: 6px; background: var(--emvb-glass-strong); color: var(--text-color-kumo-default); font: inherit; font-size: 11px; line-height: 14px; cursor: pointer; }
348
+ .emvb-icon-tile:hover { background: var(--color-kumo-tint); }
349
+ .emvb-icon-tile[data-selected="true"] { border-color: var(--color-kumo-brand); background: var(--color-kumo-tint); }
350
+ .emvb-icon-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
351
+
352
+ /* Class chip input (W-087, DESIGN.md): one 28 px box holding the chips and the text input */
353
+ .emvb-class-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
354
+ .emvb-chip-anchor { position: relative; }
355
+ .emvb-chip-box {
356
+ display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
357
+ min-height: var(--emvb-control); padding: 4px; border-radius: 6px; cursor: text;
358
+ background: var(--color-kumo-control, var(--color-kumo-base));
359
+ box-shadow: inset 0 0 0 1px var(--color-kumo-line);
360
+ }
361
+ .emvb-chip-box:focus-within { box-shadow: inset 0 0 0 1px var(--color-kumo-brand); }
362
+ .emvb-chip {
363
+ display: inline-flex; align-items: center; min-width: 0; max-width: 100%; height: 20px;
364
+ border-radius: 4px; background: var(--color-kumo-tint); color: var(--text-color-kumo-default);
365
+ font-family: var(--font-sans); font-size: 12px; line-height: 16px;
366
+ }
367
+ .emvb-chip:hover { background: var(--color-kumo-recessed); }
368
+ .emvb-chip[data-active="true"] { background: var(--color-kumo-brand); color: #fff; }
369
+ .emvb-chip-main {
370
+ display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 20px; padding: 0 4px;
371
+ border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; cursor: pointer;
372
+ }
373
+ .emvb-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 144px; }
374
+ .emvb-chip-icon {
375
+ display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
376
+ width: 16px; height: 20px; padding: 0; border: 0; border-radius: 4px;
377
+ background: transparent; color: inherit; cursor: pointer;
378
+ }
379
+ .emvb-chip-icon:last-child { margin-right: 2px; }
380
+ .emvb-chip-icon:hover { background: color-mix(in oklab, currentColor 14%, transparent); }
381
+ .emvb-chip :focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: 1px; }
382
+ .emvb-chip[data-active="true"] :focus-visible { outline-color: #fff; outline-offset: -2px; }
383
+ .emvb-chip-rename {
384
+ width: 128px; height: 20px; padding: 0 4px; border: 0; border-radius: 4px; outline: 0;
385
+ background: var(--color-kumo-base); color: var(--text-color-kumo-default); font: inherit;
386
+ box-shadow: inset 0 0 0 1px var(--color-kumo-brand);
387
+ }
388
+ .emvb-chip-text {
389
+ flex: 1 0 72px; min-width: 72px; height: 20px; padding: 0 4px; border: 0; outline: 0;
390
+ background: transparent; color: var(--text-color-kumo-default); font: inherit; font-size: 13px;
391
+ }
392
+ .emvb-chip-text::placeholder { color: var(--text-color-kumo-placeholder, var(--text-color-kumo-subtle)); }
393
+ .emvb-chip-listbox {
394
+ position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0;
395
+ display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto;
396
+ margin: 0; padding: 4px; list-style: none; border-radius: 8px;
397
+ background: var(--color-kumo-base); box-shadow: var(--emvb-elevation-m);
398
+ }
399
+ .emvb-chip-option {
400
+ display: flex; align-items: center; gap: 8px; min-height: var(--emvb-control); padding: 4px 8px;
401
+ border-radius: 4px; font-size: 13px; cursor: pointer; color: var(--text-color-kumo-default);
402
+ }
403
+ .emvb-chip-option[aria-selected="true"] { background: var(--color-kumo-tint); }
404
+ .emvb-chip-option-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
405
+ .emvb-chip-option-token { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-color-kumo-subtle); }
406
+ .emvb-chip-option-hint { padding: 4px 8px; font-size: 12px; line-height: 16px; color: var(--text-color-kumo-subtle); }
407
+
408
+ .emvb-site-styles { display: flex; flex-direction: column; gap: 8px; min-height: 0; height: 100%; }
409
+ .emvb-site-styles-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
410
+ .emvb-site-styles-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
411
+ .emvb-site-styles-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
412
+ .emvb-site-styles-subtitle { margin: 0; font-size: 11px; color: var(--text-color-kumo-subtle); }
413
+ .emvb-site-styles-body { display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0; flex: 1 1 auto; }
414
+ .emvb-site-styles-footer { margin-top: auto; }
415
+ .emvb-site-section { display: flex; flex-direction: column; gap: 6px; }
416
+ .emvb-site-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
417
+ .emvb-site-count {
418
+ display: inline-flex; align-items: center; justify-content: center;
419
+ margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
420
+ border-radius: 999px; font-size: 11px; font-weight: 600;
421
+ background: var(--color-kumo-tint); color: var(--text-color-kumo-default);
422
+ }
423
+ .emvb-site-elevated {
424
+ padding: 8px; border-radius: 6px;
425
+ background: var(--emvb-glass-elevated, var(--color-kumo-elevated));
426
+ box-shadow: var(--emvb-elevation-s);
427
+ border: 1px solid var(--color-kumo-hairline);
428
+ }
429
+ .emvb-site-create { display: flex; flex-direction: column; gap: 8px; }
430
+ .emvb-site-class-styles { display: flex; flex-direction: column; gap: 8px; }
431
+ .emvb-site-class-sections { display: flex; flex-wrap: wrap; gap: 4px; }
432
+ .emvb-site-class-section {
433
+ height: 28px; padding: 0 8px; border: 0; border-radius: 4px;
434
+ background: transparent; color: var(--text-color-kumo-subtle); font: inherit; font-size: 12px; cursor: pointer;
435
+ }
436
+ .emvb-site-class-section[aria-selected="true"] { background: var(--color-kumo-tint); color: var(--text-color-kumo-default); }
437
+ .emvb-site-class-section:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: -2px; }
438
+ .emvb-site-token { margin: 0; font-size: 11px; color: var(--text-color-kumo-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
439
+ .emvb-site-cascade { margin: 0 0 4px; padding: 8px; border-radius: 6px; background: var(--color-kumo-tint); border: 1px solid var(--color-kumo-hairline); }
440
+ .emvb-site-usage { flex: 0 0 auto; white-space: nowrap; font-size: 11px; line-height: 16px; color: var(--text-color-kumo-subtle); font-variant-numeric: tabular-nums; }
441
+ /* Compact manager rows (W-087): one 32 px line per class or variable, details on demand */
442
+ .emvb-site-items {
443
+ margin: 0; padding: 2px; list-style: none; display: flex; flex-direction: column; gap: 2px;
444
+ border-radius: 6px; background: var(--emvb-glass-elevated, var(--color-kumo-elevated));
445
+ box-shadow: var(--emvb-elevation-s);
446
+ }
447
+ .emvb-site-items:empty { display: none; }
448
+ .emvb-site-item { display: flex; flex-direction: column; border-radius: 4px; }
449
+ .emvb-site-item[data-open] { background: var(--color-kumo-tint); }
450
+ .emvb-site-item-row { display: flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px; border-radius: 4px; }
451
+ .emvb-site-item-row:hover { background: var(--color-kumo-tint); }
452
+ .emvb-site-item-main {
453
+ display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; min-height: 28px; padding: 0 4px;
454
+ border: 0; border-radius: 4px; background: transparent; color: var(--text-color-kumo-default);
455
+ font: inherit; font-size: 13px; text-align: left; cursor: pointer;
456
+ }
457
+ .emvb-site-item-main[data-renaming] { cursor: default; }
458
+ .emvb-site-item-main:focus-visible, .emvb-site-menu-btn:focus-visible, .emvb-site-value-edit:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: -2px; }
459
+ .emvb-site-item-caret { flex: 0 0 auto; color: var(--text-color-kumo-subtle); }
460
+ .emvb-site-item-icon { flex: 0 0 auto; color: var(--text-color-kumo-subtle); }
461
+ .emvb-site-item-text { display: flex; flex-direction: column; min-width: 0; }
462
+ .emvb-site-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 16px; }
463
+ .emvb-site-item-text .emvb-site-token { line-height: 14px; }
464
+ .emvb-site-item-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 8px; }
465
+ .emvb-site-menu-btn {
466
+ display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
467
+ width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px;
468
+ background: transparent; color: var(--text-color-kumo-subtle); cursor: pointer;
469
+ }
470
+ .emvb-site-menu-btn:hover, .emvb-site-menu-btn[data-popup-open] { background: var(--color-kumo-recessed); color: var(--text-color-kumo-default); }
471
+ .emvb-site-rename {
472
+ flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 6px; border: 0; border-radius: 4px; outline: 0;
473
+ background: var(--color-kumo-base); color: var(--text-color-kumo-default); font: inherit; font-size: 13px;
474
+ box-shadow: inset 0 0 0 1px var(--color-kumo-brand);
475
+ }
476
+ .emvb-site-empty-card { border-radius: 6px; border: 1px dashed var(--color-kumo-line); }
477
+ .emvb-site-empty {
478
+ display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px;
479
+ border-radius: 6px; border: 1px dashed var(--color-kumo-line);
480
+ font-size: 12px; line-height: 16px; color: var(--text-color-kumo-subtle); text-wrap: pretty;
481
+ }
482
+ .emvb-site-empty svg { flex: 0 0 auto; }
483
+ .emvb-site-preview {
484
+ display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
485
+ width: 24px; height: 24px; overflow: hidden; border-radius: 4px;
486
+ font-size: 13px; line-height: 1; color: var(--text-color-kumo-default);
487
+ }
488
+ .emvb-site-preview-color { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text-color-kumo-default) 18%, transparent); }
489
+ .emvb-site-preview-icon { color: var(--text-color-kumo-subtle); }
490
+ .emvb-site-bar {
491
+ display: inline-block; height: 6px; margin-right: 6px; border-radius: 2px; vertical-align: 1px;
492
+ background: color-mix(in oklab, var(--color-kumo-brand) 60%, transparent);
493
+ }
494
+ .emvb-site-value-row { display: flex; align-items: center; gap: 6px; }
495
+ .emvb-site-value-row .emvb-site-value-input { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); }
496
+ .emvb-site-picker {
497
+ flex: 0 0 auto; width: 28px; height: 28px; padding: 2px; border: 0; border-radius: 6px;
498
+ background: var(--color-kumo-control, var(--color-kumo-base)); box-shadow: inset 0 0 0 1px var(--color-kumo-line); cursor: pointer;
499
+ }
500
+ .emvb-site-picker::-webkit-color-swatch-wrapper { padding: 0; }
501
+ .emvb-site-picker::-webkit-color-swatch { border: 0; border-radius: 4px; }
502
+ .emvb-site-picker::-moz-color-swatch { border: 0; border-radius: 4px; }
503
+ .emvb-site-picker:focus-visible { outline: 2px solid var(--color-kumo-brand); outline-offset: 1px; }
504
+ .emvb-site-font-sample { margin: 0; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-color-kumo-default); }
505
+ .emvb-site-empty-card p { text-wrap: pretty; }
506
+ .emvb-site-confirm {
507
+ display: flex;
508
+ flex-direction: column;
509
+ gap: 8px;
510
+ padding: 8px;
511
+ border: 1px solid var(--color-kumo-hairline);
512
+ border-radius: 6px;
513
+ background: var(--emvb-glass-elevated);
514
+ -webkit-backdrop-filter: blur(var(--emvb-glass-blur));
515
+ backdrop-filter: blur(var(--emvb-glass-blur));
516
+ box-shadow: var(--emvb-elevation-s);
517
+ }
518
+
519
+ @media (prefers-reduced-transparency: reduce) {
520
+ .emvb-topbar,
521
+ .emvb-panel,
522
+ .emvb-empty-prompt,
523
+ .emvb-element-tile,
524
+ .emvb-layer-menu-list,
525
+ .emvb-media-dialog,
526
+ .emvb-media-card,
527
+ .emvb-icon-tile,
528
+ .emvb-site-confirm,
529
+ .emvb-invalid-label {
530
+ background: var(--color-kumo-base);
531
+ -webkit-backdrop-filter: none;
532
+ backdrop-filter: none;
533
+ }
534
+ .emvb-media-dialog,
535
+ .emvb-site-confirm {
536
+ background: var(--color-kumo-elevated);
537
+ }
538
+ }
539
+ `;
@@ -0,0 +1,27 @@
1
+ import { PLUGIN_ID } from "../../constants.ts";
2
+
3
+ export const PAGES_URL = `/_emdash/admin/plugins/${PLUGIN_ID}/pages`;
4
+ export const THEME_URL = `/_emdash/admin/plugins/${PLUGIN_ID}/theme`;
5
+ const EDITOR_PATH = `/_emdash/admin/plugins/${PLUGIN_ID}/editor`;
6
+
7
+ export const editorUrl = (id: string, collection?: string) => {
8
+ const params = new URLSearchParams({ entry: id });
9
+ if (collection) params.set("collection", collection);
10
+ return `${EDITOR_PATH}?${params.toString()}`;
11
+ };
12
+
13
+ /** Exit goes back to the admin page the user came from, or to Visual pages (R-001). */
14
+ export function exitTarget(referrer: string, origin: string): string {
15
+ if (!referrer) return PAGES_URL;
16
+ let url: URL;
17
+ try {
18
+ url = new URL(referrer);
19
+ } catch {
20
+ return PAGES_URL;
21
+ }
22
+ if (url.origin !== origin) return PAGES_URL;
23
+ if (!url.pathname.startsWith("/_emdash/admin") || url.pathname.startsWith(EDITOR_PATH)) {
24
+ return PAGES_URL;
25
+ }
26
+ return `${url.pathname}${url.search}`;
27
+ }