@threadlabs/looma 0.23.4 → 0.23.6
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/shared/icons.js +1 -0
- package/components/ui-badge/ui-badge.html +37 -3
- package/components/ui-icon/ui-icon.html +1 -0
- package/components/ui-list-item/ui-list-item.html +16 -1
- package/dist/index.js +1 -1
- package/editor/icons.d.ts +1 -0
- package/editor/index.js +2 -1
- package/package.json +1 -1
- package/styles/ui-badge.css +35 -0
- package/styles/ui-list-item.css +11 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +5 -2
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiListItem.d.ts +2 -0
- package/vanilla/UiListItem.js +5 -1
- package/vue/UiBadge.d.ts +3 -3
- package/vue/UiBadge.vue +39 -6
- package/vue/UiIcon.vue +4 -0
- package/vue/UiListItem.d.ts +18 -0
- package/vue/UiListItem.vue +53 -2
- package/vue/chunks/UiBadge.js +10 -5
- package/vue/chunks/UiIcon.js +8 -1
- package/vue/chunks/UiListItem.js +48 -4
- package/vue/components.css +94 -55
package/editor/icons.d.ts
CHANGED
package/editor/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as TABLE_CELL_BACKGROUND_PRESETS, t as TABLE_CELL_BACKGROUND_OPTIONS } from "./chunks/table-backgrounds.js";
|
|
2
2
|
import { n as resolveTableCellAt, t as measureTableOverlayGeometry } from "./chunks/ui.js";
|
|
3
3
|
import { A as LoomaChip, C as LoomaMentionSuggestionPluginKey, D as filterLoomaMentionItems, E as MAX_MENTION_RESULT_LIMIT, F as LOOMA_ACTIVE_BLOCK_CLASS, I as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, L as LoomaActiveBlock, M as LOOMA_CALLOUT_TONES, N as LoomaCallout, O as normalizeMentionResultLimit, P as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, R as LoomaActiveBlockPluginKey, S as siteRelativeHref, T as DEFAULT_MENTION_RESULT_LIMIT, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as normalizeLoomaChipColor, k as LOOMA_CHIP_COLORS, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as createLoomaMentionExtension, x as createSiteRelativeLinks, y as setActiveTableCellBackground } from "./chunks/extensions.js";
|
|
4
|
-
import { AlignCenter, AlignLeft, AlignRight, ArrowLeft, Bold, BookUser, Braces, Calculator, Check, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CircleDot, CircleQuestionMark, CircleX, CodeXml, Columns3, Compass, CreditCard, Ellipsis, Eraser, ExternalLink, FileText, Folder, GripHorizontal, GripVertical, Heading1, Heading2, Heading3, Highlighter, History, Image, Info, Italic, LayoutDashboard, Link, List, ListOrdered, ListTodo, LoaderCircle, Merge, Minus, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Pencil, Pilcrow, Plus, Quote, Receipt, Redo2, Rows3, Search, Settings, Split, Strikethrough, Table2, Tag, Trash2, TriangleAlert, Truck, Underline, Undo2, Unlink, UserRound, Users, X } from "lucide";
|
|
4
|
+
import { AlignCenter, AlignLeft, AlignRight, ArrowLeft, Bell, Bold, BookUser, Braces, Calculator, Check, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CircleDot, CircleQuestionMark, CircleX, CodeXml, Columns3, Compass, CreditCard, Ellipsis, Eraser, ExternalLink, FileText, Folder, GripHorizontal, GripVertical, Heading1, Heading2, Heading3, Highlighter, History, Image, Info, Italic, LayoutDashboard, Link, List, ListOrdered, ListTodo, LoaderCircle, Merge, Minus, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Pencil, Pilcrow, Plus, Quote, Receipt, Redo2, Rows3, Search, Settings, Split, Strikethrough, Table2, Tag, Trash2, TriangleAlert, Truck, Underline, Undo2, Unlink, UserRound, Users, X } from "lucide";
|
|
5
5
|
//#region src/editor/icons.ts
|
|
6
6
|
/** The opinionated Lucide set used by Looma's shipped interaction surfaces. */
|
|
7
7
|
var LOOMA_ICONS = {
|
|
@@ -9,6 +9,7 @@ var LOOMA_ICONS = {
|
|
|
9
9
|
"align-left": AlignLeft,
|
|
10
10
|
"align-right": AlignRight,
|
|
11
11
|
"arrow-left": ArrowLeft,
|
|
12
|
+
bell: Bell,
|
|
12
13
|
bold: Bold,
|
|
13
14
|
"book-user": BookUser,
|
|
14
15
|
"search": Search,
|
package/package.json
CHANGED
package/styles/ui-badge.css
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
syntax: "*";
|
|
4
4
|
inherits: false;
|
|
5
5
|
}
|
|
6
|
+
@property --ui-badge-dot-size {
|
|
7
|
+
syntax: "*";
|
|
8
|
+
inherits: false;
|
|
9
|
+
}
|
|
6
10
|
@property --ui-badge-color {
|
|
7
11
|
syntax: "*";
|
|
8
12
|
inherits: false;
|
|
@@ -203,6 +207,29 @@
|
|
|
203
207
|
--_badge-text: var(--ui-info-subtle-text, var(--ui-info-solid));
|
|
204
208
|
}
|
|
205
209
|
|
|
210
|
+
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
211
|
+
:scope[data-ui-badge-state~="shape=dot"] {
|
|
212
|
+
position: relative;
|
|
213
|
+
box-sizing: border-box;
|
|
214
|
+
flex: none;
|
|
215
|
+
inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
216
|
+
block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
217
|
+
min-inline-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
218
|
+
min-block-size: var(--ui-badge-dot-size, var(--ui-space-2));
|
|
219
|
+
padding: 0;
|
|
220
|
+
border-radius: var(--ui-radius-round);
|
|
221
|
+
text-box-trim: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:scope[data-ui-badge-state~="shape=dot"] .label {
|
|
225
|
+
position: absolute;
|
|
226
|
+
inline-size: 1px;
|
|
227
|
+
block-size: 1px;
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
clip-path: inset(50%);
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
}
|
|
232
|
+
|
|
206
233
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
|
207
234
|
has no diagonal edge to follow. Keep this edge for every tag variant. */
|
|
208
235
|
:scope[data-ui-badge-state~="shape=tag"] {
|
|
@@ -238,6 +265,12 @@
|
|
|
238
265
|
}
|
|
239
266
|
|
|
240
267
|
@media (forced-colors: active) {
|
|
268
|
+
:scope[data-ui-badge-state~="shape=dot"] {
|
|
269
|
+
forced-color-adjust: none;
|
|
270
|
+
border-color: CanvasText;
|
|
271
|
+
background: CanvasText;
|
|
272
|
+
}
|
|
273
|
+
|
|
241
274
|
:scope[data-ui-badge-state~="shape=tag"] {
|
|
242
275
|
forced-color-adjust: none;
|
|
243
276
|
background: CanvasText;
|
|
@@ -266,6 +299,8 @@
|
|
|
266
299
|
/* A solid colour fills with the ink. Its text is the page surface, mixed at 0% only so that it too is
|
|
267
300
|
invalid while the hook is unset. */
|
|
268
301
|
|
|
302
|
+
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
303
|
+
|
|
269
304
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
|
270
305
|
has no diagonal edge to follow. Keep this edge for every tag variant. */
|
|
271
306
|
|
package/styles/ui-list-item.css
CHANGED
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
border-color: var(--ui-border-strong);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
:scope[data-ui-list-item-state~="highlighted"] {
|
|
65
|
+
background: var(--ui-selection-surface);
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
:scope[data-ui-list-item-state~="current"] {
|
|
65
69
|
background: var(--ui-selection-surface);
|
|
66
70
|
color: var(--ui-selection-text);
|
|
@@ -112,6 +116,12 @@
|
|
|
112
116
|
white-space: nowrap;
|
|
113
117
|
}
|
|
114
118
|
|
|
119
|
+
:scope[data-ui-list-item-state~="wrap"] .title,
|
|
120
|
+
:scope[data-ui-list-item-state~="wrap"] .description {
|
|
121
|
+
white-space: normal;
|
|
122
|
+
overflow-wrap: anywhere;
|
|
123
|
+
}
|
|
124
|
+
|
|
115
125
|
.title {
|
|
116
126
|
font-size: var(--ui-font-size-md);
|
|
117
127
|
font-weight: var(--_ui-list-item-title-weight, var(--ui-font-medium));
|
|
@@ -136,7 +146,7 @@
|
|
|
136
146
|
outline: var(--ui-focus-width) solid Highlight;
|
|
137
147
|
outline-offset: calc(-1 * var(--ui-focus-width));
|
|
138
148
|
}
|
|
139
|
-
:scope[data-ui-list-item-state~="current"]:not(:has(a:focus-visible)) {
|
|
149
|
+
:is(:scope[data-ui-list-item-state~="current"], :scope[data-ui-list-item-state~="highlighted"]):not(:has(a:focus-visible)) {
|
|
140
150
|
outline: var(--ui-border-width) solid Highlight;
|
|
141
151
|
outline-offset: calc(-1 * var(--ui-border-width));
|
|
142
152
|
}
|
package/vanilla/UiBadge.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface UiBadgeElement extends HTMLSpanElement {
|
|
|
6
6
|
removeEventListener<K extends keyof UiBadgeEventMap>(type: K, listener: (this: UiBadgeElement, event: UiBadgeEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
7
|
}
|
|
8
8
|
export interface UiBadgeProps {
|
|
9
|
-
shape?: "pill" | "tag" | null;
|
|
9
|
+
shape?: "pill" | "tag" | "dot" | null;
|
|
10
10
|
size?: "xs" | "md" | null;
|
|
11
11
|
tone?: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | null;
|
|
12
12
|
variant?: "solid" | "subtle" | "outline" | null;
|
package/vanilla/UiBadge.js
CHANGED
|
@@ -15,17 +15,20 @@ export function createUiBadge(options = {}) {
|
|
|
15
15
|
element.setAttribute(name, value === true ? "" : String(value));
|
|
16
16
|
}
|
|
17
17
|
element.setAttribute("data-component", "ui-badge");
|
|
18
|
+
const element0 = document.createElement("span");
|
|
19
|
+
element0.setAttribute("class", "label");
|
|
18
20
|
if (children.length > 0) {
|
|
19
21
|
for (const child of children) {
|
|
20
22
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
21
23
|
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
22
24
|
projected.push([node, ""]);
|
|
23
|
-
|
|
25
|
+
element0.append(node);
|
|
24
26
|
}
|
|
25
27
|
} else {
|
|
26
28
|
}
|
|
29
|
+
element.append(element0);
|
|
27
30
|
manageGeneratedProps(element, [
|
|
28
|
-
{ name: "shape", attribute: "data-shape", value: componentProps["shape"], default: "pill", type: ["pill","tag"], required: false },
|
|
31
|
+
{ name: "shape", attribute: "data-shape", value: componentProps["shape"], default: "pill", type: ["pill","tag","dot"], required: false },
|
|
29
32
|
{ name: "size", attribute: "data-size", value: componentProps["size"], default: "md", type: ["xs","md"], required: false },
|
|
30
33
|
{ name: "tone", attribute: "data-tone", value: componentProps["tone"], default: "neutral", type: ["neutral","accent","info","success","warning","danger"], required: false },
|
|
31
34
|
{ name: "variant", attribute: "data-variant", value: componentProps["variant"], default: "subtle", type: ["solid","subtle","outline"], required: false },
|