@threadlabs/looma 0.28.4 → 0.28.5
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/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +96 -0
- package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.js +56 -0
- package/dist/index.js +34 -33
- package/package.json +1 -1
- package/styles/ui-editor-image-toolbar.css +1 -0
- package/vanilla/UiEditorImageToolbar.d.ts +19 -0
- package/vanilla/UiEditorImageToolbar.js +171 -0
- package/vanilla/index.js +1 -0
- package/vue/UiEditorImageToolbar.d.ts +54 -0
- package/vue/UiEditorImageToolbar.js +2 -0
- package/vue/UiEditorImageToolbar.vue +625 -0
- package/vue/UiText.d.ts +1 -1
- package/vue/chunks/UiEditorImageToolbar.js +584 -0
- package/vue/components.css +2142 -2142
- package/vue/editor/index.js +41 -170
- package/vue/editor/primitives.d.ts +9 -1
- package/vue/index.d.ts +1 -0
- package/vue/index.js +9 -8
- package/vue/editor/image-controls.d.ts +0 -19
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Generated by HTML Next 1.0.0-alpha.35. Do not edit. */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.35 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiEditorImageToolbarEventMap {
|
|
3
|
+
placement: CustomEvent<{ readonly placement: "block" | "center" | "wrap-left" | "wrap-right" }>;
|
|
4
|
+
describe: CustomEvent<{ readonly alt: string }>;
|
|
5
|
+
delete: CustomEvent<Readonly<Record<string, unknown>>>;
|
|
6
|
+
}
|
|
7
|
+
export interface UiEditorImageToolbarElement extends HTMLDivElement {
|
|
8
|
+
addEventListener<K extends keyof UiEditorImageToolbarEventMap>(type: K, listener: (this: UiEditorImageToolbarElement, event: UiEditorImageToolbarEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
9
|
+
removeEventListener<K extends keyof UiEditorImageToolbarEventMap>(type: K, listener: (this: UiEditorImageToolbarElement, event: UiEditorImageToolbarEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
10
|
+
}
|
|
11
|
+
export interface UiEditorImageToolbarProps {
|
|
12
|
+
alt?: string | null;
|
|
13
|
+
placement?: "block" | "center" | "wrap-left" | "wrap-right" | null;
|
|
14
|
+
target?: string | null;
|
|
15
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
16
|
+
children?: readonly (string | Node)[];
|
|
17
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createUiEditorImageToolbar(props?: UiEditorImageToolbarProps): UiEditorImageToolbarElement;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.35 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { attachGeneratedController, buildTemplate, NONCONFORMING, readIndex, textCall, toAttribute, writeAttribute, dispatchDeclared, detailCheck, formatOf, keywordFormat, acceptProps, manageProps, checkConstrained, checkFormat, checkObject, checkRecord, checkString, checkUnknown } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import * as controller from "../components/ui-editor-image-toolbar/ui-editor-image-toolbar.js";
|
|
4
|
+
import "../styles/ui-editor-image-toolbar.css";
|
|
5
|
+
|
|
6
|
+
const T0 = ["",[],["ui-text",["as","div","font","sans"],["ui-editor-toolbar",["aria-label","Image actions"],["ui-icon-button",["label","Image in line","size","sm","data-image-placement","block"],["ui-icon",["name","panel-top","size","sm"]]],["ui-icon-button",["label","Center image","size","sm","data-image-placement","center"],["ui-icon",["name","align-center","size","sm"]]],["ui-icon-button",["label","Wrap text to the right","size","sm","data-image-placement","wrap-left"],["ui-icon",["name","panel-left","size","sm"]]],["ui-icon-button",["label","Wrap text to the left","size","sm","data-image-placement","wrap-right"],["ui-icon",["name","panel-right","size","sm"]]],["ui-icon-button",["label","Image description","size","sm","variant","ghost"],["ui-icon",["name","file-text","size","sm"]]],["ui-icon-button",["label","Delete image","size","sm","variant","ghost","data-image-action","delete"],["ui-icon",["name","trash","size","sm"]]]],["ui-tooltip",[],"Image in line"],["ui-tooltip",[],"Center image"],["ui-tooltip",[],"Wrap text to the right"],["ui-tooltip",[],"Wrap text to the left"],["ui-tooltip",[],"Image description"],["ui-tooltip",[],"Delete image"],["ui-popover",["data-image-description","","size","sm","aria-label","Image description"],["form",["aria-label","Image description"],["ui-stack",["gap","s"],["ui-form-field",[],["label",["slot","label"],"Alt text"],["ui-input",["data-image-alt","","size","sm"]]],["ui-text",["size","xs","tone","secondary"],"Describe the image for people using a screen reader."],["ui-cluster",["justify","end","gap","xs"],["ui-button",["type","button","variant","ghost","tone","neutral","size","sm","data-image-action","cancel"],"Cancel"],["ui-button",["type","submit","variant","solid","size","sm"],"Save"]]]]]]];
|
|
7
|
+
let P0;
|
|
8
|
+
const S = { n: ["base","describing","draft"], t: ["s","b","s"], f: import.meta.url, g: "ui-editor-image-toolbar", d: { "placement": [detailCheck(checkObject([["placement", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["block","center","wrap-left","wrap-right"]}), false]], false)), true, true, false], "describe": [detailCheck(checkObject([["alt", checkString, false]], false)), true, true, false], "delete": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared };
|
|
9
|
+
const D = { props: { "alt": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "placement": { "required":false,"values":["block","center","wrap-left","wrap-right"],"default":"block", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "target": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
|
|
10
|
+
const C = (host) => controller.default(host);
|
|
11
|
+
|
|
12
|
+
export function createUiEditorImageToolbar(options = {}, html) {
|
|
13
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
14
|
+
const element = document.createElement("div");
|
|
15
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
16
|
+
if (value === null || value === undefined || value === false) continue;
|
|
17
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
18
|
+
}
|
|
19
|
+
element.setAttribute("data-component", "ui-editor-image-toolbar");
|
|
20
|
+
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
21
|
+
const v = ["ui-editor-image-toolbar", false, "", null, null, null];
|
|
22
|
+
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
23
|
+
const p0 = (r, c, d) => {
|
|
24
|
+
if (c === -1) {
|
|
25
|
+
const x0 = true;
|
|
26
|
+
const s0 = toAttribute(x0, "floating");
|
|
27
|
+
if (s0 !== r.v0) writeAttribute(r.a0, "floating", r.v0 = s0);
|
|
28
|
+
}
|
|
29
|
+
if (c & 1) {
|
|
30
|
+
const x1 = textCall("concat", [v[0], "-block"]);
|
|
31
|
+
if (x1 !== NONCONFORMING) {
|
|
32
|
+
const s1 = toAttribute(x1, "id");
|
|
33
|
+
if (s1 !== r.v1) writeAttribute(r.a1, "id", r.v1 = s1);
|
|
34
|
+
}
|
|
35
|
+
const x2 = textCall("concat", [v[0], "-center"]);
|
|
36
|
+
if (x2 !== NONCONFORMING) {
|
|
37
|
+
const s4 = toAttribute(x2, "id");
|
|
38
|
+
if (s4 !== r.v4) writeAttribute(r.a2, "id", r.v4 = s4);
|
|
39
|
+
}
|
|
40
|
+
const x3 = textCall("concat", [v[0], "-wrap-left"]);
|
|
41
|
+
if (x3 !== NONCONFORMING) {
|
|
42
|
+
const s7 = toAttribute(x3, "id");
|
|
43
|
+
if (s7 !== r.v7) writeAttribute(r.a3, "id", r.v7 = s7);
|
|
44
|
+
}
|
|
45
|
+
const x4 = textCall("concat", [v[0], "-wrap-right"]);
|
|
46
|
+
if (x4 !== NONCONFORMING) {
|
|
47
|
+
const s10 = toAttribute(x4, "id");
|
|
48
|
+
if (s10 !== r.v10) writeAttribute(r.a4, "id", r.v10 = s10);
|
|
49
|
+
}
|
|
50
|
+
const x5 = v[0];
|
|
51
|
+
const s13 = toAttribute(x5, "id");
|
|
52
|
+
if (s13 !== r.v13) writeAttribute(r.a5, "id", r.v13 = s13);
|
|
53
|
+
const x6 = textCall("concat", [v[0], "-delete"]);
|
|
54
|
+
if (x6 !== NONCONFORMING) {
|
|
55
|
+
const s14 = toAttribute(x6, "id");
|
|
56
|
+
if (s14 !== r.v14) writeAttribute(r.a6, "id", r.v14 = s14);
|
|
57
|
+
}
|
|
58
|
+
if (x1 !== NONCONFORMING) {
|
|
59
|
+
const s15 = toAttribute(x1, "for");
|
|
60
|
+
if (s15 !== r.v15) writeAttribute(r.a7, "for", r.v15 = s15);
|
|
61
|
+
}
|
|
62
|
+
if (x2 !== NONCONFORMING) {
|
|
63
|
+
const s16 = toAttribute(x2, "for");
|
|
64
|
+
if (s16 !== r.v16) writeAttribute(r.a8, "for", r.v16 = s16);
|
|
65
|
+
}
|
|
66
|
+
if (x3 !== NONCONFORMING) {
|
|
67
|
+
const s17 = toAttribute(x3, "for");
|
|
68
|
+
if (s17 !== r.v17) writeAttribute(r.a9, "for", r.v17 = s17);
|
|
69
|
+
}
|
|
70
|
+
if (x4 !== NONCONFORMING) {
|
|
71
|
+
const s18 = toAttribute(x4, "for");
|
|
72
|
+
if (s18 !== r.v18) writeAttribute(r.a10, "for", r.v18 = s18);
|
|
73
|
+
}
|
|
74
|
+
const s19 = toAttribute(x5, "for");
|
|
75
|
+
if (s19 !== r.v19) writeAttribute(r.a11, "for", r.v19 = s19);
|
|
76
|
+
if (x6 !== NONCONFORMING) {
|
|
77
|
+
const s20 = toAttribute(x6, "for");
|
|
78
|
+
if (s20 !== r.v20) writeAttribute(r.a12, "for", r.v20 = s20);
|
|
79
|
+
}
|
|
80
|
+
const s21 = toAttribute(x5, "for");
|
|
81
|
+
if (s21 !== r.v21) writeAttribute(r.a13, "for", r.v21 = s21);
|
|
82
|
+
const x7 = textCall("concat", [v[0], "-alt"]);
|
|
83
|
+
if (x7 !== NONCONFORMING) {
|
|
84
|
+
const s23 = toAttribute(x7, "for");
|
|
85
|
+
if (s23 !== r.v23) writeAttribute(r.a14, "for", r.v23 = s23);
|
|
86
|
+
}
|
|
87
|
+
if (x7 !== NONCONFORMING) {
|
|
88
|
+
const s24 = toAttribute(x7, "id");
|
|
89
|
+
if (s24 !== r.v24) writeAttribute(r.a15, "id", r.v24 = s24);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (c & 1073741840) {
|
|
93
|
+
const x8 = readIndex({ "true": "outline", "false": "ghost" }, textCall("concat", [(v[4] === "block")]));
|
|
94
|
+
if (x8 !== NONCONFORMING) {
|
|
95
|
+
const s2 = toAttribute(x8, "variant");
|
|
96
|
+
if (s2 !== r.v2) writeAttribute(r.a1, "variant", r.v2 = s2);
|
|
97
|
+
}
|
|
98
|
+
const x9 = readIndex({ "true": "outline", "false": "ghost" }, textCall("concat", [(v[4] === "center")]));
|
|
99
|
+
if (x9 !== NONCONFORMING) {
|
|
100
|
+
const s5 = toAttribute(x9, "variant");
|
|
101
|
+
if (s5 !== r.v5) writeAttribute(r.a2, "variant", r.v5 = s5);
|
|
102
|
+
}
|
|
103
|
+
const x10 = readIndex({ "true": "outline", "false": "ghost" }, textCall("concat", [(v[4] === "wrap-left")]));
|
|
104
|
+
if (x10 !== NONCONFORMING) {
|
|
105
|
+
const s8 = toAttribute(x10, "variant");
|
|
106
|
+
if (s8 !== r.v8) writeAttribute(r.a3, "variant", r.v8 = s8);
|
|
107
|
+
}
|
|
108
|
+
const x11 = readIndex({ "true": "outline", "false": "ghost" }, textCall("concat", [(v[4] === "wrap-right")]));
|
|
109
|
+
if (x11 !== NONCONFORMING) {
|
|
110
|
+
const s11 = toAttribute(x11, "variant");
|
|
111
|
+
if (s11 !== r.v11) writeAttribute(r.a4, "variant", r.v11 = s11);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (c & 16) {
|
|
115
|
+
const x12 = textCall("concat", [(v[4] === "block")]);
|
|
116
|
+
if (x12 !== NONCONFORMING) {
|
|
117
|
+
const s3 = toAttribute(x12, "aria-pressed");
|
|
118
|
+
if (s3 !== r.v3) writeAttribute(r.a1, "aria-pressed", r.v3 = s3);
|
|
119
|
+
}
|
|
120
|
+
const x13 = textCall("concat", [(v[4] === "center")]);
|
|
121
|
+
if (x13 !== NONCONFORMING) {
|
|
122
|
+
const s6 = toAttribute(x13, "aria-pressed");
|
|
123
|
+
if (s6 !== r.v6) writeAttribute(r.a2, "aria-pressed", r.v6 = s6);
|
|
124
|
+
}
|
|
125
|
+
const x14 = textCall("concat", [(v[4] === "wrap-left")]);
|
|
126
|
+
if (x14 !== NONCONFORMING) {
|
|
127
|
+
const s9 = toAttribute(x14, "aria-pressed");
|
|
128
|
+
if (s9 !== r.v9) writeAttribute(r.a3, "aria-pressed", r.v9 = s9);
|
|
129
|
+
}
|
|
130
|
+
const x15 = textCall("concat", [(v[4] === "wrap-right")]);
|
|
131
|
+
if (x15 !== NONCONFORMING) {
|
|
132
|
+
const s12 = toAttribute(x15, "aria-pressed");
|
|
133
|
+
if (s12 !== r.v12) writeAttribute(r.a4, "aria-pressed", r.v12 = s12);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (c & 2) {
|
|
137
|
+
const x16 = v[1];
|
|
138
|
+
const s22 = toAttribute(x16, "open");
|
|
139
|
+
if (s22 !== r.v22) writeAttribute(r.a13, "open", r.v22 = s22);
|
|
140
|
+
}
|
|
141
|
+
if (c & 4) {
|
|
142
|
+
const x17 = v[2];
|
|
143
|
+
const s25 = toAttribute(x17, "value");
|
|
144
|
+
if (s25 !== r.v25) writeAttribute(r.a15, "value", r.v25 = s25);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const t0 = element.firstChild;
|
|
148
|
+
const t1 = t0.firstChild;
|
|
149
|
+
const t2 = t1.firstChild;
|
|
150
|
+
const t3 = t2.nextSibling;
|
|
151
|
+
const t4 = t3.nextSibling;
|
|
152
|
+
const t5 = t4.nextSibling;
|
|
153
|
+
const t6 = t5.nextSibling;
|
|
154
|
+
const t7 = t6.nextSibling;
|
|
155
|
+
const t8 = t1.nextSibling;
|
|
156
|
+
const t9 = t8.nextSibling;
|
|
157
|
+
const t10 = t9.nextSibling;
|
|
158
|
+
const t11 = t10.nextSibling;
|
|
159
|
+
const t12 = t11.nextSibling;
|
|
160
|
+
const t13 = t12.nextSibling;
|
|
161
|
+
const t14 = t13.nextSibling;
|
|
162
|
+
const t15 = t14.firstChild.firstChild.firstChild;
|
|
163
|
+
const t16 = t15.firstChild;
|
|
164
|
+
const t17 = t16.nextSibling;
|
|
165
|
+
const R = { a0: t1, a1: t2, a2: t3, a3: t4, a4: t5, a5: t6, a6: t7, a7: t8, a8: t9, a9: t10, a10: t11, a11: t12, a12: t13, a13: t14, a14: t16, a15: t17, v0: null, v1: null, v2: null, v3: null, v4: null, v5: null, v6: null, v7: null, v8: null, v9: null, v10: null, v11: null, v12: null, v13: null, v14: null, v15: null, v16: null, v17: null, v18: null, v19: null, v20: null, v21: null, v22: null, v23: null, v24: null, v25: null };
|
|
166
|
+
const I = { B };
|
|
167
|
+
I.R = new Set();
|
|
168
|
+
attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, C, undefined, I);
|
|
169
|
+
manageProps(I);
|
|
170
|
+
return element;
|
|
171
|
+
}
|
package/vanilla/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./UiDescriptionList.js";
|
|
|
19
19
|
export * from "./UiDialog.js";
|
|
20
20
|
export * from "./UiDisclosure.js";
|
|
21
21
|
export * from "./UiEditable.js";
|
|
22
|
+
export * from "./UiEditorImageToolbar.js";
|
|
22
23
|
export * from "./UiEditorInsertTableGrid.js";
|
|
23
24
|
export * from "./UiEditorMentionMenu.js";
|
|
24
25
|
export * from "./UiEditorMentionMenuItem.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
alt: {
|
|
6
|
+
type: PropType<string | null>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
placement: {
|
|
10
|
+
type: PropType<"block" | "center" | "wrap-left" | "wrap-right" | null>;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
target: {
|
|
14
|
+
type: PropType<string | null>;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
delete: (event: CustomEvent<Readonly<Record<string, unknown>>>) => any;
|
|
19
|
+
placement: (event: CustomEvent<{
|
|
20
|
+
readonly placement: "block" | "center" | "wrap-left" | "wrap-right";
|
|
21
|
+
}>) => any;
|
|
22
|
+
"update:alt": (value: string) => any;
|
|
23
|
+
"update:placement": (value: string) => any;
|
|
24
|
+
describe: (event: CustomEvent<{
|
|
25
|
+
readonly alt: string;
|
|
26
|
+
}>) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
alt: {
|
|
29
|
+
type: PropType<string | null>;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
placement: {
|
|
33
|
+
type: PropType<"block" | "center" | "wrap-left" | "wrap-right" | null>;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
target: {
|
|
37
|
+
type: PropType<string | null>;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
}>> & Readonly<{
|
|
41
|
+
onDelete?: ((event: CustomEvent<Readonly<Record<string, unknown>>>) => any) | undefined;
|
|
42
|
+
onPlacement?: ((event: CustomEvent<{
|
|
43
|
+
readonly placement: "block" | "center" | "wrap-left" | "wrap-right";
|
|
44
|
+
}>) => any) | undefined;
|
|
45
|
+
"onUpdate:alt"?: ((value: string) => any) | undefined;
|
|
46
|
+
"onUpdate:placement"?: ((value: string) => any) | undefined;
|
|
47
|
+
onDescribe?: ((event: CustomEvent<{
|
|
48
|
+
readonly alt: string;
|
|
49
|
+
}>) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
alt: string | null;
|
|
52
|
+
target: string | null;
|
|
53
|
+
placement: "center" | "block" | "wrap-left" | "wrap-right" | null;
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|