@gramlot/gramlot 0.3.7 → 0.3.9

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 (71) hide show
  1. package/dist/components/editors.js +116527 -0
  2. package/dist/components/inputs.js +24507 -0
  3. package/dist/components/layout.js +1402 -0
  4. package/dist/components/tree.js +24538 -0
  5. package/dist/components/typst.js +4 -0
  6. package/dist/gramlot.js +1442 -625
  7. package/dist/gramlot.min.js +27 -405
  8. package/dist/runtime-notices.json +208 -0
  9. package/dist/typst-worker-source.js +4 -0
  10. package/package.json +36 -3
  11. package/src/binding/hooks.js +14 -0
  12. package/src/binding/providers.js +4 -0
  13. package/src/binding/remote-resolver.js +52 -0
  14. package/src/binding/remote.js +2 -0
  15. package/src/binding/router.js +11 -4
  16. package/src/binding/rpc-resolver.js +14 -93
  17. package/src/binding/runtime.js +10 -4
  18. package/src/components/bases.js +1 -0
  19. package/src/components/border-container.js +46 -23
  20. package/src/components/buttons.js +3 -0
  21. package/src/components/choice-editor.js +17 -3
  22. package/src/components/choices.js +3 -2
  23. package/src/components/code-mirror-engine.js +91 -0
  24. package/src/components/code-mirror.js +88 -0
  25. package/src/components/editor-options.d.ts +9 -0
  26. package/src/components/editor-options.js +21 -0
  27. package/src/components/editors.js +10 -0
  28. package/src/components/html-document.js +56 -0
  29. package/src/components/html-editor.js +68 -0
  30. package/src/components/html-preview.js +33 -0
  31. package/src/components/inputs.js +2 -2
  32. package/src/components/jodit-engine.js +89 -0
  33. package/src/components/markdown-codec.js +35 -0
  34. package/src/components/markdown-document.js +14 -0
  35. package/src/components/markdown-editor.js +68 -0
  36. package/src/components/prose-mirror-engine.js +65 -0
  37. package/src/components/registry.js +6 -4
  38. package/src/components/tree.js +350 -0
  39. package/src/components/typst-client.js +38 -0
  40. package/src/components/typst-preview.js +88 -0
  41. package/src/components/typst-worker.js +49 -0
  42. package/src/components/typst.js +4 -0
  43. package/src/filesystem.d.ts +22 -0
  44. package/src/filesystem.js +122 -0
  45. package/src/ide-documents.js +153 -0
  46. package/src/ide-runtime.d.ts +18 -0
  47. package/src/ide-runtime.js +238 -0
  48. package/src/index-page-runtime.d.ts +7 -8
  49. package/src/index-page-runtime.js +100 -396
  50. package/src/index.d.ts +7 -1
  51. package/src/index.js +5 -1
  52. package/src/navigation-resolver.d.ts +6 -0
  53. package/src/navigation-resolver.js +60 -0
  54. package/src/renderer/attributes.js +2 -1
  55. package/src/renderer/drag-drop-policy.js +48 -0
  56. package/src/renderer/drag-drop.js +213 -0
  57. package/src/renderer/drag-preparation.js +33 -0
  58. package/src/renderer/gramlot-renderer.d.ts +18 -0
  59. package/src/renderer/gramlot-renderer.js +41 -2
  60. package/src/server/frame-page.d.ts +12 -0
  61. package/src/server/frame-page.js +23 -0
  62. package/src/server/gramlot-server.js +2 -1
  63. package/src/server/index-page.d.ts +10 -14
  64. package/src/server/index-page.js +26 -95
  65. package/src/server/page.d.ts +7 -0
  66. package/src/server/page.js +5 -0
  67. package/src/view/button.js +2 -1
  68. package/src/view/controls.js +7 -11
  69. package/src/view/events.js +4 -8
  70. package/src/view/html.js +6 -1
  71. package/tools/gramlot-tools-inspector.js +16 -9
@@ -3,6 +3,7 @@
3
3
  * target selection; this binding owns execution, ask, delay and disposal.
4
4
  */
5
5
 
6
+ import {invokeHook} from '../binding/hooks.js';
6
7
 
