@andamento/vue 0.1.0 → 0.2.0

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/dist/index.cjs CHANGED
@@ -22,10 +22,10 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  SvgTileLayout: () => SvgTileLayout,
24
24
  TileLayout: () => TileLayout,
25
- cellFromPointer: () => import_dom3.cellFromPointer,
26
- coverStyle: () => import_dom3.coverStyle,
27
- defaultPalette: () => import_dom3.defaultPalette,
28
- neutralPalette: () => import_dom3.neutralPalette,
25
+ cellFromPointer: () => import_dom.cellFromPointer,
26
+ coverStyle: () => import_dom.coverStyle,
27
+ defaultPalette: () => import_dom.defaultPalette,
28
+ neutralPalette: () => import_dom.neutralPalette,
29
29
  useFitCount: () => useFitCount,
30
30
  useTileLayout: () => useTileLayout
31
31
  });
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(index_exports);
34
34
  // src/TileLayout.ts
35
35
  var import_vue = require("vue");
36
36
  var import_core = require("@andamento/core");
37
- var import_dom = require("@andamento/dom");
37
+ var import_internal = require("@andamento/dom/internal");
38
38
  function flatten(nodes, out = []) {
39
39
  for (const n of nodes ?? []) {
40
40
  if (n == null || typeof n === "boolean") continue;
@@ -108,8 +108,8 @@ var TileLayout = (0, import_vue.defineComponent)({
108
108
  },
109
109
  setup(props, { slots, expose }) {
110
110
  const id = `andamento-vue${++uid}`;
111
- const resolveLayout = (0, import_dom.layoutResolver)("<TileLayout>");
112
- const buildFrame = (0, import_dom.frameBuilder)();
111
+ const resolveLayout = (0, import_internal.layoutResolver)("<TileLayout>");
112
+ const buildFrame = (0, import_internal.frameBuilder)();
113
113
  const container = (0, import_vue.ref)();
114
114
  const view = (0, import_vue.shallowRef)();
115
115
  const activeId = (0, import_vue.ref)();
@@ -126,11 +126,11 @@ var TileLayout = (0, import_vue.defineComponent)({
126
126
  const overscan = () => Math.max(0, (typeof props.virtualize === "object" ? props.virtualize.overscan : void 0) ?? 300);
127
127
  const measure = () => {
128
128
  if (!container.value || !layout) return;
129
- const next = (0, import_dom.viewRect)(container.value, layout, overscan());
130
- if (!(0, import_dom.sameRect)(next, view.value)) view.value = next;
129
+ const next = (0, import_internal.viewRect)(container.value, layout, overscan());
130
+ if (!(0, import_internal.sameRect)(next, view.value)) view.value = next;
131
131
  };
132
132
  const syncWatch = () => {
133
- if (props.virtualize && container.value && !stop) stop = (0, import_dom.watchView)(container.value, measure);
133
+ if (props.virtualize && container.value && !stop) stop = (0, import_internal.watchView)(container.value, measure);
134
134
  else if (!props.virtualize && stop) {
135
135
  stop();
136
136
  stop = void 0;
@@ -171,7 +171,7 @@ var TileLayout = (0, import_vue.defineComponent)({
171
171
  const cellId = el.getAttribute?.("data-cell-id");
172
172
  if (!cellId || tiles.get(cellId) !== el || !current.focusable.has(cellId)) return;
173
173
  const cell = layout.cells.find((c) => c.id === cellId);
174
- const action = (0, import_dom.keyAction)(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);
174
+ const action = (0, import_internal.keyAction)(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);
175
175
  if (!action) return;
176
176
  e.preventDefault();
177
177
  if ("activate" in action) props.onCellActivate(cell, current.state.get(cellId));
@@ -215,7 +215,15 @@ var TileLayout = (0, import_vue.defineComponent)({
215
215
  }
216
216
  return `cell:${L.cells[i].id}`;
217
217
  };
218
- const hasContent = (i) => slotOf[i] >= 0;
218
+ const contents = /* @__PURE__ */ new Map();
219
+ const contentOf = (i) => {
220
+ if (!contents.has(i)) {
221
+ const slot = slotOf[i];
222
+ contents.set(i, slots.cell ? flatten(slots.cell({ cell: L.cells[i], slot })) : slot >= 0 ? [items[slot]] : void 0);
223
+ }
224
+ return contents.get(i);
225
+ };
226
+ const hasContent = (i) => slotOf[i] >= 0 && (virtual || !isEmpty(contentOf(i)));
219
227
  const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);
220
228
  const first = L.cells.find((c) => focusable.has(c.id))?.id;
221
229
  const active = activeId.value !== void 0 && focusable.has(activeId.value) ? activeId.value : first;
@@ -239,7 +247,7 @@ var TileLayout = (0, import_vue.defineComponent)({
239
247
  const rendered = shown.map((i) => {
240
248
  const cell = L.cells[i];
241
249
  const slot = slotOf[i];
242
- let content = slots.cell ? flatten(slots.cell({ cell, slot })) : slot >= 0 ? [items[slot]] : void 0;
250
+ let content = contentOf(i);
243
251
  const empty = isEmpty(content);
244
252
  const st = { empty, slot: empty && !slots.cell ? -1 : slot };
245
253
  state.set(cell.id, st);
@@ -247,7 +255,7 @@ var TileLayout = (0, import_vue.defineComponent)({
247
255
  const silent = empty && isEmpty(content);
248
256
  const canFocus = focusable.has(cell.id);
249
257
  const key = keyOf(i);
250
- const style = (0, import_dom.tileStyle)(frame, cell, {
258
+ const style = (0, import_internal.tileStyle)(frame, cell, {
251
259
  empty,
252
260
  safeArea: props.safeArea,
253
261
  backdrop: hasBackdrop,
@@ -256,12 +264,12 @@ var TileLayout = (0, import_vue.defineComponent)({
256
264
  aspect: !slots.cell && slot >= 0 ? props.aspects?.[slot] : void 0
257
265
  });
258
266
  const bevel = frame.bevel(i);
259
- const viewBox = (0, import_dom.tileViewBox)(cell);
267
+ const viewBox = (0, import_internal.tileViewBox)(cell);
260
268
  const children = [];
261
- if (hasBackdrop) children.push((0, import_vue.h)("div", { "aria-hidden": "true", style: (0, import_dom.backdropStyle)(frame, cell) }, slots.backdrop()));
269
+ if (hasBackdrop) children.push((0, import_vue.h)("div", { "aria-hidden": "true", style: (0, import_internal.backdropStyle)(frame, cell) }, slots.backdrop()));
262
270
  if (props.safeArea && !isEmpty(content)) {
263
271
  const aspect = !slots.cell && !empty && props.aspects ? props.aspects[slot] ?? 1 : void 0;
264
- children.push((0, import_vue.h)("div", { "data-safe-area": "", style: (0, import_dom.safeBoxStyle)(frame, cell, aspect, props.safeArea) }, content));
272
+ children.push((0, import_vue.h)("div", { "data-safe-area": "", style: (0, import_internal.safeBoxStyle)(frame, cell, aspect, props.safeArea) }, content));
265
273
  } else if (content) children.push(...content);
266
274
  if (bevel?.length)
267
275
  children.push(
@@ -275,7 +283,7 @@ var TileLayout = (0, import_vue.defineComponent)({
275
283
  "data-late": frame.anim ? "" : void 0,
276
284
  viewBox,
277
285
  preserveAspectRatio: "none",
278
- style: import_dom.overlayStyle
286
+ style: import_internal.overlayStyle
279
287
  },
280
288
  bevel.map((p, k) => (0, import_vue.h)("path", { key: k, d: p.d, fill: p.fill, "fill-opacity": p.opacity }))
281
289
  )
@@ -284,8 +292,8 @@ var TileLayout = (0, import_vue.defineComponent)({
284
292
  children.push(
285
293
  (0, import_vue.h)(
286
294
  "svg",
287
- { key: "ring", "aria-hidden": "true", "data-focus-ring": "", viewBox, preserveAspectRatio: "none", style: import_dom.overlayStyle },
288
- (0, import_dom.ringStrokes)(frame, cell, focusRing).map(
295
+ { key: "ring", "aria-hidden": "true", "data-focus-ring": "", viewBox, preserveAspectRatio: "none", style: import_internal.overlayStyle },
296
+ (0, import_internal.ringStrokes)(frame, cell, focusRing).map(
289
297
  (p, k) => (0, import_vue.h)("path", { key: k, d: p.d, fill: "none", stroke: p.stroke, "stroke-width": p.width, "vector-effect": "non-scaling-stroke" })
290
298
  )
291
299
  )
@@ -300,26 +308,26 @@ var TileLayout = (0, import_vue.defineComponent)({
300
308
  },
301
309
  role: silent ? void 0 : list ? "listitem" : void 0,
302
310
  "aria-hidden": silent ? "true" : void 0,
303
- "aria-label": silent ? void 0 : (0, import_dom.resolvePerCell)(props.cellLabel, cell, st),
311
+ "aria-label": silent ? void 0 : (0, import_internal.resolvePerCell)(props.cellLabel, cell, st),
304
312
  "aria-setsize": positions && list && !silent ? positions.size : void 0,
305
313
  "aria-posinset": positions && list && !silent ? positions.get(i) : void 0,
306
314
  tabindex: canFocus ? cell.id === active ? 0 : -1 : void 0,
307
315
  onFocus: canFocus ? (e) => e.target === e.currentTarget && (activeId.value = cell.id) : void 0,
308
316
  onClick: props.onCellActivate && !empty ? () => props.onCellActivate(cell, st) : void 0,
309
- class: (0, import_dom.resolvePerCell)(props.cellClass, cell, st),
317
+ class: (0, import_internal.resolvePerCell)(props.cellClass, cell, st),
310
318
  "data-cell-id": cell.id,
311
319
  "data-index": cell.index,
312
320
  "data-key": key,
313
321
  "data-empty": empty ? "" : void 0,
314
322
  "data-boundary": cell.boundary ? "" : void 0,
315
- style: { ...style, ...(0, import_dom.resolvePerCell)(props.cellStyle, cell, st) }
323
+ style: { ...style, ...(0, import_internal.resolvePerCell)(props.cellStyle, cell, st) }
316
324
  },
317
325
  children
318
326
  );
319
327
  });
320
328
  current = { focusable, state };
321
- const shadow = (0, import_dom.shadowShape)(frame, shown.map((i) => L.cells[i]));
322
- const css = (0, import_dom.tileSheet)({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });
329
+ const shadow = (0, import_internal.shadowShape)(frame, shown.map((i) => L.cells[i]));
330
+ const css = (0, import_internal.tileSheet)({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });
323
331
  const tileNodes = frame.anim ? (0, import_vue.h)(
324
332
  import_vue.TransitionGroup,
325
333
  {
@@ -351,11 +359,11 @@ var TileLayout = (0, import_vue.defineComponent)({
351
359
  "data-andamento": "",
352
360
  role: props.role,
353
361
  onKeydown,
354
- style: (0, import_dom.containerStyle)(L)
362
+ style: (0, import_internal.containerStyle)(L)
355
363
  },
356
364
  [
357
365
  css ? (0, import_vue.h)("style", { key: "css" }, css) : null,
358
- props.background ? (0, import_vue.h)("div", { key: "bg", "aria-hidden": "true", style: (0, import_dom.backgroundStyle)(frame, props.background) }) : null,
366
+ props.background ? (0, import_vue.h)("div", { key: "bg", "aria-hidden": "true", style: (0, import_internal.backgroundStyle)(frame, props.background) }) : null,
359
367
  shadow ? (0, import_vue.h)("svg", { key: "shadow", "aria-hidden": "true", "data-andamento-shadow": "", viewBox: shadow.viewBox, preserveAspectRatio: "none", style: shadow.style }, [
360
368
  (0, import_vue.h)("filter", { id: `${id}-shadow`, x: "-10%", y: "-10%", width: "120%", height: "120%" }, [(0, import_vue.h)("feGaussianBlur", { stdDeviation: shadow.blur })]),
361
369
  (0, import_vue.h)("path", { d: shadow.d, "fill-rule": "evenodd", transform: shadow.transform, fill: "#000", "fill-opacity": shadow.opacity, filter: `url(#${id}-shadow)` })
@@ -369,7 +377,7 @@ var TileLayout = (0, import_vue.defineComponent)({
369
377
 
370
378
  // src/SvgTileLayout.ts
371
379
  var import_vue2 = require("vue");
372
- var import_dom2 = require("@andamento/dom");
380
+ var import_internal2 = require("@andamento/dom/internal");
373
381
  var import_svg = require("@andamento/svg");
374
382
  var toVNode = (n, key) => typeof n === "string" ? n : (0, import_vue2.h)(n.tag, key === void 0 ? n.attrs : { key, ...n.attrs }, n.children.map((c, i) => toVNode(c, i)));
375
383
  var uid2 = 0;
@@ -402,7 +410,7 @@ var SvgTileLayout = (0, import_vue2.defineComponent)({
402
410
  },
403
411
  setup(props) {
404
412
  const idPrefix = `andamento-vue-svg${++uid2}`;
405
- const resolveLayout = (0, import_dom2.layoutResolver)("<SvgTileLayout>");
413
+ const resolveLayout = (0, import_internal2.layoutResolver)("<SvgTileLayout>");
406
414
  return () => {
407
415
  const fitTo = Array.isArray(props.images) && !props.repeatImages ? props.images.length : 0;
408
416
  const layout = resolveLayout(props.options, props.layout, {
@@ -422,6 +430,7 @@ var SvgTileLayout = (0, import_vue2.defineComponent)({
422
430
  // src/composables.ts
423
431
  var import_vue3 = require("vue");
424
432
  var import_core2 = require("@andamento/core");
433
+ var import_internal3 = require("@andamento/dom/internal");
425
434
  function byKey(key, make) {
426
435
  let lastKey, last;
427
436
  return (0, import_vue3.computed)(() => {
@@ -434,17 +443,17 @@ function byKey(key, make) {
434
443
  });
435
444
  }
436
445
  function useTileLayout(options) {
437
- return byKey(() => JSON.stringify((0, import_vue3.toValue)(options)), () => (0, import_core2.createLayout)((0, import_vue3.toValue)(options)));
446
+ return byKey(() => (0, import_internal3.optionsKey)((0, import_vue3.toValue)(options)), () => (0, import_core2.createLayout)((0, import_vue3.toValue)(options)));
438
447
  }
439
448
  function useFitCount(options, count, fit = {}) {
440
449
  return byKey(
441
- () => JSON.stringify([(0, import_vue3.toValue)(options), (0, import_vue3.toValue)(count)]),
450
+ () => (0, import_internal3.optionsKey)([(0, import_vue3.toValue)(options), (0, import_vue3.toValue)(count), fit.cells, fit.mode]),
442
451
  () => (0, import_core2.fitCount)((0, import_vue3.toValue)(options), (0, import_vue3.toValue)(count), fit).layout
443
452
  );
444
453
  }
445
454
 
446
455
  // src/index.ts
447
- var import_dom3 = require("@andamento/dom");
456
+ var import_dom = require("@andamento/dom");
448
457
  // Annotate the CommonJS export names for ESM import in node:
449
458
  0 && (module.exports = {
450
459
  SvgTileLayout,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/TileLayout.ts","../src/SvgTileLayout.ts","../src/composables.ts"],"sourcesContent":["/**\n * Vue 3 bindings: `<TileLayout>`, `<SvgTileLayout>` and composables.\n *\n * @module @andamento/vue\n */\nexport { TileLayout } from \"./TileLayout\";\nexport { SvgTileLayout } from \"./SvgTileLayout\";\nexport { useFitCount, useTileLayout } from \"./composables\";\nexport { cellFromPointer, coverStyle, defaultPalette, neutralPalette } from \"@andamento/dom\";\nexport type { CellState, FitProp, PerCell, PointerLike, StyleMap, FillSource, ReliefOptions } from \"@andamento/dom\";\nexport type { Cell, ContentCells, ContentPlacement, HitOptions, Layout, LayoutOptions } from \"@andamento/core\";\n","import {\n Comment,\n Fragment,\n Text,\n TransitionGroup,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n type VNodeChild,\n} from \"vue\";\nimport { cellsInRect, type Cell, type ContentCells, type ContentPlacement, type Focus, type Layout, type LayoutOptions, type Rect } from \"@andamento/core\";\nimport {\n backdropStyle,\n backgroundStyle,\n containerStyle,\n frameBuilder,\n keyAction,\n layoutResolver,\n overlayStyle,\n resolvePerCell,\n ringStrokes,\n safeBoxStyle,\n sameRect,\n shadowShape,\n tileSheet,\n tileStyle,\n tileViewBox,\n viewRect,\n watchView,\n type CellState,\n type SafeAreaProp,\n type FitProp,\n type PerCell,\n type StyleMap,\n} from \"@andamento/dom\";\nimport type { FillSource, ReliefOptions } from \"@andamento/svg\";\n\n/** Top-level children of a slot, with fragments (`v-for`) opened and comments (`v-if`) dropped. */\nfunction flatten(nodes: VNodeChild[] | undefined, out: VNode[] = []): VNode[] {\n for (const n of nodes ?? []) {\n if (n == null || typeof n === \"boolean\") continue;\n if (Array.isArray(n)) flatten(n, out);\n else if (typeof n === \"object\") {\n if (n.type === Comment) continue;\n if (n.type === Fragment) flatten(n.children as VNodeChild[], out);\n else if (n.type === Text && !String(n.children).trim()) continue;\n else out.push(n);\n } else if (String(n).trim()) out.push(h(Text, String(n)));\n }\n return out;\n}\n\nconst isEmpty = (nodes: VNode[] | undefined) => !nodes || nodes.length === 0;\n\nlet uid = 0;\n\n/**\n * A tiling as HTML: one absolutely positioned, `clip-path`-ed element per tile, holding\n * whatever you put in it. Each top-level child of the default slot fills one tile, in\n * reading order (`v-for` children count one each). Or use the `cell` slot, given\n * `{ cell, slot }`, to fill every tile. Sized in percentages, so it scales with its width.\n *\n * Slots: default (the items), `cell` (instead of items), `fallback` (empty tiles, given\n * `{ cell, state }`) and `backdrop` (one picture across all the tiles). Emits\n * `cell-activate` with `(cell, state)`. Props match the React `<TileLayout>`.\n */\nexport const TileLayout = defineComponent({\n name: \"TileLayout\",\n props: {\n /** Layout options; or pass a precomputed `layout` instead. */\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n /** Which tiles may hold items: \"all\" (default), \"whole\" or a test per cell. */\n contentCells: [String, Function] as PropType<ContentCells>,\n /** Where items go when there are fewer than tiles: \"reading\" (default), \"center\" or \"spread\". */\n placement: String as PropType<ContentPlacement>,\n /** Width / height of each item, to put items in tiles of similar shape. */\n aspects: Array as PropType<readonly number[]>,\n /**\n * Focal point of each child (fractions of its width and height; see `estimateFocus`): what\n * a photo keeps in view as its tile crops it. Each tile sets `--andamento-object-position`,\n * which `coverStyle` uses as `object-position`; exact when the photo's shape is known (`aspects`, or the focus's `aspect`).\n */\n /**\n * How many tiles each item spans (1 for an ordinary item): heavier items get featured\n * tiles where they fall in reading order (see `weightedLayout`). Needs `options`.\n */\n weights: Array as PropType<readonly number[]>,\n focalPoints: Array as PropType<readonly (Focus | undefined)[]>,\n /** With `aspects`: \"shape\" also picks which tiles hold items by their shape. */\n choose: String as PropType<\"placement\" | \"shape\">,\n /**\n * Put each tile's content in the tile's safe area (see `safeArea`). For tiles an\n * `edges: \"window\"` layout cuts, `true` or \"tile\" fits the whole tile, \"visible\" the part that shows.\n */\n safeArea: { type: [Boolean, String] as PropType<SafeAreaProp>, default: false },\n /** Color of empty tiles: a color, a palette or a function per cell. Defaults to `neutralPalette`. */\n fill: [String, Array, Function] as PropType<FillSource>,\n /** Size the tiles to the items: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n /** Raised tiles: a lit bevel and optional shadow. `true` for the defaults. */\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n /** Arrow-key navigation over the tiles with content, as one tab stop. */\n navigable: Boolean,\n /** Accessible name for each tile. */\n cellLabel: [String, Function] as PropType<PerCell<string | undefined>>,\n /** Focus ring color, or `false` for none. */\n focusRing: { type: [String, Boolean] as PropType<string | false>, default: \"#1a56db\" },\n /** Animate layout and content changes. `true` for 400 ms, or `{ duration, easing }`. */\n animate: { type: [Boolean, Object] as PropType<boolean | { duration?: number; easing?: string }>, default: false },\n /** Only mount the tiles in view (plus `overscan` pixels, default 300). */\n virtualize: { type: [Boolean, Object] as PropType<boolean | { overscan?: number }>, default: false },\n /** Class for each tile element. */\n cellClass: [String, Array, Object, Function] as PropType<PerCell<unknown>>,\n /** Extra style for each tile element. */\n cellStyle: [Object, Function] as PropType<PerCell<StyleMap | undefined>>,\n /** Color painted across the whole region, visible through the gaps. */\n background: String,\n role: { type: String, default: \"list\" },\n /** Called when a tile with content is clicked, or Enter / Space pressed on it. Bind with `@cell-activate`. */\n onCellActivate: Function as PropType<(cell: Cell, state: CellState) => void>,\n },\n setup(props, { slots, expose }) {\n const id = `andamento-vue${++uid}`;\n const resolveLayout = layoutResolver(\"<TileLayout>\");\n const buildFrame = frameBuilder();\n const container = ref<HTMLDivElement>();\n const view = shallowRef<Rect>();\n const activeId = ref<string>();\n const tiles = new Map<string, HTMLElement>();\n let pendingFocus: string | undefined;\n let layout: Layout | undefined;\n let lastKeys = new Set<string>();\n let presentKeys = new Set<string>();\n let mounted = false;\n let duration = 0;\n let stop: (() => void) | undefined;\n const timers = new Set<ReturnType<typeof setTimeout>>();\n // What the keyboard handler needs from the last render.\n let current: { focusable: Set<string>; state: Map<string, CellState> } = { focusable: new Set(), state: new Map() };\n\n const overscan = () => Math.max(0, (typeof props.virtualize === \"object\" ? props.virtualize.overscan : undefined) ?? 300);\n const measure = () => {\n if (!container.value || !layout) return;\n const next = viewRect(container.value, layout, overscan());\n if (!sameRect(next, view.value)) view.value = next;\n };\n const syncWatch = () => {\n if (props.virtualize && container.value && !stop) stop = watchView(container.value, measure);\n else if (!props.virtualize && stop) {\n stop();\n stop = undefined;\n view.value = undefined;\n }\n };\n let measuredLayout: Layout | undefined;\n const afterRender = () => {\n lastKeys = presentKeys;\n mounted = true;\n syncWatch();\n if (stop && measuredLayout !== layout) measure();\n measuredLayout = layout;\n if (pendingFocus) {\n const el = tiles.get(pendingFocus);\n if (el?.isConnected) {\n pendingFocus = undefined;\n el.focus();\n }\n }\n };\n onMounted(afterRender);\n onUpdated(afterRender);\n watch(() => props.virtualize, syncWatch);\n onBeforeUnmount(() => {\n stop?.();\n timers.forEach(clearTimeout);\n });\n\n const moveTo = (cell: Cell) => {\n activeId.value = cell.id;\n const el = tiles.get(cell.id);\n if (el?.isConnected && !el.hasAttribute(\"data-exiting\")) el.focus();\n else pendingFocus = cell.id;\n };\n const onKeydown = (e: KeyboardEvent) => {\n if (e.defaultPrevented || !props.navigable || e.altKey || e.ctrlKey || e.metaKey || !layout) return;\n const el = e.target as HTMLElement;\n const cellId = el.getAttribute?.(\"data-cell-id\");\n // Only when a tile itself has focus, not an input or button inside it.\n if (!cellId || tiles.get(cellId) !== el || !current.focusable.has(cellId)) return;\n const cell = layout.cells.find((c) => c.id === cellId)!;\n const action = keyAction(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);\n if (!action) return;\n e.preventDefault();\n if (\"activate\" in action) props.onCellActivate!(cell, current.state.get(cellId)!);\n else if (\"move\" in action) moveTo(action.move);\n };\n\n expose({\n /** The layout being shown. */\n get layout() {\n return layout;\n },\n });\n\n return () => {\n const items = slots.cell ? [] : flatten(slots.default?.());\n const L = resolveLayout(props.options, props.layout, {\n fit: !slots.cell && props.fit,\n count: items.length,\n cells: props.contentCells,\n weights: slots.cell ? undefined : props.weights,\n placement: props.placement,\n });\n layout = L;\n const frame = buildFrame(L, {\n count: slots.cell ? Infinity : items.length,\n aspects: slots.cell ? undefined : props.aspects,\n contentCells: props.contentCells,\n placement: props.placement,\n choose: props.choose,\n fill: props.fill,\n relief: props.relief,\n animate: props.animate,\n });\n const { slots: slotOf } = frame;\n const virtual = !!props.virtualize;\n const list = props.role === \"list\";\n const hasBackdrop = !!slots.backdrop;\n\n const keyOf = (i: number) => {\n const slot = slotOf[i]!;\n if (!slots.cell && slot >= 0) {\n const k = items[slot]?.key;\n return k != null ? `child:${String(k)}` : `child:${slot}`;\n }\n return `cell:${L.cells[i]!.id}`;\n };\n const hasContent = (i: number) => slotOf[i]! >= 0;\n const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);\n const first = L.cells.find((c) => focusable.has(c.id))?.id;\n const active = activeId.value !== undefined && focusable.has(activeId.value) ? activeId.value : first;\n\n let shown: number[];\n if (!virtual) shown = L.cells.map((_, i) => i);\n else {\n const s = new Set(view.value && view.value.width >= 0 ? cellsInRect(L, view.value).map((c) => c.index) : []);\n const a = active !== undefined ? L.cells.find((c) => c.id === active) : undefined;\n if (a) s.add(a.index);\n shown = [...s].sort((a, b) => a - b);\n }\n let positions: Map<number, number> | undefined;\n if (virtual) {\n positions = new Map();\n for (const c of L.cells) if (hasContent(c.index)) positions.set(c.index, positions.size + 1);\n }\n presentKeys = new Set(L.cells.map((_, i) => keyOf(i)));\n duration = frame.anim?.duration ?? 0;\n const state = new Map<string, CellState>();\n const focusRing = props.focusRing;\n\n const rendered = shown.map((i) => {\n const cell = L.cells[i]!;\n const slot = slotOf[i]!;\n let content: VNode[] | undefined = slots.cell ? flatten(slots.cell({ cell, slot })) : slot >= 0 ? [items[slot]!] : undefined;\n const empty = isEmpty(content);\n const st: CellState = { empty, slot: empty && !slots.cell ? -1 : slot };\n state.set(cell.id, st);\n if (empty && slots.fallback) content = flatten(slots.fallback({ cell, state: st }));\n const silent = empty && isEmpty(content);\n const canFocus = focusable.has(cell.id);\n const key = keyOf(i);\n const style = tileStyle(frame, cell, {\n empty,\n safeArea: props.safeArea,\n backdrop: hasBackdrop,\n clickable: !!props.onCellActivate && !empty,\n focus: !slots.cell && slot >= 0 ? props.focalPoints?.[slot] : undefined,\n aspect: !slots.cell && slot >= 0 ? props.aspects?.[slot] : undefined,\n });\n const bevel = frame.bevel(i);\n const viewBox = tileViewBox(cell);\n const children: VNodeChild[] = [];\n if (hasBackdrop) children.push(h(\"div\", { \"aria-hidden\": \"true\", style: backdropStyle(frame, cell) }, slots.backdrop!()));\n if (props.safeArea && !isEmpty(content)) {\n const aspect = !slots.cell && !empty && props.aspects ? (props.aspects[slot] ?? 1) : undefined;\n children.push(h(\"div\", { \"data-safe-area\": \"\", style: safeBoxStyle(frame, cell, aspect, props.safeArea) }, content));\n } else if (content) children.push(...content);\n if (bevel?.length)\n children.push(\n h(\n \"svg\",\n {\n // Re-made for a new shape when animating, so it fades in as the tile arrives.\n key: frame.anim ? String(style.clipPath) : \"bevel\",\n \"aria-hidden\": \"true\",\n \"data-bevel\": \"\",\n \"data-late\": frame.anim ? \"\" : undefined,\n viewBox,\n preserveAspectRatio: \"none\",\n style: overlayStyle,\n },\n bevel.map((p, k) => h(\"path\", { key: k, d: p.d, fill: p.fill, \"fill-opacity\": p.opacity })),\n ),\n );\n if (canFocus && focusRing !== false)\n children.push(\n h(\n \"svg\",\n { key: \"ring\", \"aria-hidden\": \"true\", \"data-focus-ring\": \"\", viewBox, preserveAspectRatio: \"none\", style: overlayStyle },\n ringStrokes(frame, cell, focusRing).map((p, k) =>\n h(\"path\", { key: k, d: p.d, fill: \"none\", stroke: p.stroke, \"stroke-width\": p.width, \"vector-effect\": \"non-scaling-stroke\" }),\n ),\n ),\n );\n return h(\n \"div\",\n {\n key,\n ref: (el: unknown) => {\n if (el) tiles.set(cell.id, el as HTMLElement);\n else if (!tiles.get(cell.id)?.isConnected) tiles.delete(cell.id);\n },\n role: silent ? undefined : list ? \"listitem\" : undefined,\n \"aria-hidden\": silent ? \"true\" : undefined,\n \"aria-label\": silent ? undefined : resolvePerCell(props.cellLabel, cell, st),\n \"aria-setsize\": positions && list && !silent ? positions.size : undefined,\n \"aria-posinset\": positions && list && !silent ? positions.get(i) : undefined,\n tabindex: canFocus ? (cell.id === active ? 0 : -1) : undefined,\n onFocus: canFocus ? (e: FocusEvent) => e.target === e.currentTarget && (activeId.value = cell.id) : undefined,\n onClick: props.onCellActivate && !empty ? () => props.onCellActivate!(cell, st) : undefined,\n class: resolvePerCell(props.cellClass, cell, st),\n \"data-cell-id\": cell.id,\n \"data-index\": cell.index,\n \"data-key\": key,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-boundary\": cell.boundary ? \"\" : undefined,\n style: { ...style, ...resolvePerCell(props.cellStyle, cell, st) },\n },\n children,\n );\n });\n current = { focusable, state };\n\n const shadow = shadowShape(frame, shown.map((i) => L.cells[i]!));\n const css = tileSheet({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });\n // Animated: tiles that go fade out, and new ones fade in (not those just scrolling\n // into or out of view, nor on first render).\n const tileNodes = frame.anim\n ? h(\n TransitionGroup,\n {\n css: false,\n onEnter: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (mounted && k && !lastKeys.has(k)) el.setAttribute(\"data-entering\", \"\");\n done();\n },\n onLeave: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (k && presentKeys.has(k)) return done();\n for (const a of [\"role\", \"tabindex\", \"aria-label\", \"data-entering\"]) el.removeAttribute(a);\n el.setAttribute(\"aria-hidden\", \"true\");\n el.setAttribute(\"data-exiting\", \"\");\n const timer = setTimeout(() => {\n timers.delete(timer);\n done();\n }, duration);\n timers.add(timer);\n },\n },\n () => rendered,\n )\n : rendered;\n\n return h(\n \"div\",\n {\n ref: container,\n \"data-andamento\": \"\",\n role: props.role,\n onKeydown,\n style: containerStyle(L),\n },\n [\n css ? h(\"style\", { key: \"css\" }, css) : null,\n props.background ? h(\"div\", { key: \"bg\", \"aria-hidden\": \"true\", style: backgroundStyle(frame, props.background) }) : null,\n shadow\n ? h(\"svg\", { key: \"shadow\", \"aria-hidden\": \"true\", \"data-andamento-shadow\": \"\", viewBox: shadow.viewBox, preserveAspectRatio: \"none\", style: shadow.style }, [\n h(\"filter\", { id: `${id}-shadow`, x: \"-10%\", y: \"-10%\", width: \"120%\", height: \"120%\" }, [h(\"feGaussianBlur\", { stdDeviation: shadow.blur })]),\n h(\"path\", { d: shadow.d, \"fill-rule\": \"evenodd\", transform: shadow.transform, fill: \"#000\", \"fill-opacity\": shadow.opacity, filter: `url(#${id}-shadow)` }),\n ])\n : null,\n tileNodes,\n ],\n );\n };\n },\n});\n","import { defineComponent, h, type PropType, type VNode } from \"vue\";\nimport type { ContentCells, ContentPlacement, Layout, LayoutOptions } from \"@andamento/core\";\nimport { layoutResolver, type FitProp } from \"@andamento/dom\";\nimport { toSvgTree, type FillSource, type ImageSource, type ReliefOptions, type SvgNode } from \"@andamento/svg\";\n\nconst toVNode = (n: SvgNode | string, key?: number): VNode | string =>\n typeof n === \"string\" ? n : h(n.tag, key === undefined ? n.attrs : { key, ...n.attrs }, n.children.map((c, i) => toVNode(c, i)));\n\nlet uid = 0;\n\n/**\n * A tiling as a single <svg>: colored cells, optionally with images clipped to each cell.\n * Use it for pure SVG (export, print, embedding in other SVG); use `<TileLayout>` for\n * arbitrary content. Takes the options of `renderToString` from @andamento/svg as props.\n */\nexport const SvgTileLayout = defineComponent({\n name: \"SvgTileLayout\",\n props: {\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n images: [Array, Function] as PropType<ImageSource>,\n repeatImages: Boolean,\n contentCells: [String, Function] as PropType<ContentCells>,\n placement: String as PropType<ContentPlacement>,\n imageAspects: Array as PropType<readonly number[]>,\n choose: String as PropType<\"placement\" | \"shape\">,\n imageFit: String as PropType<\"cover\" | \"contain\">,\n containWithin: String as PropType<\"tile\" | \"visible\">,\n imageWeights: Array as PropType<readonly number[]>,\n imageFocus: Array as PropType<readonly ({ x: number; y: number } | undefined)[]>,\n /** Size the tiles to the `images` array: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n fill: [String, Array, Function] as PropType<FillSource>,\n stroke: String,\n strokeWidth: Number,\n background: String,\n backdrop: String,\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n title: String,\n imageAlts: Array as PropType<readonly string[]>,\n precision: Number,\n },\n setup(props) {\n const idPrefix = `andamento-vue-svg${++uid}`;\n const resolveLayout = layoutResolver(\"<SvgTileLayout>\");\n return () => {\n const fitTo = Array.isArray(props.images) && !props.repeatImages ? props.images.length : 0;\n const layout = resolveLayout(props.options, props.layout, {\n fit: props.fit,\n count: fitTo,\n cells: props.contentCells,\n weights: Array.isArray(props.images) ? props.imageWeights : undefined,\n placement: props.placement,\n });\n const { options: _o, layout: _l, fit: _f, ...render } = props;\n const tree = toSvgTree(layout, { ...render, relief: props.relief || undefined, idPrefix });\n return toVNode(tree);\n };\n },\n});\n","import { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from \"vue\";\nimport { createLayout, fitCount, type FitOptions, type Layout, type LayoutOptions } from \"@andamento/core\";\n\n/** A computed value worked out again only when `key` changes. */\nfunction byKey<T>(key: () => string, make: () => T): ComputedRef<T> {\n let lastKey: string | undefined, last: T;\n return computed(() => {\n const k = key();\n if (k !== lastKey) {\n last = make();\n lastKey = k;\n }\n return last;\n });\n}\n\n/**\n * A layout from options (a ref, a getter or a plain object), worked out again only when\n * they change by value.\n */\nexport function useTileLayout(options: MaybeRefOrGetter<LayoutOptions>): ComputedRef<Layout> {\n return byKey(() => JSON.stringify(toValue(options)), () => createLayout(toValue(options)));\n}\n\n/** A layout whose tiles are sized to give about `count` usable cells (see `fitCount`). */\nexport function useFitCount(options: MaybeRefOrGetter<LayoutOptions>, count: MaybeRefOrGetter<number>, fit: FitOptions = {}): ComputedRef<Layout> {\n return byKey(\n () => JSON.stringify([toValue(options), toValue(count)]),\n () => fitCount(toValue(options), toValue(count), fit).layout,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAgBO;AACP,kBAAyI;AACzI,iBAuBO;AAIP,SAAS,QAAQ,OAAiC,MAAe,CAAC,GAAY;AAC5E,aAAW,KAAK,SAAS,CAAC,GAAG;AAC3B,QAAI,KAAK,QAAQ,OAAO,MAAM,UAAW;AACzC,QAAI,MAAM,QAAQ,CAAC,EAAG,SAAQ,GAAG,GAAG;AAAA,aAC3B,OAAO,MAAM,UAAU;AAC9B,UAAI,EAAE,SAAS,mBAAS;AACxB,UAAI,EAAE,SAAS,oBAAU,SAAQ,EAAE,UAA0B,GAAG;AAAA,eACvD,EAAE,SAAS,mBAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAG;AAAA,UACnD,KAAI,KAAK,CAAC;AAAA,IACj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OAAO,IAAI;AACxD,YAAM,WAAO,sBAAU,QAAQ,EAAE,GAAG,QAAQ,QAAQ,MAAM,UAAU,QAAW,SAAS,CAAC;AACzF,aAAO,QAAQ,IAAI;AAAA,IACrB;AAAA,EACF;AACF,CAAC;;;AC3DD,IAAAC,cAA2E;AAC3E,IAAAC,eAAyF;AAGzF,SAAS,MAAS,KAAmB,MAA+B;AAClE,MAAI,SAA6B;AACjC,aAAO,sBAAS,MAAM;AACpB,UAAM,IAAI,IAAI;AACd,QAAI,MAAM,SAAS;AACjB,aAAO,KAAK;AACZ,gBAAU;AAAA,IACZ;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAMO,SAAS,cAAc,SAA+D;AAC3F,SAAO,MAAM,MAAM,KAAK,cAAU,qBAAQ,OAAO,CAAC,GAAG,UAAM,+BAAa,qBAAQ,OAAO,CAAC,CAAC;AAC3F;AAGO,SAAS,YAAY,SAA0C,OAAiC,MAAkB,CAAC,GAAwB;AAChJ,SAAO;AAAA,IACL,MAAM,KAAK,UAAU,KAAC,qBAAQ,OAAO,OAAG,qBAAQ,KAAK,CAAC,CAAC;AAAA,IACvD,UAAM,2BAAS,qBAAQ,OAAO,OAAG,qBAAQ,KAAK,GAAG,GAAG,EAAE;AAAA,EACxD;AACF;;;AHtBA,IAAAC,cAA4E;","names":["a","import_vue","import_dom","uid","import_vue","import_core","import_dom"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/TileLayout.ts","../src/SvgTileLayout.ts","../src/composables.ts"],"sourcesContent":["/**\n * Vue 3 bindings: `<TileLayout>`, `<SvgTileLayout>` and composables.\n *\n * @module @andamento/vue\n */\nexport { TileLayout } from \"./TileLayout\";\nexport { SvgTileLayout } from \"./SvgTileLayout\";\nexport { useFitCount, useTileLayout } from \"./composables\";\nexport { cellFromPointer, coverStyle, defaultPalette, neutralPalette } from \"@andamento/dom\";\nexport type { CellState, FitProp, PerCell, PointerLike, StyleMap, FillSource, ReliefOptions } from \"@andamento/dom\";\nexport type { Cell, ContentCells, ContentPlacement, HitOptions, Layout, LayoutOptions } from \"@andamento/core\";\n","import {\n Comment,\n Fragment,\n Text,\n TransitionGroup,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n type VNodeChild,\n} from \"vue\";\nimport { cellsInRect, type Cell, type ContentCells, type ContentPlacement, type Focus, type Layout, type LayoutOptions, type Rect } from \"@andamento/core\";\nimport {\n type CellState,\n type SafeAreaProp,\n type FitProp,\n type PerCell,\n type StyleMap,\n} from \"@andamento/dom\";\nimport {\n backdropStyle,\n backgroundStyle,\n containerStyle,\n frameBuilder,\n keyAction,\n layoutResolver,\n overlayStyle,\n resolvePerCell,\n ringStrokes,\n safeBoxStyle,\n sameRect,\n shadowShape,\n tileSheet,\n tileStyle,\n tileViewBox,\n viewRect,\n watchView,\n} from \"@andamento/dom/internal\";\nimport type { FillSource, ReliefOptions } from \"@andamento/svg\";\n\n/** Top-level children of a slot, with fragments (`v-for`) opened and comments (`v-if`) dropped. */\nfunction flatten(nodes: VNodeChild[] | undefined, out: VNode[] = []): VNode[] {\n for (const n of nodes ?? []) {\n if (n == null || typeof n === \"boolean\") continue;\n if (Array.isArray(n)) flatten(n, out);\n else if (typeof n === \"object\") {\n if (n.type === Comment) continue;\n if (n.type === Fragment) flatten(n.children as VNodeChild[], out);\n else if (n.type === Text && !String(n.children).trim()) continue;\n else out.push(n);\n } else if (String(n).trim()) out.push(h(Text, String(n)));\n }\n return out;\n}\n\nconst isEmpty = (nodes: VNode[] | undefined) => !nodes || nodes.length === 0;\n\nlet uid = 0;\n\n/**\n * A tiling as HTML: one absolutely positioned, `clip-path`-ed element per tile, holding\n * whatever you put in it. Each top-level child of the default slot fills one tile, in\n * reading order (`v-for` children count one each). Or use the `cell` slot, given\n * `{ cell, slot }`, to fill every tile. Sized in percentages, so it scales with its width.\n *\n * Slots: default (the items), `cell` (instead of items), `fallback` (empty tiles, given\n * `{ cell, state }`) and `backdrop` (one picture across all the tiles). Emits\n * `cell-activate` with `(cell, state)`. Props match the React `<TileLayout>`.\n */\nexport const TileLayout = defineComponent({\n name: \"TileLayout\",\n props: {\n /** Layout options; or pass a precomputed `layout` instead. */\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n /** Which tiles may hold items: \"all\" (default), \"whole\" or a test per cell. */\n contentCells: [String, Function] as PropType<ContentCells>,\n /** Where items go when there are fewer than tiles: \"reading\" (default), \"center\" or \"spread\". */\n placement: String as PropType<ContentPlacement>,\n /** Width / height of each item, to put items in tiles of similar shape. */\n aspects: Array as PropType<readonly number[]>,\n /**\n * Focal point of each child (fractions of its width and height; see `estimateFocus`): what\n * a photo keeps in view as its tile crops it. Each tile sets `--andamento-object-position`,\n * which `coverStyle` uses as `object-position`; exact when the photo's shape is known (`aspects`, or the focus's `aspect`).\n */\n /**\n * How many tiles each item spans (1 for an ordinary item): heavier items get featured\n * tiles where they fall in reading order (see `weightedLayout`). Needs `options`.\n */\n weights: Array as PropType<readonly number[]>,\n focalPoints: Array as PropType<readonly (Focus | undefined)[]>,\n /** With `aspects`: \"shape\" also picks which tiles hold items by their shape. */\n choose: String as PropType<\"placement\" | \"shape\">,\n /**\n * Put each tile's content in the tile's safe area (see `safeArea`). For tiles an\n * `edges: \"window\"` layout cuts, `true` or \"tile\" fits the whole tile, \"visible\" the part that shows.\n */\n safeArea: { type: [Boolean, String] as PropType<SafeAreaProp>, default: false },\n /** Color of empty tiles: a color, a palette or a function per cell. Defaults to `neutralPalette`. */\n fill: [String, Array, Function] as PropType<FillSource>,\n /** Size the tiles to the items: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n /** Raised tiles: a lit bevel and optional shadow. `true` for the defaults. */\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n /** Arrow-key navigation over the tiles with content, as one tab stop. */\n navigable: Boolean,\n /** Accessible name for each tile. */\n cellLabel: [String, Function] as PropType<PerCell<string | undefined>>,\n /** Focus ring color, or `false` for none. */\n focusRing: { type: [String, Boolean] as PropType<string | false>, default: \"#1a56db\" },\n /** Animate layout and content changes. `true` for 400 ms, or `{ duration, easing }`. */\n animate: { type: [Boolean, Object] as PropType<boolean | { duration?: number; easing?: string }>, default: false },\n /** Only mount the tiles in view (plus `overscan` pixels, default 300). */\n virtualize: { type: [Boolean, Object] as PropType<boolean | { overscan?: number }>, default: false },\n /** Class for each tile element. */\n cellClass: [String, Array, Object, Function] as PropType<PerCell<unknown>>,\n /** Extra style for each tile element. */\n cellStyle: [Object, Function] as PropType<PerCell<StyleMap | undefined>>,\n /** Color painted across the whole region, visible through the gaps. */\n background: String,\n role: { type: String, default: \"list\" },\n /** Called when a tile with content is clicked, or Enter / Space pressed on it. Bind with `@cell-activate`. */\n onCellActivate: Function as PropType<(cell: Cell, state: CellState) => void>,\n },\n setup(props, { slots, expose }) {\n const id = `andamento-vue${++uid}`;\n const resolveLayout = layoutResolver(\"<TileLayout>\");\n const buildFrame = frameBuilder();\n const container = ref<HTMLDivElement>();\n const view = shallowRef<Rect>();\n const activeId = ref<string>();\n const tiles = new Map<string, HTMLElement>();\n let pendingFocus: string | undefined;\n let layout: Layout | undefined;\n let lastKeys = new Set<string>();\n let presentKeys = new Set<string>();\n let mounted = false;\n let duration = 0;\n let stop: (() => void) | undefined;\n const timers = new Set<ReturnType<typeof setTimeout>>();\n // What the keyboard handler needs from the last render.\n let current: { focusable: Set<string>; state: Map<string, CellState> } = { focusable: new Set(), state: new Map() };\n\n const overscan = () => Math.max(0, (typeof props.virtualize === \"object\" ? props.virtualize.overscan : undefined) ?? 300);\n const measure = () => {\n if (!container.value || !layout) return;\n const next = viewRect(container.value, layout, overscan());\n if (!sameRect(next, view.value)) view.value = next;\n };\n const syncWatch = () => {\n if (props.virtualize && container.value && !stop) stop = watchView(container.value, measure);\n else if (!props.virtualize && stop) {\n stop();\n stop = undefined;\n view.value = undefined;\n }\n };\n let measuredLayout: Layout | undefined;\n const afterRender = () => {\n lastKeys = presentKeys;\n mounted = true;\n syncWatch();\n if (stop && measuredLayout !== layout) measure();\n measuredLayout = layout;\n if (pendingFocus) {\n const el = tiles.get(pendingFocus);\n if (el?.isConnected) {\n pendingFocus = undefined;\n el.focus();\n }\n }\n };\n onMounted(afterRender);\n onUpdated(afterRender);\n watch(() => props.virtualize, syncWatch);\n onBeforeUnmount(() => {\n stop?.();\n timers.forEach(clearTimeout);\n });\n\n const moveTo = (cell: Cell) => {\n activeId.value = cell.id;\n const el = tiles.get(cell.id);\n if (el?.isConnected && !el.hasAttribute(\"data-exiting\")) el.focus();\n else pendingFocus = cell.id;\n };\n const onKeydown = (e: KeyboardEvent) => {\n if (e.defaultPrevented || !props.navigable || e.altKey || e.ctrlKey || e.metaKey || !layout) return;\n const el = e.target as HTMLElement;\n const cellId = el.getAttribute?.(\"data-cell-id\");\n // Only when a tile itself has focus, not an input or button inside it.\n if (!cellId || tiles.get(cellId) !== el || !current.focusable.has(cellId)) return;\n const cell = layout.cells.find((c) => c.id === cellId)!;\n const action = keyAction(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);\n if (!action) return;\n e.preventDefault();\n if (\"activate\" in action) props.onCellActivate!(cell, current.state.get(cellId)!);\n else if (\"move\" in action) moveTo(action.move);\n };\n\n expose({\n /** The layout being shown. */\n get layout() {\n return layout;\n },\n });\n\n return () => {\n const items = slots.cell ? [] : flatten(slots.default?.());\n const L = resolveLayout(props.options, props.layout, {\n fit: !slots.cell && props.fit,\n count: items.length,\n cells: props.contentCells,\n weights: slots.cell ? undefined : props.weights,\n placement: props.placement,\n });\n layout = L;\n const frame = buildFrame(L, {\n count: slots.cell ? Infinity : items.length,\n aspects: slots.cell ? undefined : props.aspects,\n contentCells: props.contentCells,\n placement: props.placement,\n choose: props.choose,\n fill: props.fill,\n relief: props.relief,\n animate: props.animate,\n });\n const { slots: slotOf } = frame;\n const virtual = !!props.virtualize;\n const list = props.role === \"list\";\n const hasBackdrop = !!slots.backdrop;\n\n const keyOf = (i: number) => {\n const slot = slotOf[i]!;\n if (!slots.cell && slot >= 0) {\n const k = items[slot]?.key;\n return k != null ? `child:${String(k)}` : `child:${slot}`;\n }\n return `cell:${L.cells[i]!.id}`;\n };\n // What each tile holds, worked out once per render. Without virtualization every tile's\n // is worked out first, so only tiles with content take focus; with it, only those in\n // view are, and a tile counts as having content when it has a slot.\n const contents = new Map<number, VNode[] | undefined>();\n const contentOf = (i: number) => {\n if (!contents.has(i)) {\n const slot = slotOf[i]!;\n contents.set(i, slots.cell ? flatten(slots.cell({ cell: L.cells[i]!, slot })) : slot >= 0 ? [items[slot]!] : undefined);\n }\n return contents.get(i);\n };\n const hasContent = (i: number) => slotOf[i]! >= 0 && (virtual || !isEmpty(contentOf(i)));\n const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);\n const first = L.cells.find((c) => focusable.has(c.id))?.id;\n const active = activeId.value !== undefined && focusable.has(activeId.value) ? activeId.value : first;\n\n let shown: number[];\n if (!virtual) shown = L.cells.map((_, i) => i);\n else {\n const s = new Set(view.value && view.value.width >= 0 ? cellsInRect(L, view.value).map((c) => c.index) : []);\n const a = active !== undefined ? L.cells.find((c) => c.id === active) : undefined;\n if (a) s.add(a.index);\n shown = [...s].sort((a, b) => a - b);\n }\n let positions: Map<number, number> | undefined;\n if (virtual) {\n positions = new Map();\n for (const c of L.cells) if (hasContent(c.index)) positions.set(c.index, positions.size + 1);\n }\n presentKeys = new Set(L.cells.map((_, i) => keyOf(i)));\n duration = frame.anim?.duration ?? 0;\n const state = new Map<string, CellState>();\n const focusRing = props.focusRing;\n\n const rendered = shown.map((i) => {\n const cell = L.cells[i]!;\n const slot = slotOf[i]!;\n let content = contentOf(i);\n const empty = isEmpty(content);\n const st: CellState = { empty, slot: empty && !slots.cell ? -1 : slot };\n state.set(cell.id, st);\n if (empty && slots.fallback) content = flatten(slots.fallback({ cell, state: st }));\n const silent = empty && isEmpty(content);\n const canFocus = focusable.has(cell.id);\n const key = keyOf(i);\n const style = tileStyle(frame, cell, {\n empty,\n safeArea: props.safeArea,\n backdrop: hasBackdrop,\n clickable: !!props.onCellActivate && !empty,\n focus: !slots.cell && slot >= 0 ? props.focalPoints?.[slot] : undefined,\n aspect: !slots.cell && slot >= 0 ? props.aspects?.[slot] : undefined,\n });\n const bevel = frame.bevel(i);\n const viewBox = tileViewBox(cell);\n const children: VNodeChild[] = [];\n if (hasBackdrop) children.push(h(\"div\", { \"aria-hidden\": \"true\", style: backdropStyle(frame, cell) }, slots.backdrop!()));\n if (props.safeArea && !isEmpty(content)) {\n const aspect = !slots.cell && !empty && props.aspects ? (props.aspects[slot] ?? 1) : undefined;\n children.push(h(\"div\", { \"data-safe-area\": \"\", style: safeBoxStyle(frame, cell, aspect, props.safeArea) }, content));\n } else if (content) children.push(...content);\n if (bevel?.length)\n children.push(\n h(\n \"svg\",\n {\n // Re-made for a new shape when animating, so it fades in as the tile arrives.\n key: frame.anim ? String(style.clipPath) : \"bevel\",\n \"aria-hidden\": \"true\",\n \"data-bevel\": \"\",\n \"data-late\": frame.anim ? \"\" : undefined,\n viewBox,\n preserveAspectRatio: \"none\",\n style: overlayStyle,\n },\n bevel.map((p, k) => h(\"path\", { key: k, d: p.d, fill: p.fill, \"fill-opacity\": p.opacity })),\n ),\n );\n if (canFocus && focusRing !== false)\n children.push(\n h(\n \"svg\",\n { key: \"ring\", \"aria-hidden\": \"true\", \"data-focus-ring\": \"\", viewBox, preserveAspectRatio: \"none\", style: overlayStyle },\n ringStrokes(frame, cell, focusRing).map((p, k) =>\n h(\"path\", { key: k, d: p.d, fill: \"none\", stroke: p.stroke, \"stroke-width\": p.width, \"vector-effect\": \"non-scaling-stroke\" }),\n ),\n ),\n );\n return h(\n \"div\",\n {\n key,\n ref: (el: unknown) => {\n if (el) tiles.set(cell.id, el as HTMLElement);\n else if (!tiles.get(cell.id)?.isConnected) tiles.delete(cell.id);\n },\n role: silent ? undefined : list ? \"listitem\" : undefined,\n \"aria-hidden\": silent ? \"true\" : undefined,\n \"aria-label\": silent ? undefined : resolvePerCell(props.cellLabel, cell, st),\n \"aria-setsize\": positions && list && !silent ? positions.size : undefined,\n \"aria-posinset\": positions && list && !silent ? positions.get(i) : undefined,\n tabindex: canFocus ? (cell.id === active ? 0 : -1) : undefined,\n onFocus: canFocus ? (e: FocusEvent) => e.target === e.currentTarget && (activeId.value = cell.id) : undefined,\n onClick: props.onCellActivate && !empty ? () => props.onCellActivate!(cell, st) : undefined,\n class: resolvePerCell(props.cellClass, cell, st),\n \"data-cell-id\": cell.id,\n \"data-index\": cell.index,\n \"data-key\": key,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-boundary\": cell.boundary ? \"\" : undefined,\n style: { ...style, ...resolvePerCell(props.cellStyle, cell, st) },\n },\n children,\n );\n });\n current = { focusable, state };\n\n const shadow = shadowShape(frame, shown.map((i) => L.cells[i]!));\n const css = tileSheet({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });\n // Animated: tiles that go fade out, and new ones fade in (not those just scrolling\n // into or out of view, nor on first render).\n const tileNodes = frame.anim\n ? h(\n TransitionGroup,\n {\n css: false,\n onEnter: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (mounted && k && !lastKeys.has(k)) el.setAttribute(\"data-entering\", \"\");\n done();\n },\n onLeave: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (k && presentKeys.has(k)) return done();\n for (const a of [\"role\", \"tabindex\", \"aria-label\", \"data-entering\"]) el.removeAttribute(a);\n el.setAttribute(\"aria-hidden\", \"true\");\n el.setAttribute(\"data-exiting\", \"\");\n const timer = setTimeout(() => {\n timers.delete(timer);\n done();\n }, duration);\n timers.add(timer);\n },\n },\n () => rendered,\n )\n : rendered;\n\n return h(\n \"div\",\n {\n ref: container,\n \"data-andamento\": \"\",\n role: props.role,\n onKeydown,\n style: containerStyle(L),\n },\n [\n css ? h(\"style\", { key: \"css\" }, css) : null,\n props.background ? h(\"div\", { key: \"bg\", \"aria-hidden\": \"true\", style: backgroundStyle(frame, props.background) }) : null,\n shadow\n ? h(\"svg\", { key: \"shadow\", \"aria-hidden\": \"true\", \"data-andamento-shadow\": \"\", viewBox: shadow.viewBox, preserveAspectRatio: \"none\", style: shadow.style }, [\n h(\"filter\", { id: `${id}-shadow`, x: \"-10%\", y: \"-10%\", width: \"120%\", height: \"120%\" }, [h(\"feGaussianBlur\", { stdDeviation: shadow.blur })]),\n h(\"path\", { d: shadow.d, \"fill-rule\": \"evenodd\", transform: shadow.transform, fill: \"#000\", \"fill-opacity\": shadow.opacity, filter: `url(#${id}-shadow)` }),\n ])\n : null,\n tileNodes,\n ],\n );\n };\n },\n});\n","import { defineComponent, h, type PropType, type VNode } from \"vue\";\nimport type { ContentCells, ContentPlacement, Layout, LayoutOptions } from \"@andamento/core\";\nimport { type FitProp } from \"@andamento/dom\";\nimport { layoutResolver } from \"@andamento/dom/internal\";\nimport { toSvgTree, type FillSource, type ImageSource, type ReliefOptions, type SvgNode } from \"@andamento/svg\";\n\nconst toVNode = (n: SvgNode | string, key?: number): VNode | string =>\n typeof n === \"string\" ? n : h(n.tag, key === undefined ? n.attrs : { key, ...n.attrs }, n.children.map((c, i) => toVNode(c, i)));\n\nlet uid = 0;\n\n/**\n * A tiling as a single <svg>: colored cells, optionally with images clipped to each cell.\n * Use it for pure SVG (export, print, embedding in other SVG); use `<TileLayout>` for\n * arbitrary content. Takes the options of `renderToString` from @andamento/svg as props.\n */\nexport const SvgTileLayout = defineComponent({\n name: \"SvgTileLayout\",\n props: {\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n images: [Array, Function] as PropType<ImageSource>,\n repeatImages: Boolean,\n contentCells: [String, Function] as PropType<ContentCells>,\n placement: String as PropType<ContentPlacement>,\n imageAspects: Array as PropType<readonly number[]>,\n choose: String as PropType<\"placement\" | \"shape\">,\n imageFit: String as PropType<\"cover\" | \"contain\">,\n containWithin: String as PropType<\"tile\" | \"visible\">,\n imageWeights: Array as PropType<readonly number[]>,\n imageFocus: Array as PropType<readonly ({ x: number; y: number } | undefined)[]>,\n /** Size the tiles to the `images` array: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n fill: [String, Array, Function] as PropType<FillSource>,\n stroke: String,\n strokeWidth: Number,\n background: String,\n backdrop: String,\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n title: String,\n imageAlts: Array as PropType<readonly string[]>,\n precision: Number,\n },\n setup(props) {\n const idPrefix = `andamento-vue-svg${++uid}`;\n const resolveLayout = layoutResolver(\"<SvgTileLayout>\");\n return () => {\n const fitTo = Array.isArray(props.images) && !props.repeatImages ? props.images.length : 0;\n const layout = resolveLayout(props.options, props.layout, {\n fit: props.fit,\n count: fitTo,\n cells: props.contentCells,\n weights: Array.isArray(props.images) ? props.imageWeights : undefined,\n placement: props.placement,\n });\n const { options: _o, layout: _l, fit: _f, ...render } = props;\n const tree = toSvgTree(layout, { ...render, relief: props.relief || undefined, idPrefix });\n return toVNode(tree);\n };\n },\n});\n","import { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from \"vue\";\nimport { createLayout, fitCount, type FitOptions, type Layout, type LayoutOptions } from \"@andamento/core\";\nimport { optionsKey } from \"@andamento/dom/internal\";\n\n/** A computed value worked out again only when `key` changes. */\nfunction byKey<T>(key: () => string, make: () => T): ComputedRef<T> {\n let lastKey: string | undefined, last: T;\n return computed(() => {\n const k = key();\n if (k !== lastKey) {\n last = make();\n lastKey = k;\n }\n return last;\n });\n}\n\n/**\n * A layout from options (a ref, a getter or a plain object), worked out again only when\n * they change by value.\n */\nexport function useTileLayout(options: MaybeRefOrGetter<LayoutOptions>): ComputedRef<Layout> {\n return byKey(() => optionsKey(toValue(options)), () => createLayout(toValue(options)));\n}\n\n/** A layout whose tiles are sized to give about `count` usable cells (see `fitCount`). */\nexport function useFitCount(options: MaybeRefOrGetter<LayoutOptions>, count: MaybeRefOrGetter<number>, fit: FitOptions = {}): ComputedRef<Layout> {\n return byKey(\n () => optionsKey([toValue(options), toValue(count), fit.cells, fit.mode]),\n () => fitCount(toValue(options), toValue(count), fit).layout,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAgBO;AACP,kBAAyI;AAQzI,sBAkBO;AAIP,SAAS,QAAQ,OAAiC,MAAe,CAAC,GAAY;AAC5E,aAAW,KAAK,SAAS,CAAC,GAAG;AAC3B,QAAI,KAAK,QAAQ,OAAO,MAAM,UAAW;AACzC,QAAI,MAAM,QAAQ,CAAC,EAAG,SAAQ,GAAG,GAAG;AAAA,aAC3B,OAAO,MAAM,UAAU;AAC9B,UAAI,EAAE,SAAS,mBAAS;AACxB,UAAI,EAAE,SAAS,oBAAU,SAAQ,EAAE,UAA0B,GAAG;AAAA,eACvD,EAAE,SAAS,mBAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAG;AAAA,UACnD,KAAI,KAAK,CAAC;AAAA,IACjB,WAAW,OAAO,CAAC,EAAE,KAAK,EAAG,KAAI,SAAK,cAAE,iBAAM,OAAO,CAAC,CAAC,CAAC;AAAA,EAC1D;AACA,SAAO;AACT;AAEA,IAAM,UAAU,CAAC,UAA+B,CAAC,SAAS,MAAM,WAAW;AAE3E,IAAI,MAAM;AAYH,IAAM,iBAAa,4BAAgB;AAAA,EACxC,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,IAEL,SAAS;AAAA,IACT,QAAQ;AAAA;AAAA,IAER,cAAc,CAAC,QAAQ,QAAQ;AAAA;AAAA,IAE/B,WAAW;AAAA;AAAA,IAEX,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUT,SAAS;AAAA,IACT,aAAa;AAAA;AAAA,IAEb,QAAQ;AAAA;AAAA;AA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,mBAA2B;AAG3B,SAAS,MAAS,KAAmB,MAA+B;AAClE,MAAI,SAA6B;AACjC,aAAO,sBAAS,MAAM;AACpB,UAAM,IAAI,IAAI;AACd,QAAI,MAAM,SAAS;AACjB,aAAO,KAAK;AACZ,gBAAU;AAAA,IACZ;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAMO,SAAS,cAAc,SAA+D;AAC3F,SAAO,MAAM,UAAM,iCAAW,qBAAQ,OAAO,CAAC,GAAG,UAAM,+BAAa,qBAAQ,OAAO,CAAC,CAAC;AACvF;AAGO,SAAS,YAAY,SAA0C,OAAiC,MAAkB,CAAC,GAAwB;AAChJ,SAAO;AAAA,IACL,UAAM,6BAAW,KAAC,qBAAQ,OAAO,OAAG,qBAAQ,KAAK,GAAG,IAAI,OAAO,IAAI,IAAI,CAAC;AAAA,IACxE,UAAM,2BAAS,qBAAQ,OAAO,OAAG,qBAAQ,KAAK,GAAG,GAAG,EAAE;AAAA,EACxD;AACF;;;AHvBA,iBAA4E;","names":["a","import_vue","import_internal","uid","import_vue","import_core","import_internal"]}
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  tileViewBox,
33
33
  viewRect,
34
34
  watchView
35
- } from "@andamento/dom";
35
+ } from "@andamento/dom/internal";
36
36
  function flatten(nodes, out = []) {
37
37
  for (const n of nodes ?? []) {
38
38
  if (n == null || typeof n === "boolean") continue;
@@ -213,7 +213,15 @@ var TileLayout = defineComponent({
213
213
  }
214
214
  return `cell:${L.cells[i].id}`;
215
215
  };
216
- const hasContent = (i) => slotOf[i] >= 0;
216
+ const contents = /* @__PURE__ */ new Map();
217
+ const contentOf = (i) => {
218
+ if (!contents.has(i)) {
219
+ const slot = slotOf[i];
220
+ contents.set(i, slots.cell ? flatten(slots.cell({ cell: L.cells[i], slot })) : slot >= 0 ? [items[slot]] : void 0);
221
+ }
222
+ return contents.get(i);
223
+ };
224
+ const hasContent = (i) => slotOf[i] >= 0 && (virtual || !isEmpty(contentOf(i)));
217
225
  const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);
218
226
  const first = L.cells.find((c) => focusable.has(c.id))?.id;
219
227
  const active = activeId.value !== void 0 && focusable.has(activeId.value) ? activeId.value : first;
@@ -237,7 +245,7 @@ var TileLayout = defineComponent({
237
245
  const rendered = shown.map((i) => {
238
246
  const cell = L.cells[i];
239
247
  const slot = slotOf[i];
240
- let content = slots.cell ? flatten(slots.cell({ cell, slot })) : slot >= 0 ? [items[slot]] : void 0;
248
+ let content = contentOf(i);
241
249
  const empty = isEmpty(content);
242
250
  const st = { empty, slot: empty && !slots.cell ? -1 : slot };
243
251
  state.set(cell.id, st);
@@ -367,7 +375,7 @@ var TileLayout = defineComponent({
367
375
 
368
376
  // src/SvgTileLayout.ts
369
377
  import { defineComponent as defineComponent2, h as h2 } from "vue";
370
- import { layoutResolver as layoutResolver2 } from "@andamento/dom";
378
+ import { layoutResolver as layoutResolver2 } from "@andamento/dom/internal";
371
379
  import { toSvgTree } from "@andamento/svg";
372
380
  var toVNode = (n, key) => typeof n === "string" ? n : h2(n.tag, key === void 0 ? n.attrs : { key, ...n.attrs }, n.children.map((c, i) => toVNode(c, i)));
373
381
  var uid2 = 0;
@@ -420,6 +428,7 @@ var SvgTileLayout = defineComponent2({
420
428
  // src/composables.ts
421
429
  import { computed, toValue } from "vue";
422
430
  import { createLayout, fitCount } from "@andamento/core";
431
+ import { optionsKey } from "@andamento/dom/internal";
423
432
  function byKey(key, make) {
424
433
  let lastKey, last;
425
434
  return computed(() => {
@@ -432,11 +441,11 @@ function byKey(key, make) {
432
441
  });
433
442
  }
434
443
  function useTileLayout(options) {
435
- return byKey(() => JSON.stringify(toValue(options)), () => createLayout(toValue(options)));
444
+ return byKey(() => optionsKey(toValue(options)), () => createLayout(toValue(options)));
436
445
  }
437
446
  function useFitCount(options, count, fit = {}) {
438
447
  return byKey(
439
- () => JSON.stringify([toValue(options), toValue(count)]),
448
+ () => optionsKey([toValue(options), toValue(count), fit.cells, fit.mode]),
440
449
  () => fitCount(toValue(options), toValue(count), fit).layout
441
450
  );
442
451
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/TileLayout.ts","../src/SvgTileLayout.ts","../src/composables.ts","../src/index.ts"],"sourcesContent":["import {\n Comment,\n Fragment,\n Text,\n TransitionGroup,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n type VNodeChild,\n} from \"vue\";\nimport { cellsInRect, type Cell, type ContentCells, type ContentPlacement, type Focus, type Layout, type LayoutOptions, type Rect } from \"@andamento/core\";\nimport {\n backdropStyle,\n backgroundStyle,\n containerStyle,\n frameBuilder,\n keyAction,\n layoutResolver,\n overlayStyle,\n resolvePerCell,\n ringStrokes,\n safeBoxStyle,\n sameRect,\n shadowShape,\n tileSheet,\n tileStyle,\n tileViewBox,\n viewRect,\n watchView,\n type CellState,\n type SafeAreaProp,\n type FitProp,\n type PerCell,\n type StyleMap,\n} from \"@andamento/dom\";\nimport type { FillSource, ReliefOptions } from \"@andamento/svg\";\n\n/** Top-level children of a slot, with fragments (`v-for`) opened and comments (`v-if`) dropped. */\nfunction flatten(nodes: VNodeChild[] | undefined, out: VNode[] = []): VNode[] {\n for (const n of nodes ?? []) {\n if (n == null || typeof n === \"boolean\") continue;\n if (Array.isArray(n)) flatten(n, out);\n else if (typeof n === \"object\") {\n if (n.type === Comment) continue;\n if (n.type === Fragment) flatten(n.children as VNodeChild[], out);\n else if (n.type === Text && !String(n.children).trim()) continue;\n else out.push(n);\n } else if (String(n).trim()) out.push(h(Text, String(n)));\n }\n return out;\n}\n\nconst isEmpty = (nodes: VNode[] | undefined) => !nodes || nodes.length === 0;\n\nlet uid = 0;\n\n/**\n * A tiling as HTML: one absolutely positioned, `clip-path`-ed element per tile, holding\n * whatever you put in it. Each top-level child of the default slot fills one tile, in\n * reading order (`v-for` children count one each). Or use the `cell` slot, given\n * `{ cell, slot }`, to fill every tile. Sized in percentages, so it scales with its width.\n *\n * Slots: default (the items), `cell` (instead of items), `fallback` (empty tiles, given\n * `{ cell, state }`) and `backdrop` (one picture across all the tiles). Emits\n * `cell-activate` with `(cell, state)`. Props match the React `<TileLayout>`.\n */\nexport const TileLayout = defineComponent({\n name: \"TileLayout\",\n props: {\n /** Layout options; or pass a precomputed `layout` instead. */\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n /** Which tiles may hold items: \"all\" (default), \"whole\" or a test per cell. */\n contentCells: [String, Function] as PropType<ContentCells>,\n /** Where items go when there are fewer than tiles: \"reading\" (default), \"center\" or \"spread\". */\n placement: String as PropType<ContentPlacement>,\n /** Width / height of each item, to put items in tiles of similar shape. */\n aspects: Array as PropType<readonly number[]>,\n /**\n * Focal point of each child (fractions of its width and height; see `estimateFocus`): what\n * a photo keeps in view as its tile crops it. Each tile sets `--andamento-object-position`,\n * which `coverStyle` uses as `object-position`; exact when the photo's shape is known (`aspects`, or the focus's `aspect`).\n */\n /**\n * How many tiles each item spans (1 for an ordinary item): heavier items get featured\n * tiles where they fall in reading order (see `weightedLayout`). Needs `options`.\n */\n weights: Array as PropType<readonly number[]>,\n focalPoints: Array as PropType<readonly (Focus | undefined)[]>,\n /** With `aspects`: \"shape\" also picks which tiles hold items by their shape. */\n choose: String as PropType<\"placement\" | \"shape\">,\n /**\n * Put each tile's content in the tile's safe area (see `safeArea`). For tiles an\n * `edges: \"window\"` layout cuts, `true` or \"tile\" fits the whole tile, \"visible\" the part that shows.\n */\n safeArea: { type: [Boolean, String] as PropType<SafeAreaProp>, default: false },\n /** Color of empty tiles: a color, a palette or a function per cell. Defaults to `neutralPalette`. */\n fill: [String, Array, Function] as PropType<FillSource>,\n /** Size the tiles to the items: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n /** Raised tiles: a lit bevel and optional shadow. `true` for the defaults. */\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n /** Arrow-key navigation over the tiles with content, as one tab stop. */\n navigable: Boolean,\n /** Accessible name for each tile. */\n cellLabel: [String, Function] as PropType<PerCell<string | undefined>>,\n /** Focus ring color, or `false` for none. */\n focusRing: { type: [String, Boolean] as PropType<string | false>, default: \"#1a56db\" },\n /** Animate layout and content changes. `true` for 400 ms, or `{ duration, easing }`. */\n animate: { type: [Boolean, Object] as PropType<boolean | { duration?: number; easing?: string }>, default: false },\n /** Only mount the tiles in view (plus `overscan` pixels, default 300). */\n virtualize: { type: [Boolean, Object] as PropType<boolean | { overscan?: number }>, default: false },\n /** Class for each tile element. */\n cellClass: [String, Array, Object, Function] as PropType<PerCell<unknown>>,\n /** Extra style for each tile element. */\n cellStyle: [Object, Function] as PropType<PerCell<StyleMap | undefined>>,\n /** Color painted across the whole region, visible through the gaps. */\n background: String,\n role: { type: String, default: \"list\" },\n /** Called when a tile with content is clicked, or Enter / Space pressed on it. Bind with `@cell-activate`. */\n onCellActivate: Function as PropType<(cell: Cell, state: CellState) => void>,\n },\n setup(props, { slots, expose }) {\n const id = `andamento-vue${++uid}`;\n const resolveLayout = layoutResolver(\"<TileLayout>\");\n const buildFrame = frameBuilder();\n const container = ref<HTMLDivElement>();\n const view = shallowRef<Rect>();\n const activeId = ref<string>();\n const tiles = new Map<string, HTMLElement>();\n let pendingFocus: string | undefined;\n let layout: Layout | undefined;\n let lastKeys = new Set<string>();\n let presentKeys = new Set<string>();\n let mounted = false;\n let duration = 0;\n let stop: (() => void) | undefined;\n const timers = new Set<ReturnType<typeof setTimeout>>();\n // What the keyboard handler needs from the last render.\n let current: { focusable: Set<string>; state: Map<string, CellState> } = { focusable: new Set(), state: new Map() };\n\n const overscan = () => Math.max(0, (typeof props.virtualize === \"object\" ? props.virtualize.overscan : undefined) ?? 300);\n const measure = () => {\n if (!container.value || !layout) return;\n const next = viewRect(container.value, layout, overscan());\n if (!sameRect(next, view.value)) view.value = next;\n };\n const syncWatch = () => {\n if (props.virtualize && container.value && !stop) stop = watchView(container.value, measure);\n else if (!props.virtualize && stop) {\n stop();\n stop = undefined;\n view.value = undefined;\n }\n };\n let measuredLayout: Layout | undefined;\n const afterRender = () => {\n lastKeys = presentKeys;\n mounted = true;\n syncWatch();\n if (stop && measuredLayout !== layout) measure();\n measuredLayout = layout;\n if (pendingFocus) {\n const el = tiles.get(pendingFocus);\n if (el?.isConnected) {\n pendingFocus = undefined;\n el.focus();\n }\n }\n };\n onMounted(afterRender);\n onUpdated(afterRender);\n watch(() => props.virtualize, syncWatch);\n onBeforeUnmount(() => {\n stop?.();\n timers.forEach(clearTimeout);\n });\n\n const moveTo = (cell: Cell) => {\n activeId.value = cell.id;\n const el = tiles.get(cell.id);\n if (el?.isConnected && !el.hasAttribute(\"data-exiting\")) el.focus();\n else pendingFocus = cell.id;\n };\n const onKeydown = (e: KeyboardEvent) => {\n if (e.defaultPrevented || !props.navigable || e.altKey || e.ctrlKey || e.metaKey || !layout) return;\n const el = e.target as HTMLElement;\n const cellId = el.getAttribute?.(\"data-cell-id\");\n // Only when a tile itself has focus, not an input or button inside it.\n if (!cellId || tiles.get(cellId) !== el || !current.focusable.has(cellId)) return;\n const cell = layout.cells.find((c) => c.id === cellId)!;\n const action = keyAction(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);\n if (!action) return;\n e.preventDefault();\n if (\"activate\" in action) props.onCellActivate!(cell, current.state.get(cellId)!);\n else if (\"move\" in action) moveTo(action.move);\n };\n\n expose({\n /** The layout being shown. */\n get layout() {\n return layout;\n },\n });\n\n return () => {\n const items = slots.cell ? [] : flatten(slots.default?.());\n const L = resolveLayout(props.options, props.layout, {\n fit: !slots.cell && props.fit,\n count: items.length,\n cells: props.contentCells,\n weights: slots.cell ? undefined : props.weights,\n placement: props.placement,\n });\n layout = L;\n const frame = buildFrame(L, {\n count: slots.cell ? Infinity : items.length,\n aspects: slots.cell ? undefined : props.aspects,\n contentCells: props.contentCells,\n placement: props.placement,\n choose: props.choose,\n fill: props.fill,\n relief: props.relief,\n animate: props.animate,\n });\n const { slots: slotOf } = frame;\n const virtual = !!props.virtualize;\n const list = props.role === \"list\";\n const hasBackdrop = !!slots.backdrop;\n\n const keyOf = (i: number) => {\n const slot = slotOf[i]!;\n if (!slots.cell && slot >= 0) {\n const k = items[slot]?.key;\n return k != null ? `child:${String(k)}` : `child:${slot}`;\n }\n return `cell:${L.cells[i]!.id}`;\n };\n const hasContent = (i: number) => slotOf[i]! >= 0;\n const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);\n const first = L.cells.find((c) => focusable.has(c.id))?.id;\n const active = activeId.value !== undefined && focusable.has(activeId.value) ? activeId.value : first;\n\n let shown: number[];\n if (!virtual) shown = L.cells.map((_, i) => i);\n else {\n const s = new Set(view.value && view.value.width >= 0 ? cellsInRect(L, view.value).map((c) => c.index) : []);\n const a = active !== undefined ? L.cells.find((c) => c.id === active) : undefined;\n if (a) s.add(a.index);\n shown = [...s].sort((a, b) => a - b);\n }\n let positions: Map<number, number> | undefined;\n if (virtual) {\n positions = new Map();\n for (const c of L.cells) if (hasContent(c.index)) positions.set(c.index, positions.size + 1);\n }\n presentKeys = new Set(L.cells.map((_, i) => keyOf(i)));\n duration = frame.anim?.duration ?? 0;\n const state = new Map<string, CellState>();\n const focusRing = props.focusRing;\n\n const rendered = shown.map((i) => {\n const cell = L.cells[i]!;\n const slot = slotOf[i]!;\n let content: VNode[] | undefined = slots.cell ? flatten(slots.cell({ cell, slot })) : slot >= 0 ? [items[slot]!] : undefined;\n const empty = isEmpty(content);\n const st: CellState = { empty, slot: empty && !slots.cell ? -1 : slot };\n state.set(cell.id, st);\n if (empty && slots.fallback) content = flatten(slots.fallback({ cell, state: st }));\n const silent = empty && isEmpty(content);\n const canFocus = focusable.has(cell.id);\n const key = keyOf(i);\n const style = tileStyle(frame, cell, {\n empty,\n safeArea: props.safeArea,\n backdrop: hasBackdrop,\n clickable: !!props.onCellActivate && !empty,\n focus: !slots.cell && slot >= 0 ? props.focalPoints?.[slot] : undefined,\n aspect: !slots.cell && slot >= 0 ? props.aspects?.[slot] : undefined,\n });\n const bevel = frame.bevel(i);\n const viewBox = tileViewBox(cell);\n const children: VNodeChild[] = [];\n if (hasBackdrop) children.push(h(\"div\", { \"aria-hidden\": \"true\", style: backdropStyle(frame, cell) }, slots.backdrop!()));\n if (props.safeArea && !isEmpty(content)) {\n const aspect = !slots.cell && !empty && props.aspects ? (props.aspects[slot] ?? 1) : undefined;\n children.push(h(\"div\", { \"data-safe-area\": \"\", style: safeBoxStyle(frame, cell, aspect, props.safeArea) }, content));\n } else if (content) children.push(...content);\n if (bevel?.length)\n children.push(\n h(\n \"svg\",\n {\n // Re-made for a new shape when animating, so it fades in as the tile arrives.\n key: frame.anim ? String(style.clipPath) : \"bevel\",\n \"aria-hidden\": \"true\",\n \"data-bevel\": \"\",\n \"data-late\": frame.anim ? \"\" : undefined,\n viewBox,\n preserveAspectRatio: \"none\",\n style: overlayStyle,\n },\n bevel.map((p, k) => h(\"path\", { key: k, d: p.d, fill: p.fill, \"fill-opacity\": p.opacity })),\n ),\n );\n if (canFocus && focusRing !== false)\n children.push(\n h(\n \"svg\",\n { key: \"ring\", \"aria-hidden\": \"true\", \"data-focus-ring\": \"\", viewBox, preserveAspectRatio: \"none\", style: overlayStyle },\n ringStrokes(frame, cell, focusRing).map((p, k) =>\n h(\"path\", { key: k, d: p.d, fill: \"none\", stroke: p.stroke, \"stroke-width\": p.width, \"vector-effect\": \"non-scaling-stroke\" }),\n ),\n ),\n );\n return h(\n \"div\",\n {\n key,\n ref: (el: unknown) => {\n if (el) tiles.set(cell.id, el as HTMLElement);\n else if (!tiles.get(cell.id)?.isConnected) tiles.delete(cell.id);\n },\n role: silent ? undefined : list ? \"listitem\" : undefined,\n \"aria-hidden\": silent ? \"true\" : undefined,\n \"aria-label\": silent ? undefined : resolvePerCell(props.cellLabel, cell, st),\n \"aria-setsize\": positions && list && !silent ? positions.size : undefined,\n \"aria-posinset\": positions && list && !silent ? positions.get(i) : undefined,\n tabindex: canFocus ? (cell.id === active ? 0 : -1) : undefined,\n onFocus: canFocus ? (e: FocusEvent) => e.target === e.currentTarget && (activeId.value = cell.id) : undefined,\n onClick: props.onCellActivate && !empty ? () => props.onCellActivate!(cell, st) : undefined,\n class: resolvePerCell(props.cellClass, cell, st),\n \"data-cell-id\": cell.id,\n \"data-index\": cell.index,\n \"data-key\": key,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-boundary\": cell.boundary ? \"\" : undefined,\n style: { ...style, ...resolvePerCell(props.cellStyle, cell, st) },\n },\n children,\n );\n });\n current = { focusable, state };\n\n const shadow = shadowShape(frame, shown.map((i) => L.cells[i]!));\n const css = tileSheet({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });\n // Animated: tiles that go fade out, and new ones fade in (not those just scrolling\n // into or out of view, nor on first render).\n const tileNodes = frame.anim\n ? h(\n TransitionGroup,\n {\n css: false,\n onEnter: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (mounted && k && !lastKeys.has(k)) el.setAttribute(\"data-entering\", \"\");\n done();\n },\n onLeave: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (k && presentKeys.has(k)) return done();\n for (const a of [\"role\", \"tabindex\", \"aria-label\", \"data-entering\"]) el.removeAttribute(a);\n el.setAttribute(\"aria-hidden\", \"true\");\n el.setAttribute(\"data-exiting\", \"\");\n const timer = setTimeout(() => {\n timers.delete(timer);\n done();\n }, duration);\n timers.add(timer);\n },\n },\n () => rendered,\n )\n : rendered;\n\n return h(\n \"div\",\n {\n ref: container,\n \"data-andamento\": \"\",\n role: props.role,\n onKeydown,\n style: containerStyle(L),\n },\n [\n css ? h(\"style\", { key: \"css\" }, css) : null,\n props.background ? h(\"div\", { key: \"bg\", \"aria-hidden\": \"true\", style: backgroundStyle(frame, props.background) }) : null,\n shadow\n ? h(\"svg\", { key: \"shadow\", \"aria-hidden\": \"true\", \"data-andamento-shadow\": \"\", viewBox: shadow.viewBox, preserveAspectRatio: \"none\", style: shadow.style }, [\n h(\"filter\", { id: `${id}-shadow`, x: \"-10%\", y: \"-10%\", width: \"120%\", height: \"120%\" }, [h(\"feGaussianBlur\", { stdDeviation: shadow.blur })]),\n h(\"path\", { d: shadow.d, \"fill-rule\": \"evenodd\", transform: shadow.transform, fill: \"#000\", \"fill-opacity\": shadow.opacity, filter: `url(#${id}-shadow)` }),\n ])\n : null,\n tileNodes,\n ],\n );\n };\n },\n});\n","import { defineComponent, h, type PropType, type VNode } from \"vue\";\nimport type { ContentCells, ContentPlacement, Layout, LayoutOptions } from \"@andamento/core\";\nimport { layoutResolver, type FitProp } from \"@andamento/dom\";\nimport { toSvgTree, type FillSource, type ImageSource, type ReliefOptions, type SvgNode } from \"@andamento/svg\";\n\nconst toVNode = (n: SvgNode | string, key?: number): VNode | string =>\n typeof n === \"string\" ? n : h(n.tag, key === undefined ? n.attrs : { key, ...n.attrs }, n.children.map((c, i) => toVNode(c, i)));\n\nlet uid = 0;\n\n/**\n * A tiling as a single <svg>: colored cells, optionally with images clipped to each cell.\n * Use it for pure SVG (export, print, embedding in other SVG); use `<TileLayout>` for\n * arbitrary content. Takes the options of `renderToString` from @andamento/svg as props.\n */\nexport const SvgTileLayout = defineComponent({\n name: \"SvgTileLayout\",\n props: {\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n images: [Array, Function] as PropType<ImageSource>,\n repeatImages: Boolean,\n contentCells: [String, Function] as PropType<ContentCells>,\n placement: String as PropType<ContentPlacement>,\n imageAspects: Array as PropType<readonly number[]>,\n choose: String as PropType<\"placement\" | \"shape\">,\n imageFit: String as PropType<\"cover\" | \"contain\">,\n containWithin: String as PropType<\"tile\" | \"visible\">,\n imageWeights: Array as PropType<readonly number[]>,\n imageFocus: Array as PropType<readonly ({ x: number; y: number } | undefined)[]>,\n /** Size the tiles to the `images` array: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n fill: [String, Array, Function] as PropType<FillSource>,\n stroke: String,\n strokeWidth: Number,\n background: String,\n backdrop: String,\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n title: String,\n imageAlts: Array as PropType<readonly string[]>,\n precision: Number,\n },\n setup(props) {\n const idPrefix = `andamento-vue-svg${++uid}`;\n const resolveLayout = layoutResolver(\"<SvgTileLayout>\");\n return () => {\n const fitTo = Array.isArray(props.images) && !props.repeatImages ? props.images.length : 0;\n const layout = resolveLayout(props.options, props.layout, {\n fit: props.fit,\n count: fitTo,\n cells: props.contentCells,\n weights: Array.isArray(props.images) ? props.imageWeights : undefined,\n placement: props.placement,\n });\n const { options: _o, layout: _l, fit: _f, ...render } = props;\n const tree = toSvgTree(layout, { ...render, relief: props.relief || undefined, idPrefix });\n return toVNode(tree);\n };\n },\n});\n","import { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from \"vue\";\nimport { createLayout, fitCount, type FitOptions, type Layout, type LayoutOptions } from \"@andamento/core\";\n\n/** A computed value worked out again only when `key` changes. */\nfunction byKey<T>(key: () => string, make: () => T): ComputedRef<T> {\n let lastKey: string | undefined, last: T;\n return computed(() => {\n const k = key();\n if (k !== lastKey) {\n last = make();\n lastKey = k;\n }\n return last;\n });\n}\n\n/**\n * A layout from options (a ref, a getter or a plain object), worked out again only when\n * they change by value.\n */\nexport function useTileLayout(options: MaybeRefOrGetter<LayoutOptions>): ComputedRef<Layout> {\n return byKey(() => JSON.stringify(toValue(options)), () => createLayout(toValue(options)));\n}\n\n/** A layout whose tiles are sized to give about `count` usable cells (see `fitCount`). */\nexport function useFitCount(options: MaybeRefOrGetter<LayoutOptions>, count: MaybeRefOrGetter<number>, fit: FitOptions = {}): ComputedRef<Layout> {\n return byKey(\n () => JSON.stringify([toValue(options), toValue(count)]),\n () => fitCount(toValue(options), toValue(count), fit).layout,\n );\n}\n","/**\n * Vue 3 bindings: `<TileLayout>`, `<SvgTileLayout>` and composables.\n *\n * @module @andamento/vue\n */\nexport { TileLayout } from \"./TileLayout\";\nexport { SvgTileLayout } from \"./SvgTileLayout\";\nexport { useFitCount, useTileLayout } from \"./composables\";\nexport { cellFromPointer, coverStyle, defaultPalette, neutralPalette } from \"@andamento/dom\";\nexport type { CellState, FitProp, PerCell, PointerLike, StyleMap, FillSource, ReliefOptions } from \"@andamento/dom\";\nexport type { Cell, ContentCells, ContentPlacement, HitOptions, Layout, LayoutOptions } from \"@andamento/core\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,mBAAgI;AACzI;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAIP,SAAS,QAAQ,OAAiC,MAAe,CAAC,GAAY;AAC5E,aAAW,KAAK,SAAS,CAAC,GAAG;AAC3B,QAAI,KAAK,QAAQ,OAAO,MAAM,UAAW;AACzC,QAAI,MAAM,QAAQ,CAAC,EAAG,SAAQ,GAAG,GAAG;AAAA,aAC3B,OAAO,MAAM,UAAU;AAC9B,UAAI,EAAE,SAAS,QAAS;AACxB,UAAI,EAAE,SAAS,SAAU,SAAQ,EAAE,UAA0B,GAAG;AAAA,eACvD,EAAE,SAAS,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAG;AAAA,UACnD,KAAI,KAAK,CAAC;AAAA,IACjB,WAAW,OAAO,CAAC,EAAE,KAAK,EAAG,KAAI,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;AAAA,EAC1D;AACA,SAAO;AACT;AAEA,IAAM,UAAU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AAAA,EACF;AACF,CAAC;;;AC3DD,SAAS,UAAU,eAAwD;AAC3E,SAAS,cAAc,gBAAkE;AAGzF,SAAS,MAAS,KAAmB,MAA+B;AAClE,MAAI,SAA6B;AACjC,SAAO,SAAS,MAAM;AACpB,UAAM,IAAI,IAAI;AACd,QAAI,MAAM,SAAS;AACjB,aAAO,KAAK;AACZ,gBAAU;AAAA,IACZ;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAMO,SAAS,cAAc,SAA+D;AAC3F,SAAO,MAAM,MAAM,KAAK,UAAU,QAAQ,OAAO,CAAC,GAAG,MAAM,aAAa,QAAQ,OAAO,CAAC,CAAC;AAC3F;AAGO,SAAS,YAAY,SAA0C,OAAiC,MAAkB,CAAC,GAAwB;AAChJ,SAAO;AAAA,IACL,MAAM,KAAK,UAAU,CAAC,QAAQ,OAAO,GAAG,QAAQ,KAAK,CAAC,CAAC;AAAA,IACvD,MAAM,SAAS,QAAQ,OAAO,GAAG,QAAQ,KAAK,GAAG,GAAG,EAAE;AAAA,EACxD;AACF;;;ACtBA,SAAS,iBAAiB,YAAY,gBAAgB,sBAAsB;","names":["a","defineComponent","h","layoutResolver","uid"]}
1
+ {"version":3,"sources":["../src/TileLayout.ts","../src/SvgTileLayout.ts","../src/composables.ts","../src/index.ts"],"sourcesContent":["import {\n Comment,\n Fragment,\n Text,\n TransitionGroup,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n type VNodeChild,\n} from \"vue\";\nimport { cellsInRect, type Cell, type ContentCells, type ContentPlacement, type Focus, type Layout, type LayoutOptions, type Rect } from \"@andamento/core\";\nimport {\n type CellState,\n type SafeAreaProp,\n type FitProp,\n type PerCell,\n type StyleMap,\n} from \"@andamento/dom\";\nimport {\n backdropStyle,\n backgroundStyle,\n containerStyle,\n frameBuilder,\n keyAction,\n layoutResolver,\n overlayStyle,\n resolvePerCell,\n ringStrokes,\n safeBoxStyle,\n sameRect,\n shadowShape,\n tileSheet,\n tileStyle,\n tileViewBox,\n viewRect,\n watchView,\n} from \"@andamento/dom/internal\";\nimport type { FillSource, ReliefOptions } from \"@andamento/svg\";\n\n/** Top-level children of a slot, with fragments (`v-for`) opened and comments (`v-if`) dropped. */\nfunction flatten(nodes: VNodeChild[] | undefined, out: VNode[] = []): VNode[] {\n for (const n of nodes ?? []) {\n if (n == null || typeof n === \"boolean\") continue;\n if (Array.isArray(n)) flatten(n, out);\n else if (typeof n === \"object\") {\n if (n.type === Comment) continue;\n if (n.type === Fragment) flatten(n.children as VNodeChild[], out);\n else if (n.type === Text && !String(n.children).trim()) continue;\n else out.push(n);\n } else if (String(n).trim()) out.push(h(Text, String(n)));\n }\n return out;\n}\n\nconst isEmpty = (nodes: VNode[] | undefined) => !nodes || nodes.length === 0;\n\nlet uid = 0;\n\n/**\n * A tiling as HTML: one absolutely positioned, `clip-path`-ed element per tile, holding\n * whatever you put in it. Each top-level child of the default slot fills one tile, in\n * reading order (`v-for` children count one each). Or use the `cell` slot, given\n * `{ cell, slot }`, to fill every tile. Sized in percentages, so it scales with its width.\n *\n * Slots: default (the items), `cell` (instead of items), `fallback` (empty tiles, given\n * `{ cell, state }`) and `backdrop` (one picture across all the tiles). Emits\n * `cell-activate` with `(cell, state)`. Props match the React `<TileLayout>`.\n */\nexport const TileLayout = defineComponent({\n name: \"TileLayout\",\n props: {\n /** Layout options; or pass a precomputed `layout` instead. */\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n /** Which tiles may hold items: \"all\" (default), \"whole\" or a test per cell. */\n contentCells: [String, Function] as PropType<ContentCells>,\n /** Where items go when there are fewer than tiles: \"reading\" (default), \"center\" or \"spread\". */\n placement: String as PropType<ContentPlacement>,\n /** Width / height of each item, to put items in tiles of similar shape. */\n aspects: Array as PropType<readonly number[]>,\n /**\n * Focal point of each child (fractions of its width and height; see `estimateFocus`): what\n * a photo keeps in view as its tile crops it. Each tile sets `--andamento-object-position`,\n * which `coverStyle` uses as `object-position`; exact when the photo's shape is known (`aspects`, or the focus's `aspect`).\n */\n /**\n * How many tiles each item spans (1 for an ordinary item): heavier items get featured\n * tiles where they fall in reading order (see `weightedLayout`). Needs `options`.\n */\n weights: Array as PropType<readonly number[]>,\n focalPoints: Array as PropType<readonly (Focus | undefined)[]>,\n /** With `aspects`: \"shape\" also picks which tiles hold items by their shape. */\n choose: String as PropType<\"placement\" | \"shape\">,\n /**\n * Put each tile's content in the tile's safe area (see `safeArea`). For tiles an\n * `edges: \"window\"` layout cuts, `true` or \"tile\" fits the whole tile, \"visible\" the part that shows.\n */\n safeArea: { type: [Boolean, String] as PropType<SafeAreaProp>, default: false },\n /** Color of empty tiles: a color, a palette or a function per cell. Defaults to `neutralPalette`. */\n fill: [String, Array, Function] as PropType<FillSource>,\n /** Size the tiles to the items: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n /** Raised tiles: a lit bevel and optional shadow. `true` for the defaults. */\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n /** Arrow-key navigation over the tiles with content, as one tab stop. */\n navigable: Boolean,\n /** Accessible name for each tile. */\n cellLabel: [String, Function] as PropType<PerCell<string | undefined>>,\n /** Focus ring color, or `false` for none. */\n focusRing: { type: [String, Boolean] as PropType<string | false>, default: \"#1a56db\" },\n /** Animate layout and content changes. `true` for 400 ms, or `{ duration, easing }`. */\n animate: { type: [Boolean, Object] as PropType<boolean | { duration?: number; easing?: string }>, default: false },\n /** Only mount the tiles in view (plus `overscan` pixels, default 300). */\n virtualize: { type: [Boolean, Object] as PropType<boolean | { overscan?: number }>, default: false },\n /** Class for each tile element. */\n cellClass: [String, Array, Object, Function] as PropType<PerCell<unknown>>,\n /** Extra style for each tile element. */\n cellStyle: [Object, Function] as PropType<PerCell<StyleMap | undefined>>,\n /** Color painted across the whole region, visible through the gaps. */\n background: String,\n role: { type: String, default: \"list\" },\n /** Called when a tile with content is clicked, or Enter / Space pressed on it. Bind with `@cell-activate`. */\n onCellActivate: Function as PropType<(cell: Cell, state: CellState) => void>,\n },\n setup(props, { slots, expose }) {\n const id = `andamento-vue${++uid}`;\n const resolveLayout = layoutResolver(\"<TileLayout>\");\n const buildFrame = frameBuilder();\n const container = ref<HTMLDivElement>();\n const view = shallowRef<Rect>();\n const activeId = ref<string>();\n const tiles = new Map<string, HTMLElement>();\n let pendingFocus: string | undefined;\n let layout: Layout | undefined;\n let lastKeys = new Set<string>();\n let presentKeys = new Set<string>();\n let mounted = false;\n let duration = 0;\n let stop: (() => void) | undefined;\n const timers = new Set<ReturnType<typeof setTimeout>>();\n // What the keyboard handler needs from the last render.\n let current: { focusable: Set<string>; state: Map<string, CellState> } = { focusable: new Set(), state: new Map() };\n\n const overscan = () => Math.max(0, (typeof props.virtualize === \"object\" ? props.virtualize.overscan : undefined) ?? 300);\n const measure = () => {\n if (!container.value || !layout) return;\n const next = viewRect(container.value, layout, overscan());\n if (!sameRect(next, view.value)) view.value = next;\n };\n const syncWatch = () => {\n if (props.virtualize && container.value && !stop) stop = watchView(container.value, measure);\n else if (!props.virtualize && stop) {\n stop();\n stop = undefined;\n view.value = undefined;\n }\n };\n let measuredLayout: Layout | undefined;\n const afterRender = () => {\n lastKeys = presentKeys;\n mounted = true;\n syncWatch();\n if (stop && measuredLayout !== layout) measure();\n measuredLayout = layout;\n if (pendingFocus) {\n const el = tiles.get(pendingFocus);\n if (el?.isConnected) {\n pendingFocus = undefined;\n el.focus();\n }\n }\n };\n onMounted(afterRender);\n onUpdated(afterRender);\n watch(() => props.virtualize, syncWatch);\n onBeforeUnmount(() => {\n stop?.();\n timers.forEach(clearTimeout);\n });\n\n const moveTo = (cell: Cell) => {\n activeId.value = cell.id;\n const el = tiles.get(cell.id);\n if (el?.isConnected && !el.hasAttribute(\"data-exiting\")) el.focus();\n else pendingFocus = cell.id;\n };\n const onKeydown = (e: KeyboardEvent) => {\n if (e.defaultPrevented || !props.navigable || e.altKey || e.ctrlKey || e.metaKey || !layout) return;\n const el = e.target as HTMLElement;\n const cellId = el.getAttribute?.(\"data-cell-id\");\n // Only when a tile itself has focus, not an input or button inside it.\n if (!cellId || tiles.get(cellId) !== el || !current.focusable.has(cellId)) return;\n const cell = layout.cells.find((c) => c.id === cellId)!;\n const action = keyAction(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);\n if (!action) return;\n e.preventDefault();\n if (\"activate\" in action) props.onCellActivate!(cell, current.state.get(cellId)!);\n else if (\"move\" in action) moveTo(action.move);\n };\n\n expose({\n /** The layout being shown. */\n get layout() {\n return layout;\n },\n });\n\n return () => {\n const items = slots.cell ? [] : flatten(slots.default?.());\n const L = resolveLayout(props.options, props.layout, {\n fit: !slots.cell && props.fit,\n count: items.length,\n cells: props.contentCells,\n weights: slots.cell ? undefined : props.weights,\n placement: props.placement,\n });\n layout = L;\n const frame = buildFrame(L, {\n count: slots.cell ? Infinity : items.length,\n aspects: slots.cell ? undefined : props.aspects,\n contentCells: props.contentCells,\n placement: props.placement,\n choose: props.choose,\n fill: props.fill,\n relief: props.relief,\n animate: props.animate,\n });\n const { slots: slotOf } = frame;\n const virtual = !!props.virtualize;\n const list = props.role === \"list\";\n const hasBackdrop = !!slots.backdrop;\n\n const keyOf = (i: number) => {\n const slot = slotOf[i]!;\n if (!slots.cell && slot >= 0) {\n const k = items[slot]?.key;\n return k != null ? `child:${String(k)}` : `child:${slot}`;\n }\n return `cell:${L.cells[i]!.id}`;\n };\n // What each tile holds, worked out once per render. Without virtualization every tile's\n // is worked out first, so only tiles with content take focus; with it, only those in\n // view are, and a tile counts as having content when it has a slot.\n const contents = new Map<number, VNode[] | undefined>();\n const contentOf = (i: number) => {\n if (!contents.has(i)) {\n const slot = slotOf[i]!;\n contents.set(i, slots.cell ? flatten(slots.cell({ cell: L.cells[i]!, slot })) : slot >= 0 ? [items[slot]!] : undefined);\n }\n return contents.get(i);\n };\n const hasContent = (i: number) => slotOf[i]! >= 0 && (virtual || !isEmpty(contentOf(i)));\n const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);\n const first = L.cells.find((c) => focusable.has(c.id))?.id;\n const active = activeId.value !== undefined && focusable.has(activeId.value) ? activeId.value : first;\n\n let shown: number[];\n if (!virtual) shown = L.cells.map((_, i) => i);\n else {\n const s = new Set(view.value && view.value.width >= 0 ? cellsInRect(L, view.value).map((c) => c.index) : []);\n const a = active !== undefined ? L.cells.find((c) => c.id === active) : undefined;\n if (a) s.add(a.index);\n shown = [...s].sort((a, b) => a - b);\n }\n let positions: Map<number, number> | undefined;\n if (virtual) {\n positions = new Map();\n for (const c of L.cells) if (hasContent(c.index)) positions.set(c.index, positions.size + 1);\n }\n presentKeys = new Set(L.cells.map((_, i) => keyOf(i)));\n duration = frame.anim?.duration ?? 0;\n const state = new Map<string, CellState>();\n const focusRing = props.focusRing;\n\n const rendered = shown.map((i) => {\n const cell = L.cells[i]!;\n const slot = slotOf[i]!;\n let content = contentOf(i);\n const empty = isEmpty(content);\n const st: CellState = { empty, slot: empty && !slots.cell ? -1 : slot };\n state.set(cell.id, st);\n if (empty && slots.fallback) content = flatten(slots.fallback({ cell, state: st }));\n const silent = empty && isEmpty(content);\n const canFocus = focusable.has(cell.id);\n const key = keyOf(i);\n const style = tileStyle(frame, cell, {\n empty,\n safeArea: props.safeArea,\n backdrop: hasBackdrop,\n clickable: !!props.onCellActivate && !empty,\n focus: !slots.cell && slot >= 0 ? props.focalPoints?.[slot] : undefined,\n aspect: !slots.cell && slot >= 0 ? props.aspects?.[slot] : undefined,\n });\n const bevel = frame.bevel(i);\n const viewBox = tileViewBox(cell);\n const children: VNodeChild[] = [];\n if (hasBackdrop) children.push(h(\"div\", { \"aria-hidden\": \"true\", style: backdropStyle(frame, cell) }, slots.backdrop!()));\n if (props.safeArea && !isEmpty(content)) {\n const aspect = !slots.cell && !empty && props.aspects ? (props.aspects[slot] ?? 1) : undefined;\n children.push(h(\"div\", { \"data-safe-area\": \"\", style: safeBoxStyle(frame, cell, aspect, props.safeArea) }, content));\n } else if (content) children.push(...content);\n if (bevel?.length)\n children.push(\n h(\n \"svg\",\n {\n // Re-made for a new shape when animating, so it fades in as the tile arrives.\n key: frame.anim ? String(style.clipPath) : \"bevel\",\n \"aria-hidden\": \"true\",\n \"data-bevel\": \"\",\n \"data-late\": frame.anim ? \"\" : undefined,\n viewBox,\n preserveAspectRatio: \"none\",\n style: overlayStyle,\n },\n bevel.map((p, k) => h(\"path\", { key: k, d: p.d, fill: p.fill, \"fill-opacity\": p.opacity })),\n ),\n );\n if (canFocus && focusRing !== false)\n children.push(\n h(\n \"svg\",\n { key: \"ring\", \"aria-hidden\": \"true\", \"data-focus-ring\": \"\", viewBox, preserveAspectRatio: \"none\", style: overlayStyle },\n ringStrokes(frame, cell, focusRing).map((p, k) =>\n h(\"path\", { key: k, d: p.d, fill: \"none\", stroke: p.stroke, \"stroke-width\": p.width, \"vector-effect\": \"non-scaling-stroke\" }),\n ),\n ),\n );\n return h(\n \"div\",\n {\n key,\n ref: (el: unknown) => {\n if (el) tiles.set(cell.id, el as HTMLElement);\n else if (!tiles.get(cell.id)?.isConnected) tiles.delete(cell.id);\n },\n role: silent ? undefined : list ? \"listitem\" : undefined,\n \"aria-hidden\": silent ? \"true\" : undefined,\n \"aria-label\": silent ? undefined : resolvePerCell(props.cellLabel, cell, st),\n \"aria-setsize\": positions && list && !silent ? positions.size : undefined,\n \"aria-posinset\": positions && list && !silent ? positions.get(i) : undefined,\n tabindex: canFocus ? (cell.id === active ? 0 : -1) : undefined,\n onFocus: canFocus ? (e: FocusEvent) => e.target === e.currentTarget && (activeId.value = cell.id) : undefined,\n onClick: props.onCellActivate && !empty ? () => props.onCellActivate!(cell, st) : undefined,\n class: resolvePerCell(props.cellClass, cell, st),\n \"data-cell-id\": cell.id,\n \"data-index\": cell.index,\n \"data-key\": key,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-boundary\": cell.boundary ? \"\" : undefined,\n style: { ...style, ...resolvePerCell(props.cellStyle, cell, st) },\n },\n children,\n );\n });\n current = { focusable, state };\n\n const shadow = shadowShape(frame, shown.map((i) => L.cells[i]!));\n const css = tileSheet({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });\n // Animated: tiles that go fade out, and new ones fade in (not those just scrolling\n // into or out of view, nor on first render).\n const tileNodes = frame.anim\n ? h(\n TransitionGroup,\n {\n css: false,\n onEnter: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (mounted && k && !lastKeys.has(k)) el.setAttribute(\"data-entering\", \"\");\n done();\n },\n onLeave: (el: Element, done: () => void) => {\n const k = el.getAttribute(\"data-key\");\n if (k && presentKeys.has(k)) return done();\n for (const a of [\"role\", \"tabindex\", \"aria-label\", \"data-entering\"]) el.removeAttribute(a);\n el.setAttribute(\"aria-hidden\", \"true\");\n el.setAttribute(\"data-exiting\", \"\");\n const timer = setTimeout(() => {\n timers.delete(timer);\n done();\n }, duration);\n timers.add(timer);\n },\n },\n () => rendered,\n )\n : rendered;\n\n return h(\n \"div\",\n {\n ref: container,\n \"data-andamento\": \"\",\n role: props.role,\n onKeydown,\n style: containerStyle(L),\n },\n [\n css ? h(\"style\", { key: \"css\" }, css) : null,\n props.background ? h(\"div\", { key: \"bg\", \"aria-hidden\": \"true\", style: backgroundStyle(frame, props.background) }) : null,\n shadow\n ? h(\"svg\", { key: \"shadow\", \"aria-hidden\": \"true\", \"data-andamento-shadow\": \"\", viewBox: shadow.viewBox, preserveAspectRatio: \"none\", style: shadow.style }, [\n h(\"filter\", { id: `${id}-shadow`, x: \"-10%\", y: \"-10%\", width: \"120%\", height: \"120%\" }, [h(\"feGaussianBlur\", { stdDeviation: shadow.blur })]),\n h(\"path\", { d: shadow.d, \"fill-rule\": \"evenodd\", transform: shadow.transform, fill: \"#000\", \"fill-opacity\": shadow.opacity, filter: `url(#${id}-shadow)` }),\n ])\n : null,\n tileNodes,\n ],\n );\n };\n },\n});\n","import { defineComponent, h, type PropType, type VNode } from \"vue\";\nimport type { ContentCells, ContentPlacement, Layout, LayoutOptions } from \"@andamento/core\";\nimport { type FitProp } from \"@andamento/dom\";\nimport { layoutResolver } from \"@andamento/dom/internal\";\nimport { toSvgTree, type FillSource, type ImageSource, type ReliefOptions, type SvgNode } from \"@andamento/svg\";\n\nconst toVNode = (n: SvgNode | string, key?: number): VNode | string =>\n typeof n === \"string\" ? n : h(n.tag, key === undefined ? n.attrs : { key, ...n.attrs }, n.children.map((c, i) => toVNode(c, i)));\n\nlet uid = 0;\n\n/**\n * A tiling as a single <svg>: colored cells, optionally with images clipped to each cell.\n * Use it for pure SVG (export, print, embedding in other SVG); use `<TileLayout>` for\n * arbitrary content. Takes the options of `renderToString` from @andamento/svg as props.\n */\nexport const SvgTileLayout = defineComponent({\n name: \"SvgTileLayout\",\n props: {\n options: Object as PropType<LayoutOptions>,\n layout: Object as PropType<Layout>,\n images: [Array, Function] as PropType<ImageSource>,\n repeatImages: Boolean,\n contentCells: [String, Function] as PropType<ContentCells>,\n placement: String as PropType<ContentPlacement>,\n imageAspects: Array as PropType<readonly number[]>,\n choose: String as PropType<\"placement\" | \"shape\">,\n imageFit: String as PropType<\"cover\" | \"contain\">,\n containWithin: String as PropType<\"tile\" | \"visible\">,\n imageWeights: Array as PropType<readonly number[]>,\n imageFocus: Array as PropType<readonly ({ x: number; y: number } | undefined)[]>,\n /** Size the tiles to the `images` array: `true`/\"atLeast\" or \"nearest\". */\n fit: { type: [Boolean, String] as PropType<FitProp>, default: false },\n fill: [String, Array, Function] as PropType<FillSource>,\n stroke: String,\n strokeWidth: Number,\n background: String,\n backdrop: String,\n relief: { type: [Boolean, Object] as PropType<boolean | ReliefOptions>, default: false },\n title: String,\n imageAlts: Array as PropType<readonly string[]>,\n precision: Number,\n },\n setup(props) {\n const idPrefix = `andamento-vue-svg${++uid}`;\n const resolveLayout = layoutResolver(\"<SvgTileLayout>\");\n return () => {\n const fitTo = Array.isArray(props.images) && !props.repeatImages ? props.images.length : 0;\n const layout = resolveLayout(props.options, props.layout, {\n fit: props.fit,\n count: fitTo,\n cells: props.contentCells,\n weights: Array.isArray(props.images) ? props.imageWeights : undefined,\n placement: props.placement,\n });\n const { options: _o, layout: _l, fit: _f, ...render } = props;\n const tree = toSvgTree(layout, { ...render, relief: props.relief || undefined, idPrefix });\n return toVNode(tree);\n };\n },\n});\n","import { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from \"vue\";\nimport { createLayout, fitCount, type FitOptions, type Layout, type LayoutOptions } from \"@andamento/core\";\nimport { optionsKey } from \"@andamento/dom/internal\";\n\n/** A computed value worked out again only when `key` changes. */\nfunction byKey<T>(key: () => string, make: () => T): ComputedRef<T> {\n let lastKey: string | undefined, last: T;\n return computed(() => {\n const k = key();\n if (k !== lastKey) {\n last = make();\n lastKey = k;\n }\n return last;\n });\n}\n\n/**\n * A layout from options (a ref, a getter or a plain object), worked out again only when\n * they change by value.\n */\nexport function useTileLayout(options: MaybeRefOrGetter<LayoutOptions>): ComputedRef<Layout> {\n return byKey(() => optionsKey(toValue(options)), () => createLayout(toValue(options)));\n}\n\n/** A layout whose tiles are sized to give about `count` usable cells (see `fitCount`). */\nexport function useFitCount(options: MaybeRefOrGetter<LayoutOptions>, count: MaybeRefOrGetter<number>, fit: FitOptions = {}): ComputedRef<Layout> {\n return byKey(\n () => optionsKey([toValue(options), toValue(count), fit.cells, fit.mode]),\n () => fitCount(toValue(options), toValue(count), fit).layout,\n );\n}\n","/**\n * Vue 3 bindings: `<TileLayout>`, `<SvgTileLayout>` and composables.\n *\n * @module @andamento/vue\n */\nexport { TileLayout } from \"./TileLayout\";\nexport { SvgTileLayout } from \"./SvgTileLayout\";\nexport { useFitCount, useTileLayout } from \"./composables\";\nexport { cellFromPointer, coverStyle, defaultPalette, neutralPalette } from \"@andamento/dom\";\nexport type { CellState, FitProp, PerCell, PointerLike, StyleMap, FillSource, ReliefOptions } from \"@andamento/dom\";\nexport type { Cell, ContentCells, ContentPlacement, HitOptions, Layout, LayoutOpt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AAAA,IACrB;AAAA,EACF;AACF,CAAC;;;AC5DD,SAAS,UAAU,eAAwD;AAC3E,SAAS,cAAc,gBAAkE;AACzF,SAAS,kBAAkB;AAG3B,SAAS,MAAS,KAAmB,MAA+B;AAClE,MAAI,SAA6B;AACjC,SAAO,SAAS,MAAM;AACpB,UAAM,IAAI,IAAI;AACd,QAAI,MAAM,SAAS;AACjB,aAAO,KAAK;AACZ,gBAAU;AAAA,IACZ;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAMO,SAAS,cAAc,SAA+D;AAC3F,SAAO,MAAM,MAAM,WAAW,QAAQ,OAAO,CAAC,GAAG,MAAM,aAAa,QAAQ,OAAO,CAAC,CAAC;AACvF;AAGO,SAAS,YAAY,SAA0C,OAAiC,MAAkB,CAAC,GAAwB;AAChJ,SAAO;AAAA,IACL,MAAM,WAAW,CAAC,QAAQ,OAAO,GAAG,QAAQ,KAAK,GAAG,IAAI,OAAO,IAAI,IAAI,CAAC;AAAA,IACxE,MAAM,SAAS,QAAQ,OAAO,GAAG,QAAQ,KAAK,GAAG,GAAG,EAAE;AAAA,EACxD;AACF;;;ACvBA,SAAS,iBAAiB,YAAY,gBAAgB,sBAAsB;","names":["a","defineComponent","h","layoutResolver","uid"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andamento/vue",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Vue components for @andamento tiling layouts.",
5
5
  "keywords": [
6
6
  "tiling",
@@ -56,9 +56,9 @@
56
56
  "typecheck": "tsc --noEmit -p ."
57
57
  },
58
58
  "dependencies": {
59
- "@andamento/core": "0.1.0",
60
- "@andamento/dom": "0.1.0",
61
- "@andamento/svg": "0.1.0"
59
+ "@andamento/core": "0.2.0",
60
+ "@andamento/dom": "0.2.0",
61
+ "@andamento/svg": "0.2.0"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "vue": ">=3.3"