@andamento/vue 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +28 -2
- package/dist/index.cjs +459 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +282 -0
- package/dist/index.d.ts +282 -0
- package/dist/index.js +456 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
// src/TileLayout.ts
|
|
2
|
+
import {
|
|
3
|
+
Comment,
|
|
4
|
+
Fragment,
|
|
5
|
+
Text,
|
|
6
|
+
TransitionGroup,
|
|
7
|
+
defineComponent,
|
|
8
|
+
h,
|
|
9
|
+
onBeforeUnmount,
|
|
10
|
+
onMounted,
|
|
11
|
+
onUpdated,
|
|
12
|
+
ref,
|
|
13
|
+
shallowRef,
|
|
14
|
+
watch
|
|
15
|
+
} from "vue";
|
|
16
|
+
import { cellsInRect } from "@andamento/core";
|
|
17
|
+
import {
|
|
18
|
+
backdropStyle,
|
|
19
|
+
backgroundStyle,
|
|
20
|
+
containerStyle,
|
|
21
|
+
frameBuilder,
|
|
22
|
+
keyAction,
|
|
23
|
+
layoutResolver,
|
|
24
|
+
overlayStyle,
|
|
25
|
+
resolvePerCell,
|
|
26
|
+
ringStrokes,
|
|
27
|
+
safeBoxStyle,
|
|
28
|
+
sameRect,
|
|
29
|
+
shadowShape,
|
|
30
|
+
tileSheet,
|
|
31
|
+
tileStyle,
|
|
32
|
+
tileViewBox,
|
|
33
|
+
viewRect,
|
|
34
|
+
watchView
|
|
35
|
+
} from "@andamento/dom";
|
|
36
|
+
function flatten(nodes, out = []) {
|
|
37
|
+
for (const n of nodes ?? []) {
|
|
38
|
+
if (n == null || typeof n === "boolean") continue;
|
|
39
|
+
if (Array.isArray(n)) flatten(n, out);
|
|
40
|
+
else if (typeof n === "object") {
|
|
41
|
+
if (n.type === Comment) continue;
|
|
42
|
+
if (n.type === Fragment) flatten(n.children, out);
|
|
43
|
+
else if (n.type === Text && !String(n.children).trim()) continue;
|
|
44
|
+
else out.push(n);
|
|
45
|
+
} else if (String(n).trim()) out.push(h(Text, String(n)));
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
var isEmpty = (nodes) => !nodes || nodes.length === 0;
|
|
50
|
+
var uid = 0;
|
|
51
|
+
var TileLayout = defineComponent({
|
|
52
|
+
name: "TileLayout",
|
|
53
|
+
props: {
|
|
54
|
+
/** Layout options; or pass a precomputed `layout` instead. */
|
|
55
|
+
options: Object,
|
|
56
|
+
layout: Object,
|
|
57
|
+
/** Which tiles may hold items: "all" (default), "whole" or a test per cell. */
|
|
58
|
+
contentCells: [String, Function],
|
|
59
|
+
/** Where items go when there are fewer than tiles: "reading" (default), "center" or "spread". */
|
|
60
|
+
placement: String,
|
|
61
|
+
/** Width / height of each item, to put items in tiles of similar shape. */
|
|
62
|
+
aspects: Array,
|
|
63
|
+
/**
|
|
64
|
+
* Focal point of each child (fractions of its width and height; see `estimateFocus`): what
|
|
65
|
+
* a photo keeps in view as its tile crops it. Each tile sets `--andamento-object-position`,
|
|
66
|
+
* which `coverStyle` uses as `object-position`; exact when the photo's shape is known (`aspects`, or the focus's `aspect`).
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* How many tiles each item spans (1 for an ordinary item): heavier items get featured
|
|
70
|
+
* tiles where they fall in reading order (see `weightedLayout`). Needs `options`.
|
|
71
|
+
*/
|
|
72
|
+
weights: Array,
|
|
73
|
+
focalPoints: Array,
|
|
74
|
+
/** With `aspects`: "shape" also picks which tiles hold items by their shape. */
|
|
75
|
+
choose: String,
|
|
76
|
+
/**
|
|
77
|
+
* Put each tile's content in the tile's safe area (see `safeArea`). For tiles an
|
|
78
|
+
* `edges: "window"` layout cuts, `true` or "tile" fits the whole tile, "visible" the part that shows.
|
|
79
|
+
*/
|
|
80
|
+
safeArea: { type: [Boolean, String], default: false },
|
|
81
|
+
/** Color of empty tiles: a color, a palette or a function per cell. Defaults to `neutralPalette`. */
|
|
82
|
+
fill: [String, Array, Function],
|
|
83
|
+
/** Size the tiles to the items: `true`/"atLeast" or "nearest". */
|
|
84
|
+
fit: { type: [Boolean, String], default: false },
|
|
85
|
+
/** Raised tiles: a lit bevel and optional shadow. `true` for the defaults. */
|
|
86
|
+
relief: { type: [Boolean, Object], default: false },
|
|
87
|
+
/** Arrow-key navigation over the tiles with content, as one tab stop. */
|
|
88
|
+
navigable: Boolean,
|
|
89
|
+
/** Accessible name for each tile. */
|
|
90
|
+
cellLabel: [String, Function],
|
|
91
|
+
/** Focus ring color, or `false` for none. */
|
|
92
|
+
focusRing: { type: [String, Boolean], default: "#1a56db" },
|
|
93
|
+
/** Animate layout and content changes. `true` for 400 ms, or `{ duration, easing }`. */
|
|
94
|
+
animate: { type: [Boolean, Object], default: false },
|
|
95
|
+
/** Only mount the tiles in view (plus `overscan` pixels, default 300). */
|
|
96
|
+
virtualize: { type: [Boolean, Object], default: false },
|
|
97
|
+
/** Class for each tile element. */
|
|
98
|
+
cellClass: [String, Array, Object, Function],
|
|
99
|
+
/** Extra style for each tile element. */
|
|
100
|
+
cellStyle: [Object, Function],
|
|
101
|
+
/** Color painted across the whole region, visible through the gaps. */
|
|
102
|
+
background: String,
|
|
103
|
+
role: { type: String, default: "list" },
|
|
104
|
+
/** Called when a tile with content is clicked, or Enter / Space pressed on it. Bind with `@cell-activate`. */
|
|
105
|
+
onCellActivate: Function
|
|
106
|
+
},
|
|
107
|
+
setup(props, { slots, expose }) {
|
|
108
|
+
const id = `andamento-vue${++uid}`;
|
|
109
|
+
const resolveLayout = layoutResolver("<TileLayout>");
|
|
110
|
+
const buildFrame = frameBuilder();
|
|
111
|
+
const container = ref();
|
|
112
|
+
const view = shallowRef();
|
|
113
|
+
const activeId = ref();
|
|
114
|
+
const tiles = /* @__PURE__ */ new Map();
|
|
115
|
+
let pendingFocus;
|
|
116
|
+
let layout;
|
|
117
|
+
let lastKeys = /* @__PURE__ */ new Set();
|
|
118
|
+
let presentKeys = /* @__PURE__ */ new Set();
|
|
119
|
+
let mounted = false;
|
|
120
|
+
let duration = 0;
|
|
121
|
+
let stop;
|
|
122
|
+
const timers = /* @__PURE__ */ new Set();
|
|
123
|
+
let current = { focusable: /* @__PURE__ */ new Set(), state: /* @__PURE__ */ new Map() };
|
|
124
|
+
const overscan = () => Math.max(0, (typeof props.virtualize === "object" ? props.virtualize.overscan : void 0) ?? 300);
|
|
125
|
+
const measure = () => {
|
|
126
|
+
if (!container.value || !layout) return;
|
|
127
|
+
const next = viewRect(container.value, layout, overscan());
|
|
128
|
+
if (!sameRect(next, view.value)) view.value = next;
|
|
129
|
+
};
|
|
130
|
+
const syncWatch = () => {
|
|
131
|
+
if (props.virtualize && container.value && !stop) stop = watchView(container.value, measure);
|
|
132
|
+
else if (!props.virtualize && stop) {
|
|
133
|
+
stop();
|
|
134
|
+
stop = void 0;
|
|
135
|
+
view.value = void 0;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
let measuredLayout;
|
|
139
|
+
const afterRender = () => {
|
|
140
|
+
lastKeys = presentKeys;
|
|
141
|
+
mounted = true;
|
|
142
|
+
syncWatch();
|
|
143
|
+
if (stop && measuredLayout !== layout) measure();
|
|
144
|
+
measuredLayout = layout;
|
|
145
|
+
if (pendingFocus) {
|
|
146
|
+
const el = tiles.get(pendingFocus);
|
|
147
|
+
if (el?.isConnected) {
|
|
148
|
+
pendingFocus = void 0;
|
|
149
|
+
el.focus();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
onMounted(afterRender);
|
|
154
|
+
onUpdated(afterRender);
|
|
155
|
+
watch(() => props.virtualize, syncWatch);
|
|
156
|
+
onBeforeUnmount(() => {
|
|
157
|
+
stop?.();
|
|
158
|
+
timers.forEach(clearTimeout);
|
|
159
|
+
});
|
|
160
|
+
const moveTo = (cell) => {
|
|
161
|
+
activeId.value = cell.id;
|
|
162
|
+
const el = tiles.get(cell.id);
|
|
163
|
+
if (el?.isConnected && !el.hasAttribute("data-exiting")) el.focus();
|
|
164
|
+
else pendingFocus = cell.id;
|
|
165
|
+
};
|
|
166
|
+
const onKeydown = (e) => {
|
|
167
|
+
if (e.defaultPrevented || !props.navigable || e.altKey || e.ctrlKey || e.metaKey || !layout) return;
|
|
168
|
+
const el = e.target;
|
|
169
|
+
const cellId = el.getAttribute?.("data-cell-id");
|
|
170
|
+
if (!cellId || tiles.get(cellId) !== el || !current.focusable.has(cellId)) return;
|
|
171
|
+
const cell = layout.cells.find((c) => c.id === cellId);
|
|
172
|
+
const action = keyAction(layout, cell, e.key, (c) => current.focusable.has(c.id), !!props.onCellActivate);
|
|
173
|
+
if (!action) return;
|
|
174
|
+
e.preventDefault();
|
|
175
|
+
if ("activate" in action) props.onCellActivate(cell, current.state.get(cellId));
|
|
176
|
+
else if ("move" in action) moveTo(action.move);
|
|
177
|
+
};
|
|
178
|
+
expose({
|
|
179
|
+
/** The layout being shown. */
|
|
180
|
+
get layout() {
|
|
181
|
+
return layout;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
return () => {
|
|
185
|
+
const items = slots.cell ? [] : flatten(slots.default?.());
|
|
186
|
+
const L = resolveLayout(props.options, props.layout, {
|
|
187
|
+
fit: !slots.cell && props.fit,
|
|
188
|
+
count: items.length,
|
|
189
|
+
cells: props.contentCells,
|
|
190
|
+
weights: slots.cell ? void 0 : props.weights,
|
|
191
|
+
placement: props.placement
|
|
192
|
+
});
|
|
193
|
+
layout = L;
|
|
194
|
+
const frame = buildFrame(L, {
|
|
195
|
+
count: slots.cell ? Infinity : items.length,
|
|
196
|
+
aspects: slots.cell ? void 0 : props.aspects,
|
|
197
|
+
contentCells: props.contentCells,
|
|
198
|
+
placement: props.placement,
|
|
199
|
+
choose: props.choose,
|
|
200
|
+
fill: props.fill,
|
|
201
|
+
relief: props.relief,
|
|
202
|
+
animate: props.animate
|
|
203
|
+
});
|
|
204
|
+
const { slots: slotOf } = frame;
|
|
205
|
+
const virtual = !!props.virtualize;
|
|
206
|
+
const list = props.role === "list";
|
|
207
|
+
const hasBackdrop = !!slots.backdrop;
|
|
208
|
+
const keyOf = (i) => {
|
|
209
|
+
const slot = slotOf[i];
|
|
210
|
+
if (!slots.cell && slot >= 0) {
|
|
211
|
+
const k = items[slot]?.key;
|
|
212
|
+
return k != null ? `child:${String(k)}` : `child:${slot}`;
|
|
213
|
+
}
|
|
214
|
+
return `cell:${L.cells[i].id}`;
|
|
215
|
+
};
|
|
216
|
+
const hasContent = (i) => slotOf[i] >= 0;
|
|
217
|
+
const focusable = new Set(props.navigable ? L.cells.filter((c) => hasContent(c.index)).map((c) => c.id) : []);
|
|
218
|
+
const first = L.cells.find((c) => focusable.has(c.id))?.id;
|
|
219
|
+
const active = activeId.value !== void 0 && focusable.has(activeId.value) ? activeId.value : first;
|
|
220
|
+
let shown;
|
|
221
|
+
if (!virtual) shown = L.cells.map((_, i) => i);
|
|
222
|
+
else {
|
|
223
|
+
const s = new Set(view.value && view.value.width >= 0 ? cellsInRect(L, view.value).map((c) => c.index) : []);
|
|
224
|
+
const a = active !== void 0 ? L.cells.find((c) => c.id === active) : void 0;
|
|
225
|
+
if (a) s.add(a.index);
|
|
226
|
+
shown = [...s].sort((a2, b) => a2 - b);
|
|
227
|
+
}
|
|
228
|
+
let positions;
|
|
229
|
+
if (virtual) {
|
|
230
|
+
positions = /* @__PURE__ */ new Map();
|
|
231
|
+
for (const c of L.cells) if (hasContent(c.index)) positions.set(c.index, positions.size + 1);
|
|
232
|
+
}
|
|
233
|
+
presentKeys = new Set(L.cells.map((_, i) => keyOf(i)));
|
|
234
|
+
duration = frame.anim?.duration ?? 0;
|
|
235
|
+
const state = /* @__PURE__ */ new Map();
|
|
236
|
+
const focusRing = props.focusRing;
|
|
237
|
+
const rendered = shown.map((i) => {
|
|
238
|
+
const cell = L.cells[i];
|
|
239
|
+
const slot = slotOf[i];
|
|
240
|
+
let content = slots.cell ? flatten(slots.cell({ cell, slot })) : slot >= 0 ? [items[slot]] : void 0;
|
|
241
|
+
const empty = isEmpty(content);
|
|
242
|
+
const st = { empty, slot: empty && !slots.cell ? -1 : slot };
|
|
243
|
+
state.set(cell.id, st);
|
|
244
|
+
if (empty && slots.fallback) content = flatten(slots.fallback({ cell, state: st }));
|
|
245
|
+
const silent = empty && isEmpty(content);
|
|
246
|
+
const canFocus = focusable.has(cell.id);
|
|
247
|
+
const key = keyOf(i);
|
|
248
|
+
const style = tileStyle(frame, cell, {
|
|
249
|
+
empty,
|
|
250
|
+
safeArea: props.safeArea,
|
|
251
|
+
backdrop: hasBackdrop,
|
|
252
|
+
clickable: !!props.onCellActivate && !empty,
|
|
253
|
+
focus: !slots.cell && slot >= 0 ? props.focalPoints?.[slot] : void 0,
|
|
254
|
+
aspect: !slots.cell && slot >= 0 ? props.aspects?.[slot] : void 0
|
|
255
|
+
});
|
|
256
|
+
const bevel = frame.bevel(i);
|
|
257
|
+
const viewBox = tileViewBox(cell);
|
|
258
|
+
const children = [];
|
|
259
|
+
if (hasBackdrop) children.push(h("div", { "aria-hidden": "true", style: backdropStyle(frame, cell) }, slots.backdrop()));
|
|
260
|
+
if (props.safeArea && !isEmpty(content)) {
|
|
261
|
+
const aspect = !slots.cell && !empty && props.aspects ? props.aspects[slot] ?? 1 : void 0;
|
|
262
|
+
children.push(h("div", { "data-safe-area": "", style: safeBoxStyle(frame, cell, aspect, props.safeArea) }, content));
|
|
263
|
+
} else if (content) children.push(...content);
|
|
264
|
+
if (bevel?.length)
|
|
265
|
+
children.push(
|
|
266
|
+
h(
|
|
267
|
+
"svg",
|
|
268
|
+
{
|
|
269
|
+
// Re-made for a new shape when animating, so it fades in as the tile arrives.
|
|
270
|
+
key: frame.anim ? String(style.clipPath) : "bevel",
|
|
271
|
+
"aria-hidden": "true",
|
|
272
|
+
"data-bevel": "",
|
|
273
|
+
"data-late": frame.anim ? "" : void 0,
|
|
274
|
+
viewBox,
|
|
275
|
+
preserveAspectRatio: "none",
|
|
276
|
+
style: overlayStyle
|
|
277
|
+
},
|
|
278
|
+
bevel.map((p, k) => h("path", { key: k, d: p.d, fill: p.fill, "fill-opacity": p.opacity }))
|
|
279
|
+
)
|
|
280
|
+
);
|
|
281
|
+
if (canFocus && focusRing !== false)
|
|
282
|
+
children.push(
|
|
283
|
+
h(
|
|
284
|
+
"svg",
|
|
285
|
+
{ key: "ring", "aria-hidden": "true", "data-focus-ring": "", viewBox, preserveAspectRatio: "none", style: overlayStyle },
|
|
286
|
+
ringStrokes(frame, cell, focusRing).map(
|
|
287
|
+
(p, k) => h("path", { key: k, d: p.d, fill: "none", stroke: p.stroke, "stroke-width": p.width, "vector-effect": "non-scaling-stroke" })
|
|
288
|
+
)
|
|
289
|
+
)
|
|
290
|
+
);
|
|
291
|
+
return h(
|
|
292
|
+
"div",
|
|
293
|
+
{
|
|
294
|
+
key,
|
|
295
|
+
ref: (el) => {
|
|
296
|
+
if (el) tiles.set(cell.id, el);
|
|
297
|
+
else if (!tiles.get(cell.id)?.isConnected) tiles.delete(cell.id);
|
|
298
|
+
},
|
|
299
|
+
role: silent ? void 0 : list ? "listitem" : void 0,
|
|
300
|
+
"aria-hidden": silent ? "true" : void 0,
|
|
301
|
+
"aria-label": silent ? void 0 : resolvePerCell(props.cellLabel, cell, st),
|
|
302
|
+
"aria-setsize": positions && list && !silent ? positions.size : void 0,
|
|
303
|
+
"aria-posinset": positions && list && !silent ? positions.get(i) : void 0,
|
|
304
|
+
tabindex: canFocus ? cell.id === active ? 0 : -1 : void 0,
|
|
305
|
+
onFocus: canFocus ? (e) => e.target === e.currentTarget && (activeId.value = cell.id) : void 0,
|
|
306
|
+
onClick: props.onCellActivate && !empty ? () => props.onCellActivate(cell, st) : void 0,
|
|
307
|
+
class: resolvePerCell(props.cellClass, cell, st),
|
|
308
|
+
"data-cell-id": cell.id,
|
|
309
|
+
"data-index": cell.index,
|
|
310
|
+
"data-key": key,
|
|
311
|
+
"data-empty": empty ? "" : void 0,
|
|
312
|
+
"data-boundary": cell.boundary ? "" : void 0,
|
|
313
|
+
style: { ...style, ...resolvePerCell(props.cellStyle, cell, st) }
|
|
314
|
+
},
|
|
315
|
+
children
|
|
316
|
+
);
|
|
317
|
+
});
|
|
318
|
+
current = { focusable, state };
|
|
319
|
+
const shadow = shadowShape(frame, shown.map((i) => L.cells[i]));
|
|
320
|
+
const css = tileSheet({ focusRing: props.navigable && focusRing !== false, anim: frame.anim });
|
|
321
|
+
const tileNodes = frame.anim ? h(
|
|
322
|
+
TransitionGroup,
|
|
323
|
+
{
|
|
324
|
+
css: false,
|
|
325
|
+
onEnter: (el, done) => {
|
|
326
|
+
const k = el.getAttribute("data-key");
|
|
327
|
+
if (mounted && k && !lastKeys.has(k)) el.setAttribute("data-entering", "");
|
|
328
|
+
done();
|
|
329
|
+
},
|
|
330
|
+
onLeave: (el, done) => {
|
|
331
|
+
const k = el.getAttribute("data-key");
|
|
332
|
+
if (k && presentKeys.has(k)) return done();
|
|
333
|
+
for (const a of ["role", "tabindex", "aria-label", "data-entering"]) el.removeAttribute(a);
|
|
334
|
+
el.setAttribute("aria-hidden", "true");
|
|
335
|
+
el.setAttribute("data-exiting", "");
|
|
336
|
+
const timer = setTimeout(() => {
|
|
337
|
+
timers.delete(timer);
|
|
338
|
+
done();
|
|
339
|
+
}, duration);
|
|
340
|
+
timers.add(timer);
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
() => rendered
|
|
344
|
+
) : rendered;
|
|
345
|
+
return h(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
ref: container,
|
|
349
|
+
"data-andamento": "",
|
|
350
|
+
role: props.role,
|
|
351
|
+
onKeydown,
|
|
352
|
+
style: containerStyle(L)
|
|
353
|
+
},
|
|
354
|
+
[
|
|
355
|
+
css ? h("style", { key: "css" }, css) : null,
|
|
356
|
+
props.background ? h("div", { key: "bg", "aria-hidden": "true", style: backgroundStyle(frame, props.background) }) : null,
|
|
357
|
+
shadow ? h("svg", { key: "shadow", "aria-hidden": "true", "data-andamento-shadow": "", viewBox: shadow.viewBox, preserveAspectRatio: "none", style: shadow.style }, [
|
|
358
|
+
h("filter", { id: `${id}-shadow`, x: "-10%", y: "-10%", width: "120%", height: "120%" }, [h("feGaussianBlur", { stdDeviation: shadow.blur })]),
|
|
359
|
+
h("path", { d: shadow.d, "fill-rule": "evenodd", transform: shadow.transform, fill: "#000", "fill-opacity": shadow.opacity, filter: `url(#${id}-shadow)` })
|
|
360
|
+
]) : null,
|
|
361
|
+
tileNodes
|
|
362
|
+
]
|
|
363
|
+
);
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// src/SvgTileLayout.ts
|
|
369
|
+
import { defineComponent as defineComponent2, h as h2 } from "vue";
|
|
370
|
+
import { layoutResolver as layoutResolver2 } from "@andamento/dom";
|
|
371
|
+
import { toSvgTree } from "@andamento/svg";
|
|
372
|
+
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
|
+
var uid2 = 0;
|
|
374
|
+
var SvgTileLayout = defineComponent2({
|
|
375
|
+
name: "SvgTileLayout",
|
|
376
|
+
props: {
|
|
377
|
+
options: Object,
|
|
378
|
+
layout: Object,
|
|
379
|
+
images: [Array, Function],
|
|
380
|
+
repeatImages: Boolean,
|
|
381
|
+
contentCells: [String, Function],
|
|
382
|
+
placement: String,
|
|
383
|
+
imageAspects: Array,
|
|
384
|
+
choose: String,
|
|
385
|
+
imageFit: String,
|
|
386
|
+
containWithin: String,
|
|
387
|
+
imageWeights: Array,
|
|
388
|
+
imageFocus: Array,
|
|
389
|
+
/** Size the tiles to the `images` array: `true`/"atLeast" or "nearest". */
|
|
390
|
+
fit: { type: [Boolean, String], default: false },
|
|
391
|
+
fill: [String, Array, Function],
|
|
392
|
+
stroke: String,
|
|
393
|
+
strokeWidth: Number,
|
|
394
|
+
background: String,
|
|
395
|
+
backdrop: String,
|
|
396
|
+
relief: { type: [Boolean, Object], default: false },
|
|
397
|
+
title: String,
|
|
398
|
+
imageAlts: Array,
|
|
399
|
+
precision: Number
|
|
400
|
+
},
|
|
401
|
+
setup(props) {
|
|
402
|
+
const idPrefix = `andamento-vue-svg${++uid2}`;
|
|
403
|
+
const resolveLayout = layoutResolver2("<SvgTileLayout>");
|
|
404
|
+
return () => {
|
|
405
|
+
const fitTo = Array.isArray(props.images) && !props.repeatImages ? props.images.length : 0;
|
|
406
|
+
const layout = resolveLayout(props.options, props.layout, {
|
|
407
|
+
fit: props.fit,
|
|
408
|
+
count: fitTo,
|
|
409
|
+
cells: props.contentCells,
|
|
410
|
+
weights: Array.isArray(props.images) ? props.imageWeights : void 0,
|
|
411
|
+
placement: props.placement
|
|
412
|
+
});
|
|
413
|
+
const { options: _o, layout: _l, fit: _f, ...render } = props;
|
|
414
|
+
const tree = toSvgTree(layout, { ...render, relief: props.relief || void 0, idPrefix });
|
|
415
|
+
return toVNode(tree);
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
// src/composables.ts
|
|
421
|
+
import { computed, toValue } from "vue";
|
|
422
|
+
import { createLayout, fitCount } from "@andamento/core";
|
|
423
|
+
function byKey(key, make) {
|
|
424
|
+
let lastKey, last;
|
|
425
|
+
return computed(() => {
|
|
426
|
+
const k = key();
|
|
427
|
+
if (k !== lastKey) {
|
|
428
|
+
last = make();
|
|
429
|
+
lastKey = k;
|
|
430
|
+
}
|
|
431
|
+
return last;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
function useTileLayout(options) {
|
|
435
|
+
return byKey(() => JSON.stringify(toValue(options)), () => createLayout(toValue(options)));
|
|
436
|
+
}
|
|
437
|
+
function useFitCount(options, count, fit = {}) {
|
|
438
|
+
return byKey(
|
|
439
|
+
() => JSON.stringify([toValue(options), toValue(count)]),
|
|
440
|
+
() => fitCount(toValue(options), toValue(count), fit).layout
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// src/index.ts
|
|
445
|
+
import { cellFromPointer, coverStyle, defaultPalette, neutralPalette } from "@andamento/dom";
|
|
446
|
+
export {
|
|
447
|
+
SvgTileLayout,
|
|
448
|
+
TileLayout,
|
|
449
|
+
cellFromPointer,
|
|
450
|
+
coverStyle,
|
|
451
|
+
defaultPalette,
|
|
452
|
+
neutralPalette,
|
|
453
|
+
useFitCount,
|
|
454
|
+
useTileLayout
|
|
455
|
+
};
|
|
456
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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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description": "Vue components for @andamento tiling layouts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tiling",
|
|
7
|
+
"tessellation",
|
|
8
|
+
"layout",
|
|
9
|
+
"mosaic",
|
|
10
|
+
"grid",
|
|
11
|
+
"gallery",
|
|
12
|
+
"photo-wall",
|
|
13
|
+
"hexagon",
|
|
14
|
+
"herringbone",
|
|
15
|
+
"penrose",
|
|
16
|
+
"voronoi",
|
|
17
|
+
"svg",
|
|
18
|
+
"vue",
|
|
19
|
+
"vue-component"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://mattputnam.github.io/andamento/",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/MattPutnam/andamento/issues"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/MattPutnam/andamento.git",
|
|
28
|
+
"directory": "packages/vue"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"author": "Matt Putnam",
|
|
32
|
+
"type": "module",
|
|
33
|
+
"main": "./dist/index.cjs",
|
|
34
|
+
"module": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"types": "./dist/index.d.cts",
|
|
44
|
+
"default": "./dist/index.cjs"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist",
|
|
50
|
+
"README.md",
|
|
51
|
+
"LICENSE"
|
|
52
|
+
],
|
|
53
|
+
"sideEffects": false,
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"typecheck": "tsc --noEmit -p ."
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@andamento/core": "0.1.0",
|
|
60
|
+
"@andamento/dom": "0.1.0",
|
|
61
|
+
"@andamento/svg": "0.1.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"vue": ">=3.3"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
}
|
|
69
|
+
}
|