7
8
  export class ButtonBinding {
8
9
  #binding;
@@ -150,7 +151,7 @@ export class ButtonBinding {
150
151
  if (this.binding.closed || this.element.disabled || result === null) return;
151
152
  const values = {...read(), ...result};
152
153
  if (result) values._askResult = result;
153
- this.binding.runtime.inlineCompiler.compile(node, 'action', node.getAttr('action'), Object.keys(values))(values);
154
+ invokeHook(this.binding.runtime, node, 'action', node.getAttr('action'), values);
154
155
  };
155
156
  const ask = node.getAttr('ask');
156
157
  const askDialog = this.binding.runtime.askDialog;
@@ -8,6 +8,7 @@
8
8
  import {createDecimal, isDecimal, getDecimalLibrary} from '@genrojs/tytx';
9
9
  import {Bag} from '@genrojs/bag';
10
10
  import {XHTML_NS} from '../renderer/attributes.js';
11
+ import {callLogic, invokeHook} from '../binding/hooks.js';
11
12
 
12
13
  // The elements whose `type`, `multiple` and `group` have no setter: a change rebuilds (C04.1, D7).
13
14
  const CONTROL_TAGS = new Set(['input', 'select', 'textarea']);
@@ -214,8 +215,8 @@ class ComponentControl extends ControlAdapter {
214
215
  }
215
216
  get writeEvent() {
216
217
  if (this.element.commitOnChange) return 'change';
217
- const control = this.element.control;
218
- return this.live && (control.localName === 'textarea' || ['text', 'password', 'range', 'color'].includes(control.type)) ? 'input' : 'change';
218
+ const live = this.resolved.live ?? this.element.parameters.live;
219
+ return live && this.element.liveWrites ? 'input' : 'change';
219
220
  }
220
221
  read() { return this.element.readControlValue(); }
221
222
  write(value) { this.element.writeControlValue(value); }
@@ -569,20 +570,15 @@ const INPUT_CONTROLS = {
569
570
  function componentContext(adapter) {
570
571
  const {binding, node} = adapter, app = binding.runtime.gramlot;
571
572
  const invoke = (attribute, code, keywords, expression = false) => {
572
- if (!expression && /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(code)) {
573
- const {group, method} = app.src.logicRegistry.resolve(code, node);
574
- return method.call(group, node, keywords);
575
- }
573
+ if (!expression) return invokeHook(binding.runtime, node, attribute, code, keywords);
576
574
  return binding.runtime.inlineCompiler.compile(node, attribute, code, Object.keys(keywords),
577
- expression ? `return (${code});` : code)(keywords);
575
+ `return (${code});`)(keywords);
578
576
  };
579
577
  return {
580
578
  locale:app.locale, timeZone:app.timeZone, createDecimal, isDecimal, getDecimalLibrary,
579
+ publish:(topic, payload) => node.publish(topic, payload),
581
580
  isActive:() => !binding.closed,
582
- callLogic:(name, keywords) => {
583
- const {group, method} = app.src.logicRegistry.resolve(name, node);
584
- return method.call(group, node, keywords);
585
- },
581
+ callLogic:(name, keywords) => callLogic(binding.runtime, node, name, keywords),
586
582
  format:(value, options) => app.format(value, options), invoke,
587
583
  remote:(method, keywords, signal) => app.rpc.call('data', method, keywords, {signal}),
588
584
  validationCurrent:() => {
@@ -1,15 +1,15 @@
1
+ import {isLogicMethod, callLogic} from '../binding/hooks.js';
1
2
  /**
2
3
  * `connect_on<event>` (source plan §2 Button, §4.11, S12): one DOM listener per attribute, bound to the
3
4
  * element of the node that declares it. The DOM event is the name after `connect_on`, lower-cased
4
- * (`connect_onclick` → `click`, `connect_onBlur` → `blur`). A value of dotted identifiers
5
- * (`group.method`) is named logic, resolved by LogicRegistry at every event (a missing name raises,
5
+ * (`connect_onclick` → `click`, `connect_onBlur` → `blur`). A simple or qualified identifier
6
+ * (`method` or `group.method`) is named logic, resolved by LogicRegistry at every event (a missing name raises,
6
7
  * no fallback to inline, S09); any other value is inline code with `this` = the node and the
7
8
  * parameter `event`. The handler runs with the declaring node, also when the event hits a
8
9
  * descendant (R11). A closed NodeBinding does nothing (R12); an error propagates from the listener.
9
10
  */
10
11
 
11
12
  const PREFIX = 'connect_on';
12
- const NAMED_LOGIC = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
13
13
 
14
14
  export class NativeEventBinding {
15
15
  #binding;
@@ -54,11 +54,7 @@ export class NativeEventBinding {
54
54
  if (this.binding.closed) return;
55
55
  const node = this.node;
56
56
  const runtime = this.binding.runtime;
57
- if (NAMED_LOGIC.test(this.handler)) {
58
- const {group, method} = runtime.logicRegistry.resolve(this.handler, node);
59
- method.call(group, node, event);
60
- return;
61
- }
57
+ if (isLogicMethod(this.handler)) return callLogic(runtime, node, this.handler, event);
62
58
  runtime.inlineCompiler.compile(node, this.attribute, this.handler, ['event'])({event});
63
59
  }
64
60
  }
package/src/view/html.js CHANGED
@@ -36,8 +36,9 @@ function domPropertyName(name) {
36
36
  * names and style arrive adapted by the renderers (GramlotHtmlRenderer, GramlotSvgRenderer).
37
37
  */
38
38
  export class HtmlElement {
39
- constructor({metadataAttributes = [], invokeScript = null} = {}) {
39
+ constructor({metadataAttributes = [], invokeScript = null, callLogic = null} = {}) {
40
40
  this.invokeScript = invokeScript;
41
+ this.callLogic = callLogic;
41
42
  this.metadataAttributes = new Set([...META_ATTRS, '_text', ...metadataAttributes]);
42
43
  }
43
44
 
@@ -95,6 +96,7 @@ export class HtmlElement {
95
96
  element.setSourceContext({
96
97
  publish: (topic, payload) => node.publish(topic, payload),
97
98
  writeParameter: (name, value) => this.writeParameter(node, name, value),
99
+ callLogic: (name, keywords) => this.callLogic(node, name, keywords),
98
100
  });
99
101
  }
100
102
  const text = document.createTextNode(this.text(node));
@@ -159,6 +161,9 @@ export class HtmlElement {
159
161
  });
160
162
  }
161
163
  if (this.definition(node).meta.gramlot_component) {
164
+ if (this.definition(node).meta.gramlot_component.bagStore) {
165
+ element.setStoreBag(node.getRelativeData(node.getAttr('storepath')));
166
+ }
162
167
  attrs = element.projectAttributes(attrs, adapt);
163
168
  }
164
169
  attrs = Object.fromEntries(sourceAttributeItems({...attrs, ...renderAttributes}));
@@ -674,13 +674,13 @@ var InspectorConnection = class {
674
674
  };
675
675
 
676
676
  // ../tools/gramlot-tools-inspector/src/gramlot-tools-inspector.css
677
- var gramlot_tools_inspector_default = ":host { all: initial; color-scheme: light; font: 12px/1.4 system-ui, sans-serif; color: #38414b; }\n* { box-sizing: border-box; }\nbutton, input, select { font: inherit; color: inherit; }\nbutton { cursor: pointer; }\nbutton:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid #3574cb; outline-offset: -1px; }\n.tree { padding: 7px 3px; }\n.properties { background: white; }\n.properties-heading { font-size: 11px; display: flex; align-items: center; justify-content: space-between; height: 29px; padding: 0 8px; background: #f1f3f5; color: #6d7989; border-bottom: 1px solid #d1d7df; }\n.properties-heading button { background: white; border: 1px solid #c5cdda; border-radius: 2px; width: 23px; height: 23px; padding: 0; font-size: 18px; line-height: 20px; }\nfieldset { border: 0; margin: 0; padding: 0; min-width: 0; }\n.property-row { display: grid; grid-template-columns: minmax(95px, 30%) minmax(0, 1fr); min-height: 20px; border-bottom: 1px solid #d1d7df; font-size: 11px; }\n.property-name { display: flex; align-items: center; justify-content: flex-end; background: #888; color: white; font-weight: 700; padding: 1px 6px; border-right: 1px solid #d1d7df; overflow-wrap: anywhere; text-align: right; }\n.property-value { display: flex; align-items: center; min-width: 0; }\n.property-row input { border: 0; border-radius: 0; min-width: 0; width: 100%; height: 19px; padding: 1px 5px; background: transparent; }\n.property-name input { color: white; text-align: right; padding: 0; }\n.property-value input { flex: 1; }\n.property-value input[type=checkbox] { flex: none; width: 14px; height: 14px; margin: 2px 6px; }\n.property-value select { max-width: 82px; height: 20px; padding: 0; border: 0; border-left: 1px solid #d1d7df; background: #f1f3f5; font-size: 10px; }\n.remove { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; flex: none; width: 22px; height: 20px; padding: 3px; border: 0; background: transparent; color: #7c8797; opacity: 0; }\n.remove svg { width: 13px; height: 13px; }\n.property-row:hover .remove, .property-row:focus-within .remove { opacity: 1; }\n.remove:hover { color: #b82323; background: #fbe9e9; }\n:disabled { cursor: default; opacity: .65; }\n.path { flex: none; padding: 5px 9px; border-top: 1px solid #c9cfd6; background: #f5f7f9; color: #697687; font-size: 11px; min-height: 27px; overflow-wrap: anywhere; }\n.error, .edit-status, .breakpoint-status, .breakpoint-line { font-size: 11px; margin: 0; padding: 3px 8px; overflow-wrap: anywhere; }\n.error, .edit-status, .breakpoint-status { color: #a12121; }\n.breakpoint-line { background: #fff2ed; color: #854127; border-bottom: 1px solid #d1d7df; }\n.error:empty, .edit-status:empty, .breakpoint-status:empty, .breakpoint-line:empty { display: none; }\n.breakpoint-dialog { width: min(340px, 90vw); color: #38414b; border: 1px solid #bbc3cf; border-radius: 4px; padding: 12px; box-shadow: 0 8px 28px #0003; font: 12px/1.4 system-ui, sans-serif; }\n.breakpoint-dialog::backdrop { background: #0002; }\n.breakpoint-dialog h2 { font-size: 13px; margin: 0 0 10px; overflow-wrap: anywhere; }\n.breakpoint-dialog select, .breakpoint-dialog input { width: 100%; border: 1px solid #bbc3cf; padding: 4px; margin: 0 0 7px; background: white; }\n.dialog-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 7px; }\n.dialog-actions button { padding: 3px 10px; border: 1px solid #bbc3cf; border-radius: 3px; background: #f1f3f5; }\n.heading-label { flex: 1; }\n.properties-heading .breakpoint-count { width: auto; padding: 0 5px; margin-right: 5px; font-size: 11px; color: #b04a35; }\n.breakpoint-entry { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid #d1d7df; }\n.breakpoint-entry span { flex: 1; overflow-wrap: anywhere; }\n.breakpoint-entry button { background: transparent; border: 0; font-size: 17px; }\n[hidden] { display: none !important; }\n.targetbar { flex: none; height: 28px; padding: 2px 6px; background: #edf2fa; border-bottom: 1px solid #dadce0; }\n.targetbar select { width: 100%; height: 23px; border: 0; background: transparent; font-size: 11px; }\n.styles-panel { flex: 1; min-height: 0; overflow: auto; background: #fff; font-size: 11px; }\n.styles-toolbar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; background: #f1f3f5; border-bottom: 1px solid #d1d7df; }\n.styles-toolbar span { flex: 1; font-weight: 600; }\n.styles-toolbar button, .styles-toolbar a { padding: 3px 7px; border: 1px solid #c5cdda; border-radius: 3px; background: white; }\n.styles-toolbar a { color: inherit; text-decoration: none; }\n.styles-toolbar a[aria-disabled=true] { cursor: default; opacity: .65; }\n.styles-toolbar a:focus-visible { outline: 1px solid #3574cb; outline-offset: -1px; }\n.styles-help, .styles-empty, .styles-status { margin: 0; padding: 7px 9px; color: #697687; }\n.styles-status { color: #a12121; }\n.styles-status:empty { display: none; }\n.styles-group h3 { margin: 0; padding: 6px 9px; font-size: 11px; background: #edf2fa; border-block: 1px solid #d1d7df; }\n.style-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 25px 23px; align-items: center; gap: 8px; min-width: 0; padding: 3px 9px; border-bottom: 1px solid #e8ebef; }\n.style-row label { min-width: 0; font: 11px/1.4 ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.style-row input { min-width: 0; width: 100%; height: 23px; padding: 2px 5px; border: 1px solid #c5cdda; border-radius: 3px; background: white; }\n.style-row input[type=color] { width: 25px; padding: 1px; cursor: pointer; }\n.style-row button { grid-column: 4; width: 23px; height: 23px; padding: 0; border: 1px solid #c5cdda; border-radius: 3px; background: #f5f7f9; font-size: 15px; }\n\n:host([embedded]) { display: block; height: 100%; min-height: 0; }\n:host([embedded]) > div { height: 100%; }\n.embedded-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }\n\n.property-value select.enum-value { flex: 1; min-width: 0; max-width: none; width: 100%; border: 0; background: white; font: inherit; padding: 1px 5px; }\n\n/* Presentation changes preserve the inspector runtime and selection. */\n:host([hidden]) { display: none; }\n:host([docked]) { display: block; height: 100%; min-height: 0; }\n:host([docked][hidden]) { display: none; }\n:host([docked]) > div { height: 100%; }\n:host([docked]) .targetbar select { min-height: 40px; font-size: 16px; }\n:host([docked]) .property-row { min-height: 36px; font-size: 13px; }\n:host([docked]) .property-row input { min-height: 35px; font-size: 16px; }\n:host([docked]) .remove { opacity: 1; min-height: 35px; width: 32px; }\n\n:host([docked]) { --tree-action-size: 28px; --tree-font-size: 14px; --tree-row-height: 40px; --separator-size: 14px; }\n:host([docked]) .targetbar { height: 44px; }\n:host([docked]) gramlot-poc-tabs > button { height: 44px; font-size: 14px; }\n:host([docked]) .properties-heading { height: 40px; font-size: 13px; }\n:host([docked]) .properties-heading button { width: 36px; height: 36px; }\n:host([docked]) .property-value select { height: 35px; font-size: 14px; }\n\n.history-toolbar { flex:none; display:flex; align-items:center; gap:6px; padding:4px 8px; border-bottom:1px solid #d1d7df; background:#f6f8fb; font:11px/1.4 system-ui,sans-serif; }\n.history-toolbar button { flex:none; padding:3px 6px; border:1px solid #c5cdda; border-radius:3px; background:white; cursor:pointer; }\n.history-toolbar button:disabled { opacity:.45; cursor:default; }\n.history-toolbar span { min-width:0; color:#a12121; overflow-wrap:anywhere; }\n";
677
+ var gramlot_tools_inspector_default = ":host { all: initial; background: var(--gramlot-surface, white); color-scheme: inherit; font: 12px/1.4 system-ui, sans-serif; color: var(--gramlot-ink, #38414b); }\n* { box-sizing: border-box; }\nbutton, input, select { font: inherit; color: inherit; }\nbutton { cursor: pointer; }\nbutton:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid var(--gramlot-focus-ring, #3574cb); outline-offset: -1px; }\n.tree { padding: 7px 3px; }\n.properties { background: var(--gramlot-surface, white); }\n.properties-heading { font-size: 11px; display: flex; align-items: center; justify-content: space-between; height: 29px; padding: 0 8px; background: var(--gramlot-surface-subtle, #f1f3f5); color: var(--gramlot-text-secondary, #6d7989); border-bottom: 1px solid var(--gramlot-border, #d1d7df); }\n.properties-heading button { background: var(--gramlot-surface, white); border: 1px solid var(--gramlot-border-control, #c5cdda); border-radius: 2px; width: 23px; height: 23px; padding: 0; font-size: 18px; line-height: 20px; }\nfieldset { border: 0; margin: 0; padding: 0; min-width: 0; }\n.property-row { display: grid; grid-template-columns: minmax(95px, 30%) minmax(0, 1fr); min-height: 20px; border-bottom: 1px solid var(--gramlot-border, #d1d7df); font-size: 11px; }\n.property-name { display: flex; align-items: center; justify-content: flex-end; background: var(--gramlot-surface-subtle, #f1f3f5); color: var(--gramlot-ink, #38414b); font-weight: 700; padding: 1px 6px; border-right: 1px solid var(--gramlot-border, #d1d7df); overflow-wrap: anywhere; text-align: right; }\n.property-value { display: flex; align-items: center; min-width: 0; }\n.property-row input { border: 0; border-radius: 0; min-width: 0; width: 100%; height: 19px; padding: 1px 5px; background: transparent; }\n.property-name input { color: var(--gramlot-ink, #38414b); text-align: right; padding: 0; }\n.property-value input { flex: 1; }\n.property-value input[type=checkbox] { flex: none; width: 14px; height: 14px; margin: 2px 6px; }\n.property-value select { max-width: 82px; height: 20px; padding: 0; border: 0; border-left: 1px solid var(--gramlot-border, #d1d7df); background: var(--gramlot-surface-subtle, #f1f3f5); font-size: 10px; }\n.remove { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; flex: none; width: 22px; height: 20px; padding: 3px; border: 0; background: transparent; color: var(--gramlot-text-secondary, #7c8797); opacity: 0; }\n.remove svg { width: 13px; height: 13px; }\n.property-row:hover .remove, .property-row:focus-within .remove { opacity: 1; }\n.remove:hover { color: var(--gramlot-error, #b82323); background: var(--gramlot-error-background, #fbe9e9); }\n:disabled { cursor: default; opacity: .65; }\n.path { flex: none; padding: 5px 9px; border-top: 1px solid var(--gramlot-border, #c9cfd6); background: var(--gramlot-surface-subtle, #f5f7f9); color: var(--gramlot-text-secondary, #697687); font-size: 11px; min-height: 27px; overflow-wrap: anywhere; }\n.error, .edit-status, .breakpoint-status, .breakpoint-line { font-size: 11px; margin: 0; padding: 3px 8px; overflow-wrap: anywhere; }\n.error, .edit-status, .breakpoint-status { color: var(--gramlot-error, #a12121); }\n.breakpoint-line { background: var(--gramlot-warning-background, #fff2ed); color: var(--gramlot-warning, #854127); border-bottom: 1px solid var(--gramlot-border, #d1d7df); }\n.error:empty, .edit-status:empty, .breakpoint-status:empty, .breakpoint-line:empty { display: none; }\n.breakpoint-dialog { background: var(--gramlot-surface, white); width: min(340px, 90vw); color: var(--gramlot-ink, #38414b); border: 1px solid var(--gramlot-border-control, #bbc3cf); border-radius: 4px; padding: 12px; box-shadow: 0 8px 28px #0003; font: 12px/1.4 system-ui, sans-serif; }\n.breakpoint-dialog::backdrop { background: #0002; }\n.breakpoint-dialog h2 { font-size: 13px; margin: 0 0 10px; overflow-wrap: anywhere; }\n.breakpoint-dialog select, .breakpoint-dialog input { width: 100%; border: 1px solid var(--gramlot-border-control, #bbc3cf); padding: 4px; margin: 0 0 7px; background: var(--gramlot-surface, white); }\n.dialog-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 7px; }\n.dialog-actions button { padding: 3px 10px; border: 1px solid var(--gramlot-border-control, #bbc3cf); border-radius: 3px; background: var(--gramlot-surface-subtle, #f1f3f5); }\n.heading-label { flex: 1; }\n.properties-heading .breakpoint-count { width: auto; padding: 0 5px; margin-right: 5px; font-size: 11px; color: var(--gramlot-error, #b04a35); }\n.breakpoint-entry { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--gramlot-border, #d1d7df); }\n.breakpoint-entry span { flex: 1; overflow-wrap: anywhere; }\n.breakpoint-entry button { background: transparent; border: 0; font-size: 17px; }\n[hidden] { display: none !important; }\n.targetbar { flex: none; height: 28px; padding: 2px 6px; background: var(--gramlot-surface-subtle, #edf2fa); border-bottom: 1px solid var(--gramlot-border, #dadce0); }\n.targetbar select { width: 100%; height: 23px; border: 0; background: transparent; font-size: 11px; }\n.styles-panel { flex: 1; min-height: 0; overflow: auto; background: var(--gramlot-surface, #fff); font-size: 11px; }\n.styles-toolbar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; background: var(--gramlot-surface-subtle, #f1f3f5); border-bottom: 1px solid var(--gramlot-border, #d1d7df); }\n.styles-toolbar span { flex: 1; font-weight: 600; }\n.styles-toolbar button, .styles-toolbar a { padding: 3px 7px; border: 1px solid var(--gramlot-border-control, #c5cdda); border-radius: 3px; background: var(--gramlot-surface, white); }\n.styles-toolbar a { color: inherit; text-decoration: none; }\n.styles-toolbar a[aria-disabled=true] { cursor: default; opacity: .65; }\n.styles-toolbar a:focus-visible { outline: 1px solid var(--gramlot-focus-ring, #3574cb); outline-offset: -1px; }\n.styles-help, .styles-empty, .styles-status { margin: 0; padding: 7px 9px; color: var(--gramlot-text-secondary, #697687); }\n.styles-status { color: var(--gramlot-error, #a12121); }\n.styles-status:empty { display: none; }\n.styles-group h3 { margin: 0; padding: 6px 9px; font-size: 11px; background: var(--gramlot-surface-subtle, #edf2fa); border-block: 1px solid var(--gramlot-border, #d1d7df); }\n.style-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 25px 23px; align-items: center; gap: 8px; min-width: 0; padding: 3px 9px; border-bottom: 1px solid var(--gramlot-border, #e8ebef); }\n.style-row label { min-width: 0; font: 11px/1.4 ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.style-row input { min-width: 0; width: 100%; height: 23px; padding: 2px 5px; border: 1px solid var(--gramlot-border-control, #c5cdda); border-radius: 3px; background: var(--gramlot-surface, white); }\n.style-row input[type=color] { width: 25px; padding: 1px; cursor: pointer; }\n.style-row button { grid-column: 4; width: 23px; height: 23px; padding: 0; border: 1px solid var(--gramlot-border-control, #c5cdda); border-radius: 3px; background: var(--gramlot-surface-subtle, #f5f7f9); font-size: 15px; }\n\n:host([embedded]) { display: block; height: 100%; min-height: 0; }\n:host([embedded]) > div { height: 100%; }\n.embedded-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }\n\n.property-value select.enum-value { flex: 1; min-width: 0; max-width: none; width: 100%; border: 0; background: var(--gramlot-surface, white); font: inherit; padding: 1px 5px; }\n\n/* Presentation changes preserve the inspector runtime and selection. */\n:host([hidden]) { display: none; }\n:host([docked]) { display: block; height: 100%; min-height: 0; }\n:host([docked][hidden]) { display: none; }\n:host([docked]) > div { height: 100%; }\n:host([docked]) .targetbar select { min-height: 40px; font-size: 16px; }\n:host([docked]) .property-row { min-height: 36px; font-size: 13px; }\n:host([docked]) .property-row input { min-height: 35px; font-size: 16px; }\n:host([docked]) .remove { opacity: 1; min-height: 35px; width: 32px; }\n\n:host([docked]) { --tree-action-size: 28px; --tree-font-size: 14px; --tree-row-height: 40px; --separator-size: 14px; }\n:host([docked]) .targetbar { height: 44px; }\n:host([docked]) gramlot-poc-tabs > button { height: 44px; font-size: 14px; }\n:host([docked]) .properties-heading { height: 40px; font-size: 13px; }\n:host([docked]) .properties-heading button { width: 36px; height: 36px; }\n:host([docked]) .property-value select { height: 35px; font-size: 14px; }\n\n.history-toolbar { flex:none; display:flex; align-items:center; gap:6px; padding:4px 8px; border-bottom:1px solid var(--gramlot-border, #d1d7df); background:var(--gramlot-surface-subtle, #f6f8fb); font:11px/1.4 system-ui,sans-serif; }\n.history-toolbar button { flex:none; padding:3px 6px; border:1px solid var(--gramlot-border-control, #c5cdda); border-radius:3px; background:var(--gramlot-surface, white); cursor:pointer; }\n.history-toolbar button:disabled { opacity:.45; cursor:default; }\n.history-toolbar span { min-width:0; color:var(--gramlot-error, #a12121); overflow-wrap:anywhere; }\n";
678
678
 
679
679
  // ../tools/poc/gramlot-poc-tree.js
680
680
  import { Bag as Bag2 } from "@gramlot/gramlot";
681
681
 
682
682
  // ../tools/poc/gramlot-poc-tree.css
683
- var gramlot_poc_tree_default = "/* Copyright 2025-2026 Softwell S.r.l. - SPDX-License-Identifier: Apache-2.0\n * Inspector subset of the DevTools storeTree stylesheet and inspector.css variables. */\n:host { display:block; font:var(--tree-font-size,11px)/var(--tree-row-height,18px) -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; color:#38414b; }\n:host([hidden]) { display:none; }\nul { list-style:none; margin:0; padding-left:17px; }\n.tree-root { padding-left:calc(var(--tree-action-size,14px) + 2px); }\n.tree-root > ul { padding-left:2px; }\nsummary, .leaf { position:relative; }\nli { line-height:var(--tree-row-height,18px); }\nsummary { display:flex; align-items:center; gap:7px; padding:0 5px; cursor:pointer; user-select:none; list-style:none; }\nsummary::-webkit-details-marker { display:none; }\nsummary::before { content:''; width:5px; height:5px; border-right:1.5px solid #78818a; border-bottom:1.5px solid #78818a; transform:rotate(-45deg); flex:none; margin:0 3px; }\ndetails[open] > summary::before { transform:rotate(45deg); }\n.leaf { display:flex; align-items:center; gap:7px; padding:0 5px 0 23px; cursor:pointer; }\nsummary:hover,.leaf:hover { background:#f0f3f6; }\n.selected,.selected:hover { background:transparent; color:#315dbd; font-weight:700; border-radius:2px; }\n.caption { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n/* Reserve a left gutter; showing an action must not shift the node label. */\n.actions { position:absolute; left:calc(-1 * var(--tree-action-size,14px)); top:0; display:inline-flex; opacity:0; pointer-events:none; }\nsummary:hover > .actions,.leaf:hover > .actions,summary:focus-visible > .actions,.leaf:focus-visible > .actions,\n.actions:has(button:focus-visible),.actions:has(button.active) { opacity:1; pointer-events:auto; }\n.actions button { border:0; background:transparent; color:#80868b; font:inherit; font-size:11px; line-height:var(--tree-row-height,18px); width:var(--tree-action-size,14px); height:var(--tree-row-height,18px); padding:0; cursor:pointer; border-radius:3px; }\n.actions button:hover { background:#e1e5ed; }\n.actions button[data-action=breakpoint] { font-size:0; }\n.actions button[data-action=breakpoint]::before { content:''; display:inline-block; box-sizing:border-box; width:8px; height:8px; border:1.5px solid currentColor; border-radius:50%; vertical-align:middle; }\n.actions button.active { color:#b3261e; }\n.actions button.active.conditional { color:#f9ab00; }\n.actions button.active[data-action=breakpoint]::before { background:currentColor; }\n.actions button:focus-visible,summary:focus-visible,.leaf:focus-visible { outline:2px solid #356f9f; outline-offset:-2px; }\n\n@media (hover: none) { .actions { opacity:1; pointer-events:auto; } }\n\n.actions-end { position:static; margin-left:auto; flex:none; }\n[data-drop=inside] { outline:2px solid #356f9f; outline-offset:-2px; background:#e7f0fc; }\n[data-drop=before] { box-shadow:inset 0 2px #356f9f; }\n[data-drop=after] { box-shadow:inset 0 -2px #356f9f; }\n";
683
+ var gramlot_poc_tree_default = "/* Copyright 2025-2026 Softwell S.r.l. - SPDX-License-Identifier: Apache-2.0\n * Inspector subset of the DevTools storeTree stylesheet and inspector.css variables. */\n:host { display:block; font:var(--tree-font-size,11px)/var(--tree-row-height,18px) -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; color:var(--gramlot-ink, #38414b); }\n:host([hidden]) { display:none; }\nul { list-style:none; margin:0; padding-left:17px; }\n.tree-root { padding-left:calc(var(--tree-action-size,14px) + 2px); }\n.tree-root > ul { padding-left:2px; }\nsummary, .leaf { position:relative; }\nli { line-height:var(--tree-row-height,18px); }\nsummary { display:flex; align-items:center; gap:7px; padding:0 5px; cursor:pointer; user-select:none; list-style:none; }\nsummary::-webkit-details-marker { display:none; }\nsummary::before { content:''; width:5px; height:5px; border-right:1.5px solid var(--gramlot-text-secondary, #78818a); border-bottom:1.5px solid var(--gramlot-text-secondary, #78818a); transform:rotate(-45deg); flex:none; margin:0 3px; }\ndetails[open] > summary::before { transform:rotate(45deg); }\n.leaf { display:flex; align-items:center; gap:7px; padding:0 5px 0 23px; cursor:pointer; }\nsummary:hover,.leaf:hover { background:var(--gramlot-surface-subtle, #f0f3f6); }\n.selected,.selected:hover { background:transparent; color:var(--gramlot-action, #315dbd); font-weight:700; border-radius:2px; }\n.caption { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n/* Reserve a left gutter; showing an action must not shift the node label. */\n.actions { position:absolute; left:calc(-1 * var(--tree-action-size,14px)); top:0; display:inline-flex; opacity:0; pointer-events:none; }\nsummary:hover > .actions,.leaf:hover > .actions,summary:focus-visible > .actions,.leaf:focus-visible > .actions,\n.actions:has(button:focus-visible),.actions:has(button.active) { opacity:1; pointer-events:auto; }\n.actions button { border:0; background:transparent; color:var(--gramlot-text-secondary, #80868b); font:inherit; font-size:11px; line-height:var(--tree-row-height,18px); width:var(--tree-action-size,14px); height:var(--tree-row-height,18px); padding:0; cursor:pointer; border-radius:3px; }\n.actions button:hover { background:var(--gramlot-selected, #e1e5ed); }\n.actions button[data-action=breakpoint] { font-size:0; }\n.actions button[data-action=breakpoint]::before { content:''; display:inline-block; box-sizing:border-box; width:8px; height:8px; border:1.5px solid currentColor; border-radius:50%; vertical-align:middle; }\n.actions button.active { color:var(--gramlot-error, #b3261e); }\n.actions button.active.conditional { color:var(--gramlot-warning, #f9ab00); }\n.actions button.active[data-action=breakpoint]::before { background:currentColor; }\n.actions button:focus-visible,summary:focus-visible,.leaf:focus-visible { outline:2px solid var(--gramlot-focus-ring, #356f9f); outline-offset:-2px; }\n\n@media (hover: none) { .actions { opacity:1; pointer-events:auto; } }\n\n.actions-end { position:static; margin-left:auto; flex:none; }\n[data-drop=inside] { outline:2px solid var(--gramlot-focus-ring, #356f9f); outline-offset:-2px; background:var(--gramlot-selected, #e7f0fc); }\n[data-drop=before] { box-shadow:inset 0 2px var(--gramlot-focus-ring, #356f9f); }\n[data-drop=after] { box-shadow:inset 0 -2px var(--gramlot-focus-ring, #356f9f); }\n";
684
684
 
685
685
  // ../tools/poc/gramlot-poc-tree.js
686
686
  var sequence = 0;
@@ -933,8 +933,8 @@ var GramlotPocPalette = class extends HTMLElement {
933
933
  constructor() {
934
934
  super();
935
935
  this.attachShadow({ mode: "open" }).innerHTML = `<style>
936
- :host{box-sizing:border-box;position:fixed;z-index:2147483647;left:16px;top:16px;width:480px;height:620px;min-width:min(280px,100vw);min-height:200px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);display:block;font:11px/1.45 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:white;color:#38414b;border:1px solid #b9bec5;border-radius:4px;box-shadow:0 6px 22px #20283026;overflow:hidden}
937
- *{box-sizing:border-box}.frame{height:100%;display:flex;flex-direction:column}.bar{display:flex;align-items:center;height:25px;min-height:25px;padding:0 4px;border-bottom:1px solid #d8d8dc;background:#eceef1;cursor:move;touch-action:none;user-select:none}.title{flex:1;min-width:0;text-align:left;padding-left:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:600}.body{flex:1;min-height:0;display:flex;flex-direction:column}.resize{position:absolute;right:2px;bottom:2px;width:14px;height:14px;cursor:nwse-resize;touch-action:none;background:repeating-linear-gradient(135deg,transparent 0 3px,#aab0b8 3px 4px,transparent 4px 6px);clip-path:polygon(100% 0,100% 100%,0 100%)}button{font:inherit;color:#69727c;background:transparent;border:0;cursor:pointer}.close,.collapse{width:22px;flex:none;height:22px;font-size:18px;line-height:18px;padding:0}.close:hover,.collapse:hover{background:#dce1e7}.bar:focus-visible,button:focus-visible{outline:2px solid #356f9f;outline-offset:-2px}.resize:focus-visible{clip-path:none}::slotted(*){min-height:0}
936
+ :host{box-sizing:border-box;position:fixed;z-index:2147483647;left:16px;top:16px;width:480px;height:620px;min-width:min(280px,100vw);min-height:200px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);display:block;font:11px/1.45 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:var(--gramlot-surface, white);color:var(--gramlot-ink, #38414b);border:1px solid var(--gramlot-border, #b9bec5);border-radius:4px;box-shadow:0 6px 22px #20283026;overflow:hidden}
937
+ *{box-sizing:border-box}.frame{height:100%;display:flex;flex-direction:column}.bar{display:flex;align-items:center;height:25px;min-height:25px;padding:0 4px;border-bottom:1px solid var(--gramlot-border, #d8d8dc);background:var(--gramlot-surface-subtle, #eceef1);cursor:move;touch-action:none;user-select:none}.title{flex:1;min-width:0;text-align:left;padding-left:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:600}.body{flex:1;min-height:0;display:flex;flex-direction:column}.resize{position:absolute;right:2px;bottom:2px;width:14px;height:14px;cursor:nwse-resize;touch-action:none;background:repeating-linear-gradient(135deg,transparent 0 3px,var(--gramlot-border-control, #aab0b8) 3px 4px,transparent 4px 6px);clip-path:polygon(100% 0,100% 100%,0 100%)}button{font:inherit;color:var(--gramlot-text-secondary, #69727c);background:transparent;border:0;cursor:pointer}.close,.collapse{width:22px;flex:none;height:22px;font-size:18px;line-height:18px;padding:0}.close:hover,.collapse:hover{background:var(--gramlot-selected, #dce1e7)}.bar:focus-visible,button:focus-visible{outline:2px solid var(--gramlot-focus-ring, #356f9f);outline-offset:-2px}.resize:focus-visible{clip-path:none}::slotted(*){min-height:0}
938
938
  :host([docked]){position:relative!important;inset:0!important;width:100%!important;height:100%!important;min-width:0;min-height:0;max-width:none;max-height:none;border:0;border-radius:0;box-shadow:none}
939
939
  :host([docked]) .bar,:host([docked]) .resize{display:none}
940
940
  :host([docked][collapsed]) .body{display:flex}
@@ -1020,9 +1020,9 @@ var GramlotPocTabs = class extends HTMLElement {
1020
1020
  constructor() {
1021
1021
  super();
1022
1022
  this.attachShadow({ mode: "open" }).innerHTML = `<style>
1023
- :host{display:flex;flex:none;background:#edf2fa;border-bottom:1px solid #d3e3fd}
1024
- ::slotted(button){height:25px;padding:0 10px;border:0;border-radius:0;border-bottom:2px solid transparent;background:transparent;color:#474747;font:500 11px/23px system-ui,sans-serif;cursor:pointer}
1025
- ::slotted(button:hover){background:#e1e5ed}::slotted(button[aria-selected=true]){color:#0b57d0;border-bottom-color:#0b57d0}::slotted(button:focus-visible){outline:2px solid #0b57d0;outline-offset:-2px}
1023
+ :host{display:flex;flex:none;background:var(--gramlot-surface-subtle, #edf2fa);border-bottom:1px solid var(--gramlot-border, #d3e3fd)}
1024
+ ::slotted(button){height:25px;padding:0 10px;border:0;border-radius:0;border-bottom:2px solid transparent;background:transparent;color:var(--gramlot-ink, #474747);font:500 11px/23px system-ui,sans-serif;cursor:pointer}
1025
+ ::slotted(button:hover){background:var(--gramlot-selected, #e1e5ed)}::slotted(button[aria-selected=true]){color:var(--gramlot-action, #0b57d0);border-bottom-color:var(--gramlot-action, #0b57d0)}::slotted(button:focus-visible){outline:2px solid var(--gramlot-action, #0b57d0);outline-offset:-2px}
1026
1026
  </style><slot></slot>`;
1027
1027
  this.addEventListener("keydown", (event) => {
1028
1028
  if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
@@ -1044,7 +1044,7 @@ var GramlotPocSplitter = class extends HTMLElement {
1044
1044
  super();
1045
1045
  this.attachShadow({ mode: "open" }).innerHTML = `<style>
1046
1046
  :host{display:grid;grid-template-rows:minmax(60px,var(--top-size,45%)) var(--separator-size,6px) minmax(60px,1fr);min-height:126px;flex:1;overflow:hidden}
1047
- .region{overflow:auto;min-height:0;min-width:0}.handle{position:relative;background:#e4e7eb;cursor:row-resize;touch-action:none;user-select:none}.handle:after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:1px;width:28px;background:#c2c9d3}.handle:hover{background:#c4d9ef}.handle:focus-visible{outline:2px solid #356f9f;outline-offset:-2px}::slotted(*){min-height:0}
1047
+ .region{overflow:auto;min-height:0;min-width:0}.handle{position:relative;background:var(--gramlot-surface-subtle, #e4e7eb);cursor:row-resize;touch-action:none;user-select:none}.handle:after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:1px;width:28px;background:var(--gramlot-border, #c2c9d3)}.handle:hover{background:var(--gramlot-selected, #c4d9ef)}.handle:focus-visible{outline:2px solid var(--gramlot-focus-ring, #356f9f);outline-offset:-2px}::slotted(*){min-height:0}
1048
1048
  </style><div class="region"><slot name="top"></slot></div><div class="handle" role="separator" aria-label="Resize tree and properties" aria-orientation="horizontal" tabindex="0" aria-valuemin="10" aria-valuemax="90" aria-valuenow="45"></div><div class="region"><slot name="bottom"></slot></div>`;
1049
1049
  const handle = this.shadowRoot.querySelector(".handle");
1050
1050
  handle.addEventListener("pointerdown", (event) => {
@@ -1230,6 +1230,12 @@ var GramlotToolsInspector = class extends HTMLElement {
1230
1230
  this.editChanged(node);
1231
1231
  inspector.#applyEdit();
1232
1232
  }
1233
+ booleanChanged(node) {
1234
+ const row = ui.data.getItem(`editor.rows.${node.getAttr("data-row")}`);
1235
+ if (row.getItem("type") !== "boolean") return;
1236
+ this.editChanged(node);
1237
+ inspector.#applyEdit();
1238
+ }
1233
1239
  typeChanged(node) {
1234
1240
  const row = ui.data.getItem(`editor.rows.${node.getAttr("data-row")}`);
1235
1241
  row.setItem("inputType", inspector.#inputType(row.getItem("type")));
@@ -1926,8 +1932,9 @@ ${declarations}
1926
1932
  disabled: locked,
1927
1933
  "aria-label": primary ? "Value" : `${name || "New attribute"} value`,
1928
1934
  "data-row": row.label,
1929
- title: data.getItem("isNull") ? "Null value. Backspace on an empty cell sets null." : "Enter to save; Escape to revert; Backspace on an empty cell sets null.",
1935
+ title: data.getItem("isNull") ? "Null value. Backspace on an empty cell sets null." : "Checkboxes save immediately; Enter saves other values; Escape reloads; Backspace on an empty cell sets null.",
1930
1936
  connect_oninput: "inspector.editChanged",
1937
+ connect_onchange: "inspector.booleanChanged",
1931
1938
  connect_onkeydown: "inspector.editKey"
1932
1939
  });
1933
1940
  if (fresh) {