@jxsuite/studio 2.2.1 → 2.3.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 (182) hide show
  1. package/data/css-meta.json +1487 -0
  2. package/data/elements-meta.json +370 -0
  3. package/data/html-meta.json +366 -0
  4. package/data/stylebook-meta.json +200 -0
  5. package/data/webdata.json +1621 -0
  6. package/dist/chunks/{Overlay.dev-ymy3et3y.js → Overlay.dev-d2ajy6sj.js} +7 -7
  7. package/dist/chunks/{content-source-r2n7v682.js → content-source-56xpvx83.js} +13 -12
  8. package/dist/chunks/{convert-to-repeater-cnpyvj74.js → convert-to-repeater-0xh9wwek.js} +12 -11
  9. package/dist/chunks/{extension-sections-vpcm4jvx.js → extension-sections-g34239vm.js} +17 -16
  10. package/dist/chunks/{files-zeg88k2d.js → files-gkz202dp.js} +18 -19
  11. package/dist/chunks/{format-host-taymsw55.js → format-host-pej3srnw.js} +2 -2
  12. package/dist/chunks/{git-panel-qp4rrwr9.js → git-panel-4j6xbh8g.js} +12 -11
  13. package/dist/chunks/{layers-panel-kj93w2zg.js → layers-panel-8mvn8sgd.js} +15 -14
  14. package/dist/chunks/{monaco-setup-xy3bs05d.js → monaco-setup-a5wkmbgh.js} +6 -3
  15. package/dist/chunks/{publish-panel-6qz6kp41.js → publish-panel-ptddc3kg.js} +6 -6
  16. package/dist/chunks/{quick-search-9wwa09hh.js → quick-search-j88azfs2.js} +19 -18
  17. package/dist/chunks/right-panel-egkaxy89.js +38 -0
  18. package/dist/chunks/{sp-overlay.dev-h6kdx076.js → sp-overlay.dev-s18hymn9.js} +8 -8
  19. package/dist/chunks/sp-progress-circle.dev-0zxcyz3r.js +15 -0
  20. package/dist/chunks/sp-tooltip.dev-5c6d1kjz.js +15 -0
  21. package/dist/chunks/{studio-753znj4c.js → studio-0e4h32g6.js} +5 -5
  22. package/dist/chunks/{studio-yz9s88s0.js → studio-10s469da.js} +25 -9
  23. package/dist/chunks/{studio-6f0am8f2.js → studio-2w11grav.js} +2 -2
  24. package/dist/chunks/{studio-zqv3w24n.js → studio-3q65xvzv.js} +5 -5
  25. package/dist/chunks/{studio-qhh8r5fz.js → studio-4058pg09.js} +4 -4
  26. package/dist/chunks/{studio-hekaagev.js → studio-4enps87v.js} +17 -17
  27. package/dist/chunks/{studio-tqemhphj.js → studio-50eed4c9.js} +4 -4
  28. package/dist/chunks/studio-53n8bp04.js +16 -0
  29. package/dist/chunks/{studio-nqq8jk8f.js → studio-5amdrjm4.js} +14 -14
  30. package/dist/chunks/{studio-6zzbyx17.js → studio-5ne8mdx9.js} +2 -2
  31. package/dist/chunks/{studio-3z8jjm2p.js → studio-7ejemhej.js} +3 -3
  32. package/dist/chunks/{studio-1kgfcv7s.js → studio-a11d3a1b.js} +12 -11
  33. package/dist/chunks/{studio-rgwcpast.js → studio-ay8wcr2b.js} +2 -2
  34. package/dist/chunks/{studio-fys6z73y.js → studio-bak2cyjr.js} +7 -7
  35. package/dist/chunks/{studio-xmvbhg31.js → studio-c31yb4t6.js} +2 -2
  36. package/dist/chunks/{studio-8sdyjfd6.js → studio-cf4rk7kv.js} +2 -2
  37. package/dist/chunks/{studio-yphy4z9m.js → studio-cv606rs1.js} +5 -5
  38. package/dist/chunks/{studio-5kt960pk.js → studio-hk523hby.js} +133 -147
  39. package/dist/chunks/{studio-x0et2z9g.js → studio-hs8x23fv.js} +15 -15
  40. package/dist/chunks/{studio-p471gg5n.js → studio-kvfx9z2c.js} +7 -3
  41. package/dist/chunks/{studio-22xr4q8q.js → studio-ncnet0ba.js} +18 -29
  42. package/dist/chunks/{studio-ckwz4d3x.js → studio-twsafr1e.js} +2 -2
  43. package/dist/chunks/{studio-qrsfh1w7.js → studio-tzx3xmvx.js} +5 -5
  44. package/dist/chunks/{studio-g8t7g0gp.js → studio-vdpcpada.js} +3 -3
  45. package/dist/chunks/{studio-6a0h7sne.js → studio-vhk5fmfv.js} +2 -2
  46. package/dist/chunks/{studio-hrajjyt2.js → studio-wdt9y92a.js} +2 -2
  47. package/dist/chunks/{studio-r8vx7bkz.js → studio-x3etxs0s.js} +14 -13
  48. package/dist/chunks/{studio-pv8m0h4a.js → studio-yxzgjq8q.js} +28 -23
  49. package/dist/chunks/{studio-300zsz1k.js → studio-zdkgwhkv.js} +6 -6
  50. package/dist/codicon.ttf +0 -0
  51. package/dist/iframe-entry.js +8 -1
  52. package/dist/manifest.json +82 -0
  53. package/dist/studio.js +232 -103
  54. package/index.html +0 -50
  55. package/package.json +12 -5
  56. package/src/canvas/iframe-entry.ts +5 -0
  57. package/src/canvas/iframe-host.ts +45 -4
  58. package/src/content/entry-editor.ts +2 -1
  59. package/src/editor/context-menu.ts +13 -2
  60. package/src/editor/slash-menu.ts +26 -11
  61. package/src/files/files.ts +11 -23
  62. package/src/grid/grid-panel.ts +27 -6
  63. package/src/hosting/document.ts +109 -0
  64. package/src/hosting/layout.ts +211 -0
  65. package/src/hosting/stage.ts +166 -0
  66. package/src/hosting/tsconfig.json +18 -0
  67. package/src/panels/ai-chat/chat-view.ts +25 -14
  68. package/src/panels/git-panel.ts +17 -14
  69. package/src/panels/head-panel.ts +32 -14
  70. package/src/panels/imports-panel.ts +32 -13
  71. package/src/panels/layers-panel.ts +9 -1
  72. package/src/panels/panel-registry.ts +0 -1
  73. package/src/panels/properties-panel.ts +3 -3
  74. package/src/panels/settings-pane.ts +1 -1
  75. package/src/panels/style-panel.ts +3 -3
  76. package/src/panels/stylebook-panel.ts +10 -1
  77. package/src/panels/toolbar.ts +1 -1
  78. package/src/services/bundle-base.ts +69 -0
  79. package/src/services/monaco-setup.ts +19 -13
  80. package/src/shell/tree.ts +155 -0
  81. package/src/shell.ts +0 -2
  82. package/src/studio.ts +22 -2
  83. package/src/types.ts +15 -0
  84. package/src/ui/regions.ts +10 -45
  85. package/styles/overlays.css +35 -0
  86. package/dist/chunks/2020-xp8vnwma.js.map +0 -24
  87. package/dist/chunks/Overlay.dev-ymy3et3y.js.map +0 -9
  88. package/dist/chunks/adapter-jkcyhgtr.js.map +0 -9
  89. package/dist/chunks/cf-settings-g5fbf2zp.js.map +0 -9
  90. package/dist/chunks/components-z6cnkyy1.js.map +0 -9
  91. package/dist/chunks/content-source-r2n7v682.js.map +0 -9
  92. package/dist/chunks/convert-to-repeater-cnpyvj74.js.map +0 -10
  93. package/dist/chunks/editor-cptq5jp1.js.map +0 -9
  94. package/dist/chunks/extension-sections-vpcm4jvx.js.map +0 -11
  95. package/dist/chunks/files-zeg88k2d.js.map +0 -9
  96. package/dist/chunks/flow-qbfgrpeh.js.map +0 -12
  97. package/dist/chunks/focus-trap.esm-ggawf1hy.js.map +0 -11
  98. package/dist/chunks/focus-visible-6eg70z18.js.map +0 -10
  99. package/dist/chunks/format-host-taymsw55.js.map +0 -9
  100. package/dist/chunks/git-panel-qp4rrwr9.js.map +0 -9
  101. package/dist/chunks/index-nj44jpzj.js.map +0 -14
  102. package/dist/chunks/index-zqxmqxmh.js.map +0 -9
  103. package/dist/chunks/javascript-q8kpmfah.js.map +0 -11
  104. package/dist/chunks/jsonMode-dkr040ga.js.map +0 -18
  105. package/dist/chunks/jx-validate-jj9rnt4n.js.map +0 -9
  106. package/dist/chunks/layers-panel-kj93w2zg.js.map +0 -9
  107. package/dist/chunks/monaco-binding-rj6xpx9y.js.map +0 -10
  108. package/dist/chunks/monaco-setup-xy3bs05d.js.map +0 -15
  109. package/dist/chunks/publish-panel-6qz6kp41.js.map +0 -9
  110. package/dist/chunks/quick-search-9wwa09hh.js.map +0 -9
  111. package/dist/chunks/right-panel-faf816ch.js +0 -37
  112. package/dist/chunks/right-panel-faf816ch.js.map +0 -9
  113. package/dist/chunks/section-registry-sx1ykvkw.js.map +0 -9
  114. package/dist/chunks/sp-overlay.dev-h6kdx076.js.map +0 -9
  115. package/dist/chunks/sp-popover.dev-dj9x7e7a.js.map +0 -9
  116. package/dist/chunks/sp-progress-circle.dev-0fpvhm52.js +0 -15
  117. package/dist/chunks/sp-progress-circle.dev-0fpvhm52.js.map +0 -9
  118. package/dist/chunks/sp-tooltip.dev-rvepkw4r.js +0 -15
  119. package/dist/chunks/sp-tooltip.dev-rvepkw4r.js.map +0 -9
  120. package/dist/chunks/sp-tray.dev-64v4pxw8.js.map +0 -12
  121. package/dist/chunks/studio-0a5qrh01.js.map +0 -9
  122. package/dist/chunks/studio-0rqqhrdy.js.map +0 -12
  123. package/dist/chunks/studio-18j3bmcz.js.map +0 -10
  124. package/dist/chunks/studio-1kgfcv7s.js.map +0 -13
  125. package/dist/chunks/studio-22xr4q8q.js.map +0 -13
  126. package/dist/chunks/studio-300zsz1k.js.map +0 -39
  127. package/dist/chunks/studio-3fk1ac9z.js.map +0 -12
  128. package/dist/chunks/studio-3n4ndrzh.js.map +0 -41
  129. package/dist/chunks/studio-3z8jjm2p.js.map +0 -13
  130. package/dist/chunks/studio-4mqb9a0j.js.map +0 -14
  131. package/dist/chunks/studio-4q0wznzf.js.map +0 -73
  132. package/dist/chunks/studio-5ehhackm.js.map +0 -10
  133. package/dist/chunks/studio-5kt960pk.js.map +0 -38
  134. package/dist/chunks/studio-5x5774ak.js.map +0 -10
  135. package/dist/chunks/studio-685s0ytq.js.map +0 -76
  136. package/dist/chunks/studio-6a0h7sne.js.map +0 -15
  137. package/dist/chunks/studio-6f0am8f2.js.map +0 -10
  138. package/dist/chunks/studio-6kv3apa9.js.map +0 -10
  139. package/dist/chunks/studio-6zzbyx17.js.map +0 -12
  140. package/dist/chunks/studio-753znj4c.js.map +0 -16
  141. package/dist/chunks/studio-7afd21nw.js.map +0 -10
  142. package/dist/chunks/studio-8jpzqk5s.js.map +0 -10
  143. package/dist/chunks/studio-8q517dfr.js.map +0 -10
  144. package/dist/chunks/studio-8sdyjfd6.js.map +0 -10
  145. package/dist/chunks/studio-a0tswy0w.js.map +0 -9
  146. package/dist/chunks/studio-a7pzveq1.js.map +0 -11
  147. package/dist/chunks/studio-ahnzd9rg.js.map +0 -10
  148. package/dist/chunks/studio-b9b6t1dg.js.map +0 -651
  149. package/dist/chunks/studio-bw5dz6km.js.map +0 -21
  150. package/dist/chunks/studio-cjm7fdjf.js.map +0 -14
  151. package/dist/chunks/studio-ckwz4d3x.js.map +0 -12
  152. package/dist/chunks/studio-d1ks410h.js.map +0 -10
  153. package/dist/chunks/studio-dg7zyt5x.js.map +0 -10
  154. package/dist/chunks/studio-fys6z73y.js.map +0 -10
  155. package/dist/chunks/studio-g1wdche0.js.map +0 -56
  156. package/dist/chunks/studio-g8t7g0gp.js.map +0 -10
  157. package/dist/chunks/studio-h4rxscfc.js.map +0 -10
  158. package/dist/chunks/studio-hekaagev.js.map +0 -18
  159. package/dist/chunks/studio-hrajjyt2.js.map +0 -10
  160. package/dist/chunks/studio-nqq8jk8f.js.map +0 -14
  161. package/dist/chunks/studio-p471gg5n.js.map +0 -14
  162. package/dist/chunks/studio-pv8m0h4a.js.map +0 -98
  163. package/dist/chunks/studio-qhh8r5fz.js.map +0 -13
  164. package/dist/chunks/studio-qrsfh1w7.js.map +0 -41
  165. package/dist/chunks/studio-r8vx7bkz.js.map +0 -235
  166. package/dist/chunks/studio-rgwcpast.js.map +0 -12
  167. package/dist/chunks/studio-s519zc99.js.map +0 -10
  168. package/dist/chunks/studio-sas7mt3k.js.map +0 -10
  169. package/dist/chunks/studio-t5wqwzdh.js.map +0 -10
  170. package/dist/chunks/studio-tqemhphj.js.map +0 -11
  171. package/dist/chunks/studio-tr20m8g8.js.map +0 -9
  172. package/dist/chunks/studio-tvgyw9xw.js.map +0 -14
  173. package/dist/chunks/studio-x0et2z9g.js.map +0 -32
  174. package/dist/chunks/studio-xm3dbxvn.js.map +0 -19
  175. package/dist/chunks/studio-xmvbhg31.js.map +0 -10
  176. package/dist/chunks/studio-ynxwkrzd.js.map +0 -246
  177. package/dist/chunks/studio-yphy4z9m.js.map +0 -10
  178. package/dist/chunks/studio-yz9s88s0.js.map +0 -54
  179. package/dist/chunks/studio-z6nw2ek2.js.map +0 -10
  180. package/dist/chunks/studio-zqv3w24n.js.map +0 -11
  181. package/dist/chunks/tsMode-76kr53q0.js.map +0 -13
  182. package/dist/chunks/ws-client-6shc5rze.js.map +0 -12
