@threadlabs/looma 0.49.0 → 0.49.1
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-editor/ui-editor.html +24 -9
- package/dist/index.js +1 -1
- package/docs/catalog.json +62 -11
- package/package.json +1 -1
- 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.1",
|
|
502
502
|
"groups": [
|
|
503
503
|
{
|
|
504
504
|
"id": "layout",
|
|
@@ -9893,6 +9893,16 @@
|
|
|
9893
9893
|
"path": "[].label",
|
|
9894
9894
|
"type": "string",
|
|
9895
9895
|
"required": true
|
|
9896
|
+
},
|
|
9897
|
+
{
|
|
9898
|
+
"path": "[].from",
|
|
9899
|
+
"type": "integer",
|
|
9900
|
+
"required": true
|
|
9901
|
+
},
|
|
9902
|
+
{
|
|
9903
|
+
"path": "[].to",
|
|
9904
|
+
"type": "integer",
|
|
9905
|
+
"required": true
|
|
9896
9906
|
}
|
|
9897
9907
|
],
|
|
9898
9908
|
"default": "[]"
|
|
@@ -10013,7 +10023,7 @@
|
|
|
10013
10023
|
{
|
|
10014
10024
|
"name": "mentionItems",
|
|
10015
10025
|
"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
|
|
10026
|
+
"type": "readonly ({ readonly id: string; readonly label: string; readonly detail?: string | null; readonly initials?: string | null })[]",
|
|
10017
10027
|
"fields": [
|
|
10018
10028
|
{
|
|
10019
10029
|
"path": "[].id",
|
|
@@ -10053,7 +10063,7 @@
|
|
|
10053
10063
|
{
|
|
10054
10064
|
"name": "rangeActions",
|
|
10055
10065
|
"description": "Application caret actions with host-owned durable ranges.",
|
|
10056
|
-
"type": "readonly ({ readonly id: string; readonly label: string; readonly
|
|
10066
|
+
"type": "readonly ({ readonly id: string; readonly label: string; readonly from: number; readonly to: number })[]",
|
|
10057
10067
|
"fields": [
|
|
10058
10068
|
{
|
|
10059
10069
|
"path": "[].id",
|
|
@@ -10064,6 +10074,16 @@
|
|
|
10064
10074
|
"path": "[].label",
|
|
10065
10075
|
"type": "string",
|
|
10066
10076
|
"required": true
|
|
10077
|
+
},
|
|
10078
|
+
{
|
|
10079
|
+
"path": "[].from",
|
|
10080
|
+
"type": "integer",
|
|
10081
|
+
"required": true
|
|
10082
|
+
},
|
|
10083
|
+
{
|
|
10084
|
+
"path": "[].to",
|
|
10085
|
+
"type": "integer",
|
|
10086
|
+
"required": true
|
|
10067
10087
|
}
|
|
10068
10088
|
],
|
|
10069
10089
|
"default": "[]"
|
|
@@ -10137,26 +10157,57 @@
|
|
|
10137
10157
|
},
|
|
10138
10158
|
{
|
|
10139
10159
|
"name": "image-activate",
|
|
10140
|
-
"detailType": "{ src: string; trigger: \"
|
|
10141
|
-
"detailSchema": "object
|
|
10160
|
+
"detailType": "{ readonly src: string; readonly trigger: \"pointer\" | \"keyboard\"; readonly [name: string]: unknown }",
|
|
10161
|
+
"detailSchema": "object",
|
|
10162
|
+
"fields": [
|
|
10163
|
+
{
|
|
10164
|
+
"path": "src",
|
|
10165
|
+
"type": "string",
|
|
10166
|
+
"required": true
|
|
10167
|
+
},
|
|
10168
|
+
{
|
|
10169
|
+
"path": "trigger",
|
|
10170
|
+
"type": "keyword",
|
|
10171
|
+
"required": true,
|
|
10172
|
+
"values": [
|
|
10173
|
+
"pointer",
|
|
10174
|
+
"keyboard"
|
|
10175
|
+
]
|
|
10176
|
+
}
|
|
10177
|
+
],
|
|
10142
10178
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10143
10179
|
},
|
|
10144
10180
|
{
|
|
10145
10181
|
"name": "image-rendition-error",
|
|
10146
|
-
"detailType": "{ src: string; trigger: \"
|
|
10147
|
-
"detailSchema": "object
|
|
10182
|
+
"detailType": "{ readonly src: string; readonly trigger: \"programmatic\"; readonly [name: string]: unknown }",
|
|
10183
|
+
"detailSchema": "object",
|
|
10184
|
+
"fields": [
|
|
10185
|
+
{
|
|
10186
|
+
"path": "src",
|
|
10187
|
+
"type": "string",
|
|
10188
|
+
"required": true
|
|
10189
|
+
},
|
|
10190
|
+
{
|
|
10191
|
+
"path": "trigger",
|
|
10192
|
+
"type": "keyword",
|
|
10193
|
+
"required": true,
|
|
10194
|
+
"values": [
|
|
10195
|
+
"programmatic"
|
|
10196
|
+
]
|
|
10197
|
+
}
|
|
10198
|
+
],
|
|
10148
10199
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10149
10200
|
},
|
|
10150
10201
|
{
|
|
10151
10202
|
"name": "range-action",
|
|
10152
|
-
"detailType": "{
|
|
10153
|
-
"detailSchema": "object({
|
|
10203
|
+
"detailType": "{ id: string; ranges: ReadonlyArray<{ from: number; to: number }> }",
|
|
10204
|
+
"detailSchema": "object({ id: string, ranges: list(object({ from: integer, to: integer })) })",
|
|
10154
10205
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10155
10206
|
},
|
|
10156
10207
|
{
|
|
10157
10208
|
"name": "selection-action",
|
|
10158
|
-
"detailType": "{
|
|
10159
|
-
"detailSchema": "object({
|
|
10209
|
+
"detailType": "{ id: string; from: number; to: number; text: string; before: string; after: string }",
|
|
10210
|
+
"detailSchema": "object({ id: string, from: integer, to: integer, text: string, before: string, after: string })",
|
|
10160
10211
|
"detailDocs": "Emitted with the declared detail payload."
|
|
10161
10212
|
},
|
|
10162
10213
|
{
|
package/package.json
CHANGED
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) {
|