@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/editor/icons.d.ts CHANGED
@@ -5,6 +5,7 @@ export declare const LOOMA_ICONS: {
5
5
  'align-left': IconNode;
6
6
  'align-right': IconNode;
7
7
  'arrow-left': IconNode;
8
+ bell: IconNode;
8
9
  bold: IconNode;
9
10
  'book-user': IconNode;
10
11
  search: IconNode;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.23.4",
3
+ "version": "0.23.6",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -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
 
@@ -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
  }
@@ -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;
@@ -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
- element.append(node);
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 },