@threadlabs/looma 0.53.8 → 0.53.10

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 (40) hide show
  1. package/README.md +16 -0
  2. package/blocks/editor-workspace.html +53 -0
  3. package/blocks/editor-workspace.js +15 -0
  4. package/blocks/list-detail.html +54 -0
  5. package/blocks/list-detail.js +62 -0
  6. package/blocks/search-and-open.html +33 -0
  7. package/blocks/search-and-open.js +53 -0
  8. package/blocks/settings-form.html +26 -0
  9. package/blocks/settings-form.js +16 -0
  10. package/components/shared/behaviors.d.ts +2 -0
  11. package/components/shared/behaviors.js +2 -0
  12. package/components/shared/collection-navigation.d.ts +28 -0
  13. package/components/shared/collection-navigation.js +40 -0
  14. package/components/shared/deferred-focus.d.ts +8 -0
  15. package/components/shared/deferred-focus.js +21 -0
  16. package/components/shared/form-reset.js +14 -6
  17. package/components/shared/menu-navigation.js +19 -22
  18. package/components/shared/overlay-dismissal.js +7 -0
  19. package/components/shared/overlay.js +3 -2
  20. package/components/ui-combobox/ui-combobox.js +6 -6
  21. package/components/ui-date-picker/ui-date-picker.js +5 -6
  22. package/components/ui-date-range-picker/ui-date-range-picker.js +6 -8
  23. package/components/ui-editor-toolbar/ui-editor-toolbar.js +8 -6
  24. package/components/ui-listbox/ui-listbox.js +10 -16
  25. package/components/ui-search-shell/ui-search-shell.js +4 -5
  26. package/components/ui-sidebar/ui-sidebar.html +7 -0
  27. package/components/ui-switcher/ui-switcher.html +28 -1
  28. package/components/ui-tabs/ui-tabs.js +5 -3
  29. package/dist/index.js +1 -1
  30. package/docs/catalog.json +49 -4
  31. package/editor/chunks/expressmark.js +43 -12
  32. package/editor/chunks/extensions.js +15 -2
  33. package/editor/extensions/index.js +1 -1
  34. package/editor/heading-alignment.d.ts +2 -0
  35. package/editor/index.js +78 -44
  36. package/package.json +9 -2
  37. package/styles/ui-sidebar.css +12 -1
  38. package/styles/ui-switcher.css +22 -1
  39. package/vanilla/UiSwitcher.d.ts +2 -1
  40. package/vanilla/UiSwitcher.js +96 -16
@@ -1,23 +1,35 @@
1
1
  // Generated by HTML Next 1.0.0-alpha.92 for Vanilla DOM. Do not edit.