@@ -1,14 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/panels/events-panel.ts", "../src/utils/inherited-style.ts", "../src/panels/target-line.ts", "../src/panels/style-panel.ts", "../src/panels/right-panel.ts"],
4
- "sourcesContent": [
5
- "/// <reference lib=\"dom\" />\n/**\n * The Logic tab — everything about how this element BEHAVES.\n *\n * Plan §6.5 re-split the inspector by task rather than by data type, and this is the tab that\n * gained by it. Wiring a `$switch`, wiring a repeater to a collection and wiring a click handler\n * are one job; they were three, split across two tabs, because a `$switch` is stored as a property\n * and a click handler is stored as a property-shaped function, and the old split followed the\n * storage. So Logic is now:\n *\n * - **Repeating list** — the `$prototype: \"Array\"` node's items / filter / sort, and its template.\n * - **Condition** — the `$switch` expression and its cases.\n * - **Events** — declared events, bindings, inline bodies, expressions.\n * - **Observed Attributes · CSS Properties · CSS Parts** — a custom element's outward contract.\n *\n * The last three arrived from the Content tab, where they were three near-identical hand-written\n * flex rows; they are now three calls to {@link renderStaticKvRow}.\n *\n * Everything here reads `session.selection`, so the tab is selection-level in the same sense the\n * rest of the inspector is: no selection is an empty state, not a blank panel.\n */\n\nimport { getNodeAtPath, renderOnly } from \"../store\";\nimport { html, nothing } from \"lit-html\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { primarySelection, unifyValues } from \"../tabs/selection\";\nimport { renderProvenanceChip } from \"./provenance\";\nimport {\n mutateAddDef,\n mutateAddSwitchCase,\n mutateRemoveSwitchCase,\n mutateRenameSwitchCase,\n mutateUpdateProperty,\n transactDoc,\n} from \"../tabs/transact\";\nimport { clickAnythingTo, renderEmptyState, staleSelectionMessage } from \"./empty-state\";\nimport { renderExpressionEditor } from \"../ui/expression-editor\";\nimport { renderStatementEditor } from \"./statement-editor\";\nimport { inspectorStatementsRegion } from \"../ui/regions\";\nimport { livePreviewExpression } from \"../services/live-preview\";\nimport { renderFieldRow, renderStaticKvRow } from \"../ui/field-row\";\nimport { renderDynamicSlot, slotMode, switchSlotMode } from \"../ui/dynamic-slot\";\nimport { VALUE_SOURCE_LABELS, capsForPosition } from \"../ui/value-source\";\nimport { spTextField } from \"../ui/field-input\";\nimport {\n bindableSignalNames,\n defaultAsString,\n isInspectorSectionOpen,\n mapSignalsFor,\n setInspectorSection,\n} from \"./properties-panel\";\nimport { collectCssParts } from \"./signals-panel\";\nimport { openLogicTarget } from \"./formula-workspace\";\nimport {\n getEventBinding,\n isExpressionDef,\n isFunctionDef,\n isJsonObject,\n isRef,\n} from \"@jxsuite/schema/guards\";\n\nimport type { JsonValue } from \"../types\";\nimport type { TemplateResult } from \"lit-html\";\nimport type { SlotCapsSource, SlotMode, SignalOption } from \"../ui/dynamic-slot\";\nimport type { JxPath } from \"../state\";\nimport type {\n CemEvent,\n JxEventBinding,\n JxFunctionDef,\n JxMutableNode,\n JxPrototypeDef,\n} from \"@jxsuite/schema/types\";\n\n/**\n * The events worth SUGGESTING — not the events an element may have.\n *\n * These ten were a closed `sp-picker`, so `ondragover`, `onpointerdown`, `onwheel`, `onpaste` and\n * every custom event a component emits were unbindable from the Inspector: the plan's §6.5 asks for\n * \"a free-form combobox instead of a hard-coded list of ten\", and `ui/value-selector.ts`'s own\n * docstring names this field as the reason it exists (\"what lets a control like the event-name\n * field stop being a list of ten\"). The widget was written and never wired.\n */\nexport const EVENT_NAMES = [\n \"onclick\",\n \"oninput\",\n \"onchange\",\n \"onsubmit\",\n \"onkeydown\",\n \"onkeyup\",\n \"onfocus\",\n \"onblur\",\n \"onmouseenter\",\n \"onmouseleave\",\n];\n\n/** {@link EVENT_NAMES} as the combobox's option list, plus whatever this element already declares. */\nfunction eventNameOptions(declared: readonly string[]): { label: string; value: string }[] {\n const seen = new Set<string>();\n const out: { label: string; value: string }[] = [];\n for (const name of [...declared, ...EVENT_NAMES]) {\n if (!seen.has(name)) {\n seen.add(name);\n out.push({ label: name, value: name });\n }\n }\n return out;\n}\n\n/**\n * The rungs an `on*` handler permits, derived from the schema (`RefObject | ExpressionEntry |\n * FunctionDef`) rather than listed here.\n *\n * This picker used to read Inline code / Expression / Existing function — a fourth private dialect\n * for the one ladder §6.6 collapses, so a user who learned \"Formula\" on a property row met\n * \"Expression\" here and had no reason to think they were the same thing.\n */\nconst HANDLER_MODES: SlotMode[] = capsForPosition(\"eventHandler\");\n\n/** The value a handler starts at on each rung, when the user has never been on that rung before. */\nfunction seedForHandlerMode(mode: SlotMode, functionDefs: [string, unknown][]): JsonValue {\n if (mode === \"function\") {\n return { $prototype: \"Function\", body: \"\", parameters: [] };\n }\n if (mode === \"expression\") {\n return { $expression: { operator: \"=\", target: null } };\n }\n const [firstFn] = functionDefs;\n return firstFn ? { $ref: `#/state/${firstFn[0]}` } : { $ref: \"\" };\n}\n\n// ─── The bindable row ────────────────────────────────────────────────────────\n\n/** Arguments for {@link bindableFieldRow}. */\ninterface BindableRowOpts {\n /** The `data-prop` key — what `inspector/field:<prop>` addresses. */\n prop: string;\n label: string;\n /** The raw document value: a JSON literal, `{ $ref }`, a `${}` template or an `$expression`. */\n rawValue: unknown;\n onChange: (v?: JsonValue) => void;\n /** Removes the position outright. Absent means the position is mandatory and cannot be cleared. */\n onClear?: (() => void) | undefined;\n /** Extra signals this position may bind to — `$map/item` and friends inside a template. */\n extraSignals?: SignalOption[] | null;\n /** Stable identity for the dynamic slot's per-mode value memory; must include the node path. */\n fieldKey: string;\n /** The document position being edited — the rungs follow from its schema, never from here. */\n caps: SlotCapsSource;\n}\n\n/**\n * A bindable value as a first-class field row.\n *\n * This used to render a bare `<div class=\"field-row\">` with a label and a widget: no set-dot, no\n * clear affordance, no error slot — the three things every other row in the inspector has had since\n * `renderFieldRow` landed. Repeater and Switch fields were the last second-class rows in the\n * inspector, which is exactly what §12 P5 item 6 names.\n *\n * Every position it serves is a single-line expression (a collection, a filter, a sort key, a\n * `$switch`), so it draws one literal editor rather than dispatching over a widget type — the\n * textarea and checkbox arms it used to carry had no caller in either tab.\n */\nfunction bindableFieldRow({\n prop,\n label,\n rawValue,\n onChange,\n onClear,\n extraSignals = null,\n fieldKey,\n caps,\n}: BindableRowOpts) {\n const defs = activeTab.value!.doc.document.state || {};\n const boundRef = isRef(rawValue) ? rawValue.$ref : null;\n const staticVal = slotMode(rawValue) === \"literal\" ? (rawValue ?? \"\") : \"\";\n\n // De-escalating to literal restores the bound signal's declared default (old unbind behavior).\n const literalDefault = boundRef\n ? defaultAsString(defs[boundRef.startsWith(\"#/state/\") ? boundRef.slice(8) : boundRef]) ||\n undefined\n : undefined;\n\n const slot = renderDynamicSlot({\n caps,\n extraSignals,\n fieldKey,\n literalDefault,\n onChange,\n staticWidget: spTextField(`prop:${label}`, String(staticVal), (v: string) => onChange(v)),\n stateDefs: bindableSignalNames(activeTab.value!.doc.document),\n value: rawValue,\n });\n return renderFieldRow({\n hasValue: rawValue !== undefined && rawValue !== \"\",\n label,\n labelExtra: slot.modeButton,\n prop,\n widget: slot.widget,\n ...(onClear ? { onClear } : {}),\n });\n}\n\n// ─── Repeating list ──────────────────────────────────────────────────────────\n\n/**\n * The repeater's items / filter / sort, and the way into its template.\n *\n * Filter and Sort are always drawn. They used to hide behind `+ Add filter`, which seeded `{ $ref:\n * \"#/state/\" }` — a binding to the empty pointer, which is not a signal — so the row opened already\n * bound to nothing and the only way to type a literal was to cycle the mode ring twice (§11.4).\n * There is no seed to fix, because a repeater has exactly three inputs and an empty row states that\n * better than a button does: type into it and it is set, clear it and it is gone.\n */\nfunction renderRepeaterFieldsTemplate(node: JxMutableNode, path: JxPath) {\n const key = path.join(\"/\");\n const clear = (name: string) => () =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, name));\n const optional = (name: \"filter\" | \"sort\", label: string) =>\n bindableFieldRow({\n caps: name === \"filter\" ? \"repeaterFilter\" : \"repeaterSort\",\n fieldKey: `prop|${key}|${name}`,\n label,\n onChange: (v?: JsonValue) =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, name, v || undefined)),\n onClear: clear(name),\n prop: name,\n rawValue: node[name],\n });\n return html`\n ${bindableFieldRow({\n caps: \"repeaterItems\",\n fieldKey: `prop|${key}|items`,\n label: \"Items\",\n onChange: (v?: JsonValue) =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, \"items\", v)),\n prop: \"items\",\n rawValue: node.items,\n })}\n ${optional(\"filter\", \"Filter\")} ${optional(\"sort\", \"Sort\")}\n ${\n node.map\n ? html`\n <sp-action-button\n size=\"s\"\n class=\"logic-edit-template\"\n @click=${() => {\n activeTab.value!.session.selection = [[...path, \"map\"]];\n }}\n >Edit template →</sp-action-button\n >\n `\n : nothing\n }\n `;\n}\n\n// ─── Condition ───────────────────────────────────────────────────────────────\n\n/** The `$switch` expression and its cases — each case a field row like every other. */\nfunction renderSwitchFieldsTemplate(\n node: JxMutableNode,\n path: JxPath,\n mapSignals: SignalOption[] | null,\n) {\n const caseNames = Object.keys(node.cases || {});\n return html`\n ${bindableFieldRow({\n // `SwitchDef` is a $ref and nothing else, so From data… is the only rung — a $switch is\n // Inherently dynamic, and de-escalating it would delete the key and demote the node.\n caps: \"switchDiscriminant\",\n extraSignals: mapSignals,\n fieldKey: `prop|${path.join(\"/\")}|$switch`,\n label: \"Expression\",\n onChange: (v?: JsonValue) =>\n transactDoc(activeTab.value, (t) => mutateUpdateProperty(t, path, \"$switch\", v)),\n prop: \"$switch\",\n rawValue: node.$switch,\n })}\n <div class=\"logic-subhead\">Cases</div>\n ${caseNames.map((caseName) => {\n let debounce: ReturnType<typeof setTimeout> | undefined;\n return renderFieldRow({\n hasValue: true,\n label: \"Case\",\n prop: `case:${caseName}`,\n provenance: {\n onClick: () =>\n transactDoc(activeTab.value!, (t) => mutateRemoveSwitchCase(t, path, caseName)),\n state: \"set\",\n title: `Remove case \"${caseName}\"`,\n },\n widget: html`\n <div class=\"logic-case-row\">\n <sp-textfield\n size=\"s\"\n class=\"logic-case-name\"\n .value=${live(caseName)}\n @input=${(e: Event) => {\n clearTimeout(debounce);\n const next = (e.target as HTMLInputElement).value;\n debounce = setTimeout(() => {\n if (next && next !== caseName) {\n transactDoc(activeTab.value, (t) =>\n mutateRenameSwitchCase(t, path, caseName, next),\n );\n }\n }, 500);\n }}\n ></sp-textfield>\n <sp-action-button\n size=\"xs\"\n quiet\n class=\"logic-case-open\"\n title=\"Edit case\"\n @click=${(e: Event) => {\n e.stopPropagation();\n activeTab.value!.session.selection = [[...path, \"cases\", caseName]];\n }}\n >→</sp-action-button\n >\n </div>\n `,\n });\n })}\n <span\n class=\"kv-add\"\n @click=${() => {\n transactDoc(activeTab.value, (t) =>\n mutateAddSwitchCase(t, path, `case${caseNames.length + 1}`),\n );\n }}\n >+ Add case</span\n >\n `;\n}\n\n// ─── Events ──────────────────────────────────────────────────────────────────\n\n/** The event bindings themselves — declared events, then one block per bound `on*` key. */\n/**\n * The Logic tab's Mixed contract (§6.5), stated once because it is a judgement, not a mechanism.\n *\n * Wiring splits in two, and a multi-selection treats the halves differently:\n *\n * - **Which events exist, and how each is produced** — the event key, its Value Source rung, and its\n * removal — is a property of the BATCH. Binding one handler to six buttons, or clearing it off\n * all six, is a single decision, so those three controls write to every selected element inside\n * one transaction and one undo step.\n * - **What a handler CONTAINS** — a function body, an expression's operands, a repeater's source and\n * template — is the PRIMARY's. Six elements do not share one handler body; broadcasting a\n * keystroke into six different bodies would destroy five of them, and showing one body while\n * claiming to edit six is the lie the Mixed chip exists to prevent.\n *\n * So the row header states `mixed (n)` when the selected elements disagree about a key — including\n * when some of them do not bind it at all — and the body below it stays what it always was: the\n * primary's, edited alone.\n *\n * @param {readonly JxPath[]} targets\n * @param {string} key\n * @param {JsonValue} [value] — omitted deletes the key.\n */\nfunction commitToTargets(targets: readonly JxPath[], key: string, value?: JsonValue): void {\n transactDoc(activeTab.value, (t) => {\n for (const target of targets) {\n mutateUpdateProperty(t, target, key, value);\n }\n });\n}\n\n/**\n * How many selected elements disagree about one event key — 0 when they agree or there is one.\n *\n * @param {JxMutableNode} doc\n * @param {readonly JxPath[]} targets\n * @param {string} evKey\n * @returns {number}\n */\nfunction mixedEventCount(doc: JxMutableNode, targets: readonly JxPath[], evKey: string): number {\n if (targets.length < 2) {\n return 0;\n }\n const values = targets.map((path) => {\n const n = getNodeAtPath(doc, path) as JxMutableNode | undefined;\n return n ? (getEventBinding(n, evKey) ?? null) : null;\n });\n return unifyValues(values).mixed ? targets.length : 0;\n}\n\nfunction renderEventsBody(\n node: JxMutableNode,\n selection: JxPath,\n isCustomElement: boolean,\n targets: readonly JxPath[] = [selection],\n) {\n const tab = activeTab.value!;\n const defs = tab.doc.document.state || {};\n const functionDefs = Object.entries(defs).filter(\n ([, d]) =>\n (d as JxPrototypeDef)?.$prototype === \"Function\" || (d as Record<string, unknown>)?.$handler,\n );\n\n // Declared CEM events (custom element docs)\n let declaredEventsT: unknown = nothing;\n if (isCustomElement) {\n const allEmits: (CemEvent & { _fn: string })[] = [];\n for (const [fnName, d] of Object.entries(defs)) {\n if (isFunctionDef(d) && Array.isArray(d.emits)) {\n for (const ev of d.emits) {\n allEmits.push({ ...ev, _fn: fnName });\n }\n }\n }\n if (allEmits.length > 0) {\n declaredEventsT = html`\n <div class=\"events-section\">\n <sp-field-label size=\"s\">Declared Events</sp-field-label>\n ${allEmits.map(\n (ev) => html`\n <div class=\"declared-event-row\" title=${ev.description || \"\"}>\n <code class=\"event-code\">${ev.name || \"(unnamed)\"}</code>\n <span class=\"event-source\">← ${ev._fn}</span>\n ${\n isJsonObject(ev.type) && typeof ev.type.text === \"string\"\n ? html`<span class=\"event-type\">${ev.type.text}</span>`\n : nothing\n }\n </div>\n `,\n )}\n </div>\n <sp-divider size=\"s\"></sp-divider>\n `;\n }\n }\n\n // Find existing event bindings. Resolved once, as pairs: asking `getEventBinding` for the key and\n // Then again for the value left a `if (!evVal) return nothing` arm nothing could ever reach.\n const eventEntries = Object.keys(node)\n .filter((k) => k.startsWith(\"on\"))\n .map((k) => [k, getEventBinding(node, k)] as const)\n .filter((pair): pair is [string, JxEventBinding] => pair[1] !== undefined);\n\n return html`\n <div class=\"events-panel\">\n ${declaredEventsT}\n <div class=\"events-section\">\n ${\n eventEntries.length > 0\n ? html` <sp-field-label size=\"s\">Event Bindings</sp-field-label> `\n : nothing\n }\n ${eventEntries.map(([evKey, evVal]) => {\n const inlineFn: JxFunctionDef | null = isFunctionDef(evVal) ? evVal : null;\n const expression = isExpressionDef(evVal) ? evVal.$expression : null;\n const refValue = isRef(evVal) ? evVal.$ref : null;\n const currentMode = slotMode(evVal);\n const modeFieldKey = `event|${selection.join(\"/\")}|${evKey}`;\n return html`\n <div class=\"event-binding\">\n <div class=\"event-row\">\n <jx-value-selector\n size=\"s\"\n class=\"event-name\"\n .value=${evKey}\n .options=${eventNameOptions(Object.keys(node).filter((k) => k.startsWith(\"on\")))}\n @change=${(e: Event) => {\n const newKey = (e.target as HTMLInputElement).value.trim();\n // A NAME, not a menu choice: the field is free-form now, so it has to refuse\n // What it cannot bind rather than trusting a list it no longer constrains.\n if (newKey && newKey !== evKey && /^on[a-z][\\da-z-]*$/i.test(newKey)) {\n // Renaming the key moves the binding on every selected element, in one step.\n transactDoc(activeTab.value, (t) => {\n for (const target of targets) {\n const existing = getEventBinding(\n getNodeAtPath(t.doc.document, target) as JxMutableNode,\n evKey,\n );\n if (existing === undefined) {\n continue;\n }\n mutateUpdateProperty(t, target, evKey);\n mutateUpdateProperty(t, target, newKey, existing as JsonValue);\n }\n });\n }\n }}\n >\n ></jx-value-selector\n >\n <sp-picker\n size=\"s\"\n class=\"event-mode\"\n .value=${live(currentMode)}\n @change=${(e: Event) => {\n const next = (e.target as HTMLInputElement).value as SlotMode;\n /* The same ladder the inspector's rows offer, remembering the representation\n it left: switching to Formula and back used to throw the handler body away. */\n commitToTargets(\n targets,\n evKey,\n switchSlotMode(\n modeFieldKey,\n currentMode,\n next,\n evVal as JsonValue,\n seedForHandlerMode(next, functionDefs),\n ) ?? seedForHandlerMode(next, functionDefs),\n );\n }}\n >\n ${HANDLER_MODES.map(\n (m) => html`<sp-menu-item value=${m}>${VALUE_SOURCE_LABELS[m]}</sp-menu-item>`,\n )}\n </sp-picker>\n ${renderProvenanceChip(evKey, {\n state: mixedEventCount(tab.doc.document, targets, evKey) > 0 ? \"mixed\" : \"set\",\n donor: String(targets.length),\n onClick: () => commitToTargets(targets, evKey),\n title:\n mixedEventCount(tab.doc.document, targets, evKey) > 0\n ? `${targets.length} selected elements bind ${evKey} differently — ` +\n `clearing removes it from all of them`\n : `Clear ${evKey}`,\n })}\n <sp-action-button size=\"xs\" quiet @click=${() => commitToTargets(targets, evKey)}>\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n ${\n inlineFn\n ? html`\n <div class=\"event-body-mode\" style=\"display:flex;justify-content:flex-end\">\n <sp-action-group size=\"s\" compact class=\"body-mode-toggle\">\n <sp-action-button\n size=\"s\"\n class=\"body-mode-statements\"\n ?selected=${Array.isArray(inlineFn.body)}\n @click=${() => {\n if (!Array.isArray(inlineFn.body)) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n ...inlineFn,\n body: [],\n }),\n );\n }\n }}\n >\n Statements\n </sp-action-button>\n <sp-action-button\n size=\"s\"\n class=\"body-mode-code\"\n ?selected=${!Array.isArray(inlineFn.body)}\n @click=${() => {\n if (Array.isArray(inlineFn.body)) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n ...inlineFn,\n body: \"\",\n }),\n );\n }\n }}\n >\n Code\n </sp-action-button>\n </sp-action-group>\n </div>\n ${\n Array.isArray(inlineFn.body)\n ? renderStatementEditor(\n inlineFn.body,\n (next) =>\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n ...inlineFn,\n body: next,\n }),\n ),\n {\n allowEventRef: true,\n emits: inlineFn.emits ?? [],\n // The Inspector's copy, named by the handler it edits. It answered\n // To `navigator/statements` until the docks were split, and then\n // To a bare `inspector/statements` — which this `.map` stamps once\n // Per structured handler, so two handlers on a node made two\n // Elements answer to it and `resolveRegion` took the second.\n region: inspectorStatementsRegion(evKey),\n stateDefs: Object.keys(defs),\n stateEntries: defs,\n },\n )\n : html`\n <div class=\"event-body-row\">\n <sp-textfield\n size=\"s\"\n multiline\n grows\n placeholder=\"// handler body\"\n .value=${live(typeof inlineFn.body === \"string\" ? inlineFn.body : \"\")}\n @input=${(e: Event) => {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n $prototype: \"Function\",\n body: (e.target as HTMLInputElement).value,\n parameters: inlineFn?.parameters || [],\n }),\n );\n }}\n >\n </sp-textfield>\n <sp-action-button\n size=\"xs\"\n quiet\n title=\"Open in editor\"\n @click=${() => {\n openLogicTarget({\n editing: { eventKey: evKey, path: selection, type: \"event\" },\n surface: \"function\",\n });\n }}\n >\n <sp-icon-code slot=\"icon\"></sp-icon-code>\n </sp-action-button>\n </div>\n `\n }\n `\n : expression\n ? html`\n <div class=\"event-body-row\">\n <div style=\"flex:1;min-width:0\">\n ${renderExpressionEditor(\n expression,\n (newNode: unknown) =>\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n $expression: newNode,\n }),\n ),\n {\n allowEventRef: true,\n // Live-context evaluation in the canvas iframe, snapshot fallback\n // (M6). The selection path is the context, so a binding inside a\n // Repeater template previews with the first item's $map scope.\n preview: livePreviewExpression(\n tab,\n `event:${JSON.stringify(selection)}:${evKey}`,\n expression,\n selection,\n () => renderOnly(\"rightPanel\"),\n ),\n onInsertDef: (defName, def) =>\n transactDoc(activeTab.value, (t) =>\n mutateAddDef(t, defName, def as Record<string, JsonValue>),\n ),\n stateDefs: Object.keys(defs),\n stateEntries: defs,\n },\n )}\n </div>\n <sp-action-button\n size=\"xs\"\n quiet\n title=\"Open in formula workspace\"\n @click=${() => {\n openLogicTarget({\n editing: { eventKey: evKey, path: selection, type: \"event\" },\n surface: \"formula\",\n });\n }}\n >\n <sp-icon-align-bottom slot=\"icon\"></sp-icon-align-bottom>\n </sp-action-button>\n </div>\n `\n : html`\n <sp-picker\n size=\"s\"\n class=\"event-handler\"\n .value=${live(refValue || \"__none__\")}\n @change=${(e: Event) => {\n if (\n (e.target as HTMLInputElement).value &&\n (e.target as HTMLInputElement).value !== \"__none__\"\n ) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey, {\n $ref: (e.target as HTMLInputElement).value,\n }),\n );\n } else {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evKey),\n );\n }\n }}\n >\n <sp-menu-item value=\"__none__\">— none —</sp-menu-item>\n ${functionDefs.map(\n ([fName]) =>\n html`<sp-menu-item value=${`#/state/${fName}`}\n >${fName}</sp-menu-item\n >`,\n )}\n </sp-picker>\n `\n }\n </div>\n `;\n })}\n <sp-action-button\n size=\"s\"\n quiet\n @click=${() => {\n let evName = \"onclick\";\n for (const name of EVENT_NAMES) {\n if (!node[name]) {\n evName = name;\n break;\n }\n }\n if (functionDefs.length > 0) {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evName, {\n $ref: `#/state/${functionDefs[0]![0]}`,\n }),\n );\n } else {\n transactDoc(activeTab.value, (t) =>\n mutateUpdateProperty(t, selection, evName, {\n $prototype: \"Function\",\n body: \"\",\n parameters: [],\n }),\n );\n }\n }}\n >\n <sp-icon-add slot=\"icon\"></sp-icon-add>\n Add Event\n </sp-action-button>\n </div>\n </div>\n `;\n}\n\n// ─── The custom element's outward contract ───────────────────────────────────\n\n/** Observed attributes: the `attribute` names a page may set from markup, and what they feed. */\nfunction renderObservedAttrsSection(document: JxMutableNode) {\n const state = document.state || {};\n const entries = Object.entries(state).filter(([, d]) => (d as Record<string, unknown>).attribute);\n return html`\n <sp-accordion-item\n label=\"Observed Attributes\"\n ?open=${isInspectorSectionOpen(\"__observed\", false)}\n @sp-accordion-item-toggle=${() =>\n setInspectorSection(\"__observed\", !isInspectorSectionOpen(\"__observed\", false))}\n >\n <div class=\"style-section-body\">\n ${\n entries.length === 0\n ? renderEmptyState({\n compact: true,\n message:\n \"Attributes let a page set this component from markup. \" +\n 'Name an \"attribute\" on a data entry to expose it here.',\n })\n : entries.map(([key, d]) => {\n const def = d as Record<string, unknown>;\n return renderStaticKvRow({\n detail: `→ ${key}`,\n name: String(def.attribute),\n ...(def.type ? { value: String(def.type) } : {}),\n ...(def.reflects ? { tags: [\"reflects\"] } : {}),\n });\n })\n }\n </div>\n </sp-accordion-item>\n `;\n}\n\n/** The `--custom-properties` a page may override on this component. */\nfunction renderCssPropsSection(node: JxMutableNode) {\n const style = node.style || {};\n const cssProps = Object.entries(style).filter(([k]) => k.startsWith(\"--\"));\n if (cssProps.length === 0) {\n return nothing;\n }\n return html`\n <sp-accordion-item\n label=\"CSS Properties\"\n ?open=${isInspectorSectionOpen(\"__cssprops\", false)}\n @sp-accordion-item-toggle=${() =>\n setInspectorSection(\"__cssprops\", !isInspectorSectionOpen(\"__cssprops\", false))}\n >\n <div class=\"style-section-body\">\n ${cssProps.map(([prop, val]) => renderStaticKvRow({ name: prop, value: String(val) }))}\n </div>\n </sp-accordion-item>\n `;\n}\n\n/** The `part` names a page may style inside this component's shadow tree. */\nfunction renderCssPartsSection(document: JxMutableNode) {\n const parts = collectCssParts(document);\n if (parts.length === 0) {\n return nothing;\n }\n return html`\n <sp-accordion-item\n label=\"CSS Parts\"\n ?open=${isInspectorSectionOpen(\"__cssparts\", false)}\n @sp-accordion-item-toggle=${() =>\n setInspectorSection(\"__cssparts\", !isInspectorSectionOpen(\"__cssparts\", false))}\n >\n <div class=\"style-section-body\">\n ${parts.map((p) => renderStaticKvRow({ detail: `<${p.tag}>`, name: p.name }))}\n </div>\n </sp-accordion-item>\n `;\n}\n\n// ─── The tab ─────────────────────────────────────────────────────────────────\n\n/**\n * The Logic tab.\n *\n * @param {{ isCustomElementDoc: () => boolean }} helpers — injected because the answer needs the\n * tab's mode and ui, which the dock already has in hand.\n */\nexport function renderLogicPanelTemplate(helpers: {\n isCustomElementDoc: () => boolean;\n}): TemplateResult {\n const { isCustomElementDoc } = helpers;\n const tab = activeTab.value;\n const selection = primarySelection(tab?.session.selection);\n const doc = tab?.doc.document;\n if (!selection) {\n return renderEmptyState({ message: clickAnythingTo(\"wire it up\") });\n }\n const node = getNodeAtPath(doc!, selection);\n if (!node) {\n return renderEmptyState({ message: staleSelectionMessage() });\n }\n\n // The whole selection the Logic tab wires. `[selection]` when one element is selected — which is\n // Every existing call site's behaviour, unchanged.\n const targets: JxPath[] =\n tab!.session.selection.length > 0 ? tab!.session.selection : [selection];\n const isMapNode = node.$prototype === \"Array\";\n const isSwitchNode = Boolean(node.$switch);\n const isRoot = selection.length === 0;\n const isCustomElement = isCustomElementDoc();\n const mapSignals = mapSignalsFor(selection);\n\n const repeaterT = isMapNode\n ? html`\n <sp-accordion-item label=\"Repeating list\" open>\n <div class=\"style-section-body\">${renderRepeaterFieldsTemplate(node, selection)}</div>\n </sp-accordion-item>\n `\n : nothing;\n\n const switchT = isSwitchNode\n ? html`\n <sp-accordion-item label=\"Condition\" open>\n <div class=\"style-section-body\">\n ${renderSwitchFieldsTemplate(node, selection, mapSignals)}\n </div>\n </sp-accordion-item>\n `\n : nothing;\n\n // A repeater is not an element: it has no `on*` position to bind, and offering \"Add Event\" on one\n // Writes a handler onto a node the renderer never mounts.\n const eventsT = isMapNode\n ? nothing\n : html`\n <sp-accordion-item label=\"Events\" open>\n <div class=\"style-section-body\">\n ${renderEventsBody(node, selection, isCustomElement, targets)}\n </div>\n </sp-accordion-item>\n `;\n\n const contractT =\n isCustomElement && isRoot\n ? html`\n ${renderObservedAttrsSection(doc!)} ${renderCssPropsSection(node)}\n ${renderCssPartsSection(doc!)}\n `\n : nothing;\n\n return html`\n <div class=\"style-sidebar\">\n <sp-accordion allow-multiple size=\"s\">\n ${repeaterT} ${switchT} ${eventsT} ${contractT}\n </sp-accordion>\n </div>\n `;\n}\n",
6
- "/**\n * Inherited-style.js — the effective inherited style for a breakpoint tab, **and the breakpoint it\n * came from**.\n *\n * Walks the cascade (base → each media block in order) up to but not including the active\n * breakpoint, producing the set of property values that would apply if no explicit override exists\n * on the current tab.\n *\n * The walk has always known the donor — it is the loop variable — and the answer was thrown away\n * one line later, which left the inspector able to show an inherited value only as an input\n * placeholder, visually identical to the CSS initial value rendered beside it.\n * {@link computeInheritedSources} keeps the donor; {@link computeInheritedStyle} is the projection\n * that drops it, for callers that only want the value.\n */\n\nimport type { JxStyle } from \"@jxsuite/schema/types\";\n\n/** One inherited property: the value that shows through, and the breakpoint it was set on. */\nexport interface InheritedSource {\n value: string | number;\n /** The donor breakpoint's name, or `null` when the value comes from the base context. */\n donor: string | null;\n}\n\n/**\n * Compute the inherited style map WITH each value's donor breakpoint.\n *\n * @param {JxStyle} style — full style object (flat props + @media blocks + selectors)\n * @param {string[]} mediaNames — ordered breakpoint names (from parseMediaEntries, respects cascade\n * direction)\n * @param {string | null} activeTab — current breakpoint tab name, or null for base\n * @param {string | null} activeSelector — current nested selector, or null\n * @returns {Record<string, InheritedSource>} Prop → { value, donor }\n */\nexport function computeInheritedSources(\n style: JxStyle,\n mediaNames: string[],\n activeTab: string | null,\n activeSelector: string | null = null,\n): Record<string, InheritedSource> {\n if (activeTab === null || mediaNames.length === 0) {\n return {};\n }\n\n const inherited: Record<string, InheritedSource> = {};\n\n /** Layer one block over the accumulator, recording `donor` for everything it contributes. */\n const layer = (block: JxStyle, donor: string | null) => {\n for (const [p, v] of Object.entries(block)) {\n if (typeof v !== \"object\") {\n inherited[p] = { donor, value: (v as string | number) ?? \"\" };\n }\n }\n };\n\n if (activeSelector) {\n // Selector inheritance: base selector → each media's selector block, in cascade order.\n layer((style[activeSelector] || {}) as JxStyle, null);\n for (const name of mediaNames) {\n if (name === activeTab) {\n break;\n }\n layer(\n (((style[`@${name}`] || {}) as Record<string, unknown>)[activeSelector] || {}) as JxStyle,\n name,\n );\n }\n return inherited;\n }\n\n // Base flat props first, then each media block in order until the current tab.\n layer(style, null);\n for (const name of mediaNames) {\n if (name === activeTab) {\n break;\n }\n layer((style[`@${name}`] || {}) as JxStyle, name);\n }\n return inherited;\n}\n\n/**\n * Compute the inherited style object for a given breakpoint tab — values only.\n *\n * @param {JxStyle} style — full style object (flat props + @media blocks + selectors)\n * @param {string[]} mediaNames — ordered breakpoint names (from parseMediaEntries, respects cascade\n * direction)\n * @param {string | null} activeTab — current breakpoint tab name, or null for base\n * @param {string | null} activeSelector — current nested selector, or null\n * @returns {Record<string, string | number>} Inherited style map (prop → value)\n */\nexport function computeInheritedStyle(\n style: JxStyle,\n mediaNames: string[],\n activeTab: string | null,\n activeSelector: string | null = null,\n): Record<string, string | number> {\n const values: Record<string, string | number> = {};\n for (const [prop, source] of Object.entries(\n computeInheritedSources(style, mediaNames, activeTab, activeSelector),\n )) {\n values[prop] = source.value;\n }\n return values;\n}\n",
7
- "/// <reference lib=\"dom\" />\n/**\n * The Target Line — the Style tab's compound edit target, as one sentence (plan §6.1).\n *\n * ```text\n * ⌖ h1 · @md · :hover · dark variant [ all <h1> in this document ]\n * ```\n *\n * `style-panel.ts` has always computed this tuple exactly: it is the per-field key\n * (`style|${sel}|${editMedia}|${activeSelector}|${prop}`) and the five-branch if/else that picks\n * the commit function. What it did with it was hide it behind three disconnected widgets on two\n * different bars — a `<sp-tabs>` breakpoint strip, a `.selector-select` picker, and a\n * `.style-scheme-badge` whose class had **no CSS rule anywhere in the repo**, so the one control\n * that admitted the tab bar was overriding the panel rendered as unstyled inline text.\n *\n * Three rules shape what this module is allowed to be:\n *\n * 1. **Every segment is a control.** A sentence you cannot act on is a caption, and the panel already\n * had one of those.\n * 2. **The Style tab does not own the breakpoint or the scheme.** Those axes are SELECTED on the pane\n * context bar (region ⑦) and DEFINED in Project Settings › Contexts — §2 principle 5. The\n * breakpoint and scheme segments therefore state the resolved value and route to the definition\n * site; they do not offer a third list to pick from. The selector segment is the one axis this\n * tab owns, so it is the one segment with a menu.\n * 3. **The scope chip is what makes Stylebook safe.** Entering Stylebook silently discards the element\n * selection and converts every subsequent edit from \"this element\" to \"every element of this\n * tag\" — with one line of text, after the fact, as the only signal. The chip states the blast\n * radius BEFORE the first keystroke, and the project case is a warning band with an affected\n * count and a \"show affected\" list.\n *\n * The count comes from `services/references.ts` where that query can answer, and says **\"unknown\"**\n * where it cannot. A confirmation may be silent; it may never be confidently wrong.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { ref } from \"lit-html/directives/ref.js\";\nimport { classMap } from \"lit-html/directives/class-map.js\";\n\n/** The overlay this module drives — `open` is `overlay-trigger`'s own declared state. */\ninterface SelectorTrigger extends HTMLElement {\n open?: string | undefined;\n}\n\n/** The live selector trigger, captured by the template's own `ref`. */\nlet _selectorTrigger: SelectorTrigger | null = null;\n\n/**\n * Forget the trigger — the Inspector unmounted, or a test is starting clean.\n *\n * A module-local handle rather than a `querySelector` at call time: the line is rebuilt on every\n * Inspector render, so anything that resolved it once would hold a detached node.\n */\nexport function resetSelectorTrigger(): void {\n _selectorTrigger = null;\n}\n\n/**\n * Open the selector menu.\n *\n * `open = \"click\"` is the element's own declared state, which is the difference between a command\n * that presses a control and a manifest that hands a CSS selector to a synthetic mouse (§13).\n *\n * @throws {RangeError} When the Style tab is not rendered.\n */\nexport function openSelectorMenu(): void {\n if (!_selectorTrigger?.isConnected) {\n throw new RangeError(\n `command \"style.openSelectorMenu\" needs the Inspector's Style tab rendered; its selector ` +\n `menu is not in the document`,\n );\n }\n _selectorTrigger.open = \"click\";\n}\n\n/** Close it again — every menu choice does this, so the sentence is readable straight after. */\nfunction closeSelectorMenu(): void {\n if (_selectorTrigger) {\n _selectorTrigger.open = undefined;\n }\n}\n\n// ─── The model ───────────────────────────────────────────────────────────────\n\n/** One clickable word of the sentence. */\nexport interface TargetSegment {\n /** `element` | `media` | `scheme` — the axis, used as the segment's `data-seg`. */\n key: string;\n label: string;\n title: string;\n /** What clicking it opens. A segment with no action is not rendered as a button. */\n onActivate?: (() => void) | undefined;\n}\n\n/** The selector axis — the one the Style tab owns, so the one with a menu. */\nexport interface TargetSelector {\n /** The active nested selector, or `null` for the element's own base rule. */\n value: string | null;\n /** Every selector offerable right now: the common set ∪ what the element declares. */\n options: string[];\n /** Which options the element already declares — marked in the menu. */\n declared: Set<string>;\n onSelect: (selector: string | null) => void;\n /** Opens the Add Nested Selector dialog (`showPromptDialog`, ui-guidelines §8.7). */\n onAddCustom: () => void;\n}\n\n/** How wide the blast radius is, and what the app can say about it. */\nexport interface TargetScope {\n kind: \"element\" | \"document\" | \"project\";\n /** \"this element\" / \"all `<h1>` in this document\" / \"all `<h1>` in this project\". */\n label: string;\n /** The affected-count sentence — \"312 elements in 24 files\", or \"unknown\". */\n affected?: string | undefined;\n /** The files the count came from, for the \"show affected\" disclosure. */\n affectedFiles?: readonly { path: string; count: number }[] | undefined;\n showAffected?: boolean | undefined;\n onToggleAffected?: (() => void) | undefined;\n}\n\nexport interface TargetLineModel {\n segments: TargetSegment[];\n selector: TargetSelector;\n scope: TargetScope;\n}\n\n// ─── Rendering ───────────────────────────────────────────────────────────────\n\nfunction segmentTpl(segment: TargetSegment) {\n const cls = `tl-seg tl-seg--${segment.key}`;\n if (!segment.onActivate) {\n return html`<span class=${cls} data-seg=${segment.key} title=${segment.title}\n >${segment.label}</span\n >`;\n }\n return html`<button\n type=\"button\"\n class=${cls}\n data-seg=${segment.key}\n title=${segment.title}\n @click=${segment.onActivate}\n >\n ${segment.label}\n </button>`;\n}\n\n/** The label the selector segment wears when no nested selector is active. */\nexport const BASE_SELECTOR_LABEL = \"base rule\";\n\nfunction selectorTpl(selector: TargetSelector) {\n const label = selector.value ?? BASE_SELECTOR_LABEL;\n const choose = (value: string | null) => {\n closeSelectorMenu();\n selector.onSelect(value);\n };\n return html`\n <overlay-trigger\n placement=\"bottom-start\"\n triggered-by=\"click\"\n ${ref((el) => {\n _selectorTrigger = (el as SelectorTrigger | undefined) ?? null;\n })}\n >\n <button\n slot=\"trigger\"\n type=\"button\"\n class=\"tl-seg tl-seg--selector\"\n data-seg=\"selector\"\n title=\"The state or nested rule these edits land in — click to choose another\"\n >\n ${label} ⌄\n </button>\n <sp-popover slot=\"click-content\" tip class=\"tl-selector-popover\">\n <sp-menu class=\"tl-selector-menu\">\n <sp-menu-item value=\"__base__\" @click=${() => choose(null)}>\n ${BASE_SELECTOR_LABEL}\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n ${selector.options.map(\n (option) => html`\n <sp-menu-item value=${option} @click=${() => choose(option)}>\n ${selector.declared.has(option) ? `${option} ●` : option}\n </sp-menu-item>\n `,\n )}\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item\n value=\"__add_custom__\"\n @click=${() => {\n closeSelectorMenu();\n selector.onAddCustom();\n }}\n >\n + Add custom…\n </sp-menu-item>\n </sp-menu>\n </sp-popover>\n </overlay-trigger>\n `;\n}\n\nfunction scopeTpl(scope: TargetScope) {\n const classes = classMap({\n \"tl-scope\": true,\n [`tl-scope--${scope.kind}`]: true,\n });\n const title =\n scope.kind === \"element\"\n ? \"These edits apply to the selected element only\"\n : `These edits apply to ${scope.label}`;\n return html`<span class=${classes} data-scope=${scope.kind} title=${title}>${scope.label}</span>`;\n}\n\nfunction warningTpl(scope: TargetScope) {\n if (scope.kind !== \"project\") {\n return nothing;\n }\n const files = scope.affectedFiles ?? [];\n return html`\n <div class=\"tl-warning\" role=\"status\">\n <p class=\"tl-warning-text\">\n Every edit here restyles ${scope.label} — ${scope.affected ?? \"unknown\"}.\n </p>\n ${\n scope.onToggleAffected\n ? html`<button type=\"button\" class=\"tl-warning-action\" @click=${scope.onToggleAffected}>\n ${scope.showAffected ? \"Hide affected\" : \"Show affected\"}\n </button>`\n : nothing\n }\n ${\n scope.showAffected\n ? files.length > 0\n ? html`<ul class=\"tl-affected\">\n ${files.map(\n (file) => html`<li class=\"tl-affected-row\">\n <span class=\"tl-affected-path\">${file.path}</span>\n <span class=\"tl-affected-count\">${file.count}</span>\n </li>`,\n )}\n </ul>`\n : html`<p class=\"tl-affected-empty\">\n No file list — the project could not be searched.\n </p>`\n : nothing\n }\n </div>\n `;\n}\n\n/**\n * Render the Target Line.\n *\n * @param {TargetLineModel} model\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderTargetLine(model: TargetLineModel) {\n return html`\n <div class=\"target-line\" data-jx-region=\"inspector/target\">\n <span class=\"tl-glyph\" aria-hidden=\"true\">⌖</span>\n <div class=\"tl-segments\">\n ${model.segments.map(\n (segment, index) => html`\n ${index > 0 ? html`<span class=\"tl-sep\" aria-hidden=\"true\">·</span>` : nothing}\n ${segmentTpl(segment)}\n `,\n )}\n <span class=\"tl-sep\" aria-hidden=\"true\">·</span>\n ${selectorTpl(model.selector)}\n </div>\n ${scopeTpl(model.scope)}\n </div>\n ${warningTpl(model.scope)}\n `;\n}\n",
8
- "/// <reference lib=\"dom\" />\n/**\n * Style panel — CSS property editor under the **Target Line** (§6.1), with provenance-coded rows\n * (§6.2), a section accordion, shorthand expand/compress, and a property filter.\n *\n * The panel resolves a compound coordinate before it can commit anything: `(selection, breakpoint,\n * scheme layer, nested selector)`. It has always computed that tuple — it is the per-field key and\n * the five-branch if/else below — and it used to hide it behind three disconnected widgets on two\n * different bars. `target-line.ts` renders it as one sentence instead, and the three widgets are\n * gone: the breakpoint and scheme axes are selected on the pane context bar (region ⑦), and the\n * selector is the one axis this tab owns.\n *\n * Every row then says where its value came from. `provenance.ts` supplies the chip;\n * `computeInheritedSources()` supplies the donor breakpoint the cascade walk always knew and this\n * panel used to throw away.\n */\n\nimport { html, nothing } from \"lit-html\";\nimport { getNestedStyle } from \"@jxsuite/schema/guards\";\nimport { live } from \"lit-html/directives/live.js\";\nimport { ifDefined } from \"lit-html/directives/if-defined.js\";\nimport {\n COMMON_SELECTORS,\n debouncedStyleCommit,\n getNodeAtPath,\n isNestedSelector,\n renderOnly,\n updateUi,\n} from \"../store\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { primarySelection, unifyValues } from \"../tabs/selection\";\nimport { shell } from \"../shell\";\nimport { activeRegistry } from \"../commands/active-registry\";\nimport { selectStylebookTag } from \"./stylebook-panel\";\nimport {\n mutateUpdateMediaNestedStyle,\n mutateUpdateMediaNestedStylePath,\n mutateUpdateMediaStyle,\n mutateUpdateNestedStyle,\n mutateUpdateNestedStylePath,\n mutateUpdateStyle,\n transactDoc,\n} from \"../tabs/transact\";\nimport { inferInputType, propLabel } from \"../utils/studio-utils\";\nimport { stringArg } from \"../commands/command-args\";\nimport type { AnyCommand, CommandRegistry } from \"../commands/registry\";\nimport { renderFieldRow } from \"../ui/field-row\";\nimport { showPromptDialog } from \"../ui/layers\";\nimport { renderDynamicSlot } from \"../ui/dynamic-slot\";\nimport { parseMediaEntries, schemeOfQuery } from \"../utils/canvas-media\";\nimport { getEffectiveMedia, getEffectiveStyle } from \"../site-context\";\nimport { computeInheritedSources } from \"../utils/inherited-style\";\nimport { loadUsages, peekUsages, usageFiles } from \"../services/references\";\nimport { mediaDisplayName } from \"./shared\";\nimport { countProvenance, renderProvenanceChip, renderProvenanceDots } from \"./provenance\";\nimport {\n openSelectorMenu,\n renderTargetLine,\n resetSelectorTrigger as resetTargetSelector,\n} from \"./target-line\";\nimport {\n clickAnythingTo,\n openPageAction,\n renderEmptyState,\n staleSelectionMessage,\n} from \"./empty-state\";\nimport {\n allConditionsPass,\n autoOpenSections,\n compressBorderSide,\n compressShorthand,\n cssMeta,\n expandBorderSide,\n expandShorthand,\n getCssInitialMap,\n getLonghands,\n} from \"./style-utils\";\nimport { widgetForType } from \"./style-inputs\";\n\nimport type { FieldProvenance, ProvenanceState } from \"./provenance\";\nimport type { TargetScope, TargetSegment } from \"./target-line\";\nimport type { Tab } from \"../tabs/tab\";\nimport type { JxPath } from \"../state\";\nimport type { JsonValue } from \"../types\";\nimport type { JxMutableNode, JxStyle } from \"@jxsuite/schema/types\";\n\ninterface CssLonghand {\n name: string;\n entry: Record<string, unknown>;\n}\n\ntype CssPropertyEntry = Record<string, unknown>;\n\n/** The chip a row wears when its caller has nothing more specific to say. */\nconst DEFAULT_PROVENANCE: FieldProvenance = { state: \"default\" };\n\ntype StyleMutateFn = (\n t: Tab,\n prop: string,\n val?: string | Record<string, unknown> | undefined,\n) => void;\n\n/**\n * Check if a selector is a stylebook tag path (e.g., \"table\" or \"table th\"). Tag paths don't start\n * with selector prefixes (`:`, `.`, `&`, `[`, `@`).\n *\n * @param {string} selector\n * @returns {boolean}\n */\nfunction isTagPath(selector: string) {\n return /^[a-z]/.test(selector);\n}\n\n/**\n * Resolve a style object by traversing a nested tag path. e.g., \"table th\" → style[\"table\"][\"th\"]\n *\n * @param {JxStyle} style\n * @param {string} tagPath\n * @returns {JxStyle}\n */\nfunction resolveNestedTagStyle(style: JxStyle, tagPath: string): JxStyle {\n let obj: JxStyle | undefined = style;\n for (const part of tagPath.split(\" \")) {\n obj = getNestedStyle(obj, part);\n if (!obj) {\n return {};\n }\n }\n return obj;\n}\n\n/**\n * The style object one compound coordinate addresses.\n *\n * Split out of the panel body because the coordinate has to be resolved TWICE: once against the\n * effective (site-merged) style, which is what the rows display, and once against the document's\n * own, which is what a commit writes. The difference between the two is the \"from site tokens\"\n * donor — invisible for as long as there was only one resolution.\n *\n * @param {JxStyle} style\n * @param {string | null} activeSelector\n * @param {string | null} editMedia\n * @returns {JxStyle}\n */\nfunction resolveContextStyle(\n style: JxStyle,\n activeSelector: string | null,\n editMedia: string | null,\n): JxStyle {\n const base = editMedia ? (getNestedStyle(style, `@${editMedia}`) ?? {}) : style;\n if (activeSelector) {\n return isTagPath(activeSelector)\n ? resolveNestedTagStyle(base, activeSelector)\n : (getNestedStyle(base, activeSelector) ?? {});\n }\n const flat: JxStyle = {};\n for (const [p, v] of Object.entries(base)) {\n if (typeof v !== \"object\") {\n flat[p] = v;\n }\n }\n return flat;\n}\n\n/**\n * The mutation that writes to one compound coordinate — the other half of\n * {@link resolveContextStyle}, and the reason the two now sit side by side: they are one decision\n * expressed twice, and they used to be interleaved in a five-branch `if/else` where a new branch\n * could easily read one coordinate and write another.\n *\n * @param {JxPath} sel\n * @param {string | null} activeSelector\n * @param {string | null} editMedia\n * @returns {StyleMutateFn}\n */\nfunction contextMutate(\n sel: JxPath,\n activeSelector: string | null,\n editMedia: string | null,\n): StyleMutateFn {\n if (activeSelector && isTagPath(activeSelector)) {\n const stylePath = activeSelector.split(\" \");\n return editMedia\n ? (t, prop, val) =>\n mutateUpdateMediaNestedStylePath(\n t,\n sel,\n editMedia,\n stylePath,\n prop,\n val as string | undefined,\n )\n : (t, prop, val) =>\n mutateUpdateNestedStylePath(t, sel, stylePath, prop, val as string | undefined);\n }\n if (activeSelector) {\n return editMedia\n ? (t, prop, val) =>\n mutateUpdateMediaNestedStyle(\n t,\n sel,\n editMedia,\n activeSelector,\n prop,\n val as string | undefined,\n )\n : (t, prop, val) =>\n mutateUpdateNestedStyle(t, sel, activeSelector, prop, val as string | undefined);\n }\n return editMedia\n ? (t, prop, val) => mutateUpdateMediaStyle(t, sel, editMedia, prop, val as string | undefined)\n : (t, prop, val) => mutateUpdateStyle(t, sel, prop, val as string | undefined);\n}\n\n/**\n * Which properties the selected elements disagree about, at the coordinate the tab is editing.\n *\n * Resolved through the SAME `resolveContextStyle` the panel reads its own values with, so \"mixed\"\n * is decided at exactly the breakpoint, scheme layer and selector the Target Line names — two cards\n * that differ only inside `@md` are not mixed while you are editing Base.\n *\n * Returns an empty set for a selection of one, which is the whole reason a single selection renders\n * no Mixed state anywhere: the loop never finds a second value to disagree with.\n *\n * @param {Tab} tab\n * @param {readonly JxPath[]} targets\n * @param {string | null} activeSelector\n * @param {string | null} editMedia\n * @returns {Set<string>}\n */\nfunction mixedStyleProps(\n tab: Tab,\n targets: readonly JxPath[],\n activeSelector: string | null,\n editMedia: string | null,\n): Set<string> {\n const mixed = new Set<string>();\n if (targets.length < 2) {\n return mixed;\n }\n const blocks = targets.map((path) => {\n const node = getNodeAtPath(tab.doc.document, path) as JxMutableNode | undefined;\n return resolveContextStyle(node?.style ?? {}, activeSelector, editMedia);\n });\n const props = new Set<string>();\n for (const block of blocks) {\n for (const prop of Object.keys(block)) {\n props.add(prop);\n }\n }\n for (const prop of props) {\n if (unifyValues(blocks.map((block) => block[prop] ?? null)).mixed) {\n mixed.add(prop);\n }\n }\n return mixed;\n}\n\n// ─── Row renderers ──────────────────────────────────────────────────────────\n\nfunction renderStyleRow(\n entry: CssPropertyEntry,\n prop: string,\n value: string,\n onCommit: (v: string | undefined) => void,\n isWarning: boolean,\n gridMode: boolean,\n inheritedValue: string | undefined,\n templateSignals: string[] = [],\n fieldKey: string = prop,\n provenance?: FieldProvenance,\n) {\n const chip: FieldProvenance = provenance ?? DEFAULT_PROVENANCE;\n const type = inferInputType(entry);\n const hasVal = value !== undefined && value !== \"\";\n const placeholder = !hasVal && inheritedValue ? String(inheritedValue) : \"\";\n const spanVal = gridMode && (entry as Record<string, unknown>).$span === 2 ? 2 : undefined;\n // The rungs come from `StyleObject.additionalProperties`, not from a list here (§6.6 rule 2).\n // That derives literal + ${} template: a CSS value carrying `${…}` IS a signal binding, which\n // `emitStyleString` compiles to a reactive declaration, and `$ref` is not admitted by JxStyle.\n // Naming the POSITION rather than the answer is the point — a schema that later admits another\n // Rung cannot then be contradicted by a hand-written array sitting here.\n const slot = renderDynamicSlot({\n caps: \"styleProperty\",\n fieldKey,\n onChange: (v?: JsonValue) => onCommit(v === undefined || v === \"\" ? undefined : String(v)),\n staticWidget: widgetForType(type, entry, prop, value, onCommit, { placeholder }),\n stateDefs: templateSignals,\n value,\n });\n // `hasValue` is false because the chip supersedes the row's derived set-dot: the dot could only\n // Say set-or-not, and three of the four states this panel can now answer with were previously\n // Indistinguishable from \"unset\".\n return renderFieldRow({\n prop,\n label: propLabel(entry, prop),\n hasValue: false,\n widget: slot.widget,\n provenance: chip,\n labelExtra: slot.modeButton,\n ...(spanVal != null && { span: spanVal }),\n warning: isWarning,\n });\n}\n\n/** What {@link renderShorthandRow} needs to draw one shorthand and its longhand children. */\ninterface ShorthandRowOptions {\n prop: string;\n entry: CssPropertyEntry;\n /** The style block at the edited coordinate — the primary element's, as every row reads it. */\n style: Record<string, unknown>;\n /** The write, already fanned across the selection. Called INSIDE a transaction. */\n mutate: StyleMutateFn;\n inherited: Record<string, string | number>;\n ctx: ProvenanceCtx;\n}\n\n/**\n * A shorthand property row: the header field, plus one row per longhand when it is expanded.\n *\n * Two things were wrong with it, and they were the same thing. It took a single-target mutation\n * while every other row in the tab took the selection-wide one, so \"set padding on six cards in one\n * decision\" — the sentence §6.5 makes, with padding as its example — wrote to one card. And it drew\n * its own `.set-dot` rather than a provenance chip, so a shorthand `mixedStyleProps` had ALREADY\n * flagged as mixed offered a plain \"Clear padding\" affordance instead of saying so.\n *\n * Both are fixed by taking the same two things every other row takes: `mutate`, which fans across\n * the selection, and `ctx`, which answers where a value came from.\n */\nfunction renderShorthandRow({\n prop: shortProp,\n entry,\n style,\n mutate,\n inherited,\n ctx,\n}: ShorthandRowOptions) {\n const tab = activeTab.value!;\n const longhands = getLonghands(shortProp) as CssLonghand[];\n const shortVal = style[shortProp];\n const hasLonghands = longhands.some((l: CssLonghand) => style[l.name] !== undefined);\n const isExpanded = tab.session.ui.styleShorthands[shortProp] ?? hasLonghands;\n const hasAnyVal = shortVal !== undefined || hasLonghands;\n\n /**\n * Drop every longhand, then write the shorthand — the one write order this row has.\n *\n * The longhands go unconditionally rather than \"the ones the panel can see set\", because what the\n * panel can see is the PRIMARY element's style: a second selected element with a `paddingTop` of\n * its own would otherwise keep it and quietly out-rank the shorthand just written over it.\n * Deleting a property an element does not have is a no-op on that element.\n */\n const writeShorthand = (val?: string | undefined) =>\n transactDoc(activeTab.value, (t) => {\n for (const l of longhands) {\n mutate(t, l.name);\n }\n mutate(t, shortProp, val);\n });\n const clearAll = () =>\n transactDoc(activeTab.value, (t) => {\n mutate(t, shortProp);\n for (const l of longhands) {\n mutate(t, l.name);\n }\n });\n\n const headerWidget = html`\n <div class=\"style-shorthand-header\">\n <sp-textfield\n size=\"s\"\n .value=${live(shortVal || \"\")}\n placeholder=${\n !shortVal && hasLonghands\n ? longhands.map((l: CssLonghand) => style[l.name] || \"0\").join(\" \")\n : !shortVal && inherited[shortProp]\n ? inherited[shortProp]\n : !shortVal && longhands.some((l: CssLonghand) => inherited[l.name])\n ? longhands.map((l: CssLonghand) => inherited[l.name] || \"0\").join(\" \")\n : \"\"\n }\n @input=${debouncedStyleCommit(`short:${shortProp}`, 400, (e: Event) => {\n writeShorthand((e.target as HTMLInputElement).value || undefined);\n })}\n ></sp-textfield>\n <sp-action-button\n size=\"xs\"\n quiet\n @click=${(e: Event) => {\n e.stopPropagation();\n activeTab.value!.session.ui.styleShorthands = {\n ...activeTab.value!.session.ui.styleShorthands,\n [shortProp]: !isExpanded,\n };\n }}\n >\n ${\n isExpanded\n ? html`<sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>`\n : html`<sp-icon-chevron-right slot=\"icon\"></sp-icon-chevron-right>`\n }\n </sp-action-button>\n </div>\n `;\n\n return html`\n ${renderFieldRow({\n prop: shortProp,\n label: propLabel(entry, shortProp),\n hasValue: hasAnyVal,\n widget: headerWidget,\n provenance: shorthandProvenance(shortProp, ctx, hasAnyVal ? clearAll : undefined),\n })}\n ${\n isExpanded\n ? (() => {\n const isBorderSide =\n (entry as Record<string, unknown>).$shorthandType === \"border-side\";\n const expanded = shortVal\n ? isBorderSide\n ? expandBorderSide(shortVal as string)\n : expandShorthand(shortVal as string, longhands.length)\n : null;\n const compress = isBorderSide ? compressBorderSide : compressShorthand;\n const emptyVal = isBorderSide ? \"\" : \"0\";\n /** This longhand becomes `val`; the others keep whatever they show. */\n const recompress = (idx: number, val: string) =>\n writeShorthand(\n compress(\n longhands.map((l: CssLonghand, i: number) =>\n i === idx ? val : (style[l.name] ?? (expanded ? expanded[i] : emptyVal)),\n ) as string[],\n ),\n );\n return longhands.map(({ name, entry: lEntry }: CssLonghand, idx: number) => {\n const lVal = style[name] ?? (expanded ? expanded[idx] : \"\");\n const hasLVal = lVal !== undefined && lVal !== \"\";\n return html`\n <div class=\"style-row style-row--child\" data-prop=${name}>\n <div class=\"style-row-label\">\n ${renderProvenanceChip(\n name,\n longhandProvenance(name, shortProp, hasLVal, ctx, () =>\n recompress(idx, emptyVal),\n ),\n )}\n <sp-field-label size=\"s\" title=${name}\n >${propLabel(lEntry, name)}</sp-field-label\n >\n </div>\n ${widgetForType(\n inferInputType(lEntry),\n lEntry,\n name,\n lVal as string,\n (newVal: string) => recompress(idx, newVal || emptyVal),\n {\n placeholder: !lVal && inherited[name] ? String(inherited[name]) : \"\",\n },\n )}\n </div>\n `;\n });\n })()\n : nothing\n }\n `;\n}\n\n// ─── The edit target ─────────────────────────────────────────────────────────\n\n/** Forget the selector menu's element handle — the Inspector unmounted, or a test starts clean. */\nexport function resetSelectorMenu(): void {\n resetTargetSelector();\n}\n\n/**\n * Whether the \"show affected\" list under a project-wide warning band is open.\n *\n * Module-local rather than a `session.ui` field: it is a disclosure on a project-level warning, and\n * a per-document field would make the same warning open in one tab and closed in another.\n */\nlet _showAffected = false;\n\n/** Fold the affected list away — the Inspector unmounted, or a test starts clean. */\nexport function resetAffectedDisclosure(): void {\n _showAffected = false;\n}\n\n/**\n * Ask a registered command to do something this panel does not own.\n *\n * The breakpoint and the colour scheme are DEFINED in Project Settings › Contexts and SELECTED on\n * the pane context bar. A Target Line segment that opened its own list would be the third selector\n * §6.4 forbids, so it routes to the definition site through the same command the context bar's\n * \"Manage contexts…\" footer runs.\n */\nfunction runCommand(id: string, args?: Record<string, unknown>): void {\n void activeRegistry()?.run(id, args);\n}\n\n/**\n * The tag a stylebook rule restyles, when one is being edited.\n *\n * In Stylebook the \"selector\" is a bare tag path (`h1`, `table th`) written into the DOCUMENT's\n * root style, so the first segment of the path is the tag whose blast radius the scope chip\n * states.\n */\nfunction stylebookTagOf(selector: string | null): string | null {\n return selector && isTagPath(selector) ? (selector.split(\" \")[0] ?? null) : null;\n}\n\n/**\n * Whether this document IS the project's stylesheet.\n *\n * `project.json`'s `style` is not a document's style. The compiler hands it to EVERY route's\n * compile as `projectStyle` (`site/site-build.ts`), and `compileStyles` emits its custom properties\n * as `:root`, its flat properties as `body`, and every bare tag key as a global rule — so `{ \"h1\":\n * { \"color\": \"red\" } }` in project.json becomes `h1 { color: red }` in the stylesheet of every\n * page, reaching inside every component instance too (nothing in the compiler or the runtime\n * attaches a shadow root). Studio shows the same cascade: `getEffectiveStyle` merges the object\n * into every open document.\n *\n * That makes the document Stylebook opens by default the widest blast radius in the app — and it is\n * the one `resolveScope` used to label \"in this **document**\", the narrowest.\n *\n * Matched by suffix rather than by equality, the way `studio.ts` and `imports-panel.ts` already\n * address this file: a config reached from a sub-directory is still a config, and it still has no\n * elements of its own for \"in this document\" to be about.\n */\nfunction isProjectStylesheet(path: string): boolean {\n return /(?:^|\\/)project\\.json$/.test(path);\n}\n\n/**\n * How wide an edit here reaches, and — for the project case — how wide, in numbers.\n *\n * Three kinds, in the order a user meets them:\n *\n * - **element** — an element is selected; the rule is scoped to it and to nothing else.\n * - **document** — Stylebook on an ordinary document: every `<tag>` on this page.\n * - **project** — the same keystroke restyles files that are not open. Two documents reach this far:\n * a LAYOUT, whose root style is inherited by every page declaring it, and\n * {@link isProjectStylesheet}, which is inherited by all of them.\n *\n * The project stylesheet reaches it with NO tag as well, which no other document does: deselecting\n * in Stylebook leaves the tab editing project.json's own root style — `:root` and `body` on every\n * route — and there is no element anywhere for \"this element\" to have meant.\n */\nfunction resolveScope(tab: Tab, stylebookTag: string | null): TargetScope {\n const path = tab.documentPath ?? \"\";\n const isProjectStyle = isProjectStylesheet(path);\n if (!stylebookTag) {\n return isProjectStyle\n ? projectScope(\"every page in this project\", null)\n : { kind: \"element\", label: \"this element\" };\n }\n const shared = isProjectStyle || /^\\.?\\/?layouts\\//.test(path);\n const label = `all <${stylebookTag}> in this ${shared ? \"project\" : \"document\"}`;\n return shared ? projectScope(label, stylebookTag) : { kind: \"document\", label };\n}\n\n/**\n * The project-wide warning band: its label, its count, and its disclosure.\n *\n * The count is `findReferences`' tag walk, which counts `tagName` matches across the project. Where\n * the host cannot answer — no `findReferences` route, a failed sweep, or no tag to ask about — the\n * band says **unknown** rather than a confident zero, exactly as `services/references.ts` requires\n * of every rendering.\n *\n * @param {string} label\n * @param {string | null} tagName — null for a root-style edit, which has no tag to count.\n * @returns {TargetScope}\n */\nfunction projectScope(label: string, tagName: string | null): TargetScope {\n if (tagName === null) {\n // No tag, so no query: `:root`/`body` on every route is not a `tagName` sweep, and how many\n // Routes that is, is a question no surface here can answer. A zero would be the same lie the\n // Band exists to stop, in a smaller font — and with no file list, there is nothing to disclose.\n return { affected: \"how many pages that is, is unknown\", kind: \"project\", label };\n }\n const query = { tagName };\n const state = peekUsages(query);\n if (state === null) {\n // First paint for this tag: ask once, and repaint when the answer lands. `loadUsages` joins an\n // In-flight request, so a panel repainting sixty times a second is still one sweep.\n void loadUsages(query).then(() => renderOnly(\"rightPanel\"));\n }\n return {\n kind: \"project\",\n label,\n affected: affectedSentence(state),\n affectedFiles: state?.status === \"ready\" ? usageFiles(state.result) : [],\n showAffected: _showAffected,\n onToggleAffected: () => {\n _showAffected = !_showAffected;\n renderOnly(\"rightPanel\");\n },\n };\n}\n\n/** The affected count, in words — and \"unknown\" wherever the query cannot answer. */\nfunction affectedSentence(state: ReturnType<typeof peekUsages>): string {\n if (state === null || state.status === \"pending\") {\n return \"counting the elements it affects…\";\n }\n if (state.status !== \"ready\") {\n return \"how many elements that is, is unknown\";\n }\n const { files, refsTotal } = state.result;\n if (refsTotal === 0) {\n return \"no element in the project uses it yet\";\n }\n return `${refsTotal} element${refsTotal === 1 ? \"\" : \"s\"} in ${files.length} file${\n files.length === 1 ? \"\" : \"s\"\n }`;\n}\n\n/** The two axes the Style tab states but does not own, plus the element it is pointed at. */\nfunction targetSegments(\n elementLabel: string,\n mediaTab: string | null,\n hasBreakpoints: boolean,\n schemeLayer: string | null,\n): TargetSegment[] {\n const segments: TargetSegment[] = [\n {\n key: \"element\",\n label: elementLabel,\n title: \"What these edits are pointed at — click to find it in the Outline\",\n onActivate: () => runCommand(\"view.setActivity\", { tab: \"layers\" }),\n },\n {\n key: \"media\",\n label: hasBreakpoints && mediaTab ? `@${mediaDisplayName(mediaTab)}` : \"Base\",\n title:\n \"The breakpoint these edits land in. Choose it on the pane's Context control; click to \" +\n \"manage breakpoints.\",\n onActivate: () => runCommand(\"settings.open\", { section: \"contexts\" }),\n },\n ];\n if (schemeLayer) {\n segments.push({\n key: \"scheme\",\n label: `${mediaDisplayName(schemeLayer)} variant`,\n title:\n \"Edits land in this colour-scheme variant. Set the pane's Context control back to Auto \" +\n \"to edit base styles; click to manage schemes.\",\n onActivate: () => runCommand(\"settings.open\", { section: \"contexts\" }),\n });\n }\n return segments;\n}\n\n// ─── Provenance ──────────────────────────────────────────────────────────────\n\n/** An inherited value, its donor's name, and how to go there. */\ninterface InheritedInfo {\n value: string | number;\n donor: string;\n jump?: (() => void) | undefined;\n}\n\n/**\n * The signal a `${…}` style value reads, when it reads one.\n *\n * `state.` is optional because both spellings occur in documents and both mean the same entry — the\n * chip names the signal, not the accessor path it was reached by.\n */\nfunction templateSignalOf(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n return /\\$\\{\\s*(?:state\\.)?([A-Za-z_$][\\w$]*)/.exec(value)?.[1] ?? null;\n}\n\n/** Whether a value is a `${}` template rather than a literal — the `bound` rung for a CSS value. */\nfunction isTemplateValue(value: unknown): boolean {\n return typeof value === \"string\" && value.includes(\"${\");\n}\n\n/** What the Style tab can say about one property's origin. */\ninterface ProvenanceCtx {\n own: JxStyle;\n active: JxStyle;\n inherited: Record<string, InheritedInfo>;\n signals: string[];\n clear: (prop: string) => void;\n /**\n * Properties the selected elements DISAGREE about, and how many elements are selected (§6.5).\n *\n * Empty for a selection of one — which is what keeps every other branch of `provenanceOf`\n * reachable exactly as often as it was before the selection became a set.\n */\n mixed?: { props: Set<string>; count: number } | undefined;\n}\n\n/**\n * Where this property's value came from.\n *\n * Four answers, and three of them were previously indistinguishable from each other: an inherited\n * value arrived as a placeholder identical to the CSS initial value, a site token arrived looking\n * like a local override, and a `${}` binding arrived looking like a literal with braces in it.\n */\nfunction provenanceOf(prop: string, ctx: ProvenanceCtx): FieldProvenance {\n // Mixed is decided FIRST, because it is a fact about the selection rather than about the value:\n // The primary's own value may be perfectly ordinary while five other elements disagree with it,\n // And drawing that as `set` is exactly the lie this state exists to stop.\n if (ctx.mixed?.props.has(prop)) {\n return {\n state: \"mixed\",\n donor: String(ctx.mixed.count),\n onClick: () => ctx.clear(prop),\n };\n }\n const value = ctx.active[prop];\n if (value !== undefined && ctx.own[prop] === undefined) {\n // Present in the effective style but not in the document's own: it came from the site style.\n // No jump: the project style document is not something this tab can open.\n return {\n state: \"inherited\",\n donor: \"site tokens\",\n title: `Inherited from the project's site tokens — ${prop} is not set on this document`,\n };\n }\n if (value !== undefined) {\n if (isTemplateValue(value)) {\n const signal = templateSignalOf(value);\n return {\n state: \"bound\",\n ...(signal ? { donor: signal } : {}),\n ...(signal && ctx.signals.includes(signal)\n ? {\n onClick: () => {\n runCommand(\"view.setActivity\", { tab: \"data\" });\n runCommand(\"data.expandRow\", { name: signal });\n },\n }\n : {}),\n };\n }\n return { state: \"set\", onClick: () => ctx.clear(prop) };\n }\n const inherited = ctx.inherited[prop];\n if (inherited) {\n return {\n state: \"inherited\",\n donor: inherited.donor,\n ...(inherited.jump ? { onClick: inherited.jump } : {}),\n };\n }\n return { state: \"default\" };\n}\n\n/**\n * Where a SHORTHAND row's value came from.\n *\n * A shorthand is less a value than a name for four of them, so every answer it can give is about\n * five properties at once: `padding` is set when `padding` or any of `paddingTop…Left` is, mixed\n * when the selection disagrees about any of the five, and inherited when the cascade supplies one\n * and this document supplies none. Asking only about the shorthand key is what let the row draw a\n * plain \"Clear padding\" dot over a property the panel had already computed as mixed.\n *\n * @param {string} shortProp\n * @param {ProvenanceCtx} ctx\n * @param {(() => void) | undefined} [clearAll] — clears the shorthand AND its longhands, which is\n * the only clear this row has ever meant; omitted where there is nothing to clear.\n * @returns {FieldProvenance}\n */\nfunction shorthandProvenance(\n shortProp: string,\n ctx: ProvenanceCtx,\n clearAll?: (() => void) | undefined,\n): FieldProvenance {\n const props = [shortProp, ...(getLonghands(shortProp) as CssLonghand[]).map((l) => l.name)];\n const { mixed } = ctx;\n if (mixed && props.some((p) => mixed.props.has(p))) {\n return {\n state: \"mixed\",\n donor: String(mixed.count),\n ...(clearAll ? { onClick: clearAll } : {}),\n };\n }\n for (const p of props) {\n const prov = provenanceOf(p, ctx);\n if (prov.state === \"default\") {\n continue;\n }\n return prov.state === \"set\" && clearAll ? { ...prov, onClick: clearAll } : prov;\n }\n return DEFAULT_PROVENANCE;\n}\n\n/**\n * Where a longhand CHILD row's value came from.\n *\n * A longhand can hold a value it was never given: `padding: 1px 2px` fills four child rows, and\n * clearing one of them recompresses the shorthand rather than deleting a key. So a value derived\n * from the shorthand counts as `set` here, and a selection that disagrees about the shorthand\n * disagrees about every child the shorthand fills.\n *\n * @param {string} name\n * @param {string} shortProp\n * @param {boolean} hasValue — set here, or filled in by the shorthand above.\n * @param {ProvenanceCtx} ctx\n * @param {() => void} clearChild\n * @returns {FieldProvenance}\n */\nfunction longhandProvenance(\n name: string,\n shortProp: string,\n hasValue: boolean,\n ctx: ProvenanceCtx,\n clearChild: () => void,\n): FieldProvenance {\n const { mixed } = ctx;\n if (mixed && (mixed.props.has(name) || (hasValue && mixed.props.has(shortProp)))) {\n return { state: \"mixed\", donor: String(mixed.count), onClick: clearChild };\n }\n const prov = provenanceOf(name, ctx);\n if (prov.state === \"set\" || (prov.state === \"default\" && hasValue)) {\n return { state: \"set\", onClick: clearChild };\n }\n return prov;\n}\n\n/**\n * A section's tally, counting a shorthand as set when any of its longhands is.\n *\n * @param {{ prop: string; entry: CssPropertyEntry }[]} entries\n * @param {ProvenanceCtx} ctx\n */\nfunction sectionProvenance(\n entries: { prop: string; entry: CssPropertyEntry }[],\n ctx: ProvenanceCtx,\n): ProvenanceState[] {\n return entries.map(({ prop, entry }) =>\n inferInputType(entry) === \"shorthand\"\n ? shorthandProvenance(prop, ctx).state\n : provenanceOf(prop, ctx).state,\n );\n}\n\n// ─── Main template ──────────────────────────────────────────────────────────\n\n/**\n * @param {JxMutableNode} node\n * @param {string | null} activeMediaTab\n * @param {string | null} activeSelector\n * @param {{ effectiveStyle?: JxStyle; stylebookSelector?: string | null }} [opts] —\n * `effectiveStyle` is the site-merged style Stylebook edits against; `stylebookSelector` is the\n * tag catalogue entry being styled, which is what makes the edit tag-wide rather than\n * element-wide and therefore what the scope chip reports.\n */\nfunction styleSidebarTemplate(\n node: JxMutableNode,\n activeMediaTab: string | null,\n activeSelector: string | null,\n opts: { effectiveStyle?: JxStyle | undefined; stylebookSelector?: string | null } = {},\n) {\n const { effectiveStyle, stylebookSelector = null } = opts;\n const tab = activeTab.value!;\n const sel = primarySelection(tab.session.selection) as JxPath;\n /** The document's OWN style — what a commit writes into. */\n const ownRootStyle: JxStyle = node.style || {};\n const style = effectiveStyle ?? ownRootStyle;\n // Signals seeding the ${} template default when a style value escalates (no $ref in JxStyle).\n const templateSignals = Object.entries(tab.doc.document.state || {})\n .filter(\n ([, d]) =>\n !(d as Record<string, unknown>)?.$handler &&\n (d as Record<string, unknown>)?.$prototype !== \"Function\",\n )\n .map(([defName]) => defName);\n const { sizeBreakpoints } = parseMediaEntries(getEffectiveMedia(tab.doc.document.$media));\n const mediaNames = sizeBreakpoints.map((bp) => bp.name);\n const mediaTab = activeMediaTab || null;\n\n // ── Scheme-layer routing (spec §9.5) ────────────────────────────────────────\n // With the tab-bar scheme control forcing a scheme that has a matching declared scheme query,\n // Base-context edits target that scheme's `@--name` block — no extra sidebar tabs. Breakpoint\n // Tabs stay breakpoint-scoped (scheme × breakpoint compound blocks are unsupported).\n const forcedScheme = tab.session.ui.previewColorScheme;\n const schemeLayer =\n mediaTab === null && (forcedScheme === \"light\" || forcedScheme === \"dark\")\n ? (Object.entries(getEffectiveMedia(tab.doc.document.$media) ?? {}).find(\n ([, q]) => schemeOfQuery(String(q)) === forcedScheme,\n )?.[0] ?? null)\n : null;\n // The media context edits actually target: a valid breakpoint tab, else the scheme layer.\n const editMedia = mediaTab && mediaNames.length > 0 ? mediaTab : schemeLayer;\n\n // ── The selector axis — the one this tab owns ──────────────────────────────\n const contextStyle = editMedia\n ? (style[`@${editMedia}`] as Record<string, unknown>) || {}\n : style;\n const declaredSelectors = new Set(Object.keys(contextStyle).filter((s) => isNestedSelector(s)));\n const selectorOptions = [\n ...new Set([\n ...COMMON_SELECTORS,\n ...declaredSelectors,\n ...(activeSelector ? [activeSelector] : []),\n ]),\n ];\n\n // ── The Target Line (§6.1) ─────────────────────────────────────────────────\n // The three widgets this replaces are gone: the breakpoint `<sp-tabs>` strip, the\n // `.selector-select` picker and the `.style-scheme-badge`. The first two named axes the pane\n // Context bar already selects; the third emitted a class with no CSS rule anywhere in the repo.\n const stylebookTag = stylebookTagOf(stylebookSelector);\n const elementLabel =\n stylebookTag ?? (typeof node.tagName === \"string\" ? node.tagName : \"element\");\n const targetLineT = renderTargetLine({\n segments: targetSegments(elementLabel, mediaTab, mediaNames.length > 0, schemeLayer),\n selector: {\n value: activeSelector,\n options: selectorOptions,\n declared: declaredSelectors,\n onSelect: (value) => {\n activeTab.value!.session.ui.activeSelector = value;\n },\n onAddCustom: () => {\n // One flow, through `ui/layers.ts` — the imperative `<input>` this replaces was appended to\n // A bar lit-html owns, bypassing both the renderer and the overlay stack (§11.4).\n void showPromptDialog(\"Add Selector\", {\n confirmLabel: \"Use\",\n message: \"A state or nested rule to edit under this element.\",\n placeholder: \":hover, .child, &.active, [attr]\",\n validate: (v) =>\n isNestedSelector(v.trim()) ? \"\" : 'A selector must start with \":\", \".\", \"&\" or \"[\".',\n }).then((value) => {\n if (value) {\n activeTab.value!.session.ui.activeSelector = value.trim();\n renderOnly(\"rightPanel\");\n }\n });\n },\n },\n scope: resolveScope(tab, stylebookTag),\n });\n\n // ── Filter bar ─────────────────────────────────────────────────────────────\n // One control. The \"Active\" toggle is gone: it existed only because provenance was invisible\n // With a section closed, and a heading that says \"3 set here · 2 inherited\" answers the same\n // Question without hiding two thirds of the panel to do it (§6.2).\n const filterBarT = html`\n <div class=\"style-filter-bar\">\n <sp-textfield\n size=\"s\"\n class=\"style-filter-input\"\n placeholder=\"Filter properties…\"\n .value=${live(tab.session.ui.styleFilter || \"\")}\n @input=${(e: Event) => {\n activeTab.value!.session.ui.styleFilter = (e.target as HTMLInputElement).value;\n }}\n ></sp-textfield>\n </div>\n `;\n\n // ── Determine the active style object ──────────────────────────────────────\n const activeStyle = resolveContextStyle(style, activeSelector, editMedia);\n // The SAME coordinate, resolved against the document's own style. In Stylebook `style` is the\n // Site-merged effective style, so a property present here and absent there arrived from the\n // Project's tokens — a donor the panel can now name instead of drawing it as a local override\n // Whose \"clear\" would silently do nothing.\n const ownStyle =\n style === ownRootStyle\n ? activeStyle\n : resolveContextStyle(ownRootStyle, activeSelector, editMedia);\n // ── The selection, and what it means to commit to it (§6.5) ────────────────\n // Every selected element gets the same write, inside ONE `transactDoc` — so setting padding on\n // Six cards is one decision and one undo step. With one element selected this loop runs once\n // Against `sel` and is indistinguishable from the single-target commit it replaces.\n const targets = tab.session.selection.length > 0 ? tab.session.selection : [sel];\n /**\n * ONE write, applied to every selected element — the only write function this tab has.\n *\n * It takes the caller's transaction rather than opening its own, because a row that writes twice\n * (a shorthand and the longhands it supersedes; a renamed custom property and its old key) must\n * still be one undo step. There is no single-target counterpart: every row that had one wrote to\n * the primary element and silently dropped the rest of the selection on the floor.\n */\n const mutateTargets: StyleMutateFn = (t, prop, val) => {\n for (const target of targets) {\n contextMutate(target, activeSelector, editMedia)(t, prop, val);\n }\n };\n const commitStyle = (prop: string, val?: string | Record<string, unknown> | undefined) =>\n transactDoc(activeTab.value, (t) => mutateTargets(t, prop, val));\n /** One target's OWN block at this coordinate — what a write that preserves values reads first. */\n const targetStyleOf = (t: Tab, target: JxPath): JxStyle => {\n const targetNode = getNodeAtPath(t.doc.document, target) as JxMutableNode | undefined;\n return resolveContextStyle(targetNode?.style ?? {}, activeSelector, editMedia);\n };\n\n // ── Compute inherited style, and NAME THE DONOR ────────────────────────────\n // Scheme layer: the base styles show through as inherited; breakpoint tabs inherit from lower\n // Breakpoints as before. Either way the donor is known at this point and is now kept: it is the\n // Difference between \"some value is showing through\" and \"Base sets this to 16px, go and look\".\n const inheritedInfo: Record<string, InheritedInfo> = {};\n if (schemeLayer) {\n const baseBlock = activeSelector ? (getNestedStyle(style, activeSelector) ?? {}) : style;\n for (const [p, v] of Object.entries(baseBlock)) {\n if (typeof v !== \"object\") {\n inheritedInfo[p] = {\n value: (v as string | number) ?? \"\",\n donor: \"Base\",\n jump: () => updateUi(activeTab.value, \"previewColorScheme\", \"auto\"),\n };\n }\n }\n } else {\n for (const [p, source] of Object.entries(\n computeInheritedSources(style, mediaNames, mediaTab, activeSelector),\n )) {\n inheritedInfo[p] = {\n value: source.value,\n donor: source.donor === null ? \"Base\" : mediaDisplayName(source.donor),\n jump: () => updateUi(activeTab.value, \"activeMedia\", source.donor),\n };\n }\n }\n const inheritedStyle: Record<string, string | number> = {};\n for (const [p, info] of Object.entries(inheritedInfo)) {\n inheritedStyle[p] = info.value;\n }\n const mixedProps = mixedStyleProps(tab, targets, activeSelector, editMedia);\n const provCtx: ProvenanceCtx = {\n own: ownStyle,\n active: activeStyle,\n inherited: inheritedInfo,\n signals: templateSignals,\n clear: (prop: string) => commitStyle(prop),\n ...(mixedProps.size > 0 ? { mixed: { count: targets.length, props: mixedProps } } : {}),\n };\n\n // Auto-open sections that have properties\n const newSections = autoOpenSections({ style: activeStyle }, tab.session.ui.styleSections);\n if (JSON.stringify(newSections) !== JSON.stringify(tab.session.ui.styleSections)) {\n tab.session.ui.styleSections = newSections;\n }\n\n // Partition properties into sections\n const sectionProps: Record<string, { prop: string; entry: CssPropertyEntry }[]> = {};\n for (const sec of cssMeta.$sections) {\n sectionProps[sec.key] = [];\n }\n\n for (const [prop, entry] of Object.entries(cssMeta.$defs) as [string, CssPropertyEntry][]) {\n if (typeof (entry as Record<string, unknown>).$shorthand === \"string\") {\n continue;\n }\n const sec = ((entry as Record<string, unknown>).$section as string) || \"other\";\n sectionProps[sec]!.push({ entry, prop });\n }\n for (const sec of cssMeta.$sections) {\n sectionProps[sec.key]!.sort(\n (\n a: { prop: string; entry: CssPropertyEntry },\n b: { prop: string; entry: CssPropertyEntry },\n ) =>\n ((a.entry as Record<string, unknown>).$order as number) -\n ((b.entry as Record<string, unknown>).$order as number),\n );\n }\n\n const otherProps = [];\n for (const prop of Object.keys(activeStyle)) {\n if (!(cssMeta.$defs as Record<string, unknown>)[prop]) {\n const val = activeStyle[prop];\n if (val !== null && typeof val === \"object\") {\n continue;\n }\n otherProps.push(prop);\n }\n }\n\n const nestedRules: string[] = [];\n for (const [prop, val] of Object.entries(activeStyle)) {\n if (val !== null && typeof val === \"object\" && !Array.isArray(val) && !prop.startsWith(\"@\")) {\n nestedRules.push(prop);\n }\n }\n\n // ── Filter state ─────────────────────────────────────────────────────────\n const filterText = (tab.session.ui.styleFilter || \"\").toLowerCase();\n const isFiltering = filterText.length > 0;\n\n // ── Section templates ────────────────────────────────────────────────────\n const sectionTemplates = cssMeta.$sections\n .filter((sec) => sec.key !== \"other\")\n .map((sec) => {\n const entries = sectionProps[sec.key]!;\n\n const sectionActiveProps = entries.filter(\n ({ prop, entry }: { prop: string; entry: CssPropertyEntry }) => {\n if (activeStyle[prop] !== undefined) {\n return true;\n }\n if (inferInputType(entry) === \"shorthand\") {\n return (getLonghands(prop) as CssLonghand[]).some(\n (l: CssLonghand) => activeStyle[l.name] !== undefined,\n );\n }\n return false;\n },\n );\n\n const clearSection = () => {\n transactDoc(activeTab.value, (t) => {\n for (const { prop, entry } of sectionActiveProps) {\n if (activeStyle[prop] !== undefined) {\n mutateTargets(t, prop);\n }\n if (inferInputType(entry) === \"shorthand\") {\n for (const l of getLonghands(prop) as CssLonghand[]) {\n mutateTargets(t, l.name);\n }\n }\n }\n });\n };\n\n // The heading's own answer to \"is anything in here set, inherited or bound\" — the question\n // The retired \"Active\" toggle answered by hiding everything that was not.\n const counts = countProvenance(sectionProvenance(entries, provCtx));\n const headingT = html`\n <span slot=\"heading\" class=\"style-section-heading\">\n ${sec.label}\n ${renderProvenanceDots(counts, {\n onClearSet: sectionActiveProps.length > 0 ? clearSection : undefined,\n clearTitle: `Clear all ${sec.label.toLowerCase()} properties`,\n })}\n </span>\n `;\n\n const isOpen = isFiltering ? true : (tab.session.ui.styleSections[sec.key] ?? false);\n\n if (!isOpen) {\n return html`\n <sp-accordion-item\n label=${sec.label}\n .open=${false}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n [sec.key]: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n ${headingT}\n </sp-accordion-item>\n `;\n }\n\n const rows = [];\n for (const { prop, entry } of entries) {\n const val = activeStyle[prop];\n const hasVal = val !== undefined;\n const condMet = allConditionsPass(entry, activeStyle);\n const type = inferInputType(entry);\n if (!hasVal && !condMet) {\n continue;\n }\n\n if (filterText) {\n const label = propLabel(entry, prop).toLowerCase();\n if (!prop.includes(filterText) && !label.includes(filterText)) {\n continue;\n }\n }\n\n if (type === \"shorthand\") {\n const longhands = getLonghands(prop) as CssLonghand[];\n const hasAny =\n hasVal || longhands.some((l: CssLonghand) => activeStyle[l.name] !== undefined);\n if (!hasAny && !condMet) {\n continue;\n }\n rows.push(\n renderShorthandRow({\n prop,\n entry,\n style: activeStyle,\n mutate: mutateTargets,\n inherited: inheritedStyle,\n ctx: provCtx,\n }),\n );\n } else {\n const isWarning = hasVal && !condMet;\n if (hasVal || condMet) {\n rows.push(\n renderStyleRow(\n entry,\n prop,\n (val as string) ?? \"\",\n (newVal: string | undefined) => commitStyle(prop, newVal || undefined),\n isWarning,\n sec.$layout === \"grid\",\n inheritedStyle[prop] as string | undefined,\n templateSignals,\n `style|${sel.join(\"/\")}|${editMedia ?? \"\"}|${activeSelector ?? \"\"}|${prop}`,\n provenanceOf(prop, provCtx),\n ),\n );\n }\n }\n }\n\n if (isFiltering && rows.length === 0) {\n return nothing;\n }\n\n return html`\n <sp-accordion-item\n label=${sec.label}\n .open=${isOpen}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n [sec.key]: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n ${headingT}\n <div class=${sec.$layout === \"grid\" ? \"style-section-body--grid\" : \"\"}>${rows}</div>\n </sp-accordion-item>\n `;\n });\n\n // ── Custom section ─────────────────────────────────────────────────────────\n const cssInitialMap = getCssInitialMap();\n const customIsOpen = tab.session.ui.styleSections.other ?? otherProps.length > 0;\n const customSectionT = html`\n <sp-accordion-item\n label=\"Custom\"\n .open=${customIsOpen}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n other: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n <div>\n ${otherProps.map(\n (prop) => html`\n <div class=\"kv-row\">\n <sp-textfield\n size=\"s\"\n class=\"kv-key\"\n .value=${live(prop)}\n @change=${(e: Event) => {\n const newProp = (e.target as HTMLInputElement).value.trim();\n if (!newProp || newProp === prop) {\n return;\n }\n // A rename is the one write that cannot be fanned out with a single value: each\n // Element keeps ITS OWN value under the new key. The old code batched half of the\n // Rename (the delete) against the primary and the other half against the primary\n // Too, while the value cell beside it wrote to the whole selection — so renaming\n // A property the selection shared moved it on one element and left it on the\n // Rest.\n transactDoc(activeTab.value, (t) => {\n for (const target of targets) {\n const current = targetStyleOf(t, target)[prop];\n if (current === undefined) {\n continue;\n }\n const write = contextMutate(target, activeSelector, editMedia);\n write(t, prop);\n write(t, newProp, String(current));\n }\n });\n }}\n ></sp-textfield>\n <sp-textfield\n size=\"s\"\n class=\"kv-val\"\n .value=${live(String(activeStyle[prop]))}\n placeholder=${ifDefined(cssInitialMap.get(prop))}\n @input=${debouncedStyleCommit(`custom:${prop}`, 400, (e: Event) => {\n commitStyle(prop, (e.target as HTMLInputElement).value);\n })}\n ></sp-textfield>\n <sp-action-button size=\"xs\" quiet @click=${() => commitStyle(prop)}>\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-action-button>\n </div>\n `,\n )}\n <div style=\"display:flex;gap:4px;padding-top:4px\">\n <sp-textfield\n size=\"s\"\n placeholder=\"Property name…\"\n style=\"flex:1\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n const prop = (e.target as HTMLInputElement).value.trim();\n if (prop) {\n const initial = cssInitialMap.get(prop) || \"\";\n commitStyle(prop, initial || \"\");\n (e.target as HTMLInputElement).value = \"\";\n }\n }\n }}\n ></sp-textfield>\n </div>\n </div>\n </sp-accordion-item>\n `;\n\n // ── Relative Styling section (nested rules) ───────────────────────────────\n const nestedIsOpen = tab.session.ui.styleSections.nested ?? nestedRules.length > 0;\n const nestedSectionT =\n nestedRules.length > 0\n ? html`\n <sp-accordion-item\n label=\"Relative Styling\"\n .open=${nestedIsOpen}\n @sp-accordion-item-toggle=${(e: Event) => {\n activeTab.value!.session.ui.styleSections = {\n ...activeTab.value!.session.ui.styleSections,\n nested: (e.target as HTMLElement & { open: boolean }).open,\n };\n }}\n >\n <div style=\"display:flex;flex-direction:column;gap:4px;padding:4px 0\">\n ${nestedRules.map(\n (rule) => html`\n <div style=\"display:flex;align-items:center;gap:4px\">\n <button\n style=\"flex:1;text-align:left;padding:6px 10px;background:var(--spectrum-gray-200, #1a1a1a);border:none;border-radius:var(--radius);color:var(--spectrum-gray-900, #fafafa);font-size:var(--spectrum-font-size-75, 12px);cursor:pointer\"\n @click=${() => {\n const newSelector = activeSelector ? `${activeSelector} ${rule}` : rule;\n selectStylebookTag(newSelector, undefined, {\n panCanvas: true,\n });\n }}\n >\n ${rule}\n </button>\n <sp-action-button size=\"xs\" quiet @click=${() => commitStyle(rule)}>\n <sp-icon-delete slot=\"icon\"></sp-icon-delete>\n </sp-action-button>\n </div>\n `,\n )}\n <button\n style=\"padding:6px 10px;background:none;border:1px dashed var(--spectrum-gray-400, #333);border-radius:var(--radius);color:var(--spectrum-gray-700, #a1a1aa);font-size:var(--spectrum-font-size-75, 12px);cursor:pointer\"\n @click=${async () => {\n const name = await showPromptDialog(\"Add Nested Selector\", {\n confirmLabel: \"Add\",\n message: \"Enter a selector to nest under the current rule.\",\n placeholder: \"th, :hover, .active\",\n validate: (v) => (v.trim() ? \"\" : \"Enter a selector.\"),\n });\n if (name) {\n commitStyle(name, {});\n }\n }}\n >\n + Add\n </button>\n </div>\n </sp-accordion-item>\n `\n : nothing;\n\n return html`\n <div class=\"style-sidebar\">\n ${targetLineT} ${filterBarT}\n <sp-accordion allow-multiple size=\"s\">\n ${sectionTemplates} ${nestedSectionT} ${customSectionT}\n </sp-accordion>\n </div>\n `;\n}\n\n// ─── Entry point ────────────────────────────────────────────────────────────\n\n/**\n * Top-level Style panel — returns a lit-html template.\n *\n * @param {{ getCanvasMode: () => string }} ctx\n * @returns {import(\"lit-html\").TemplateResult}\n */\nexport function renderStylePanelTemplate(ctx: { getCanvasMode: () => string }) {\n const tab = activeTab.value;\n const noDocument = () =>\n renderEmptyState({\n actions: [openPageAction()],\n message: \"Open a page to style what you click.\",\n });\n if (!tab) {\n return noDocument();\n }\n if (ctx.getCanvasMode() === \"stylebook\" && shell.stylebook.selection) {\n const node = tab.doc.document;\n if (!node) {\n return noDocument();\n }\n // No separate `Styling: <h1>` header. It said the same thing the Target Line's scope chip says,\n // Except that it said it as a caption, after the fact, and without the blast radius (§6.1).\n return styleSidebarTemplate(node, tab.session.ui.activeMedia, tab.session.ui.activeSelector, {\n effectiveStyle: getEffectiveStyle(node.style),\n stylebookSelector: shell.stylebook.selection,\n });\n }\n const selected = primarySelection(tab.session.selection);\n if (!selected) {\n return renderEmptyState({ message: clickAnythingTo(\"style it\") });\n }\n const node = getNodeAtPath(tab.doc.document, selected);\n if (!node) {\n return renderEmptyState({ message: staleSelectionMessage() });\n }\n return styleSidebarTemplate(node, tab.session.ui.activeMedia, tab.session.ui.activeSelector);\n}\n\n// ─── Commands ─────────────────────────────────────────────────────────────────\n\n/**\n * The Style tab's selector verbs.\n *\n * `style.openSelectorMenu` is the one command here that addresses a CONTROL rather than a state,\n * and it earns that on purpose: the shot it serves photographs the open menu, so the menu is the\n * subject. What it does not do is hand a CSS selector back to the runner for a synthetic mouse\n * press — the element comes from the Target Line's own `ref`, so a refactor of that markup moves\n * the handle with it. The menu it opens is now a segment of the Target Line rather than a picker on\n * a retired toolbar; the id, and therefore the shot, is unchanged.\n *\n * `style.setSelector` is the state half of the same idea, and it is what a caller that wants a\n * RESULT rather than a picture should use: the menu exists to choose a selector, and choosing one\n * is expressible.\n *\n * @returns {AnyCommand[]}\n */\nexport function styleCommands(): AnyCommand[] {\n const styleTabOpen = (ctx: { document: { open: boolean }; selection: { count: number } }) =>\n ctx.document.open && ctx.selection.count > 0;\n\n return [\n {\n category: \"View\",\n id: \"style.openSelectorMenu\",\n level: \"selection\",\n menus: [\"palette\"],\n group: \"8_style\",\n requires: \"the Style tab showing a selected element\",\n when: styleTabOpen,\n run: () => openSelectorMenu(),\n title: \"Open Selector Menu\",\n },\n {\n args: {\n additionalProperties: false,\n properties: {\n selector: pathlessSelectorProperty(),\n },\n required: [\"selector\"],\n type: \"object\",\n },\n category: \"View\",\n id: \"style.setSelector\",\n level: \"selection\",\n menus: [\"palette\"],\n group: \"8_style\",\n requires: \"an element selection\",\n when: styleTabOpen,\n run: (_commandCtx, args) => {\n const { selector } = args as { selector?: unknown };\n if (selector === null) {\n const tab = activeTab.value;\n if (tab) {\n tab.session.ui.activeSelector = null;\n }\n return;\n }\n const value = stringArg(\"style.setSelector\", args, \"selector\");\n if (!isNestedSelector(value)) {\n throw new RangeError(\n `command \"style.setSelector\" argument \"selector\": \"${value}\" is not a nested ` +\n `selector — it must start with \":\", \".\", \"&\" or \"[\"`,\n );\n }\n const tab = activeTab.value;\n if (!tab) {\n throw new RangeError(`command \"style.setSelector\" needs an open document`);\n }\n tab.session.ui.activeSelector = value;\n },\n title: \"Set Style Selector\",\n },\n ];\n}\n\n/** The `selector` property's schema: a nested selector, or `null` for the base context. */\nfunction pathlessSelectorProperty(): object {\n return {\n description:\n 'A nested selector such as \":hover\", \".child\" or \"[open]\". null edits the base context.',\n oneOf: [{ type: \"string\" }, { type: \"null\" }],\n };\n}\n\n/**\n * Register the Style tab's selector verbs.\n *\n * @param {CommandRegistry} registry\n */\nexport function registerStyleCommands(registry: CommandRegistry): void {\n registry.registerAll(styleCommands());\n}\n",
9
- "/// <reference lib=\"dom\" />\n/**\n * Right panel — the Inspector dock: four tabs, one dock, one column.\n *\n * **Content · Style · Logic · Assistant**, text-labelled. Three of those are renames of what was\n * here (Properties→Content, Events→Logic) and the fourth is the assistant, folded in from the fifth\n * grid column it used to own — which is the point of plan §3.2 ⑨: an inspector tab costs zero\n * additional width, so the canvas gets the ~300px back and the assistant is still one key away.\n *\n * Two things changed shape to make that work:\n *\n * - **The tabs are words, not icons.** Three icon-only tabs with `title` attributes meant three hover\n * probes to learn a dock you look at all day, and the icons were `sp-icon-properties` /\n * `sp-icon-event` / `sp-icon-brush` — a form, a lightning bolt and a paintbrush, none of which\n * says \"this is where the link target lives\".\n * - **The containers are permanent.** The no-document state used to drop and rebuild them; it now\n * renders INTO the three document tabs, because the Assistant's DOM (composer draft, scroll\n * position, streaming part cache) must survive a document closing — the assistant works with no\n * project at all, which is exactly the New Project hand-off's requirement.\n *\n * Every tab renders under a header naming its target (§3.2 ⑨), the same treatment wave A gave the\n * Navigator panels. The Target Line proper — provenance-coded, cascade-aware — is §6 and P5; this\n * is its honest predecessor: the tab's name, and what it is pointed at.\n *\n * The heavy sub-templates (properties, style) remain in their own modules and are passed the ctx\n * they need.\n */\n\nimport { html, render as litRender } from \"lit-html\";\nimport { getNodeAtPath, nodeLabel, rightPanel } from \"../store\";\nimport { effect, effectScope, reactive } from \"../reactivity\";\nimport { createPanelScheduler } from \"./panel-scheduler\";\nimport type { PanelScheduler } from \"./panel-scheduler\";\nimport { activeTab } from \"../workspace/workspace\";\nimport { primarySelection } from \"../tabs/selection\";\nimport { openPageAction, renderEmptyState } from \"./empty-state\";\nimport { renderLogicPanelTemplate } from \"./events-panel\";\nimport { isCustomElementDoc } from \"./signals-panel\";\n\nimport { DEFAULT_INSPECTOR_TAB, isInspectorTabId, shell } from \"../shell\";\nimport { INSPECTOR_TABS } from \"../commands/defaults\";\nimport { inspectorTabRegion, REGION_ATTR } from \"../ui/regions\";\nimport { isColorPopoverOpen } from \"../ui/color-selector\";\nimport { renderStylePanelTemplate } from \"./style-panel\";\nimport { renderPropertiesPanelTemplate } from \"./properties-panel\";\n\nimport type { InspectorTabId } from \"../shell\";\nimport type { TemplateResult } from \"lit-html\";\nimport type { EffectScope } from \"@vue/reactivity\";\n\ninterface RightPanelCtx {\n navigateToComponent: (path: string) => void;\n getCanvasMode: () => string;\n renderCanvas: () => void;\n /**\n * Hand the Assistant tab's body to whoever owns the assistant, once.\n *\n * Injected rather than imported so the dependency runs one way: `chat-panel.ts` reaches back into\n * this module to SELECT its tab, and a matching import here would be a cycle between the host and\n * its tenant. `studio.ts` already composes both, so it is the natural place to join them.\n */\n mountAssistant: (host: HTMLElement) => void;\n}\n\nlet _ctx: RightPanelCtx | null = null;\n\nlet _scope: EffectScope | null = null;\n\nlet _scheduler: PanelScheduler | null = null;\n\n/**\n * The selected tab while NO document is open.\n *\n * `session.ui.rightTab` is per-document — the tab you were on comes back with the file — and with\n * no file there is nowhere per-document to put it. The Assistant is usable in exactly that state\n * (the New Project flow hands it a brief before any document exists), so the selection falls back\n * here rather than being refused.\n *\n * Reactive, because it is read by surfaces outside this module: the Command Bar's assistant toggle\n * reports whether the assistant is showing, and a plain field would leave that button lying on the\n * welcome screen — which is the whole class of bug `shell.ts` was split out to end.\n */\nconst _detached = reactive({ tab: DEFAULT_INSPECTOR_TAB as InspectorTabId });\n\n/**\n * Mount the right panel.\n *\n * @param {RightPanelCtx} ctx\n */\nexport function mount(ctx: RightPanelCtx) {\n _ctx = ctx;\n _scheduler = createPanelScheduler({\n blockWhile: isColorPopoverOpen,\n render: _doRender,\n root: rightPanel,\n });\n _scheduler.bindFocus();\n _scope = effectScope();\n _scope.run(() => {\n effect(() => {\n const tab = activeTab.value;\n // Layout chrome is not IN the document, so nothing per-tab changes when the canvas reports a\n // `layoutHit` — and the panel that answers it (the Content tab's Layout Element card) spent a\n // Release cycle repainting only because the canvas host happened to call `renderOnly` too.\n // Reading it here makes the dock's dependency on it real.\n void shell.layoutSelection;\n // No tab is a state the inspector renders (its no-document empty state), not one it skips.\n if (tab) {\n // Track properties the right panel reads\n void tab.doc.document;\n // The whole SET, joined — a bare property read would not re-trigger when the selection\n // Changes WITHIN the array, and §6.5's helpers always replace it but nothing enforces that.\n void tab.session.selection.map((path) => path.join(\"/\")).join(\"|\");\n void tab.session.ui.rightTab;\n void tab.session.ui.activeMedia;\n void tab.session.ui.activeSelector;\n void tab.session.ui.styleSections;\n void tab.session.ui.styleShorthands;\n void tab.session.ui.styleFilter;\n void tab.session.ui.inspectorSections;\n }\n render();\n });\n });\n}\n\nexport function unmount() {\n _scope?.stop();\n _scope = null;\n _ctx = null;\n _scheduler?.unbind();\n _scheduler = null;\n _containers = null;\n _detached.tab = DEFAULT_INSPECTOR_TAB;\n}\n\n/**\n * Request a render. Coalesced and deferred while a text input in the panel is focused or a color\n * popover is open (so explicit callers can never clobber a field mid-edit).\n */\nexport function render() {\n _scheduler?.schedule();\n}\n\n/**\n * The tab showing right now — the stored value, coerced to a declared one.\n *\n * Coercion rather than trust because the value is persisted session state: a build that spelled a\n * tab differently, or an automation step that guessed, must land on Content rather than on a blank\n * dock with no tab selected.\n */\nexport function inspectorTab(): InspectorTabId {\n const tab = activeTab.value;\n if (!tab) {\n return _detached.tab;\n }\n const stored: unknown = tab.session.ui.rightTab;\n return isInspectorTabId(stored) ? stored : DEFAULT_INSPECTOR_TAB;\n}\n\n/**\n * Select a tab. The ONE writer — the strip, `view.setRightTab`, `view.setAssistant` and the\n * assistant's own pending-prompt hand-off all come through here.\n */\nexport function setInspectorTab(tab: InspectorTabId): void {\n const aTab = activeTab.value;\n if (aTab) {\n aTab.session.ui.rightTab = tab;\n } else {\n _detached.tab = tab;\n }\n render();\n}\n\n/** Tab value → its body container, built once and reused across renders. */\nlet _containers: Map<InspectorTabId, HTMLElement> | null = null;\n\nfunction _ensureContainers(ctx: RightPanelCtx): Map<InspectorTabId, HTMLElement> {\n if (_containers) {\n return _containers;\n }\n _containers = new Map(\n INSPECTOR_TABS.map((t) => {\n const el = document.createElement(\"div\");\n el.className = \"panel-body\";\n el.setAttribute(REGION_ATTR, inspectorTabRegion(t.id));\n return [t.id as InspectorTabId, el] as const;\n }),\n );\n // The assistant owns its container for the life of the window: it is bound as lit's render host\n // For a streaming rAF loop, and rebuilding it would drop the transcript and the composer draft.\n ctx.mountAssistant(_containers.get(\"assistant\")!);\n return _containers;\n}\n\n/**\n * What the selected tab is pointed AT, in the fewest words that are true.\n *\n * A tag name when a node is selected, the document's own name when nothing is, and \"no document\"\n * when there is nothing open. The dock spent its whole life unable to answer this — three icon tabs\n * and no statement of target anywhere — which is how \"why is this field disabled\" became a question\n * with no on-screen answer.\n */\nfunction inspectorTarget(): string {\n const tab = activeTab.value;\n if (!tab) {\n return \"no document\";\n }\n // Layout chrome first: it is mutually exclusive with a document selection, and it is the one\n // Target whose name has to say where it came FROM — \"<header> in layouts/base.json\" is the whole\n // Answer to \"why can I not edit this\".\n const layout = shell.layoutSelection;\n if (layout) {\n return `<${layout.tagName || \"element\"}> in ${layout.layoutFile || \"the layout\"}`;\n }\n const paths = tab.session.selection;\n const selection = primarySelection(paths);\n if (selection) {\n // The inspector's title names the batch when there is one — it edits all of them, and titling\n // It after the primary alone is how a Mixed field ends up looking like a plain value.\n return paths.length > 1\n ? `${paths.length} elements`\n : nodeLabel(getNodeAtPath(tab.doc.document, selection));\n }\n const path = tab.documentPath;\n return path ? (path.split(\"/\").at(-1) ?? \"document\") : \"document\";\n}\n\n/** The dock's header: which tab you are in, and what it is pointed at. */\nfunction headerTpl(tab: InspectorTabId): TemplateResult {\n const title = INSPECTOR_TABS.find((t) => t.id === tab)?.title ?? tab;\n return html`\n <header class=\"panel-header\">\n <span class=\"panel-header-title\">${title}</span>\n <span class=\"panel-header-level\">${inspectorTarget()}</span>\n </header>\n `;\n}\n\n/** The four-tab strip. Text labels: a dock you read all day should not need to be hovered. */\nfunction tabsTpl(tab: InspectorTabId): TemplateResult {\n return html`\n <div class=\"panel-tabs inspector-tabs\">\n <sp-tabs\n selected=${tab}\n quiet\n size=\"s\"\n @change=${(e: Event & { target: { selected: string } }) => {\n const sel = e.target.selected;\n if (sel && sel !== tab && isInspectorTabId(sel)) {\n setInspectorTab(sel);\n }\n }}\n >\n ${INSPECTOR_TABS.map((t) => html`<sp-tab value=${t.id} label=${t.title}></sp-tab>`)}\n </sp-tabs>\n </div>\n `;\n}\n\n/** The inspector's no-document state, rendered into a document tab's own body. */\nfunction noDocumentTpl(): TemplateResult {\n return renderEmptyState({\n actions: [openPageAction()],\n message: \"Open a page to inspect and style what you click.\",\n });\n}\n\nfunction _doRender() {\n if (!_ctx) {\n return;\n }\n try {\n const ctx = _ctx as RightPanelCtx;\n const aTab = activeTab.value;\n const tab = inspectorTab();\n\n litRender(html`${headerTpl(tab)}${tabsTpl(tab)}`, rightPanel);\n\n const containers = _ensureContainers(ctx);\n // Show/hide containers, and attach any that a fresh build has not mounted yet.\n for (const [key, el] of containers) {\n el.style.display = key === tab ? \"\" : \"none\";\n if (!el.parentNode) {\n rightPanel.append(el);\n }\n }\n\n const body = containers.get(tab)!;\n // The assistant paints itself through its own rAF loop into this very container (streaming has\n // To repaint while the composer is focused), so the host must not render over it.\n if (tab === \"assistant\") {\n return;\n }\n if (!aTab) {\n litRender(noDocumentTpl(), body);\n return;\n }\n if (tab === \"properties\") {\n litRender(\n renderPropertiesPanelTemplate({\n navigateToComponent: ctx.navigateToComponent,\n }),\n body,\n );\n } else if (tab === \"events\") {\n litRender(\n renderLogicPanelTemplate({\n isCustomElementDoc: () =>\n isCustomElementDoc({\n document: aTab.doc.document,\n mode: aTab.doc.mode,\n selection: aTab.session.selection,\n ui: aTab.session.ui,\n }),\n }),\n body,\n );\n } else {\n try {\n litRender(renderStylePanelTemplate({ getCanvasMode: ctx.getCanvasMode }), body);\n } catch (error) {\n console.error(\"[renderStylePanelTemplate]\", error);\n }\n }\n } catch (error) {\n console.error(\"right-panel render error:\", error);\n }\n}\n"
10
- ],
11
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGA,SAAS,gBAAgB,CAAC,UAAiE;AAAA,EACzF,MAAM,OAAO,IAAI;AAAA,EACjB,MAAM,MAA0C,CAAC;AAAA,EACjD,WAAW,QAAQ,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG;AAAA,IAChD,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG;AAAA,MACnB,KAAK,IAAI,IAAI;AAAA,MACb,IAAI,KAAK,EAAE,OAAO,MAAM,OAAO,KAAK,CAAC;AAAA,IACvC;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAWT,IAAM,gBAA4B,gBAAgB,cAAc;AAGhE,SAAS,kBAAkB,CAAC,MAAgB,cAA8C;AAAA,EACxF,IAAI,SAAS,YAAY;AAAA,IACvB,OAAO,EAAE,YAAY,YAAY,MAAM,IAAI,YAA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AA;AAAA;AAAA,IAGrD,OAAO,OAAO;AAAA,IACd,QAAQ,MAAM,6BAA6B,KAAK;AAAA;AAAA;",
12
- "debugId": "EE6BCDBC241C370964756E2164756E21",
13
- "names": []
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../node_modules/lit-html/development/directive-helpers.js", "../../../node_modules/lit-html/development/directive.js", "../../../node_modules/lit-html/development/async-directive.js", "../../../node_modules/lit-html/development/directives/ref.js", "../../../node_modules/lit-html/development/directives/repeat.js"],
4
- "sourcesContent": [
5
- "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { _$LH, } from './lit-html.js';\nconst { _ChildPart: ChildPart } = _$LH;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst wrap = ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM.wrap\n : (node) => node;\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value) => value === null || (typeof value != 'object' && typeof value != 'function');\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n};\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult = (value, type) => type === undefined\n ? // This property needs to remain unminified.\n value?.['_$litType$'] !== undefined\n : value?.['_$litType$'] === type;\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (value) => {\n return value?.['_$litType$']?.h != null;\n};\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value) => \n// This property needs to remain unminified.\nvalue?.['_$litDirective$'] !== undefined;\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value) => \n// This property needs to remain unminified.\nvalue?.['_$litDirective$'];\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part) => part.strings === undefined;\nconst createMarker = () => document.createComment('');\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (containerPart, refPart, part) => {\n const container = wrap(containerPart._$startNode).parentNode;\n const refNode = refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(startNode, endNode, containerPart, containerPart.options);\n }\n else {\n const endNode = wrap(part._$endNode).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent._$isConnected) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start = part._$startNode;\n while (start !== endNode) {\n const n = wrap(start).nextSibling;\n wrap(container).insertBefore(start, refNode);\n start = n;\n }\n }\n }\n return part;\n};\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = (part, value, directiveParent = part) => {\n part._$setValue(value, directiveParent);\n return part;\n};\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part, value = RESET_VALUE) => (part._$committedValue = value);\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part) => part._$committedValue;\n/**\n * Removes a ChildPart from the DOM, including any of its content and markers.\n *\n * Note: The only difference between this and clearPart() is that this also\n * removes the part's start node. This means that the ChildPart must own its\n * start node, ie it must be a marker node specifically for this part and not an\n * anchor from surrounding content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part) => {\n part._$clear();\n part._$startNode.remove();\n};\nexport const clearPart = (part) => {\n part._$clear();\n};\n//# sourceMappingURL=directive-helpers.js.map",
6
- "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n};\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive = (c) => (...values) => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n});\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport class Directive {\n constructor(_partInfo) { }\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n /** @internal */\n _$initialize(part, parent, attributeIndex) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part, props) {\n return this.update(part, props);\n }\n update(_part, props) {\n return this.render(...props);\n }\n}\n//# sourceMappingURL=directive.js.map",
7
- "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { isSingleExpression } from './directive-helpers.js';\nimport { Directive, PartType } from './directive.js';\nexport * from './directive.js';\nconst DEV_MODE = true;\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (parent, isConnected) => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n obj['_$notifyDirectiveConnectionChanged']?.(isConnected, false);\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\nconst addDisconnectableToParent = (obj) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n }\n else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(newParent) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n }\n else {\n this._$parent = newParent;\n }\n}\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(isConnected, isClearingValue = false, fromPartIndex = 0) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n }\n else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value, false);\n removeDisconnectableFromParent(value);\n }\n }\n else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj) => {\n if (obj.type == PartType.CHILD) {\n obj._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n obj._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport class AsyncDirective extends Directive {\n constructor() {\n super(...arguments);\n // @internal\n this._$disconnectableChildren = undefined;\n }\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n _$initialize(part, parent, attributeIndex) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n ['_$notifyDirectiveConnectionChanged'](isConnected, isClearingDirective = true) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n }\n else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value) {\n if (isSingleExpression(this.__part)) {\n this.__part._$setValue(value, this);\n }\n else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...this.__part._$committedValue];\n newValues[this.__attributeIndex] = value;\n this.__part._$setValue(newValues, this, 0);\n }\n }\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n disconnected() { }\n reconnected() { }\n}\n//# sourceMappingURL=async-directive.js.map",
8
- "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { nothing } from '../lit-html.js';\nimport { directive, AsyncDirective } from '../async-directive.js';\n/**\n * Creates a new Ref object, which is container for a reference to an element.\n */\nexport const createRef = () => new Ref();\n/**\n * An object that holds a ref value.\n */\nclass Ref {\n}\n// When callbacks are used for refs, this map tracks the last value the callback\n// was called with, for ensuring a directive doesn't clear the ref if the ref\n// has already been rendered to a new spot. It is double-keyed on both the\n// context (`options.host`) and the callback, since we auto-bind class methods\n// to `options.host`.\nconst lastElementForContextAndCallback = new WeakMap();\nclass RefDirective extends AsyncDirective {\n render(_ref) {\n return nothing;\n }\n update(part, [ref]) {\n const refChanged = ref !== this._ref;\n if (refChanged) {\n // The ref passed to the directive has changed;\n // unset the previous ref's value\n this._updateRefValue(undefined);\n }\n if (refChanged || this._lastElementForRef !== this._element) {\n // We either got a new ref or this is the first render;\n // store the ref/element & update the ref value\n this._ref = ref;\n this._context = part.options?.host;\n this._updateRefValue((this._element = part.element));\n }\n return nothing;\n }\n _updateRefValue(element) {\n if (this._ref === undefined) {\n return;\n }\n if (!this.isConnected) {\n element = undefined;\n }\n if (typeof this._ref === 'function') {\n // If the current ref was called with a previous value, call with\n // `undefined`; We do this to ensure callbacks are called in a consistent\n // way regardless of whether a ref might be moving up in the tree (in\n // which case it would otherwise be called with the new value before the\n // previous one unsets it) and down in the tree (where it would be unset\n // before being set). Note that element lookup is keyed by\n // both the context and the callback, since we allow passing unbound\n // functions that are called on options.host, and we want to treat\n // these as unique \"instances\" of a function.\n const context = this._context ?? globalThis;\n let lastElementForCallback = lastElementForContextAndCallback.get(context);\n if (lastElementForCallback === undefined) {\n lastElementForCallback = new WeakMap();\n lastElementForContextAndCallback.set(context, lastElementForCallback);\n }\n if (lastElementForCallback.get(this._ref) !== undefined) {\n this._ref.call(this._context, undefined);\n }\n lastElementForCallback.set(this._ref, element);\n // Call the ref with the new element value\n if (element !== undefined) {\n this._ref.call(this._context, element);\n }\n }\n else {\n this._ref.value = element;\n }\n }\n get _lastElementForRef() {\n return typeof this._ref === 'function'\n ? lastElementForContextAndCallback\n .get(this._context ?? globalThis)\n ?.get(this._ref)\n : this._ref?.value;\n }\n disconnected() {\n // Only clear the box if our element is still the one in it (i.e. another\n // directive instance hasn't rendered its element to it before us); that\n // only happens in the event of the directive being cleared (not via manual\n // disconnection)\n if (this._lastElementForRef === this._element) {\n this._updateRefValue(undefined);\n }\n }\n reconnected() {\n // If we were manually disconnected, we can safely put our element back in\n // the box, since no rendering could have occurred to change its state\n this._updateRefValue(this._element);\n }\n}\n/**\n * Sets the value of a Ref object or calls a ref callback with the element it's\n * bound to.\n *\n * A Ref object acts as a container for a reference to an element. A ref\n * callback is a function that takes an element as its only argument.\n *\n * The ref directive sets the value of the Ref object or calls the ref callback\n * during rendering, if the referenced element changed.\n *\n * Note: If a ref callback is rendered to a different element position or is\n * removed in a subsequent render, it will first be called with `undefined`,\n * followed by another call with the new element it was rendered to (if any).\n *\n * ```js\n * // Using Ref object\n * const inputRef = createRef();\n * render(html`<input ${ref(inputRef)}>`, container);\n * inputRef.value.focus();\n *\n * // Using callback\n * const callback = (inputElement) => inputElement.focus();\n * render(html`<input ${ref(callback)}>`, container);\n * ```\n */\nexport const ref = directive(RefDirective);\n//# sourceMappingURL=ref.js.map",
9
- "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { noChange } from '../lit-html.js';\nimport { directive, Directive, PartType } from '../directive.js';\nimport { insertPart, getCommittedValue, removePart, setCommittedValue, setChildPartValue, } from '../directive-helpers.js';\n// Helper for generating a map of array item to its index over a subset\n// of an array (used to lazily generate `newKeyToIndexMap` and\n// `oldKeyToIndexMap`)\nconst generateMap = (list, start, end) => {\n const map = new Map();\n for (let i = start; i <= end; i++) {\n map.set(list[i], i);\n }\n return map;\n};\nclass RepeatDirective extends Directive {\n constructor(partInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('repeat() can only be used in text expressions');\n }\n }\n _getValuesAndKeys(items, keyFnOrTemplate, template) {\n let keyFn;\n if (template === undefined) {\n template = keyFnOrTemplate;\n }\n else if (keyFnOrTemplate !== undefined) {\n keyFn = keyFnOrTemplate;\n }\n const keys = [];\n const values = [];\n let index = 0;\n for (const item of items) {\n keys[index] = keyFn ? keyFn(item, index) : index;\n values[index] = template(item, index);\n index++;\n }\n return {\n values,\n keys,\n };\n }\n render(items, keyFnOrTemplate, template) {\n return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;\n }\n update(containerPart, [items, keyFnOrTemplate, template]) {\n // Old part & key lists are retrieved from the last update (which may\n // be primed by hydration)\n const oldParts = getCommittedValue(containerPart);\n const { values: newValues, keys: newKeys } = this._getValuesAndKeys(items, keyFnOrTemplate, template);\n // We check that oldParts, the committed value, is an Array as an\n // indicator that the previous value came from a repeat() call. If\n // oldParts is not an Array then this is the first render and we return\n // an array for lit-html's array handling to render, and remember the\n // keys.\n if (!Array.isArray(oldParts)) {\n this._itemKeys = newKeys;\n return newValues;\n }\n // In SSR hydration it's possible for oldParts to be an array but for us\n // to not have item keys because the update() hasn't run yet. We set the\n // keys to an empty array. This will cause all oldKey/newKey comparisons\n // to fail and execution to fall to the last nested brach below which\n // reuses the oldPart.\n const oldKeys = (this._itemKeys ??= []);\n // New part list will be built up as we go (either reused from\n // old parts or created for new keys in this update). This is\n // saved in the above cache at the end of the update.\n const newParts = [];\n // Maps from key to index for current and previous update; these\n // are generated lazily only when needed as a performance\n // optimization, since they are only required for multiple\n // non-contiguous changes in the list, which are less common.\n let newKeyToIndexMap;\n let oldKeyToIndexMap;\n // Head and tail pointers to old parts and new values\n let oldHead = 0;\n let oldTail = oldParts.length - 1;\n let newHead = 0;\n let newTail = newValues.length - 1;\n // Overview of O(n) reconciliation algorithm (general approach\n // based on ideas found in ivi, vue, snabbdom, etc.):\n //\n // * We start with the list of old parts and new values (and\n // arrays of their respective keys), head/tail pointers into\n // each, and we build up the new list of parts by updating\n // (and when needed, moving) old parts or creating new ones.\n // The initial scenario might look like this (for brevity of\n // the diagrams, the numbers in the array reflect keys\n // associated with the old parts or new values, although keys\n // and parts/values are actually stored in parallel arrays\n // indexed using the same head/tail pointers):\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [ , , , , , , ]\n // newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new\n // item order\n // newHead ^ ^ newTail\n //\n // * Iterate old & new lists from both sides, updating,\n // swapping, or removing parts at the head/tail locations\n // until neither head nor tail can move.\n //\n // * Example below: keys at head pointers match, so update old\n // part 0 in-place (no need to move it) and record part 0 in\n // the `newParts` list. The last thing we do is advance the\n // `oldHead` and `newHead` pointers (will be reflected in the\n // next diagram).\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , ] <- heads matched: update 0\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: head pointers don't match, but tail\n // pointers do, so update part 6 in place (no need to move\n // it), and record part 6 in the `newParts` list. Last,\n // advance the `oldTail` and `oldHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- tails matched: update 6\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldTail\n // & newTail\n // newHead ^ ^ newTail\n //\n // * If neither head nor tail match; next check if one of the\n // old head/tail items was removed. We first need to generate\n // the reverse map of new keys to index (`newKeyToIndexMap`),\n // which is done once lazily as a performance optimization,\n // since we only hit this case if multiple non-contiguous\n // changes were made. Note that for contiguous removal\n // anywhere in the list, the head and tails would advance\n // from either end and pass each other before we get to this\n // case and removals would be handled in the final while loop\n // without needing to generate the map.\n //\n // * Example below: The key at `oldTail` was removed (no longer\n // in the `newKeyToIndexMap`), so remove that part from the\n // DOM and advance just the `oldTail` pointer.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- 5 not in new map: remove\n // newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail\n // newHead ^ ^ newTail\n //\n // * Once head and tail cannot move, any mismatches are due to\n // either new or moved items; if a new key is in the previous\n // \"old key to old index\" map, move the old part to the new\n // location, otherwise create and insert a new part. Note\n // that when moving an old part we null its position in the\n // oldParts array if it lies between the head and tail so we\n // know to skip it when the pointers get there.\n //\n // * Example below: neither head nor tail match, and neither\n // were removed; so find the `newHead` key in the\n // `oldKeyToIndexMap`, and move that old part's DOM into the\n // next head position (before `oldParts[oldHead]`). Last,\n // null the part in the `oldPart` array since it was\n // somewhere in the remaining oldParts still to be scanned\n // (between the head and tail pointers) so that we know to\n // skip that old part on future iterations.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, , , , , 6] <- stuck: update & move 2\n // newKeys: [0, 2, 1, 4, 3, 7, 6] into place and advance\n // newHead\n // newHead ^ ^ newTail\n //\n // * Note that for moves/insertions like the one above, a part\n // inserted at the head pointer is inserted before the\n // current `oldParts[oldHead]`, and a part inserted at the\n // tail pointer is inserted before `newParts[newTail+1]`. The\n // seeming asymmetry lies in the fact that new parts are\n // moved into place outside in, so to the right of the head\n // pointer are old parts, and to the right of the tail\n // pointer are new parts.\n //\n // * We always restart back from the top of the algorithm,\n // allowing matching and simple updates in place to\n // continue...\n //\n // * Example below: the head pointers once again match, so\n // simply update part 1 and record it in the `newParts`\n // array. Last, advance both head pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, , , , 6] <- heads matched: update 1\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * As mentioned above, items that were moved as a result of\n // being stuck (the final else clause in the code below) are\n // marked with null, so we always advance old pointers over\n // these so we're comparing the next actual old value on\n // either end.\n //\n // * Example below: `oldHead` is null (already placed in\n // newParts), so advance `oldHead`.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6] <- old head already used:\n // newParts: [0, 2, 1, , , , 6] advance oldHead\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ ^ newTail\n //\n // * Note it's not critical to mark old parts as null when they\n // are moved from head to tail or tail to head, since they\n // will be outside the pointer range and never visited again.\n //\n // * Example below: Here the old tail key matches the new head\n // key, so the part at the `oldTail` position and move its\n // DOM to the new head position (before `oldParts[oldHead]`).\n // Last, advance `oldTail` and `newHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, , , 6] <- old tail matches new\n // newKeys: [0, 2, 1, 4, 3, 7, 6] head: update & move 4,\n // advance oldTail & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: Old and new head keys match, so update the\n // old head part in place, and advance the `oldHead` and\n // `newHead` pointers.\n //\n // oldHead v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance oldHead &\n // newHead\n // newHead ^ ^ newTail\n //\n // * Once the new or old pointers move past each other then all\n // we have left is additions (if old list exhausted) or\n // removals (if new list exhausted). Those are handled in the\n // final while loops at the end.\n //\n // * Example below: `oldHead` exceeded `oldTail`, so we're done\n // with the main loop. Create the remaining part and insert\n // it at the new head position, and the update is complete.\n //\n // (oldHead > oldTail)\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ newTail\n //\n // * Note that the order of the if/else clauses is not\n // important to the algorithm, as long as the null checks\n // come first (to ensure we're always working on valid old\n // parts) and that the final else clause comes last (since\n // that's where the expensive moves occur). The order of\n // remaining clauses is just a simple guess at which cases\n // will be most common.\n //\n // * Note, we could calculate the longest\n // increasing subsequence (LIS) of old items in new position,\n // and only move those not in the LIS set. However that costs\n // O(nlogn) time and adds a bit more code, and only helps\n // make rare types of mutations require fewer moves. The\n // above handles removes, adds, reversal, swaps, and single\n // moves of contiguous items in linear time, in the minimum\n // number of moves. As the number of multiple moves where LIS\n // might help approaches a random shuffle, the LIS\n // optimization becomes less helpful, so it seems not worth\n // the code at this point. Could reconsider if a compelling\n // case arises.\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldParts[oldHead] === null) {\n // `null` means old part at head has already been used\n // below; skip\n oldHead++;\n }\n else if (oldParts[oldTail] === null) {\n // `null` means old part at tail has already been used\n // below; skip\n oldTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newHead]) {\n // Old head matches new head; update in place\n newParts[newHead] = setChildPartValue(oldParts[oldHead], newValues[newHead]);\n oldHead++;\n newHead++;\n }\n else if (oldKeys[oldTail] === newKeys[newTail]) {\n // Old tail matches new tail; update in place\n newParts[newTail] = setChildPartValue(oldParts[oldTail], newValues[newTail]);\n oldTail--;\n newTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newTail]) {\n // Old head matches new tail; update and move to new tail\n newParts[newTail] = setChildPartValue(oldParts[oldHead], newValues[newTail]);\n insertPart(containerPart, newParts[newTail + 1], oldParts[oldHead]);\n oldHead++;\n newTail--;\n }\n else if (oldKeys[oldTail] === newKeys[newHead]) {\n // Old tail matches new head; update and move to new head\n newParts[newHead] = setChildPartValue(oldParts[oldTail], newValues[newHead]);\n insertPart(containerPart, oldParts[oldHead], oldParts[oldTail]);\n oldTail--;\n newHead++;\n }\n else {\n if (newKeyToIndexMap === undefined) {\n // Lazily generate key-to-index maps, used for removals &\n // moves below\n newKeyToIndexMap = generateMap(newKeys, newHead, newTail);\n oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);\n }\n if (!newKeyToIndexMap.has(oldKeys[oldHead])) {\n // Old head is no longer in new list; remove\n removePart(oldParts[oldHead]);\n oldHead++;\n }\n else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {\n // Old tail is no longer in new list; remove\n removePart(oldParts[oldTail]);\n oldTail--;\n }\n else {\n // Any mismatches at this point are due to additions or\n // moves; see if we have an old part we can reuse and move\n // into place\n const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);\n const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;\n if (oldPart === null) {\n // No old part for this value; create a new one and\n // insert it\n const newPart = insertPart(containerPart, oldParts[oldHead]);\n setChildPartValue(newPart, newValues[newHead]);\n newParts[newHead] = newPart;\n }\n else {\n // Reuse old part\n newParts[newHead] = setChildPartValue(oldPart, newValues[newHead]);\n insertPart(containerPart, oldParts[oldHead], oldPart);\n // This marks the old part as having been used, so that\n // it will be skipped in the first two checks above\n oldParts[oldIndex] = null;\n }\n newHead++;\n }\n }\n }\n // Add parts for any remaining new values\n while (newHead <= newTail) {\n // For all remaining additions, we insert before last new\n // tail, since old pointers are no longer valid\n const newPart = insertPart(containerPart, newParts[newTail + 1]);\n setChildPartValue(newPart, newValues[newHead]);\n newParts[newHead++] = newPart;\n }\n // Remove any remaining unused old parts\n while (oldHead <= oldTail) {\n const oldPart = oldParts[oldHead++];\n if (oldPart !== null) {\n removePart(oldPart);\n }\n }\n // Save order of new parts for next round\n this._itemKeys = newKeys;\n // Directly set part value, bypassing it's dirty-checking\n setCommittedValue(containerPart, newParts);\n return noChange;\n }\n}\n/**\n * A directive that repeats a series of values (usually `TemplateResults`)\n * generated from an iterable, and updates those items efficiently when the\n * iterable changes based on user-provided `keys` associated with each item.\n *\n * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,\n * meaning previous DOM for a given key is moved into the new position if\n * needed, and DOM will never be reused with values for different keys (new DOM\n * will always be created for new keys). This is generally the most efficient\n * way to use `repeat` since it performs minimum unnecessary work for insertions\n * and removals.\n *\n * The `keyFn` takes two parameters, the item and its index, and returns a unique key value.\n *\n * ```js\n * html`\n * <ol>\n * ${repeat(this.items, (item) => item.id, (item, index) => {\n * return html`<li>${index}: ${item.name}</li>`;\n * })}\n * </ol>\n * `\n * ```\n *\n * **Important**: If providing a `keyFn`, keys *must* be unique for all items in a\n * given call to `repeat`. The behavior when two or more items have the same key\n * is undefined.\n *\n * If no `keyFn` is provided, this directive will perform similar to mapping\n * items to values, and DOM will be reused against potentially different items.\n */\nexport const repeat = directive(RepeatDirective);\n//# sourceMappingURL=repeat.js.map"
10
- ],
11
- "mappings": ";;;;;;;AAMA,MAAQ,YAAY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