@mulmoclaude/collection-plugin 0.2.2 → 0.4.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/chunk-CKQMccvm.cjs +28 -0
- package/dist/core/actionVisible.d.ts +1 -0
- package/dist/core/actionVisible.d.ts.map +1 -0
- package/dist/core/calendarGrid.d.ts +1 -0
- package/dist/core/calendarGrid.d.ts.map +1 -0
- package/dist/core/deriveAll.d.ts +2 -1
- package/dist/core/deriveAll.d.ts.map +1 -0
- package/dist/core/derivedFormula.d.ts +1 -0
- package/dist/core/derivedFormula.d.ts.map +1 -0
- package/dist/core/draft.d.ts +3 -2
- package/dist/core/draft.d.ts.map +1 -0
- package/dist/core/enumColors.d.ts +2 -1
- package/dist/core/enumColors.d.ts.map +1 -0
- package/dist/core/errorMessage.d.ts +5 -0
- package/dist/core/errorMessage.d.ts.map +1 -0
- package/dist/core/itemLabel.d.ts +2 -1
- package/dist/core/itemLabel.d.ts.map +1 -0
- package/dist/core/presentCollection.d.ts +2 -1
- package/dist/core/presentCollection.d.ts.map +1 -0
- package/dist/core/promptSafety.d.ts +2 -0
- package/dist/core/promptSafety.d.ts.map +1 -0
- package/dist/core/schema.d.ts +1 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/shortHexId.d.ts +9 -0
- package/dist/core/shortHexId.d.ts.map +1 -0
- package/dist/core/sortItems.d.ts +2 -1
- package/dist/core/sortItems.d.ts.map +1 -0
- package/dist/core/uiTypes.d.ts +54 -1
- package/dist/core/uiTypes.d.ts.map +1 -0
- package/dist/{deriveAll-B5spcUIb.js → deriveAll-BHcs1erT.js} +2 -20
- package/dist/deriveAll-BHcs1erT.js.map +1 -0
- package/dist/{deriveAll-Do0v6Xjb.cjs → deriveAll-BJ0Lvm1Q.cjs} +1 -31
- package/dist/deriveAll-BJ0Lvm1Q.cjs.map +1 -0
- package/dist/index.cjs +49 -712
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -670
- package/dist/index.js.map +1 -1
- package/dist/promptSafety-BSO2gdsg.cjs +961 -0
- package/dist/promptSafety-BSO2gdsg.cjs.map +1 -0
- package/dist/promptSafety-DShN_VCG.js +698 -0
- package/dist/promptSafety-DShN_VCG.js.map +1 -0
- package/dist/schema-DyfSfVzh.js +21 -0
- package/dist/schema-DyfSfVzh.js.map +1 -0
- package/dist/schema-LrmrgW12.cjs +32 -0
- package/dist/schema-LrmrgW12.cjs.map +1 -0
- package/dist/server/atomic.d.ts +1 -0
- package/dist/server/atomic.d.ts.map +1 -0
- package/dist/server/delete.d.ts +2 -1
- package/dist/server/delete.d.ts.map +1 -0
- package/dist/server/derive.d.ts +4 -3
- package/dist/server/derive.d.ts.map +1 -0
- package/dist/server/discoveredCollection.d.ts +2 -1
- package/dist/server/discoveredCollection.d.ts.map +1 -0
- package/dist/server/discovery.d.ts +4 -3
- package/dist/server/discovery.d.ts.map +1 -0
- package/dist/server/host.d.ts +1 -0
- package/dist/server/host.d.ts.map +1 -0
- package/dist/server/index.d.ts +12 -11
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/io.d.ts +3 -2
- package/dist/server/io.d.ts.map +1 -0
- package/dist/server/paths.d.ts +1 -0
- package/dist/server/paths.d.ts.map +1 -0
- package/dist/server/spawn.d.ts +3 -2
- package/dist/server/spawn.d.ts.map +1 -0
- package/dist/server/templatePath.d.ts +1 -0
- package/dist/server/templatePath.d.ts.map +1 -0
- package/dist/server/util.d.ts +1 -0
- package/dist/server/util.d.ts.map +1 -0
- package/dist/server/validate.d.ts +3 -2
- package/dist/server/validate.d.ts.map +1 -0
- package/dist/server/views.d.ts +3 -2
- package/dist/server/views.d.ts.map +1 -0
- package/dist/server.cjs +6 -26
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/style.css +2664 -0
- package/dist/vue/collectionViewMode.d.ts +12 -0
- package/dist/vue/collectionViewMode.d.ts.map +1 -0
- package/dist/vue/components/CollectionCalendarView.vue.d.ts +27 -0
- package/dist/vue/components/CollectionCalendarView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionCustomView.vue.d.ts +9 -0
- package/dist/vue/components/CollectionCustomView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionDayView.vue.d.ts +40 -0
- package/dist/vue/components/CollectionDayView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionEmbedView.vue.d.ts +9 -0
- package/dist/vue/components/CollectionEmbedView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionKanbanView.vue.d.ts +23 -0
- package/dist/vue/components/CollectionKanbanView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionRecordModal.vue.d.ts +18 -0
- package/dist/vue/components/CollectionRecordModal.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionRecordPanel.vue.d.ts +46 -0
- package/dist/vue/components/CollectionRecordPanel.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionView.vue.d.ts +41 -0
- package/dist/vue/components/CollectionView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionViewConfigModal.vue.d.ts +16 -0
- package/dist/vue/components/CollectionViewConfigModal.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionsIndexView.vue.d.ts +4 -0
- package/dist/vue/components/CollectionsIndexView.vue.d.ts.map +1 -0
- package/dist/vue/components/FeedsView.vue.d.ts +4 -0
- package/dist/vue/components/FeedsView.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +16 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/lang/de.d.ts +4 -0
- package/dist/vue/lang/de.d.ts.map +1 -0
- package/dist/vue/lang/en.d.ts +98 -0
- package/dist/vue/lang/en.d.ts.map +1 -0
- package/dist/vue/lang/es.d.ts +4 -0
- package/dist/vue/lang/es.d.ts.map +1 -0
- package/dist/vue/lang/fr.d.ts +4 -0
- package/dist/vue/lang/fr.d.ts.map +1 -0
- package/dist/vue/lang/index.d.ts +111 -0
- package/dist/vue/lang/index.d.ts.map +1 -0
- package/dist/vue/lang/ja.d.ts +4 -0
- package/dist/vue/lang/ja.d.ts.map +1 -0
- package/dist/vue/lang/ko.d.ts +4 -0
- package/dist/vue/lang/ko.d.ts.map +1 -0
- package/dist/vue/lang/ptBR.d.ts +4 -0
- package/dist/vue/lang/ptBR.d.ts.map +1 -0
- package/dist/vue/lang/zh.d.ts +4 -0
- package/dist/vue/lang/zh.d.ts.map +1 -0
- package/dist/vue/uiContext.d.ts +169 -0
- package/dist/vue/uiContext.d.ts.map +1 -0
- package/dist/vue/useCollectionRendering.d.ts +30 -0
- package/dist/vue/useCollectionRendering.d.ts.map +1 -0
- package/dist/vue.cjs +4713 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.js +4693 -0
- package/dist/vue.js.map +1 -0
- package/package.json +21 -6
- package/dist/deriveAll-B5spcUIb.js.map +0 -1
- package/dist/deriveAll-Do0v6Xjb.cjs.map +0 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { CollectionDetailResponse, ItemMutationResponse, CollectionNotifySeverity, CollectionsListResponse, FeedsListResponse, CollectionShortcutInfo } from "../core/uiTypes";
|
|
3
|
+
import type { CollectionItem } from "../core/schema";
|
|
4
|
+
/** Result of a host data fetch — structurally a subset of the host's own
|
|
5
|
+
* `ApiResult` (so the host can pass `apiGet` straight through). The view layer
|
|
6
|
+
* treats `ok: false` as a skip, never throwing on one failed target. */
|
|
7
|
+
export type CollectionFetchResult<T> = {
|
|
8
|
+
ok: true;
|
|
9
|
+
data: T;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
};
|
|
13
|
+
/** Result of a host write (delete / create / update / action) — the normalised
|
|
14
|
+
* `ApiResult` shape, so the host passes `apiDelete`/`apiPost`/… straight through.
|
|
15
|
+
* Carries the host's error string on failure for inline display. */
|
|
16
|
+
export type CollectionMutationResult = {
|
|
17
|
+
ok: true;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
error: string;
|
|
21
|
+
};
|
|
22
|
+
/** Full host `ApiResult<T>` (data on success, error + HTTP status on failure) —
|
|
23
|
+
* matches the host's `ApiResult` exactly, so `apiGet`/`apiPost`/`apiPut` pass
|
|
24
|
+
* straight through. `status` lets the view distinguish 404 (not-found) from a
|
|
25
|
+
* generic failure. */
|
|
26
|
+
export type CollectionApiResult<T> = {
|
|
27
|
+
ok: true;
|
|
28
|
+
data: T;
|
|
29
|
+
} | {
|
|
30
|
+
ok: false;
|
|
31
|
+
error: string;
|
|
32
|
+
status: number;
|
|
33
|
+
};
|
|
34
|
+
/** A collection / item action's result — a seed prompt + role for a new chat. */
|
|
35
|
+
export interface CollectionActionResult {
|
|
36
|
+
prompt: string;
|
|
37
|
+
role: string;
|
|
38
|
+
}
|
|
39
|
+
/** A feed refresh's result — counts + per-source errors. */
|
|
40
|
+
export interface CollectionRefreshResult {
|
|
41
|
+
refreshed: boolean;
|
|
42
|
+
written: number;
|
|
43
|
+
errors: string[];
|
|
44
|
+
}
|
|
45
|
+
/** Scoped capability token for a sandboxed custom view (mirrors the host's mint
|
|
46
|
+
* response) — the iframe reads/writes the collection through it. */
|
|
47
|
+
export interface CollectionViewToken {
|
|
48
|
+
token: string;
|
|
49
|
+
exp: number;
|
|
50
|
+
dataUrl: string;
|
|
51
|
+
capabilities: string[];
|
|
52
|
+
}
|
|
53
|
+
/** Result of fetching a custom view's HTML — status-only failure (the host
|
|
54
|
+
* attaches the global bearer; a non-2xx is surfaced as `HTTP <status>`). */
|
|
55
|
+
export type CollectionViewHtmlResult = {
|
|
56
|
+
ok: true;
|
|
57
|
+
html: string;
|
|
58
|
+
} | {
|
|
59
|
+
ok: false;
|
|
60
|
+
status: number;
|
|
61
|
+
};
|
|
62
|
+
/** Inputs the host needs to wrap a custom view's HTML into a sandboxed srcdoc
|
|
63
|
+
* (token + data URL injected, CSP applied — the host owns the CSP policy). */
|
|
64
|
+
export interface CollectionViewSrcdocBoot {
|
|
65
|
+
slug: string;
|
|
66
|
+
token: string;
|
|
67
|
+
dataUrl: string;
|
|
68
|
+
origin: string;
|
|
69
|
+
}
|
|
70
|
+
/** Options for the host's confirm dialog — structurally matches the host's own
|
|
71
|
+
* `ConfirmOptions`, so `confirm` can forward to `useConfirm().openConfirm`. */
|
|
72
|
+
export interface CollectionConfirmOptions {
|
|
73
|
+
message: string;
|
|
74
|
+
confirmText?: string;
|
|
75
|
+
cancelText?: string;
|
|
76
|
+
variant?: "primary" | "success" | "danger";
|
|
77
|
+
}
|
|
78
|
+
export interface CollectionUi {
|
|
79
|
+
/** Fetch a collection's detail (schema + records) by slug — backs both the
|
|
80
|
+
* View's own load (reads `status` for 404 → not-found) and ref/embed
|
|
81
|
+
* resolution (treats `!ok` as a skip). Replaces `apiGet(…collections.detail)`. */
|
|
82
|
+
fetchCollectionDetail: (slug: string) => Promise<CollectionApiResult<CollectionDetailResponse>>;
|
|
83
|
+
/** Browser-loadable URL for a file/image asset value (an html/svg artifact),
|
|
84
|
+
* or null when the value isn't a renderable asset path. Replaces
|
|
85
|
+
* `isValidFilePath` + `htmlPreviewUrlFor`/`svgPreviewUrlFor`. */
|
|
86
|
+
fileAssetUrl: (value: unknown) => string | null;
|
|
87
|
+
/** In-app File-Explorer route for a workspace file path (the fallback for
|
|
88
|
+
* `file` values that aren't a directly-served artifact), or null when the
|
|
89
|
+
* value isn't a valid in-workspace path. */
|
|
90
|
+
fileRoutePath: (value: unknown) => string | null;
|
|
91
|
+
/** Browser `<img src>` for a stored image value (a workspace file path), via
|
|
92
|
+
* the host's raw-file endpoint. Replaces the host's `resolveImageSrc`. */
|
|
93
|
+
imageSrc: (imageData: string) => string;
|
|
94
|
+
/** Open the host's confirm dialog; resolves true if confirmed. Replaces
|
|
95
|
+
* `useConfirm().openConfirm`. */
|
|
96
|
+
confirm: (options: CollectionConfirmOptions) => Promise<boolean>;
|
|
97
|
+
/** Delete a collection's custom view by id. Replaces the host's
|
|
98
|
+
* `apiDelete(API_ROUTES.collections.viewDelete)`. */
|
|
99
|
+
deleteView: (slug: string, viewId: string) => Promise<CollectionMutationResult>;
|
|
100
|
+
/** Mint a scoped capability token for a custom view (host: `apiPost` over
|
|
101
|
+
* `API_ROUTES.collections.viewToken`). */
|
|
102
|
+
mintViewToken: (slug: string, viewId: string) => Promise<CollectionApiResult<CollectionViewToken>>;
|
|
103
|
+
/** Fetch a custom view's raw HTML (host: `apiFetchRaw` over
|
|
104
|
+
* `API_ROUTES.collections.viewFile`, global bearer attached). */
|
|
105
|
+
fetchViewHtml: (slug: string, viewId: string) => Promise<CollectionViewHtmlResult>;
|
|
106
|
+
/** Wrap a custom view's HTML in a sandboxed `<iframe srcdoc>` with the token +
|
|
107
|
+
* data URL injected and the host's CSP applied. Replaces the host's
|
|
108
|
+
* `buildCustomViewSrcdoc`. */
|
|
109
|
+
buildViewSrcdoc: (html: string, boot: CollectionViewSrcdocBoot) => string;
|
|
110
|
+
/** Create a record (`apiPost` over `…collections.items`). */
|
|
111
|
+
createItem: (slug: string, record: CollectionItem) => Promise<CollectionApiResult<ItemMutationResponse>>;
|
|
112
|
+
/** Update a record (`apiPut` over `…collections.item`). */
|
|
113
|
+
updateItem: (slug: string, itemId: string, record: CollectionItem) => Promise<CollectionApiResult<ItemMutationResponse>>;
|
|
114
|
+
/** Delete a record (`apiDelete` over `…collections.item`). */
|
|
115
|
+
deleteItem: (slug: string, itemId: string) => Promise<CollectionMutationResult>;
|
|
116
|
+
/** Delete a whole collection (`apiDelete` over `…collections.detail`). */
|
|
117
|
+
deleteCollection: (slug: string) => Promise<CollectionMutationResult>;
|
|
118
|
+
/** Delete a feed via the project-scope feed-delete route (`…feeds.detail`). */
|
|
119
|
+
deleteFeed: (slug: string) => Promise<CollectionMutationResult>;
|
|
120
|
+
/** Run a per-record action (`apiPost` over `…collections.itemAction`). */
|
|
121
|
+
runItemAction: (slug: string, itemId: string, actionId: string) => Promise<CollectionApiResult<CollectionActionResult>>;
|
|
122
|
+
/** Run a collection-level action (`apiPost` over `…collections.collectionAction`). */
|
|
123
|
+
runCollectionAction: (slug: string, actionId: string) => Promise<CollectionApiResult<CollectionActionResult>>;
|
|
124
|
+
/** Refresh a feed-backed collection (`apiPost` over `…collections.refresh`). */
|
|
125
|
+
refreshCollection: (slug: string) => Promise<CollectionApiResult<CollectionRefreshResult>>;
|
|
126
|
+
/** Current route's `:slug` param (standalone page), or undefined. */
|
|
127
|
+
routeSlug: () => string | undefined;
|
|
128
|
+
/** Current route's `?selected=` query (deep-linked record), or undefined. */
|
|
129
|
+
routeSelectedId: () => string | undefined;
|
|
130
|
+
/** True when the standalone page is the feeds route (vs collections). */
|
|
131
|
+
isFeedRoute: () => boolean;
|
|
132
|
+
/** Set/clear the `?selected=` deep-link (router.replace, no history entry). */
|
|
133
|
+
setSelectedId: (itemId: string | null) => void;
|
|
134
|
+
/** Navigate to the collections / feeds index after a delete. */
|
|
135
|
+
gotoIndex: (kind: "collection" | "feed") => void;
|
|
136
|
+
/** Navigate to a specific collection / feed detail page (from an index card). */
|
|
137
|
+
gotoDetail: (kind: "collection" | "feed", slug: string) => void;
|
|
138
|
+
/** List skill-backed collections (`apiGet` over `…collections.list`). */
|
|
139
|
+
listCollections: () => Promise<CollectionApiResult<CollectionsListResponse>>;
|
|
140
|
+
/** List feed-backed collections (`apiGet` over `…feeds.list`). */
|
|
141
|
+
listFeeds: () => Promise<CollectionApiResult<FeedsListResponse>>;
|
|
142
|
+
/** Bulk-reconcile pinned launcher shortcuts of one kind against the
|
|
143
|
+
* authoritative list — prune dead slugs, refresh stale labels
|
|
144
|
+
* (`useShortcuts().reconcile`). */
|
|
145
|
+
reconcileShortcuts: (kind: "collection" | "feed", live: CollectionShortcutInfo[]) => Promise<void>;
|
|
146
|
+
/** Start a new chat with a seed prompt + role (host: `useAppApi().startNewChat`). */
|
|
147
|
+
startChat: (prompt: string, role: string) => void;
|
|
148
|
+
/** The host's active i18n locale tag (e.g. "en", "ja"), read reactively — the
|
|
149
|
+
* plugin syncs its own self-contained i18n instance to it. */
|
|
150
|
+
localeTag: () => string;
|
|
151
|
+
/** The host's "general" role id, for chats seeded without a specific role. */
|
|
152
|
+
generalRoleId: string;
|
|
153
|
+
/** The host's "personal" role id (the feed-add chat seeds into it). */
|
|
154
|
+
personalRoleId: string;
|
|
155
|
+
/** Remove a pinned launcher shortcut for a 404'd collection/feed
|
|
156
|
+
* (`useShortcuts().unpin`). */
|
|
157
|
+
unpin: (kind: "collection" | "feed", slug: string) => Promise<boolean>;
|
|
158
|
+
/** Active-notification severity per record id, for accenting flagged rows/cards
|
|
159
|
+
* (`collectionNotifiedSeverities` over the host's live notifier entries). */
|
|
160
|
+
notifiedSeverities: (slug: string) => Map<string, CollectionNotifySeverity>;
|
|
161
|
+
/** The host's pin/unpin toggle (couples to the host's shortcut store + is
|
|
162
|
+
* shared with other host views), rendered in the View header via
|
|
163
|
+
* `<component :is>`. Props: `kind`, `slug`, `title`, `icon`. */
|
|
164
|
+
pinToggle: Component;
|
|
165
|
+
}
|
|
166
|
+
/** Wire the collection view layer to a host. Call once at app startup. */
|
|
167
|
+
export declare function configureCollectionUi(capabilities: CollectionUi): void;
|
|
168
|
+
export declare function collectionUi(): CollectionUi;
|
|
169
|
+
//# sourceMappingURL=uiContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uiContext.d.ts","sourceRoot":"","sources":["../../src/vue/uiContext.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;yEAEyE;AACzE,MAAM,MAAM,qBAAqB,CAAC,CA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I,CAEtE;AAED,wBAAgB,YAAY,IAAI,YAAY,CAK3C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from "vue";
|
|
2
|
+
import type { CollectionDetail, CollectionItem, CollectionSchema, CollectionFieldSpec as FieldSpec, CollectionFieldType as FieldType } from "../core/schema";
|
|
3
|
+
import type { EmbedCache, EmbedView, RefCache, RefOption, RefRecordCache } from "../core/uiTypes";
|
|
4
|
+
export interface CollectionRendering {
|
|
5
|
+
refCache: Ref<RefCache>;
|
|
6
|
+
refRecordCache: Ref<RefRecordCache>;
|
|
7
|
+
embedCache: Ref<EmbedCache>;
|
|
8
|
+
resetLinkedCaches: () => void;
|
|
9
|
+
loadLinkedCollections: (schema: CollectionSchema, expectedSlug: string) => Promise<void>;
|
|
10
|
+
refDisplay: (targetSlug: string, itemSlug: string) => string;
|
|
11
|
+
refOptions: (targetSlug: string) => RefOption[];
|
|
12
|
+
embedViews: ComputedRef<Record<string, EmbedView>>;
|
|
13
|
+
resolveCurrency: (field: FieldSpec, record: CollectionItem | null | undefined) => string | undefined;
|
|
14
|
+
currencySymbol: (currency: string | undefined) => string;
|
|
15
|
+
formatMoney: (value: unknown, currency: string | undefined, displayLocale: string) => string;
|
|
16
|
+
formatCell: (value: unknown, type: FieldType) => string;
|
|
17
|
+
detailText: (value: unknown) => string;
|
|
18
|
+
isExternalUrl: (value: unknown) => boolean;
|
|
19
|
+
artifactUrl: (value: unknown) => string | null;
|
|
20
|
+
fileRoutePath: (value: unknown) => string | null;
|
|
21
|
+
tableRows: (value: unknown) => Record<string, unknown>[];
|
|
22
|
+
hasTableRows: (value: unknown) => boolean;
|
|
23
|
+
formatSubCell: (subField: FieldSpec, value: unknown, record: CollectionItem | null) => string;
|
|
24
|
+
inputTypeFor: (type: FieldType) => string;
|
|
25
|
+
deriveAll: (schema: CollectionSchema, base: CollectionItem, refRecords: RefRecordCache) => CollectionItem;
|
|
26
|
+
evaluateDerivedAgainstItem: (field: FieldSpec, fieldKey: string, item: CollectionItem) => number | null;
|
|
27
|
+
derivedDisplay: (field: FieldSpec, computedValue: unknown, record: CollectionItem | null) => string;
|
|
28
|
+
}
|
|
29
|
+
export declare function useCollectionRendering(collection: Ref<CollectionDetail | null>, locale: Ref<string>): CollectionRendering;
|
|
30
|
+
//# sourceMappingURL=useCollectionRendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCollectionRendering.d.ts","sourceRoot":"","sources":["../../src/vue/useCollectionRendering.ts"],"names":[],"mappings":"AASA,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,IAAI,SAAS,EAAE,mBAAmB,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7J,OAAO,KAAK,EAEV,UAAU,EAEV,SAAS,EACT,QAAQ,EAER,SAAS,EACT,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACpC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,qBAAqB,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7D,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;IAChD,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACnD,eAAe,EAAE,C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