2
- import { attachGeneratedController, buildTemplate, writeAttribute, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, checkFormat, checkInteger, forwardAttributes, resetForwardedAttributes, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
2
+ import { attachGeneratedController, equalValue, buildTemplate, truthy, writeAttribute, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, armElement, replaceRoot, checkFormat, checkInteger, forwardAttributes, resetForwardedAttributes, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
3
3
  import * as controller from "../components/ui-switcher/ui-switcher.js";
4
4
  import "../styles/ui-switcher.css";
5
5
 
6
6
  const T0 = ["",[],4];
7
7
  const T1 = ["",[]];
8
- let P0, P1;
8
+ const T2 = ["",[],"\n ",["div",["class","start"],4],"\n ",["div",["class","end"],4],"\n "];
9
+ const T3 = ["",[]];
10
+ const T4 = ["",[]];
11
+ let P0, P1, P2, P3, P4;
9
12
  const S = { n: ["overLimit"], t: ["b"], f: import.meta.url, g: "ui-switcher", a: (host, I) => C(host, I), b: generatedInputs, i: [false] };
10
- const D = { g: "ui-switcher", props: { "align": { "required":false,"values":["start","center","end","stretch"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "gap": { "required":false,"values":["xs","s","m","l","xl"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "limit": { "required":false, c: checkInteger, t: "integer", j: 0, m: "i" }, "threshold": { "required":false,"values":["xs","sm","md","lg"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
13
+ const A = [["div",{},[],"",[],["data-ui-switcher-state","data-ui-switcher-prop-align","data-ui-switcher-prop-balance","data-ui-switcher-prop-gap","data-ui-switcher-prop-limit","data-ui-switcher-prop-threshold"]],["div",{},[],"",[],["data-ui-switcher-state","data-ui-switcher-prop-align","data-ui-switcher-prop-balance","data-ui-switcher-prop-gap","data-ui-switcher-prop-limit","data-ui-switcher-prop-threshold"]]];
14
+ const Q = [[],[]];
15
+ const D = { g: "ui-switcher", props: { "align": { "required":false,"values":["start","center","end","stretch"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "balance": { "required":false,"values":["equal","narrow-start","narrow-end"],"default":"equal", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "gap": { "required":false,"values":["xs","s","m","l","xl"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "limit": { "required":false, c: checkInteger, t: "integer", j: 0, m: "i" }, "threshold": { "required":false,"values":["xs","sm","md","lg"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
11
16
  const C = (host) => activateModule(controller, host);
12
17
 
13
18
  export function createUiSwitcher(options = {}, html) {
14
19
  const { attributes: authoredAttributes = {}, children = [], slots = {}, ...componentProps } = options;
15
- const attributes = Object.fromEntries([...[], ...Object.entries(authoredAttributes)].filter(([name]) => !["align","gap","limit","threshold"].includes(name)));
16
- const element = document.createElement("div");
17
- element.setAttribute("component", "ui-switcher");
18
- element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
19
- const v = [false, null, null, null, null];
20
- const B = acceptProps(element, D, S.n, v, componentProps, [], html);
20
+ const attributes = Object.fromEntries([...[], ...Object.entries(authoredAttributes)].filter(([name]) => !["align","balance","gap","limit","threshold"].includes(name)));
21
+ const v = [false, null, null, null, null, null];
22
+ let B = acceptProps(undefined, D, S.n, v, componentProps, [], html);
23
+ let a = (truthy(equalValue(v[2], "equal")) ? 0 : 1);
24
+ let element;
25
+ if (a === 0) {
26
+ element = document.createElement("div");
27
+ element.setAttribute("component", "ui-switcher");
28
+ } else {
29
+ element = document.createElement("div");
30
+ element.setAttribute("component", "ui-switcher");
31
+ }
32
+ B = acceptProps(element, D, S.n, v, componentProps, Q[a], html);
21
33
  const m1 = (d) => {
22
34
  const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
23
35
  const r = { n };
@@ -26,13 +38,36 @@ export function createUiSwitcher(options = {}, html) {
26
38
  };
27
39
  const p1 = (r, c, d) => {
28
40
  };
41
+ const m3 = (d) => {
42
+ const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
43
+ const r = { n };
44
+ p3(r, -1, d);
45
+ return r;
46
+ };
47
+ const p3 = (r, c, d) => {
48
+ };
49
+ const m4 = (d) => {
50
+ const n = (P4 ??= buildTemplate(T4)).cloneNode(true);
51
+ const r = { n };
52
+ p4(r, -1, d);
53
+ return r;
54
+ };
55
+ const p4 = (r, c, d) => {
56
+ };
57
+ const m0 = (n, d) => {
58
+ n.append((P0 ??= buildTemplate(T0)).cloneNode(true));
59
+ const t0 = n.firstChild;
60
+ const r = { n, v0: undefined, v1: undefined, a1: t0, e0: t0.nextSibling, b0: undefined, f0: undefined };
61
+ p0(r, -1, d);
62
+ return r;
63
+ };
29
64
  const p0 = (r, c, d) => {
30
65
  if (c === -1) {
31
66
  resetForwardedAttributes(r.n, attributes, r.v0);
32
67
  r.v0 = forwardAttributes(r.n, attributes);
33
68
  }
34
- if (c & 23) {
35
- const x0 = hostState(["overLimit","gap","threshold","align"], [v[0], v[2], v[4], v[1]]);
69
+ if (c & 47) {
70
+ const x0 = hostState(["overLimit","balance","gap","threshold","align"], [v[0], v[2], v[3], v[5], v[1]]);
36
71
  const s1 = x0;
37
72
  if (s1 !== r.v1) writeAttribute(r.n, "data-ui-switcher-state", (r.v1 = s1) === "" ? null : s1);
38
73
  }
@@ -40,14 +75,59 @@ export function createUiSwitcher(options = {}, html) {
40
75
  if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b0 = m1(d); at.before(r.b0.n); } }
41
76
  else if (r.b0 !== undefined) p1(r.b0, c, d);
42
77
  };
43
- const t0 = element.firstChild;
44
- const R = { n: element, v0: undefined, v1: undefined, a1: t0, e0: t0.nextSibling, b0: undefined, f0: undefined };
78
+ const m2 = (n, d) => {
79
+ n.append((P2 ??= buildTemplate(T2)).cloneNode(true));
80
+ const t0 = n.firstChild.nextSibling;
81
+ const t1 = t0.firstChild;
82
+ const t2 = t0.nextSibling.nextSibling.firstChild;
83
+ const r = { n, v0: undefined, v1: undefined, a1: t1, e0: t1.nextSibling, b0: undefined, f0: undefined, a2: t2, e1: t2.nextSibling, b1: undefined, f1: undefined };
84
+ p2(r, -1, d);
85
+ return r;
86
+ };
87
+ const p2 = (r, c, d) => {
88
+ if (c === -1) {
89
+ resetForwardedAttributes(r.n, attributes, r.v0);
90
+ r.v0 = forwardAttributes(r.n, attributes);
91
+ }
92
+ if (c & 47) {
93
+ const x0 = hostState(["overLimit","balance","gap","threshold","align"], [v[0], v[2], v[3], v[5], v[1]]);
94
+ const s1 = x0;
95
+ if (s1 !== r.v1) writeAttribute(r.n, "data-ui-switcher-state", (r.v1 = s1) === "" ? null : s1);
96
+ }
97
+ if (r.f0 === undefined) { r.f0 = 1; const at = fillSlot(r.a1, r.e0, "start", J, false, undefined, d);
98
+ if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b0 = m3(d); at.before(r.b0.n); } }
99
+ else if (r.b0 !== undefined) p3(r.b0, c, d);
100
+ if (r.f1 === undefined) { r.f1 = 1; const at = fillSlot(r.a2, r.e1, "end", J, false, undefined, d);
101
+ if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b1 = m4(d); at.before(r.b1.n); } }
102
+ else if (r.b1 !== undefined) p4(r.b1, c, d);
103
+ };
104
+ const M = [m0, m2], N = [p0, p2];
105
+ let R;
106
+ const p = (c, d) => {
107
+ if (R === null) return;
108
+ if (R === undefined) { R = M[a](element, d); return; }
109
+ if (c & 4) {
110
+ const t = (truthy(equalValue(v[2], "equal")) ? 0 : 1);
111
+ if (t !== a) {
112
+ dispose(R);
113
+ for (const key in I.r) delete I.r[key];
114
+ const previous = I.e, next = armElement(previous, A[a], A[t]);
115
+ I.B.b = Q[t];
116
+ a = t;
117
+ R = null;
118
+ R = M[t](next, d);
119
+ replaceRoot(I, previous, next);
120
+ return;
121
+ }
122
+ }
123
+ N[a](R, c, d);
124
+ };
45
125
  const I = { B };
46
126
  const J = project(I, children, slots);
47
127
  I.R = new Set();
48
- I.F = { values: attributes, draw: () => ((c, d) => p0(R, c, d))(-1) };
49
- attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, undefined, I);
128
+ I.F = { values: attributes, draw: () => p(-1) };
129
+ attachGeneratedController(element, S, v, (c, d) => { p(c, d); for (const f of I.R) f(c, d); }, undefined, undefined, I);
50
130
  manageProps(I);
51
131
  return element;
52
132
  }
53
- defineComponent("ui-switcher", createUiSwitcher, ["align","gap","limit","threshold"]);
133
+ defineComponent("ui-switcher", createUiSwitcher, ["align","balance","gap","limit","threshold"]);