@threadlabs/looma 0.49.0 → 0.49.2
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.
- package/README.md +1 -1
- package/components/ui-cycle-button/ui-cycle-button.html +5 -3
- package/components/ui-cycle-button/ui-cycle-button.js +3 -2
- package/components/ui-editor/ui-editor.html +24 -9
- package/components/ui-search-result-row/ui-search-result-row.html +1 -1
- package/dist/index.js +1 -1
- package/docs/catalog.json +88 -11
- package/package.json +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/vanilla/UiCycleButton.d.ts +2 -0
- package/vanilla/UiCycleButton.js +26 -21
- package/vanilla/UiEditor.d.ts +9 -9
- package/vanilla/UiEditor.js +3 -3
package/docs/catalog.json
CHANGED
|
@@ -498,7 +498,7 @@
|
|
|
498
498
|
],
|
|
499
499
|
"schemaVersion": 1,
|
|
500
500
|
"package": "@threadlabs/looma",
|
|
501
|
-
"version": "0.49.
|
|
501
|
+
"version": "0.49.2",
|
|
502
502
|
"groups": [
|
|
503
503
|
{
|
|
504
504
|
"id": "layout",
|
|
@@ -8021,6 +8021,13 @@
|
|
|
8021
8021
|
"shared": []
|
|
8022
8022
|
},
|
|
8023
8023
|
"attributes": [
|
|
8024
|
+
{
|
|
8025
|
+
"name": "description",
|
|
8026
|
+
"property": "description",
|
|
8027
|
+
"description": "Accessible instruction for cycling; accepts localized reader text.",
|
|
8028
|
+
"type": "string",
|
|
8029
|
+
"default": "Activate to choose the next state."
|
|
8030
|
+
},
|
|
8024
8031
|
{
|
|
8025
8032
|
"name": "disabled",
|
|
8026
8033
|
"property": "disabled",
|
|
@@ -8028,6 +8035,13 @@
|
|
|
8028
8035
|
"type": "boolean",
|
|
8029
8036
|
"default": false
|
|
8030
8037
|
},
|
|
8038
|
+
{
|
|
8039
|
+
"name": "empty-label",
|
|
8040
|
+
"property": "emptyLabel",
|
|
8041
|
+
"description": "Selected-state label while no choices are available.",
|
|
8042
|
+
"type": "string",
|
|
8043
|
+
"default": "No choices"
|
|
8044
|
+
},
|
|
8031
8045
|
{
|
|
8032
8046
|
"name": "index",
|
|
8033
8047
|
"property": "index",
|
|
@@ -8091,12 +8105,24 @@
|
|
|
8091
8105
|
}
|
|
8092
8106
|
],
|
|
8093
8107
|
"properties": [
|
|
8108
|
+
{
|
|
8109
|
+
"name": "description",
|
|
8110
|
+
"description": "Accessible instruction for cycling; accepts localized reader text.",
|
|
8111
|
+
"type": "string",
|
|
8112
|
+
"default": "Activate to choose the next state."
|
|
8113
|
+
},
|
|
8094
8114
|
{
|
|
8095
8115
|
"name": "disabled",
|
|
8096
8116
|
"description": "Prevents cycling while keeping the selected state visible.",
|
|
8097
8117
|
"type": "boolean",
|
|
8098
8118
|
"default": false
|
|
8099
8119
|
},
|
|
8120
|
+
{
|
|
8121
|
+
"name": "emptyLabel",
|
|
8122
|
+
"description": "Selected-state label while no choices are available.",
|
|
8123
|
+
"type": "string",
|
|
8124
|
+
"default": "No choices"
|
|
8125
|
+
},
|
|
8100
8126
|
{
|
|
8101
8127
|
"name": "index",
|
|
8102
8128
|
"description": "Initial or externally selected zero-based state. The first state is the default.",
|
|
@@ -9893,6 +9919,16 @@
|
|
|
9893
9919
|
"path": "[].label",
|
|
9894
9920
|
"type": "string",
|
|
9895
9921
|
"required": true
|
|
9922
|
+
},
|
|
9923
|
+
{
|
|
9924
|
+
"path": "[].from",
|
|
9925
|
+
"type": "integer",
|
|
9926
|
+
"required": true
|
|
9927
|
+
},
|
|
9928
|
+
{
|
|
9929
|
+
"path": "[].to",
|
|
9930
|
+
"type": "integer",
|
|
9931
|
+
"required": true
|
|
9896
9932
|
}
|
|
9897
9933
|
],
|
|
9898
9934
|
"default": "[]"
|
|
@@ -10013,7 +10049,7 @@
|
|
|
10013
10049
|
{
|
|
10014
10050
|
"name": "mentionItems",
|
|
10015
10051
|
"description": "Default mention choices when nobody answers mention-query.",
|
|
10016
|
-
"type": "readonly ({ readonly id: string; readonly label: string; readonly detail?: string | null; readonly initials?: string | null
|
|
10052
|
+
"type": "readonly ({ readonly id: string; readonly label: string; readonly detail?: string | null; readonly initials?: string | null })[]",
|
|
10017
10053
|
"fields": [
|
|
10018
10054
|
{
|
|
10019
10055
|
"path": "[].id",
|
|
@@ -10053,7 +10089,7 @@
|
|
|
10053
10089
|
{
|
|
10054
10090
|
"name": "rangeActions",
|
|
10055
10091
|
"description": "Application caret actions with host-owned durable ranges.",
|
|
10056
|
-
"type": "readonly ({ readonly id: string; readonly label: string; readonly
|
|
10092
|
+
"type": "readonly ({ readonly id: string; readonly label: string; readonly from: number; readonly to: number })[]",
|
|
10057
10093
|
"fields": [
|
|
10058
10094
|
{
|
|
10059
10095
|
"path": "[].id",
|
|
@@ -10064,6 +10100,16 @@
|
|
|
10064
10100
|
"path": "[].label",
|
|
10065
10101
|
"type": "string",
|
|
10066
10102
|
"required": true
|
|
10103
|
+
},
|
|
10104
|
+
{
|
|
10105
|
+
"path": "[].from",
|
|
10106
|
+
"type": "integer",
|
|
10107
|
+
"required": true
|
|
10108
|
+
},
|
|
10109
|
+
{
|
|
10110
|
+
"path": "[].to",
|
|
10111
|
+
"type": "integer",
|
|
10112
|
+
"required": true
|
|
10067
10113
|
}
|
|
10068
10114
|
],
|
|
10069
10115
|
"default": "[]"
|
|
@@ -10137,26 +10183,57 @@
|
|
|
10137
10183
|
},
|
|
10138
10184
|
{
|
|
10139
10185
|
"name": "image-activate",
|
|
10140
|
-
"detailType": "{ src: string; trigger: \"
|
|
10141
|
-
"detailSchema": "object
|
|
10186
|
+
"detailType": "{ readonly src: string; readonly trigger: \"pointer\" | \"keyboard\"; readonly [name: string]: unknown }",
|
|
10187
|
+
"detailSchema": "object",
|
|
10188
|
+
"fields": [
|
|
10189
|
+
{
|
|
10190
|
+
"path": "src",
|
|
10191
|
+
"type": "string",
|
|
10192
|
+
"required": true
|
|
10193
|
+
},
|
|
10194
|
+
{
|
|
10195
|
+
"path": "trigger",
|
|
10196
|
+
"type": "keyword",
|
|
10197
|
+
"required": true,
|
|
10198
|
+
"values": [
|
|
10199
|
+
"pointer",
|
|
10200
|
+
"keyboard"
|
|
10201
|
+
]
|
|
10202
|
+
}
|
|
10203
|
+
],
|
|
10142
10204
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10143
10205
|
},
|
|
10144
10206
|
{
|
|
10145
10207
|
"name": "image-rendition-error",
|
|
10146
|
-
"detailType": "{ src: string; trigger: \"
|
|
10147
|
-
"detailSchema": "object
|
|
10208
|
+
"detailType": "{ readonly src: string; readonly trigger: \"programmatic\"; readonly [name: string]: unknown }",
|
|
10209
|
+
"detailSchema": "object",
|
|
10210
|
+
"fields": [
|
|
10211
|
+
{
|
|
10212
|
+
"path": "src",
|
|
10213
|
+
"type": "string",
|
|
10214
|
+
"required": true
|
|
10215
|
+
},
|
|
10216
|
+
{
|
|
10217
|
+
"path": "trigger",
|
|
10218
|
+
"type": "keyword",
|
|
10219
|
+
"required": true,
|
|
10220
|
+
"values": [
|
|
10221
|
+
"programmatic"
|
|
10222
|
+
]
|
|
10223
|
+
}
|
|
10224
|
+
],
|
|
10148
10225
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10149
10226
|
},
|
|
10150
10227
|
{
|
|
10151
10228
|
"name": "range-action",
|
|
10152
|
-
"detailType": "{
|
|
10153
|
-
"detailSchema": "object({
|
|
10229
|
+
"detailType": "{ id: string; ranges: ReadonlyArray<{ from: number; to: number }> }",
|
|
10230
|
+
"detailSchema": "object({ id: string, ranges: list(object({ from: integer, to: integer })) })",
|
|
10154
10231
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10155
10232
|
},
|
|
10156
10233
|
{
|
|
10157
10234
|
"name": "selection-action",
|
|
10158
|
-
"detailType": "{
|
|
10159
|
-
"detailSchema": "object({
|
|
10235
|
+
"detailType": "{ id: string; from: number; to: number; text: string; before: string; after: string }",
|
|
10236
|
+
"detailSchema": "object({ id: string, from: integer, to: integer, text: string, before: string, after: string })",
|
|
10160
10237
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10161
10238
|
},
|
|
10162
10239
|
{
|
package/package.json
CHANGED
|
@@ -11,7 +11,9 @@ export interface UiCycleButtonElement extends HTMLSpanElement {
|
|
|
11
11
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
12
12
|
}
|
|
13
13
|
export interface UiCycleButtonProps {
|
|
14
|
+
description?: string | null;
|
|
14
15
|
disabled?: boolean | null;
|
|
16
|
+
emptyLabel?: string | null;
|
|
15
17
|
index?: number | null;
|
|
16
18
|
items: readonly ({ readonly value: string; readonly label: string; readonly icon: string })[];
|
|
17
19
|
label?: string | null;
|
package/vanilla/UiCycleButton.js
CHANGED
|
@@ -3,10 +3,10 @@ import { attachGeneratedController, stateInitializers, binaryValue, buildTemplat
|
|
|
3
3
|
import * as controller from "../components/ui-cycle-button/ui-cycle-button.js";
|
|
4
4
|
import "../styles/ui-cycle-button.css";
|
|
5
5
|
|
|
6
|
-
const T0 = ["",[],["ui-icon-button",["tone","neutral"
|
|
6
|
+
const T0 = ["",[],["ui-icon-button",["tone","neutral"],["ui-icon",[]]]];
|
|
7
7
|
let P0;
|
|
8
8
|
const S = { n: ["current","selected"], t: ["n","?"], f: import.meta.url, g: "ui-cycle-button", k: 1, d: { "change": [detailCheck(checkObject([["value", checkString, false], ["index", checkNumber, false]], false)), true, true, false] }, x: dispatchDeclared, r: readonlyView, a: (host, I) => C(host, I), b: generatedInputs };
|
|
9
|
-
const D = { g: "ui-cycle-button", props: { "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "index": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "items": { "required":true, c: checkList(checkObject([["value", checkString, false], ["label", checkString, false], ["icon", checkString, false]], false)), j: 1, m: ["l",["o",["value","s","label","s","icon","s"]]] }, "label": { "required":false,"default":"State", c: checkString, t: "string", j: 0, m: "s" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["ghost","outline","solid"],"default":"outline", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
|
|
9
|
+
const D = { g: "ui-cycle-button", props: { "description": { "required":false,"default":"Activate to choose the next state.", c: checkString, t: "string", j: 0, m: "s" }, "disabled": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "emptyLabel": { "required":false,"default":"No choices", c: checkString, t: "string", j: 0, m: "s" }, "index": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "items": { "required":true, c: checkList(checkObject([["value", checkString, false], ["label", checkString, false], ["icon", checkString, false]], false)), j: 1, m: ["l",["o",["value","s","label","s","icon","s"]]] }, "label": { "required":false,"default":"State", c: checkString, t: "string", j: 0, m: "s" }, "size": { "required":false,"values":["sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["ghost","outline","solid"],"default":"outline", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
|
|
10
10
|
const C = (host) => activateModule(controller, host);
|
|
11
11
|
|
|
12
12
|
export function createUiCycleButton(options, html) {
|
|
@@ -18,13 +18,13 @@ export function createUiCycleButton(options, html) {
|
|
|
18
18
|
}
|
|
19
19
|
element.setAttribute("data-component", "ui-cycle-button");
|
|
20
20
|
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
21
|
-
const v = [null, undefined, null, null, null, null, null, null];
|
|
21
|
+
const v = [null, undefined, null, null, null, null, null, null, null, null];
|
|
22
22
|
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
23
23
|
const CS = [];
|
|
24
|
-
const inputStatus = (j) => { if (j === 0) return E.status(j); if (j >= 1 && j < 2) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 2) return awaitInput(B, "
|
|
24
|
+
const inputStatus = (j) => { if (j === 0) return E.status(j); if (j >= 1 && j < 2) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 2) return awaitInput(B, "description", true); if (j === 3) return awaitInput(B, "disabled", true); if (j === 4) return awaitInput(B, "emptyLabel", true); if (j === 5) return awaitInput(B, "index", true); if (j === 6) return awaitInput(B, "items", true); if (j === 7) return awaitInput(B, "label", true); if (j === 8) return awaitInput(B, "size", true); if (j === 9) return awaitInput(B, "variant", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
|
|
25
25
|
const X = { e: 0, g: (j) => g(j), w: new Set(), a: CS, i: inputStatus };
|
|
26
26
|
const ke = [];
|
|
27
|
-
const K = [() => (checkReference(S, v[0], "n", "expression:default($items[default($current, 0)], $items[0]):current", "Reference `current` must satisfy number.") && checkReference(S, readDeclared(v[
|
|
27
|
+
const K = [() => (checkReference(S, v[0], "n", "expression:default($items[default($current, 0)], $items[0]):current", "Reference `current` must satisfy number.") && checkReference(S, readDeclared(v[6], ["0"]), ["o",["value","s","label","s","icon","s"]], "expression:default($items[default($current, 0)], $items[0]):items.0", "Reference `items.0` must satisfy object({ value: string, label: string, icon: string }).") ? inputDefault(() => readIndex(inputRead(v[6], inputStatus(6)), inputDefault(() => inputRead(E.read(0), inputStatus(0)), () => 0, ABSENT)), () => readIndex(inputRead(v[6], inputStatus(6)), 0), ABSENT) : NONCONFORMING)];
|
|
28
28
|
const g = (j) => {
|
|
29
29
|
const i = j - 1;
|
|
30
30
|
if (ke[i] === X.e) return v[j];
|
|
@@ -37,10 +37,10 @@ export function createUiCycleButton(options, html) {
|
|
|
37
37
|
if (!Object.is(previous, next)) { v[j] = next; X.n?.(j, previous, next); }
|
|
38
38
|
return next;
|
|
39
39
|
};
|
|
40
|
-
const E = stateInitializers(S, v, X, { 0: () => inputRead(v[
|
|
40
|
+
const E = stateInitializers(S, v, X, { 0: () => inputRead(v[5], inputStatus(5)) });
|
|
41
41
|
const p0 = (r, c, d) => {
|
|
42
|
-
if (c &
|
|
43
|
-
const x0 = textCall("concat", [v[
|
|
42
|
+
if (c & 1073742033) {
|
|
43
|
+
const x0 = textCall("concat", [v[7], ": ", defaultValue(readFailing(g(1), "label"), v[4])]);
|
|
44
44
|
if (x0 !== NONCONFORMING) {
|
|
45
45
|
const s0 = toAttribute(x0, "label");
|
|
46
46
|
if (s0 !== r.v0) writeAttribute(r.a0, "label", r.v0 = s0);
|
|
@@ -50,36 +50,41 @@ export function createUiCycleButton(options, html) {
|
|
|
50
50
|
if (s1 !== r.v1) writeAttribute(r.a0, "title", r.v1 = s1);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
if (c &
|
|
54
|
-
const x1 = v[
|
|
53
|
+
if (c & 1073742080) {
|
|
54
|
+
const x1 = v[8];
|
|
55
55
|
const s2 = toAttribute(x1, "size");
|
|
56
56
|
if (s2 !== r.v2) writeAttribute(r.a0, "size", r.v2 = s2);
|
|
57
57
|
}
|
|
58
|
-
if (c &
|
|
59
|
-
const x2 = v[
|
|
58
|
+
if (c & 1073742336) {
|
|
59
|
+
const x2 = v[9];
|
|
60
60
|
const s3 = toAttribute(x2, "variant");
|
|
61
61
|
if (s3 !== r.v3) writeAttribute(r.a0, "variant", r.v3 = s3);
|
|
62
62
|
}
|
|
63
|
-
if (c &
|
|
64
|
-
const x3 = (truthy(v[
|
|
63
|
+
if (c & 1073741896) {
|
|
64
|
+
const x3 = (truthy(v[3]) || truthy(binaryValue("<", readMember(v[6], "length"), 2)));
|
|
65
65
|
const s4 = toAttribute(x3, "disabled");
|
|
66
66
|
if (s4 !== r.v4) writeAttribute(r.a0, "disabled", r.v4 = s4);
|
|
67
67
|
}
|
|
68
|
-
if (c &
|
|
69
|
-
const x4 =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
if (c & 4) {
|
|
69
|
+
const x4 = v[2];
|
|
70
|
+
const s5 = toAttribute(x4, "aria-description");
|
|
71
|
+
if (s5 !== r.v5) writeAttribute(r.a0, "aria-description", r.v5 = s5);
|
|
72
|
+
}
|
|
73
|
+
if (c & 1073741889) {
|
|
74
|
+
const x5 = defaultValue(readFailing(g(1), "icon"), "");
|
|
75
|
+
if (x5 !== NONCONFORMING) {
|
|
76
|
+
const s6 = toAttribute(x5, "name");
|
|
77
|
+
if (s6 !== r.v6) writeAttribute(r.a1, "name", r.v6 = s6);
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
};
|
|
76
81
|
const t0 = element.firstChild;
|
|
77
82
|
const t1 = t0.firstChild;
|
|
78
|
-
const R = { a0: t0, a1: t1, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null };
|
|
83
|
+
const R = { a0: t0, a1: t1, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null };
|
|
79
84
|
const I = { B, U: E };
|
|
80
85
|
I.R = new Set();
|
|
81
86
|
attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, X, I);
|
|
82
87
|
manageProps(I);
|
|
83
88
|
return element;
|
|
84
89
|
}
|
|
85
|
-
defineComponent("ui-cycle-button", createUiCycleButton, ["disabled","index","items","label","size","variant"]);
|
|
90
|
+
defineComponent("ui-cycle-button", createUiCycleButton, ["description","disabled","emptyLabel","index","items","label","size","variant"]);
|
package/vanilla/UiEditor.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ export interface UiEditorEventMap {
|
|
|
4
4
|
change: CustomEvent<{ readonly content: { readonly type: string; readonly [name: string]: unknown } }>;
|
|
5
5
|
"toolbar-open": CustomEvent<{ readonly [name: string]: unknown }>;
|
|
6
6
|
"toolbar-close": CustomEvent<{ readonly [name: string]: unknown }>;
|
|
7
|
-
"selection-action": CustomEvent<{ readonly
|
|
8
|
-
"range-action": CustomEvent<{ readonly
|
|
7
|
+
"selection-action": CustomEvent<{ readonly id: string; readonly from: number; readonly to: number; readonly text: string; readonly before: string; readonly after: string }>;
|
|
8
|
+
"range-action": CustomEvent<{ readonly id: string; readonly ranges: readonly ({ readonly from: number; readonly to: number })[] }>;
|
|
9
9
|
"upload-error": CustomEvent<{ readonly error: unknown; readonly file: unknown }>;
|
|
10
|
-
"image-activate": CustomEvent<{ readonly src: string; readonly trigger:
|
|
11
|
-
"image-rendition-error": CustomEvent<{ readonly src: string; readonly trigger:
|
|
10
|
+
"image-activate": CustomEvent<{ readonly src: string; readonly trigger: "pointer" | "keyboard"; readonly [name: string]: unknown }>;
|
|
11
|
+
"image-rendition-error": CustomEvent<{ readonly src: string; readonly trigger: "programmatic"; readonly [name: string]: unknown }>;
|
|
12
12
|
extensions: RequestEvent<null, readonly (unknown)[]>;
|
|
13
13
|
"slash-commands": RequestEvent<{ readonly defaults: readonly (unknown)[] }, readonly (unknown)[]>;
|
|
14
|
-
"mention-query": RequestEvent<{ readonly query: string; readonly limit: number }, readonly ({ readonly id: string; readonly label: string; readonly
|
|
15
|
-
"link-search": RequestEvent<{ readonly query: string }, readonly ({ readonly id: string; readonly label: string; readonly href: string; readonly
|
|
16
|
-
"link-resolve": RequestEvent<{ readonly href: string }, { readonly id: string; readonly label: string; readonly href: string; readonly
|
|
14
|
+
"mention-query": RequestEvent<{ readonly query: string; readonly limit: number }, readonly ({ readonly id: string; readonly label: string; readonly detail?: string | null; readonly initials?: string | null })[]>;
|
|
15
|
+
"link-search": RequestEvent<{ readonly query: string }, readonly ({ readonly id: string; readonly label: string; readonly href: string; readonly detail?: string | null })[]>;
|
|
16
|
+
"link-resolve": RequestEvent<{ readonly href: string }, { readonly id: string; readonly label: string; readonly href: string; readonly detail?: string | null }>;
|
|
17
17
|
"image-upload": RequestEvent<{ readonly file: unknown }, { readonly src: string; readonly [name: string]: unknown }>;
|
|
18
18
|
"file-upload": RequestEvent<{ readonly file: unknown }, { readonly href: string; readonly name: string; readonly size: number; readonly contentType: string; readonly [name: string]: unknown }>;
|
|
19
19
|
"code-languages": RequestEvent<null, { readonly [name: string]: unknown }>;
|
|
@@ -36,10 +36,10 @@ export interface UiEditorProps {
|
|
|
36
36
|
label?: string | null;
|
|
37
37
|
linkBaseUrl?: string | null;
|
|
38
38
|
linkTargetLabel?: string | null;
|
|
39
|
-
mentionItems?: readonly ({ readonly id: string; readonly label: string; readonly detail?: string | null; readonly initials?: string | null
|
|
39
|
+
mentionItems?: readonly ({ readonly id: string; readonly label: string; readonly detail?: string | null; readonly initials?: string | null })[] | null;
|
|
40
40
|
mentionLimit?: number | null;
|
|
41
41
|
placeholder?: string | null;
|
|
42
|
-
rangeActions?: readonly ({ readonly id: string; readonly label: string; readonly
|
|
42
|
+
rangeActions?: readonly ({ readonly id: string; readonly label: string; readonly from: number; readonly to: number })[] | null;
|
|
43
43
|
references?: { readonly [name: string]: unknown } | null;
|
|
44
44
|
selectionActions?: readonly ({ readonly id: string; readonly label: string })[] | null;
|
|
45
45
|
toolbarMode?: "bubble" | "sticky" | "popover" | "contextual" | null;
|
package/vanilla/UiEditor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.76 for Vanilla DOM. Do not edit.
|
|
2
|
-
import { attachGeneratedController, buildTemplate, clearRegion, KeyedList, NONCONFORMING, readMember, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, writeUrlAttribute, dispatchDeclared, detailCheck, plainObject, dispose, formatOf, keywordFormat, acceptProps, manageProps, generatedInputs, project, fillSlot, RangedIndexedList, checkBoolean, checkFormat, checkInteger, checkList, checkObject, checkString, checkUnknown, requestHost, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
2
|
+
import { attachGeneratedController, buildTemplate, clearRegion, KeyedList, NONCONFORMING, readMember, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, writeUrlAttribute, dispatchDeclared, detailCheck, plainObject, dispose, formatOf, keywordFormat, acceptProps, manageProps, generatedInputs, project, fillSlot, RangedIndexedList, checkBoolean, checkConstrained, checkFormat, checkInteger, checkList, checkObject, checkString, checkUnknown, requestHost, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
3
|
import * as controller from "../components/ui-editor/ui-editor.js";
|
|
4
4
|
import "../styles/ui-editor.css";
|
|
5
5
|
|
|
@@ -43,8 +43,8 @@ const T36 = ["ui-editor-table-overlay",["open",""]];
|
|
|
43
43
|
const T37 = ["div",["class","looma-editor__table-menu-shell"],"\n ",["ui-editor-table-context-menu",["open",""]],"\n "];
|
|
44
44
|
let P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, P23, P24, P25, P26, P27, P28, P29, P30, P31, P32, P33, P34, P35, P36, P37;
|
|
45
45
|
const E = new Map();
|
|
46
|
-
const S = { n: ["view"], t: [["o",[],1]], f: import.meta.url, g: "ui-editor", d: { "change": [detailCheck(checkObject([["content", checkObject([["type", checkString, false]], true), false]], false)), true, true, false], "toolbar-open": [detailCheck(checkObject([], true)), true, true, false], "toolbar-close": [detailCheck(checkObject([], true)), true, true, false], "selection-action": [detailCheck(checkObject([],
|
|
47
|
-
const D = { g: "ui-editor", props: { "compactToolbar": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "content": { "required":false,"default":{"type":"doc","content":[{"type":"paragraph"}]}, c: checkObject([["type", checkString, false]], true), j: 1, m: ["o",["type","s"],1] }, "contentDensity": { "required":false,"values":["comfortable","compact"],"default":"comfortable", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "disableHighlight": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "editable": { "required":false,"default":true, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "label": { "required":false,"default":"Document", c: checkString, t: "string", j: 0, m: "s" }, "linkBaseUrl": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "linkTargetLabel": { "required":false,"default":"Item", c: checkString, t: "string", j: 0, m: "s" }, "mentionItems": { "required":false,"default":[], c: checkList(checkObject([["id", checkString, false], ["label", checkString, false], ["detail", checkString, true], ["initials", checkString, true]],
|
|
46
|
+
const S = { n: ["view"], t: [["o",[],1]], f: import.meta.url, g: "ui-editor", d: { "change": [detailCheck(checkObject([["content", checkObject([["type", checkString, false]], true), false]], false)), true, true, false], "toolbar-open": [detailCheck(checkObject([], true)), true, true, false], "toolbar-close": [detailCheck(checkObject([], true)), true, true, false], "selection-action": [detailCheck(checkObject([["id", checkString, false], ["from", checkInteger, false], ["to", checkInteger, false], ["text", checkString, false], ["before", checkString, false], ["after", checkString, false]], false)), true, true, false], "range-action": [detailCheck(checkObject([["id", checkString, false], ["ranges", checkList(checkObject([["from", checkInteger, false], ["to", checkInteger, false]], false)), false]], false)), true, true, false], "upload-error": [detailCheck(checkObject([["error", checkUnknown, false], ["file", checkUnknown, false]], false)), true, true, false], "image-activate": [detailCheck(checkObject([["src", checkString, false], ["trigger", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["pointer","keyboard"]}), false]], true)), true, true, false], "image-rendition-error": [detailCheck(checkObject([["src", checkString, false], ["trigger", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["programmatic"]}), false]], true)), true, true, false] }, x: dispatchDeclared, q: { "extensions": [(v0) => v0 === null, (v0) => (Array.isArray(v0) && v0.every((v1) => true))], "slash-commands": [(v0) => (plainObject(v0) && "defaults" in v0 && (Array.isArray(v0["defaults"]) && v0["defaults"].every((v1) => true)) && Object.keys(v0).every((v1) => ["defaults"].includes(v1))), (v0) => (Array.isArray(v0) && v0.every((v1) => true))], "mention-query": [(v0) => (plainObject(v0) && "query" in v0 && typeof v0["query"] == "string" && "limit" in v0 && Number.isInteger(v0["limit"]) && Object.keys(v0).every((v1) => ["query","limit"].includes(v1))), (v0) => (Array.isArray(v0) && v0.every((v1) => (plainObject(v1) && "id" in v1 && typeof v1["id"] == "string" && "label" in v1 && typeof v1["label"] == "string" && (v1["detail"] == null || typeof v1["detail"] == "string") && (v1["initials"] == null || typeof v1["initials"] == "string") && Object.keys(v1).every((v2) => ["id","label","detail","initials"].includes(v2)))))], "link-search": [(v0) => (plainObject(v0) && "query" in v0 && typeof v0["query"] == "string" && Object.keys(v0).every((v1) => ["query"].includes(v1))), (v0) => (Array.isArray(v0) && v0.every((v1) => (plainObject(v1) && "id" in v1 && typeof v1["id"] == "string" && "label" in v1 && typeof v1["label"] == "string" && "href" in v1 && typeof v1["href"] == "string" && (v1["detail"] == null || typeof v1["detail"] == "string") && Object.keys(v1).every((v2) => ["id","label","href","detail"].includes(v2)))))], "link-resolve": [(v0) => (plainObject(v0) && "href" in v0 && typeof v0["href"] == "string" && Object.keys(v0).every((v1) => ["href"].includes(v1))), (v0) => (plainObject(v0) && "id" in v0 && typeof v0["id"] == "string" && "label" in v0 && typeof v0["label"] == "string" && "href" in v0 && typeof v0["href"] == "string" && (v0["detail"] == null || typeof v0["detail"] == "string") && Object.keys(v0).every((v1) => ["id","label","href","detail"].includes(v1)))], "image-upload": [(v0) => (plainObject(v0) && "file" in v0 && true && Object.keys(v0).every((v1) => ["file"].includes(v1))), (v0) => (plainObject(v0) && "src" in v0 && typeof v0["src"] == "string")], "file-upload": [(v0) => (plainObject(v0) && "file" in v0 && true && Object.keys(v0).every((v1) => ["file"].includes(v1))), (v0) => (plainObject(v0) && "href" in v0 && typeof v0["href"] == "string" && "name" in v0 && typeof v0["name"] == "string" && "size" in v0 && Number.isFinite(v0["size"]) && "contentType" in v0 && typeof v0["contentType"] == "string")], "code-languages": [(v0) => v0 === null, (v0) => (plainObject(v0))], "image-delivery": [(v0) => v0 === null, (v0) => true] }, a: (host, I) => C(host, I), b: generatedInputs, i: [{ }] };
|
|
47
|
+
const D = { g: "ui-editor", props: { "compactToolbar": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "content": { "required":false,"default":{"type":"doc","content":[{"type":"paragraph"}]}, c: checkObject([["type", checkString, false]], true), j: 1, m: ["o",["type","s"],1] }, "contentDensity": { "required":false,"values":["comfortable","compact"],"default":"comfortable", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "disableHighlight": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "editable": { "required":false,"default":true, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "label": { "required":false,"default":"Document", c: checkString, t: "string", j: 0, m: "s" }, "linkBaseUrl": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "linkTargetLabel": { "required":false,"default":"Item", c: checkString, t: "string", j: 0, m: "s" }, "mentionItems": { "required":false,"default":[], c: checkList(checkObject([["id", checkString, false], ["label", checkString, false], ["detail", checkString, true], ["initials", checkString, true]], false)), j: 1, m: ["l",["o",["id","s","label","s","detail","s","initials","s"]]] }, "mentionLimit": { "required":false,"default":8, c: checkInteger, t: "integer", j: 0, m: "i" }, "placeholder": { "required":false,"default":"Type “/” for commands, or start writing…", c: checkString, t: "string", j: 0, m: "s" }, "rangeActions": { "required":false,"default":[], c: checkList(checkObject([["id", checkString, false], ["label", checkString, false], ["from", checkInteger, false], ["to", checkInteger, false]], false)), j: 1, m: ["l",["o",["id","s","label","s","from","i","to","i"]]] }, "references": { "required":false, c: checkObject([], true), j: 1, m: ["o",[],1] }, "selectionActions": { "required":false,"default":[], c: checkList(checkObject([["id", checkString, false], ["label", checkString, false]], false)), j: 1, m: ["l",["o",["id","s","label","s"]]] }, "toolbarMode": { "required":false,"values":["bubble","sticky","popover","contextual"],"default":"bubble", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "toolbarOpen": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "toolbarTriggerId": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
|
|
48
48
|
const C = (host, I) => activateModule(controller, requestHost(host, I));
|
|
49
49
|
|
|
50
50
|
export function createUiEditor(options = {}, html) {
|