@threadlabs/looma 0.1.5 → 0.1.7
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 +5 -4
- package/dist/{chunk-3PASQ7DE.js → chunk-UMFO4QNN.js} +26 -26
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/ui-dialog.cjs.entry.js +3 -1
- package/dist/collection/components/ui-dialog/ui-dialog.js +22 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/ui-dialog.entry.js +3 -1
- package/dist/index.cjs +4 -2
- package/dist/index.js +2 -2
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-5df568d8.entry.js +1 -0
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +2 -0
- package/dist/types/components.d.ts +9 -0
- package/dist/{ui-avatar-group.entry-DBVLQ4KB.js → ui-avatar-group.entry-S6DFXYB7.js} +1 -1
- package/dist/{ui-avatar.entry-2WTBM2EC.js → ui-avatar.entry-MDRGXLWQ.js} +1 -1
- package/dist/{ui-badge.entry-XKIGBK5V.js → ui-badge.entry-RLL4YKPD.js} +1 -1
- package/dist/{ui-button.entry-PWT56MPD.js → ui-button.entry-IYMYLBFY.js} +1 -1
- package/dist/{ui-checkbox.entry-QT5S7EEL.js → ui-checkbox.entry-K5FGWDG2.js} +1 -1
- package/dist/{ui-context-menu.entry-NGWR3LOZ.js → ui-context-menu.entry-KWXXJ3ZV.js} +1 -1
- package/dist/{ui-dialog.entry-PEDDIALQ.js → ui-dialog.entry-RKHLQLQM.js} +4 -2
- package/dist/{ui-disclosure.entry-UKO7MAZM.js → ui-disclosure.entry-FRZKGEJP.js} +1 -1
- package/dist/{ui-floating-action-button.entry-SSGHRMCO.js → ui-floating-action-button.entry-BH4FDSTL.js} +1 -1
- package/dist/{ui-form-field.entry-6TZCWPYL.js → ui-form-field.entry-3CR2KSUH.js} +1 -1
- package/dist/{ui-icon-button.entry-WMCYMK2H.js → ui-icon-button.entry-LB54U25M.js} +1 -1
- package/dist/{ui-input.entry-AZ5BGQNA.js → ui-input.entry-5PQR37HS.js} +1 -1
- package/dist/{ui-menu-item.entry-L4NJDBKF.js → ui-menu-item.entry-2T3QWHLK.js} +1 -1
- package/dist/{ui-menu.entry-DGUYAE3Q.js → ui-menu.entry-Q5Z5YO5P.js} +1 -1
- package/dist/{ui-popover.entry-A54EKVZG.js → ui-popover.entry-4P2NWWAY.js} +1 -1
- package/dist/{ui-radio-group.entry-6YP4LY4N.js → ui-radio-group.entry-QKPRNV26.js} +1 -1
- package/dist/{ui-radio.entry-CGYNK7PN.js → ui-radio.entry-O4DOMFNU.js} +1 -1
- package/dist/{ui-search-result-row.entry-DGKSI2QM.js → ui-search-result-row.entry-BR5O3UCH.js} +1 -1
- package/dist/{ui-search-shell.entry-3F5ASGTW.js → ui-search-shell.entry-2ZBP7SA3.js} +1 -1
- package/dist/{ui-select.entry-SXSZPVXA.js → ui-select.entry-L75HQY72.js} +1 -1
- package/dist/{ui-switch.entry-AD4EVUWM.js → ui-switch.entry-L5QWD3BT.js} +1 -1
- package/dist/{ui-tabs.entry-WLKO5G5N.js → ui-tabs.entry-KWRD6Y7J.js} +1 -1
- package/dist/{ui-textarea.entry-IHPC7Q4R.js → ui-textarea.entry-JC3HPEBS.js} +1 -1
- package/dist/{ui-toast-region.entry-GCW2LJAC.js → ui-toast-region.entry-C6KK4OM4.js} +1 -1
- package/dist/{ui-tooltip.entry-EU2G6BH5.js → ui-tooltip.entry-G5EOCWP4.js} +1 -1
- package/dist/{ui-top-bar.entry-NMAFXVET.js → ui-top-bar.entry-YLKVAQFH.js} +1 -1
- package/editor/chunk-CX4QDKSV.js +22 -0
- package/editor/{chunk-YGJLGDQC.js → chunk-NJ2KAMS2.js} +2203 -17
- package/editor/{chunk-CWCXYQMT.js → chunk-OK5NARJI.js} +59 -28
- package/editor/extensions/index.d.ts +74 -20
- package/editor/extensions/index.js +22 -4
- package/editor/index.d.ts +3 -3
- package/editor/index.js +25 -5
- package/editor/table-overlay-Bq0F5xPg.d.ts +64 -0
- package/editor/ui.d.ts +2 -12
- package/editor/ui.js +9 -1
- package/editor.css +375 -4
- package/package.json +9 -2
- package/tokens.css +17 -0
- package/vue/chunk-KDA4RFLQ.js +203 -0
- package/vue/editor/index.d.ts +93 -3
- package/vue/editor/index.js +565 -30
- package/vue/index.js +38 -82
- package/dist/looma/p-a7be33fd.entry.js +0 -1
- package/editor/table-overlay-DTr3KC9e.d.ts +0 -12
- package/vue/chunk-P72L3GWE.js +0 -84
package/vue/index.js
CHANGED
|
@@ -1,86 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"ui-floating-action-button",
|
|
41
|
-
"FloatingActionButton"
|
|
42
|
-
);
|
|
43
|
-
var SearchShell = createAdapterComponent("ui-search-shell", "SearchShell");
|
|
44
|
-
var SearchResultRow = createAdapterComponent("ui-search-result-row", "SearchResultRow");
|
|
45
|
-
var TopBar = createAdapterComponent("ui-top-bar", "TopBar");
|
|
46
|
-
var ADAPTER_COMPONENT_TAG_MAP = {
|
|
47
|
-
Stack: "ui-stack",
|
|
48
|
-
Inline: "ui-inline",
|
|
49
|
-
Cluster: "ui-cluster",
|
|
50
|
-
Grid: "ui-grid",
|
|
51
|
-
Center: "ui-center",
|
|
52
|
-
Switcher: "ui-switcher",
|
|
53
|
-
Sidebar: "ui-sidebar",
|
|
54
|
-
Reel: "ui-reel",
|
|
55
|
-
Separator: "ui-separator",
|
|
56
|
-
Disclosure: "ui-disclosure",
|
|
57
|
-
Tabs: "ui-tabs",
|
|
58
|
-
Dialog: "ui-dialog",
|
|
59
|
-
Popover: "ui-popover",
|
|
60
|
-
Menu: "ui-menu",
|
|
61
|
-
MenuItem: "ui-menu-item",
|
|
62
|
-
ContextMenu: "ui-context-menu",
|
|
63
|
-
Button: "ui-button",
|
|
64
|
-
IconButton: "ui-icon-button",
|
|
65
|
-
Input: "ui-input",
|
|
66
|
-
Select: "ui-select",
|
|
67
|
-
Textarea: "ui-textarea",
|
|
68
|
-
FormField: "ui-form-field",
|
|
69
|
-
Tooltip: "ui-tooltip",
|
|
70
|
-
ToastRegion: "ui-toast-region",
|
|
71
|
-
Checkbox: "ui-checkbox",
|
|
72
|
-
Switch: "ui-switch",
|
|
73
|
-
RadioGroup: "ui-radio-group",
|
|
74
|
-
Radio: "ui-radio",
|
|
75
|
-
Badge: "ui-badge",
|
|
76
|
-
Avatar: "ui-avatar",
|
|
77
|
-
AvatarGroup: "ui-avatar-group",
|
|
78
|
-
FloatingActionButton: "ui-floating-action-button",
|
|
79
|
-
SearchShell: "ui-search-shell",
|
|
80
|
-
SearchResultRow: "ui-search-result-row",
|
|
81
|
-
TopBar: "ui-top-bar"
|
|
82
|
-
};
|
|
83
|
-
var VUE_ADAPTER_NOTE = "Thin adapter only: attrs and slots pass through to custom elements and DOM events map to typed callbacks.";
|
|
2
|
+
ADAPTER_COMPONENT_TAG_MAP,
|
|
3
|
+
Avatar,
|
|
4
|
+
AvatarGroup,
|
|
5
|
+
Badge,
|
|
6
|
+
Button,
|
|
7
|
+
Center,
|
|
8
|
+
Checkbox,
|
|
9
|
+
Cluster,
|
|
10
|
+
ContextMenu,
|
|
11
|
+
Dialog,
|
|
12
|
+
Disclosure,
|
|
13
|
+
FloatingActionButton,
|
|
14
|
+
FormField,
|
|
15
|
+
Grid,
|
|
16
|
+
IconButton,
|
|
17
|
+
Inline,
|
|
18
|
+
Input,
|
|
19
|
+
Menu,
|
|
20
|
+
MenuItem,
|
|
21
|
+
Popover,
|
|
22
|
+
Radio,
|
|
23
|
+
RadioGroup,
|
|
24
|
+
Reel,
|
|
25
|
+
SearchResultRow,
|
|
26
|
+
SearchShell,
|
|
27
|
+
Select,
|
|
28
|
+
Separator,
|
|
29
|
+
Sidebar,
|
|
30
|
+
Stack,
|
|
31
|
+
Switch,
|
|
32
|
+
Switcher,
|
|
33
|
+
Tabs,
|
|
34
|
+
Textarea,
|
|
35
|
+
ToastRegion,
|
|
36
|
+
Tooltip,
|
|
37
|
+
TopBar,
|
|
38
|
+
VUE_ADAPTER_NOTE
|
|
39
|
+
} from "./chunk-KDA4RFLQ.js";
|
|
84
40
|
export {
|
|
85
41
|
ADAPTER_COMPONENT_TAG_MAP,
|
|
86
42
|
Avatar,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,g as a,h as o,H as e}from"./p-CEeiinfk.js";import{o as r,c as t,r as s}from"./p-CR7f2MQC.js";import{d as n}from"./p-JwSoedEO.js";const d=class{constructor(a){i(this,a)}get host(){return a(this)}open=!1;defaultOpen=!1;modal=!0;dismissible=!0;internalOpen=!1;overlayId=`ui-dialog-${Math.random().toString(36).slice(2,11)}`;dialogRef;syncFromProp(){this.internalOpen=this.open}syncOpen(){this.dialogRef&&(this.internalOpen?(this.dialogRef.showModal(),r({id:this.overlayId,modal:this.modal,element:this.host,dismissible:this.dismissible,requestClose:(i,a)=>this.handleRequestClose(i,a)})):(this.dialogRef.close(),t(this.overlayId)))}componentDidLoad(){this.syncFromProp(),this.internalOpen=this.internalOpen||this.defaultOpen,this.dialogRef?.addEventListener("close",this.onDialogClose),this.syncOpen()}disconnectedCallback(){this.dialogRef?.removeEventListener("close",this.onDialogClose),t(this.overlayId)}componentDidUpdate(){this.syncOpen()}handleRequestClose(i,a){this.internalOpen=!1,n(this.host,"close",{open:!1,reason:i,trigger:a})}onDialogClose=()=>{this.internalOpen&&(this.internalOpen=!1,t(this.overlayId),n(this.host,"close",{open:!1,reason:"programmatic",trigger:"programmatic"}))};onKeydown=i=>{"Escape"===i.key&&s("escape","keyboard")};render(){return o(e,{key:"2a2fcdfa1e3fac5eb3c0e3d6748cebdf388c216d","data-open":this.internalOpen?"":void 0,onKeyDown:this.onKeydown},o("dialog",{key:"c3eef2bb3bec77fa518269fce38c19c2ededda49",ref:i=>this.dialogRef=i,open:this.internalOpen},o("slot",{key:"9ae5c30d57096184ec287fd9dd134ff566b9fd39"})))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{syncOpen:0}]}}};d.style=":host{display:block}:host:not([data-open]){display:none}:host dialog{--ui-dialog-duration:var(--ui-motion-base);--ui-dialog-viewport-gap:var(--ui-space-4, 1rem);position:fixed;inset:0;inline-size:min( calc(100% - (var(--ui-dialog-viewport-gap) * 2)), var(--ui-dialog-max-width, 440px) );max-inline-size:none;max-block-size:calc(100dvh - (var(--ui-dialog-viewport-gap) * 2));margin:auto;padding:var(--ui-space-4);overflow:auto;background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-dialog);box-shadow:var(--ui-shadow-dialog);visibility:hidden;pointer-events:none;opacity:0;transform:scale(0.96);transition:opacity var(--ui-dialog-duration) var(--ui-motion-ease), transform var(--ui-dialog-duration) var(--ui-motion-ease), visibility var(--ui-dialog-duration), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]{visibility:visible;pointer-events:auto;opacity:1;transform:scale(1);animation:ui-dialog-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-enter{from{opacity:0;transform:scale(0.96)}}:host dialog::backdrop{background-color:transparent;transition:background-color var(--ui-dialog-duration) var(--ui-motion-ease), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]::backdrop{background-color:var(--ui-overlay-backdrop);animation:ui-dialog-backdrop-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-backdrop-enter{from{background-color:transparent}}";export{d as ui_dialog}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ui-editor-table-overlay — table edge controls for row/column insertion.
|
|
3
|
-
* Emits looma-editor-table-overlay-action with insertion intent.
|
|
4
|
-
* Domain-neutral: no Tiptap dependency.
|
|
5
|
-
*/
|
|
6
|
-
type TableOverlayAction = "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after";
|
|
7
|
-
interface TableOverlayActionEventDetail {
|
|
8
|
-
action: TableOverlayAction;
|
|
9
|
-
boundaryIndex: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type { TableOverlayAction as T, TableOverlayActionEventDetail as a };
|
package/vue/chunk-P72L3GWE.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// src/adapter.ts
|
|
2
|
-
import {
|
|
3
|
-
cloneVNode,
|
|
4
|
-
defineComponent,
|
|
5
|
-
h,
|
|
6
|
-
isVNode,
|
|
7
|
-
shallowRef,
|
|
8
|
-
watchEffect
|
|
9
|
-
} from "vue";
|
|
10
|
-
var BASE_EVENT_BINDINGS = [
|
|
11
|
-
["open", "onOpen"],
|
|
12
|
-
["close", "onClose"],
|
|
13
|
-
["select", "onSelect"],
|
|
14
|
-
["change", "onChange"],
|
|
15
|
-
["input", "onInput"],
|
|
16
|
-
["dismiss", "onDismiss"]
|
|
17
|
-
];
|
|
18
|
-
function toHTMLElement(value) {
|
|
19
|
-
if (!value) return null;
|
|
20
|
-
if (value instanceof HTMLElement) return value;
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
function createAdapterComponent(tagName, displayName, additionalEventBindings = []) {
|
|
24
|
-
const eventBindings = [...BASE_EVENT_BINDINGS, ...additionalEventBindings];
|
|
25
|
-
const callbackAttrs = new Set(eventBindings.map(([, callbackAttr]) => callbackAttr));
|
|
26
|
-
return defineComponent({
|
|
27
|
-
name: displayName,
|
|
28
|
-
inheritAttrs: false,
|
|
29
|
-
setup(_props, { attrs, slots }) {
|
|
30
|
-
const elementRef = shallowRef(null);
|
|
31
|
-
watchEffect((onCleanup) => {
|
|
32
|
-
const element = elementRef.value;
|
|
33
|
-
if (!element) return;
|
|
34
|
-
const adapterAttrs = attrs;
|
|
35
|
-
const handlers = eventBindings.map(
|
|
36
|
-
([eventName, callbackAttr]) => {
|
|
37
|
-
const callback = adapterAttrs[callbackAttr];
|
|
38
|
-
return [
|
|
39
|
-
eventName,
|
|
40
|
-
typeof callback === "function" ? (event) => callback(event.detail) : void 0
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
for (const [eventName, handler] of handlers) {
|
|
45
|
-
if (handler) element.addEventListener(eventName, handler);
|
|
46
|
-
}
|
|
47
|
-
onCleanup(() => {
|
|
48
|
-
for (const [eventName, handler] of handlers) {
|
|
49
|
-
if (handler) element.removeEventListener(eventName, handler);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
return () => {
|
|
54
|
-
const forwardedAttrs = Object.fromEntries(
|
|
55
|
-
Object.entries(attrs).filter(([name]) => !callbackAttrs.has(name))
|
|
56
|
-
);
|
|
57
|
-
const children = Object.entries(slots).flatMap(([slotName, slotFn]) => {
|
|
58
|
-
if (!slotFn) return [];
|
|
59
|
-
return slotFn().map((node) => {
|
|
60
|
-
if (slotName === "default") return node;
|
|
61
|
-
if (isVNode(node)) return cloneVNode(node, { slot: slotName });
|
|
62
|
-
return h("span", { slot: slotName }, node);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
return h(
|
|
66
|
-
tagName,
|
|
67
|
-
{
|
|
68
|
-
"data-allow-mismatch": forwardedAttrs["data-allow-mismatch"] ?? "class",
|
|
69
|
-
...forwardedAttrs,
|
|
70
|
-
ref: (value) => {
|
|
71
|
-
elementRef.value = toHTMLElement(value);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
children.length > 0 ? children : void 0
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
toHTMLElement,
|
|
83
|
-
createAdapterComponent
|
|
84
|
-
};
|