@knime/product-features 6.4.0 → 7.0.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/CHANGELOG.md +24 -0
- package/README.md +0 -1
- package/dist/ai.css +21 -21
- package/dist/ai.js +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/{core-CIwP11Fc.js → core-n-n9OaZY.js} +2 -2
- package/dist/{core-CIwP11Fc.js.map → core-n-n9OaZY.js.map} +1 -1
- package/dist/dataTransfer/core.js +1 -1
- package/dist/dataTransfer.js +3 -31
- package/dist/dataTransfer.js.map +1 -1
- package/dist/{dist-htLRPkoq.js → dist-D193M-Gt.js} +27 -11
- package/dist/{dist-htLRPkoq.js.map → dist-D193M-Gt.js.map} +1 -1
- package/dist/embedding.js +30 -6
- package/dist/embedding.js.map +1 -1
- package/dist/embeddingSDK.js +1 -1
- package/dist/{rfcErrors-CNWg8BiD.js → rfcErrors-DdxFC4Hg.js} +2 -2
- package/dist/{rfcErrors-CNWg8BiD.js.map → rfcErrors-DdxFC4Hg.js.map} +1 -1
- package/dist/rfcErrors.js +1 -1
- package/dist/src/dataTransfer/upload/useFileUpload.d.ts.map +1 -1
- package/dist/src/embedding/index.d.ts +1 -1
- package/dist/src/embedding/index.d.ts.map +1 -1
- package/dist/src/embedding/outlets/index.d.ts +6 -1
- package/dist/src/embedding/outlets/index.d.ts.map +1 -1
- package/dist/src/embedding/outlets/versions.d.ts +93 -0
- package/dist/src/embedding/outlets/versions.d.ts.map +1 -0
- package/dist/toasts.js +1 -1
- package/package.json +7 -11
- package/dist/src/versions/CreateVersionForm/CreateVersionForm.vue.d.ts +0 -17
- package/dist/src/versions/CreateVersionForm/CreateVersionForm.vue.d.ts.map +0 -1
- package/dist/src/versions/CreateVersionForm/index.d.ts +0 -3
- package/dist/src/versions/CreateVersionForm/index.d.ts.map +0 -1
- package/dist/src/versions/CreateVersionForm/types.d.ts +0 -5
- package/dist/src/versions/CreateVersionForm/types.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/CurrentState.vue.d.ts +0 -21
- package/dist/src/versions/VersionHistory/CurrentState.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/HistoryEvent.vue.d.ts +0 -19
- package/dist/src/versions/VersionHistory/HistoryEvent.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/HistoryEventAuthor.vue.d.ts +0 -8
- package/dist/src/versions/VersionHistory/HistoryEventAuthor.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/HistoryEventFooter.vue.d.ts +0 -9
- package/dist/src/versions/VersionHistory/HistoryEventFooter.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/VersionHistory.vue.d.ts +0 -21
- package/dist/src/versions/VersionHistory/VersionHistory.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/VersionItem.vue.d.ts +0 -22
- package/dist/src/versions/VersionHistory/VersionItem.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/VersionLabel.vue.d.ts +0 -17
- package/dist/src/versions/VersionHistory/VersionLabel.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/VersionLimitInfo.vue.d.ts +0 -10
- package/dist/src/versions/VersionHistory/VersionLimitInfo.vue.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/constants.d.ts +0 -4
- package/dist/src/versions/VersionHistory/constants.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/index.d.ts +0 -4
- package/dist/src/versions/VersionHistory/index.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/mock-data/index.d.ts +0 -11
- package/dist/src/versions/VersionHistory/mock-data/index.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/mock-data/savepoints.d.ts +0 -5
- package/dist/src/versions/VersionHistory/mock-data/savepoints.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/mock-data/versionHistory.d.ts +0 -7
- package/dist/src/versions/VersionHistory/mock-data/versionHistory.d.ts.map +0 -1
- package/dist/src/versions/VersionHistory/types.d.ts +0 -105
- package/dist/src/versions/VersionHistory/types.d.ts.map +0 -1
- package/dist/src/versions/index.d.ts +0 -5
- package/dist/src/versions/index.d.ts.map +0 -1
- package/dist/versions.css +0 -108
- package/dist/versions.js +0 -584
- package/dist/versions.js.map +0 -1
package/dist/embedding.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as rfcErrors, t as RFC_ERROR_TOAST_META_KEY } from "./rfcErrors-
|
|
1
|
+
import { n as rfcErrors, t as RFC_ERROR_TOAST_META_KEY } from "./rfcErrors-DdxFC4Hg.js";
|
|
2
2
|
//#region src/embedding/outlets/spaceExplorer.ts
|
|
3
3
|
/**
|
|
4
4
|
* Keep only the capabilities that this contract version knows.
|
|
@@ -6,18 +6,42 @@ import { n as rfcErrors, t as RFC_ERROR_TOAST_META_KEY } from "./rfcErrors-CNWg8
|
|
|
6
6
|
var resolveSpaceExplorerGuestCapabilities = (declared) => ({ ...declared.itemDrop && { itemDrop: true } });
|
|
7
7
|
var resolveSpaceExplorerHostCapabilities = (declared) => ({ ...declared.revealItem && { revealItem: true } });
|
|
8
8
|
//#endregion
|
|
9
|
+
//#region src/embedding/outlets/versions.ts
|
|
10
|
+
/**
|
|
11
|
+
* Keep only the capabilities that this contract version knows.
|
|
12
|
+
*/
|
|
13
|
+
var resolveVersionsGuestCapabilities = (declared) => ({
|
|
14
|
+
...declared.close && { close: true },
|
|
15
|
+
...declared.switchVersion && { switchVersion: true },
|
|
16
|
+
...declared.syncUnsavedChanges && { syncUnsavedChanges: true },
|
|
17
|
+
...declared.onVersionRestored && { onVersionRestored: true },
|
|
18
|
+
...declared.onChangesDiscarded && { onChangesDiscarded: true },
|
|
19
|
+
...declared.onVersionDeleted && { onVersionDeleted: true }
|
|
20
|
+
});
|
|
21
|
+
var resolveVersionsHostCapabilities = (declared) => ({
|
|
22
|
+
...declared.getVersionTitle && { getVersionTitle: true },
|
|
23
|
+
...declared.reportVersionRestored && { reportVersionRestored: true },
|
|
24
|
+
...declared.refreshVersions && { refreshVersions: true }
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
9
27
|
//#region src/embedding/outlets/index.ts
|
|
10
|
-
var outletCapabilityResolvers = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
28
|
+
var outletCapabilityResolvers = {
|
|
29
|
+
spaceExplorer: {
|
|
30
|
+
guest: resolveSpaceExplorerGuestCapabilities,
|
|
31
|
+
host: resolveSpaceExplorerHostCapabilities
|
|
32
|
+
},
|
|
33
|
+
versions: {
|
|
34
|
+
guest: resolveVersionsGuestCapabilities,
|
|
35
|
+
host: resolveVersionsHostCapabilities
|
|
36
|
+
}
|
|
37
|
+
};
|
|
14
38
|
//#endregion
|
|
15
39
|
//#region src/embedding/capabilities.ts
|
|
16
40
|
/**
|
|
17
41
|
* Version of `@knime/product-features` that this build uses. Informational
|
|
18
42
|
* only: logs, support, deprecation tracking. It never gates behavior.
|
|
19
43
|
*/
|
|
20
|
-
var contractVersion = "
|
|
44
|
+
var contractVersion = "7.0.0";
|
|
21
45
|
/**
|
|
22
46
|
* Outlets that both sides declare. Capabilities that this contract version does not know are
|
|
23
47
|
* dropped.
|
package/dist/embedding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedding.js","names":[],"sources":["../src/embedding/outlets/spaceExplorer.ts","../src/embedding/outlets/index.ts","../src/embedding/capabilities.ts","../src/embedding/toasts.ts"],"sourcesContent":["/**\n * An item that the space explorer drags onto the canvas.\n */\nexport type SpaceExplorerDragItem = {\n spaceId: string;\n itemId: string;\n name: string;\n type: string;\n};\n\n/**\n * Drags items from the space explorer onto the another container. This allows custom control\n * over rendering a drag preview and also running custom logic when an item is dropped onto another\n * container.\n */\nexport type SpaceExplorerItemDrop = {\n start: (item: SpaceExplorerDragItem) => void;\n /**\n * When `accepts` is true, the space explorer hides its own drag ghost.\n */\n move: (clientX: number, clientY: number) => { accepts: boolean };\n /**\n * Resolves to whether the guest added the item.\n */\n end: (clientX: number, clientY: number) => Promise<boolean>;\n cancel: () => void;\n};\n\n/**\n * Announced by the guest when the element the outlet will render to exists.\n */\nexport type SpaceExplorerOutletHandle = {\n name: \"spaceExplorer\";\n /**\n * A stable, empty element. Must not be patched/removed by the guest\n */\n element: HTMLElement;\n /**\n * Present when both sides declare `itemDrop`.\n */\n itemDrop?: SpaceExplorerItemDrop;\n};\n\n/**\n * The space explorer's public api. Returned after `announce`ing the feature.\n */\nexport type SpaceExplorerFeatureAPI = {\n /**\n * Shows the item: its parent folder, with the item selected. Present when\n * the host declares `revealItem`.\n */\n revealItem?: (item: { spaceId: string; itemId: string }) => void;\n};\n\n/**\n * Capabilities the space explorer expects the guest to implement\n */\nexport type SpaceExplorerGuestCapabilities = {\n itemDrop?: true;\n};\n\n/**\n * Capabilities the space explorer of the host offers to the guest for public/direct usage\n * (all behavior is normally self-contained).\n */\nexport type SpaceExplorerHostCapabilities = {\n revealItem?: true;\n};\n\n/**\n * Keep only the capabilities that this contract version knows.\n */\nexport const resolveSpaceExplorerGuestCapabilities = (\n declared: SpaceExplorerGuestCapabilities,\n): SpaceExplorerGuestCapabilities => ({\n ...(declared.itemDrop && { itemDrop: true }),\n});\n\nexport const resolveSpaceExplorerHostCapabilities = (\n declared: SpaceExplorerHostCapabilities,\n): SpaceExplorerHostCapabilities => ({\n ...(declared.revealItem && { revealItem: true }),\n});\n","import {\n type SpaceExplorerFeatureAPI,\n type SpaceExplorerGuestCapabilities,\n type SpaceExplorerHostCapabilities,\n type SpaceExplorerOutletHandle,\n resolveSpaceExplorerGuestCapabilities,\n resolveSpaceExplorerHostCapabilities,\n} from \"./spaceExplorer\";\n\n/**\n * Outlets the guest can expose (the editor in this case). Each outlet contains one feature of the host.\n */\nexport type OutletHandle = SpaceExplorerOutletHandle;\n\nexport type OutletName = OutletHandle[\"name\"];\n\nexport type OutletRegistry = {\n spaceExplorer: SpaceExplorerFeatureAPI;\n};\n\nexport type GuestCapabilitiesForOutlet = {\n spaceExplorer: SpaceExplorerGuestCapabilities;\n};\n\nexport type HostCapabilitiesForOutlet = {\n spaceExplorer: SpaceExplorerHostCapabilities;\n};\n\nexport const outletCapabilityResolvers: {\n [N in OutletName]: {\n guest: (\n declared: GuestCapabilitiesForOutlet[N],\n ) => GuestCapabilitiesForOutlet[N];\n host: (\n declared: HostCapabilitiesForOutlet[N],\n ) => HostCapabilitiesForOutlet[N];\n };\n} = {\n spaceExplorer: {\n guest: resolveSpaceExplorerGuestCapabilities,\n host: resolveSpaceExplorerHostCapabilities,\n },\n};\n\nexport type {\n SpaceExplorerDragItem,\n SpaceExplorerFeatureAPI,\n SpaceExplorerItemDrop,\n SpaceExplorerOutletHandle,\n} from \"./spaceExplorer\";\n","import {\n type GuestCapabilitiesForOutlet,\n type HostCapabilitiesForOutlet,\n type OutletName,\n outletCapabilityResolvers,\n} from \"./outlets\";\n\n/**\n * Version of `@knime/product-features` that this build uses. Informational\n * only: logs, support, deprecation tracking. It never gates behavior.\n */\nexport const contractVersion: string = __PRODUCT_FEATURES_VERSION__;\n\n/**\n * Static declaration of the guest app. The host reads it before embedding.\n */\nexport type GuestCapabilities = {\n contractVersion: string;\n /**\n * Outlets the guest declares and supports. The host does not send a feature\n * for an outlet the guest does not support\n */\n outlets: Partial<GuestCapabilitiesForOutlet>;\n};\n\n/**\n * Static declaration of the host, passed as context for mounting the embedded guest\n */\nexport type HostCapabilities = {\n contractVersion: string;\n /**\n * Outlets the host has features for. The guest does not render an outlet that the\n * host cannot provide.\n */\n outlets: Partial<HostCapabilitiesForOutlet>;\n};\n\nexport type ResolvedOutlets = {\n [N in OutletName]?: {\n guest: GuestCapabilitiesForOutlet[N];\n host: HostCapabilitiesForOutlet[N];\n };\n};\n\n/**\n * Outlets that both sides declare. Capabilities that this contract version does not know are\n * dropped.\n */\nexport const resolveOutlets = (\n guest: GuestCapabilities,\n host: HostCapabilities,\n): ResolvedOutlets => {\n const resolved: ResolvedOutlets = {};\n\n for (const [name, resolvers] of Object.entries(outletCapabilityResolvers)) {\n const guestDeclared = guest.outlets?.[name as OutletName];\n const hostDeclared = host.outlets?.[name as OutletName];\n if (guestDeclared && hostDeclared) {\n resolved[name as OutletName] = {\n guest: resolvers.guest(guestDeclared),\n host: resolvers.host(hostDeclared),\n };\n }\n }\n\n return resolved;\n};\n","import {\n type RFCErrorToastMeta,\n RFC_ERROR_TOAST_META_KEY,\n rfcErrors,\n} from \"../rfcErrors\";\nimport type { Toast } from \"../toasts\";\n\nimport type { HostToast } from \"./types\";\n\n/**\n * Guest: turns a toast into data the host can render. An RFC error toast\n * keeps its error data. Any other component is dropped, because the host\n * cannot render a component from the guest's Vue runtime.\n */\nexport const toHostToast = (toast: Toast): HostToast => {\n const { component, meta, ...rest } = toast;\n const rfcError = meta?.[RFC_ERROR_TOAST_META_KEY] as\n RFCErrorToastMeta | undefined;\n\n if (component && !rfcError) {\n consola.warn(\"Embedding: dropped the component of a toast\", toast);\n }\n\n return {\n ...rest,\n ...(meta && { meta }),\n ...(rfcError && { rfcError }),\n };\n};\n\n/**\n * Host: turns a toast from the guest into a toast for its own\n * toast service context.\n */\nexport const fromHostToast = (hostToast: HostToast): Toast => {\n const { rfcError, ...toast } = hostToast;\n\n if (!rfcError) {\n return toast;\n }\n\n return {\n ...toast,\n ...rfcErrors.toToast({\n headline: toast.headline ?? \"\",\n rfcError: new rfcErrors.RFCError(rfcError.data),\n canCopyToClipboard: rfcError.canCopyToClipboard,\n serializeErrorForClipboard: rfcError.serializeErrorForClipboard,\n }),\n };\n};\n"],"mappings":";;;;;AAwEA,IAAa,yCACX,cACoC,EACpC,GAAI,SAAS,YAAY,EAAE,UAAU,KAAK,EAC5C;AAEA,IAAa,wCACX,cACmC,EACnC,GAAI,SAAS,cAAc,EAAE,YAAY,KAAK,EAChD;;;ACtDA,IAAa,4BAST,EACF,eAAe;CACb,OAAO;CACP,MAAM;AACR,EACF;;;;;;;AC/BA,IAAa,kBAAA;;;;;AAqCb,IAAa,kBACX,OACA,SACoB;CACpB,MAAM,WAA4B,CAAC;CAEnC,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,yBAAyB,GAAG;EACzE,MAAM,gBAAgB,MAAM,UAAU;EACtC,MAAM,eAAe,KAAK,UAAU;EACpC,IAAI,iBAAiB,cACnB,SAAS,QAAsB;GAC7B,OAAO,UAAU,MAAM,aAAa;GACpC,MAAM,UAAU,KAAK,YAAY;EACnC;CAEJ;CAEA,OAAO;AACT;;;;;;;;ACpDA,IAAa,eAAe,UAA4B;CACtD,MAAM,EAAE,WAAW,MAAM,GAAG,SAAS;CACrC,MAAM,WAAW,OAAO;CAGxB,IAAI,aAAa,CAAC,UAChB,QAAQ,KAAK,+CAA+C,KAAK;CAGnE,OAAO;EACL,GAAG;EACH,GAAI,QAAQ,EAAE,KAAK;EACnB,GAAI,YAAY,EAAE,SAAS;CAC7B;AACF;;;;;AAMA,IAAa,iBAAiB,cAAgC;CAC5D,MAAM,EAAE,UAAU,GAAG,UAAU;CAE/B,IAAI,CAAC,UACH,OAAO;CAGT,OAAO;EACL,GAAG;EACH,GAAG,UAAU,QAAQ;GACnB,UAAU,MAAM,YAAY;GAC5B,UAAU,IAAI,UAAU,SAAS,SAAS,IAAI;GAC9C,oBAAoB,SAAS;GAC7B,4BAA4B,SAAS;EACvC,CAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"embedding.js","names":[],"sources":["../src/embedding/outlets/spaceExplorer.ts","../src/embedding/outlets/versions.ts","../src/embedding/outlets/index.ts","../src/embedding/capabilities.ts","../src/embedding/toasts.ts"],"sourcesContent":["/**\n * An item that the space explorer drags onto the canvas.\n */\nexport type SpaceExplorerDragItem = {\n spaceId: string;\n itemId: string;\n name: string;\n type: string;\n};\n\n/**\n * Drags items from the space explorer onto the another container. This allows custom control\n * over rendering a drag preview and also running custom logic when an item is dropped onto another\n * container.\n */\nexport type SpaceExplorerItemDrop = {\n start: (item: SpaceExplorerDragItem) => void;\n /**\n * When `accepts` is true, the space explorer hides its own drag ghost.\n */\n move: (clientX: number, clientY: number) => { accepts: boolean };\n /**\n * Resolves to whether the guest added the item.\n */\n end: (clientX: number, clientY: number) => Promise<boolean>;\n cancel: () => void;\n};\n\n/**\n * Announced by the guest when the element the outlet will render to exists.\n */\nexport type SpaceExplorerOutletHandle = {\n name: \"spaceExplorer\";\n /**\n * A stable, empty element. Must not be patched/removed by the guest\n */\n element: HTMLElement;\n /**\n * Present when both sides declare `itemDrop`.\n */\n itemDrop?: SpaceExplorerItemDrop;\n};\n\n/**\n * The space explorer's public api. Returned after `announce`ing the feature.\n */\nexport type SpaceExplorerFeatureAPI = {\n /**\n * Shows the item: its parent folder, with the item selected. Present when\n * the host declares `revealItem`.\n */\n revealItem?: (item: { spaceId: string; itemId: string }) => void;\n};\n\n/**\n * Capabilities the space explorer expects the guest to implement\n */\nexport type SpaceExplorerGuestCapabilities = {\n itemDrop?: true;\n};\n\n/**\n * Capabilities the space explorer of the host offers to the guest for public/direct usage\n * (all behavior is normally self-contained).\n */\nexport type SpaceExplorerHostCapabilities = {\n revealItem?: true;\n};\n\n/**\n * Keep only the capabilities that this contract version knows.\n */\nexport const resolveSpaceExplorerGuestCapabilities = (\n declared: SpaceExplorerGuestCapabilities,\n): SpaceExplorerGuestCapabilities => ({\n ...(declared.itemDrop && { itemDrop: true }),\n});\n\nexport const resolveSpaceExplorerHostCapabilities = (\n declared: SpaceExplorerHostCapabilities,\n): SpaceExplorerHostCapabilities => ({\n ...(declared.revealItem && { revealItem: true }),\n});\n","/**\n * Announced by the guest when the element the outlet will render to exists.\n */\nexport type VersionsOutletHandle = {\n name: \"versions\";\n /**\n * A stable, empty element. Must not be patched/removed by the guest\n */\n element: HTMLElement;\n /**\n * Called when the host's close button is clicked, so the guest can hide the\n * outlet. Present when the guest declares `close`.\n */\n close?: () => void;\n /**\n * Switches which version of the workflow the live editor loads: a version\n * number, or `\"current-state\"`/`\"most-recent\"`. Present when the guest\n * declares `switchVersion`.\n */\n switchVersion?: (version: number | \"current-state\" | \"most-recent\") => void;\n /**\n * Called when the host wants the guest to sync its own unsaved live edits\n * before proceeding with an action. Present when the guest declares\n * `syncUnsavedChanges`.\n */\n syncUnsavedChanges?: () => Promise<{ didSync: boolean }>;\n /**\n * Called after the host restores a version, so the editor can reload the\n * now-current state. Present when the guest declares `onVersionRestored`.\n */\n onVersionRestored?: (version: number) => void;\n /**\n * Called after the host discards the unversioned savepoint, so the editor\n * can reload the current state. Present when the guest declares\n * `onChangesDiscarded`.\n */\n onChangesDiscarded?: () => void;\n /**\n * Called after the host deletes a version, so the editor can drop any\n * cached data for it. Present when the guest declares `onVersionDeleted`.\n */\n onVersionDeleted?: (version: number) => void;\n};\n\n/**\n * The version history's public api. Returned after `announce`ing the feature.\n */\nexport type VersionsFeatureAPI = {\n /**\n * Resolves the display title of a version, e.g. for the editor's own\n * version-aware UI. Present when the host declares `getVersionTitle`.\n */\n getVersionTitle?: (version: number) => Promise<string | undefined>;\n /**\n * Called by the guest after it restores a version through its own UI\n * (outside the host's panel), so the host can refresh its panel. Present\n * when the host declares `reportVersionRestored`.\n */\n reportVersionRestored?: (version: number) => void;\n /**\n * Called by the guest after its content was saved, so the host can refresh\n * its panel's data if needed (e.g. a draft that didn't exist before).\n * Present when the host declares `refreshVersions`.\n */\n refreshVersions?: () => void;\n};\n\n/**\n * Capabilities the version history expects the guest to implement\n */\nexport type VersionsGuestCapabilities = {\n close?: true;\n switchVersion?: true;\n syncUnsavedChanges?: true;\n onVersionRestored?: true;\n onChangesDiscarded?: true;\n onVersionDeleted?: true;\n};\n\n/**\n * Capabilities the version history of the host offers to the guest for public/direct usage\n * (all behavior is normally self-contained).\n */\nexport type VersionsHostCapabilities = {\n getVersionTitle?: true;\n reportVersionRestored?: true;\n refreshVersions?: true;\n};\n\n/**\n * Keep only the capabilities that this contract version knows.\n */\nexport const resolveVersionsGuestCapabilities = (\n declared: VersionsGuestCapabilities,\n): VersionsGuestCapabilities => ({\n ...(declared.close && { close: true }),\n ...(declared.switchVersion && { switchVersion: true }),\n ...(declared.syncUnsavedChanges && { syncUnsavedChanges: true }),\n ...(declared.onVersionRestored && { onVersionRestored: true }),\n ...(declared.onChangesDiscarded && { onChangesDiscarded: true }),\n ...(declared.onVersionDeleted && { onVersionDeleted: true }),\n});\n\nexport const resolveVersionsHostCapabilities = (\n declared: VersionsHostCapabilities,\n): VersionsHostCapabilities => ({\n ...(declared.getVersionTitle && { getVersionTitle: true }),\n ...(declared.reportVersionRestored && { reportVersionRestored: true }),\n ...(declared.refreshVersions && { refreshVersions: true }),\n});\n","import {\n type SpaceExplorerFeatureAPI,\n type SpaceExplorerGuestCapabilities,\n type SpaceExplorerHostCapabilities,\n type SpaceExplorerOutletHandle,\n resolveSpaceExplorerGuestCapabilities,\n resolveSpaceExplorerHostCapabilities,\n} from \"./spaceExplorer\";\nimport {\n type VersionsFeatureAPI,\n type VersionsGuestCapabilities,\n type VersionsHostCapabilities,\n type VersionsOutletHandle,\n resolveVersionsGuestCapabilities,\n resolveVersionsHostCapabilities,\n} from \"./versions\";\n\n/**\n * Outlets the guest can expose (the editor in this case). Each outlet contains one feature of the host.\n */\nexport type OutletHandle = SpaceExplorerOutletHandle | VersionsOutletHandle;\n\nexport type OutletName = OutletHandle[\"name\"];\n\nexport type OutletRegistry = {\n spaceExplorer: SpaceExplorerFeatureAPI;\n versions: VersionsFeatureAPI;\n};\n\nexport type GuestCapabilitiesForOutlet = {\n spaceExplorer: SpaceExplorerGuestCapabilities;\n versions: VersionsGuestCapabilities;\n};\n\nexport type HostCapabilitiesForOutlet = {\n spaceExplorer: SpaceExplorerHostCapabilities;\n versions: VersionsHostCapabilities;\n};\n\nexport const outletCapabilityResolvers: {\n [N in OutletName]: {\n guest: (\n declared: GuestCapabilitiesForOutlet[N],\n ) => GuestCapabilitiesForOutlet[N];\n host: (\n declared: HostCapabilitiesForOutlet[N],\n ) => HostCapabilitiesForOutlet[N];\n };\n} = {\n spaceExplorer: {\n guest: resolveSpaceExplorerGuestCapabilities,\n host: resolveSpaceExplorerHostCapabilities,\n },\n versions: {\n guest: resolveVersionsGuestCapabilities,\n host: resolveVersionsHostCapabilities,\n },\n};\n\nexport type {\n SpaceExplorerDragItem,\n SpaceExplorerFeatureAPI,\n SpaceExplorerItemDrop,\n SpaceExplorerOutletHandle,\n} from \"./spaceExplorer\";\nexport type { VersionsFeatureAPI, VersionsOutletHandle } from \"./versions\";\n","import {\n type GuestCapabilitiesForOutlet,\n type HostCapabilitiesForOutlet,\n type OutletName,\n outletCapabilityResolvers,\n} from \"./outlets\";\n\n/**\n * Version of `@knime/product-features` that this build uses. Informational\n * only: logs, support, deprecation tracking. It never gates behavior.\n */\nexport const contractVersion: string = __PRODUCT_FEATURES_VERSION__;\n\n/**\n * Static declaration of the guest app. The host reads it before embedding.\n */\nexport type GuestCapabilities = {\n contractVersion: string;\n /**\n * Outlets the guest declares and supports. The host does not send a feature\n * for an outlet the guest does not support\n */\n outlets: Partial<GuestCapabilitiesForOutlet>;\n};\n\n/**\n * Static declaration of the host, passed as context for mounting the embedded guest\n */\nexport type HostCapabilities = {\n contractVersion: string;\n /**\n * Outlets the host has features for. The guest does not render an outlet that the\n * host cannot provide.\n */\n outlets: Partial<HostCapabilitiesForOutlet>;\n};\n\nexport type ResolvedOutlets = {\n [N in OutletName]?: {\n guest: GuestCapabilitiesForOutlet[N];\n host: HostCapabilitiesForOutlet[N];\n };\n};\n\n/**\n * Outlets that both sides declare. Capabilities that this contract version does not know are\n * dropped.\n */\nexport const resolveOutlets = (\n guest: GuestCapabilities,\n host: HostCapabilities,\n): ResolvedOutlets => {\n const resolved: ResolvedOutlets = {};\n\n for (const [name, resolvers] of Object.entries(outletCapabilityResolvers)) {\n const guestDeclared = guest.outlets?.[name as OutletName];\n const hostDeclared = host.outlets?.[name as OutletName];\n if (guestDeclared && hostDeclared) {\n resolved[name as OutletName] = {\n guest: resolvers.guest(guestDeclared),\n host: resolvers.host(hostDeclared),\n };\n }\n }\n\n return resolved;\n};\n","import {\n type RFCErrorToastMeta,\n RFC_ERROR_TOAST_META_KEY,\n rfcErrors,\n} from \"../rfcErrors\";\nimport type { Toast } from \"../toasts\";\n\nimport type { HostToast } from \"./types\";\n\n/**\n * Guest: turns a toast into data the host can render. An RFC error toast\n * keeps its error data. Any other component is dropped, because the host\n * cannot render a component from the guest's Vue runtime.\n */\nexport const toHostToast = (toast: Toast): HostToast => {\n const { component, meta, ...rest } = toast;\n const rfcError = meta?.[RFC_ERROR_TOAST_META_KEY] as\n RFCErrorToastMeta | undefined;\n\n if (component && !rfcError) {\n consola.warn(\"Embedding: dropped the component of a toast\", toast);\n }\n\n return {\n ...rest,\n ...(meta && { meta }),\n ...(rfcError && { rfcError }),\n };\n};\n\n/**\n * Host: turns a toast from the guest into a toast for its own\n * toast service context.\n */\nexport const fromHostToast = (hostToast: HostToast): Toast => {\n const { rfcError, ...toast } = hostToast;\n\n if (!rfcError) {\n return toast;\n }\n\n return {\n ...toast,\n ...rfcErrors.toToast({\n headline: toast.headline ?? \"\",\n rfcError: new rfcErrors.RFCError(rfcError.data),\n canCopyToClipboard: rfcError.canCopyToClipboard,\n serializeErrorForClipboard: rfcError.serializeErrorForClipboard,\n }),\n };\n};\n"],"mappings":";;;;;AAwEA,IAAa,yCACX,cACoC,EACpC,GAAI,SAAS,YAAY,EAAE,UAAU,KAAK,EAC5C;AAEA,IAAa,wCACX,cACmC,EACnC,GAAI,SAAS,cAAc,EAAE,YAAY,KAAK,EAChD;;;;;;ACUA,IAAa,oCACX,cAC+B;CAC/B,GAAI,SAAS,SAAS,EAAE,OAAO,KAAK;CACpC,GAAI,SAAS,iBAAiB,EAAE,eAAe,KAAK;CACpD,GAAI,SAAS,sBAAsB,EAAE,oBAAoB,KAAK;CAC9D,GAAI,SAAS,qBAAqB,EAAE,mBAAmB,KAAK;CAC5D,GAAI,SAAS,sBAAsB,EAAE,oBAAoB,KAAK;CAC9D,GAAI,SAAS,oBAAoB,EAAE,kBAAkB,KAAK;AAC5D;AAEA,IAAa,mCACX,cAC8B;C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g.js";
|
|
2
|
-
import { c as promise_exports } from "./dist-
|
|
2
|
+
import { c as promise_exports } from "./dist-D193M-Gt.js";
|
|
3
3
|
//#region src/embeddingSDK/messages.ts
|
|
4
4
|
/**
|
|
5
5
|
* ----------- IMPORTANT NOTES ---------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
|
|
2
|
-
import {
|
|
2
|
+
import { r as formatDateTimeString } from "./dist-D193M-Gt.js";
|
|
3
3
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createPropsRestProxy, createTextVNode, defineComponent, h, openBlock, ref, renderList, toDisplayString, unref } from "vue";
|
|
4
4
|
import { KdsButton } from "@knime/kds-components";
|
|
5
5
|
import { useClipboard } from "@vueuse/core";
|
|
@@ -179,4 +179,4 @@ var rfcErrors = {
|
|
|
179
179
|
//#endregion
|
|
180
180
|
export { rfcErrors as n, RFC_ERROR_TOAST_META_KEY as t };
|
|
181
181
|
|
|
182
|
-
//# sourceMappingURL=rfcErrors-
|
|
182
|
+
//# sourceMappingURL=rfcErrors-DdxFC4Hg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rfcErrors-CNWg8BiD.js","names":[],"sources":["../src/rfcErrors/serializeRFCErrorData.ts","../src/rfcErrors/RFCErrorToastTemplate.vue","../src/rfcErrors/RFCErrorToastTemplate.vue","../src/rfcErrors/types.ts","../src/rfcErrors/index.ts"],"sourcesContent":["import type { RFCErrorData } from \"./types\";\n\nexport const serializeErrorForClipboard = (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n): string => {\n let details = \"\";\n if (error.details?.length) {\n if (error.details.length > 1) {\n const detailLines = error.details\n .map((item) => `\\u2022 ${item}`)\n .join(\"\\n\");\n details = `\\n${detailLines}`;\n } else {\n details = error.details[0];\n }\n }\n\n let errorText = `${headline}\\n\\n`;\n errorText += `${error.title}\\n\\n`;\n errorText += details ? `Details: ${details}\\n\\n` : \"\";\n\n if (error.status !== undefined) {\n errorText += `Status: ${error.status}\\n`;\n }\n\n if (error.date) {\n errorText += `Date: ${formatDate(error.date)}\\n`;\n }\n\n if (error.requestId) {\n errorText += `Request Id: ${error.requestId}\\n`;\n }\n\n if (error.errorId) {\n errorText += `Error Id: ${error.errorId}\\n`;\n }\n\n if (error.stacktrace) {\n errorText += \"------\\n\"; // separator\n errorText += `Stacktrace:\\n\\n${error.stacktrace}\\n`;\n }\n\n return errorText;\n};\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { useClipboard } from \"@vueuse/core\";\n\nimport { KdsButton } from \"@knime/kds-components\";\nimport { formatDateTimeString } from \"@knime/utils\";\n\nimport { serializeErrorForClipboard as defaultSerializeRFCErrorData } from \"./serializeRFCErrorData\";\nimport type { RFCErrorData } from \"./types\";\n\ntype Props = {\n /**\n * Toast headline shown in the toast title bar. Not rendered inside this\n * template, but included when serializing the error to the clipboard.\n */\n headline: string;\n /** Whether to show the \"Copy error to clipboard\" button. */\n canCopyToClipboard?: boolean;\n /**\n * Custom serializer for the clipboard payload. Defaults to\n * `serializeRFCErrorData` which formats the full error as text.\n */\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n} & RFCErrorData;\n\nconst {\n headline,\n canCopyToClipboard = true,\n serializeErrorForClipboard = defaultSerializeRFCErrorData,\n ...rfcError\n} = defineProps<Props>();\n\nconst emits = defineEmits([\"showMore\"]);\n\nconst { copy, copied } = useClipboard({\n copiedDuring: 3000,\n});\n\nconst hasDetails =\n rfcError.details?.length ||\n rfcError.status !== undefined ||\n rfcError.date !== undefined ||\n rfcError.requestId !== undefined ||\n rfcError.errorId !== undefined;\n// don't show 'Show details' button if there are no details to show\nconst showDetails = ref(!hasDetails);\n\nconst formatDate = (date: Date): string =>\n date ? formatDateTimeString(date.getTime()) : \"\";\n\nconst copyToClipboard = () => {\n if (copied.value) {\n return;\n }\n copy(serializeErrorForClipboard(rfcError, headline, formatDate)).catch(\n (error) => {\n consola.error(\"Failed to copy to clipboard\", { error });\n },\n );\n};\n\nconst onShowDetailsClicked = () => {\n showDetails.value = true;\n emits(\"showMore\");\n};\n</script>\n\n<template>\n <div class=\"wrapper\">\n <div class=\"title\">\n {{ title }}\n </div>\n <div v-if=\"showDetails\">\n <div v-if=\"details?.length\">\n <strong>Details: </strong>\n <template v-if=\"details.length === 1\">\n {{ details[0] }}\n </template>\n <template v-else>\n <ul class=\"details-list\">\n <li v-for=\"(item, index) in details\" :key=\"index\">{{ item }}</li>\n </ul>\n </template>\n </div>\n\n <div v-if=\"status !== undefined\">\n <strong>Status: </strong>{{ status }}\n </div>\n <div v-if=\"date\"><strong>Date: </strong>{{ formatDate(date) }}</div>\n <div v-if=\"requestId\"><strong>Request id: </strong>{{ requestId }}</div>\n <div v-if=\"errorId\"><strong>Error id: </strong>{{ errorId }}</div>\n <div v-if=\"stacktrace && canCopyToClipboard\">\n <strong>Stacktrace: </strong>Part of clipboard text\n </div>\n </div>\n <div class=\"actions-wrapper\">\n <KdsButton\n v-if=\"!showDetails\"\n data-testid=\"show-details\"\n variant=\"transparent\"\n label=\"Show details\"\n size=\"xsmall\"\n @click=\"onShowDetailsClicked\"\n />\n <KdsButton\n v-if=\"canCopyToClipboard\"\n data-testid=\"copy-to-clipboard\"\n :label=\"copied ? 'Error was copied' : 'Copy error to clipboard'\"\n :leading-icon=\"copied ? 'checkmark' : 'copy'\"\n variant=\"transparent\"\n size=\"xsmall\"\n @click=\"copyToClipboard\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-25x);\n font: var(--kds-font-base-body-small);\n color: var(--kds-color-text-and-icon-neutral);\n}\n\n.details-list {\n padding-left: var(--kds-spacing-container-1-5x);\n margin-top: var(--kds-spacing-container-0-37x);\n margin-bottom: var(--kds-spacing-container-0-37x);\n}\n\n.actions-wrapper {\n display: flex;\n gap: var(--kds-spacing-container-0-5x);\n align-items: center;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { useClipboard } from \"@vueuse/core\";\n\nimport { KdsButton } from \"@knime/kds-components\";\nimport { formatDateTimeString } from \"@knime/utils\";\n\nimport { serializeErrorForClipboard as defaultSerializeRFCErrorData } from \"./serializeRFCErrorData\";\nimport type { RFCErrorData } from \"./types\";\n\ntype Props = {\n /**\n * Toast headline shown in the toast title bar. Not rendered inside this\n * template, but included when serializing the error to the clipboard.\n */\n headline: string;\n /** Whether to show the \"Copy error to clipboard\" button. */\n canCopyToClipboard?: boolean;\n /**\n * Custom serializer for the clipboard payload. Defaults to\n * `serializeRFCErrorData` which formats the full error as text.\n */\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n} & RFCErrorData;\n\nconst {\n headline,\n canCopyToClipboard = true,\n serializeErrorForClipboard = defaultSerializeRFCErrorData,\n ...rfcError\n} = defineProps<Props>();\n\nconst emits = defineEmits([\"showMore\"]);\n\nconst { copy, copied } = useClipboard({\n copiedDuring: 3000,\n});\n\nconst hasDetails =\n rfcError.details?.length ||\n rfcError.status !== undefined ||\n rfcError.date !== undefined ||\n rfcError.requestId !== undefined ||\n rfcError.errorId !== undefined;\n// don't show 'Show details' button if there are no details to show\nconst showDetails = ref(!hasDetails);\n\nconst formatDate = (date: Date): string =>\n date ? formatDateTimeString(date.getTime()) : \"\";\n\nconst copyToClipboard = () => {\n if (copied.value) {\n return;\n }\n copy(serializeErrorForClipboard(rfcError, headline, formatDate)).catch(\n (error) => {\n consola.error(\"Failed to copy to clipboard\", { error });\n },\n );\n};\n\nconst onShowDetailsClicked = () => {\n showDetails.value = true;\n emits(\"showMore\");\n};\n</script>\n\n<template>\n <div class=\"wrapper\">\n <div class=\"title\">\n {{ title }}\n </div>\n <div v-if=\"showDetails\">\n <div v-if=\"details?.length\">\n <strong>Details: </strong>\n <template v-if=\"details.length === 1\">\n {{ details[0] }}\n </template>\n <template v-else>\n <ul class=\"details-list\">\n <li v-for=\"(item, index) in details\" :key=\"index\">{{ item }}</li>\n </ul>\n </template>\n </div>\n\n <div v-if=\"status !== undefined\">\n <strong>Status: </strong>{{ status }}\n </div>\n <div v-if=\"date\"><strong>Date: </strong>{{ formatDate(date) }}</div>\n <div v-if=\"requestId\"><strong>Request id: </strong>{{ requestId }}</div>\n <div v-if=\"errorId\"><strong>Error id: </strong>{{ errorId }}</div>\n <div v-if=\"stacktrace && canCopyToClipboard\">\n <strong>Stacktrace: </strong>Part of clipboard text\n </div>\n </div>\n <div class=\"actions-wrapper\">\n <KdsButton\n v-if=\"!showDetails\"\n data-testid=\"show-details\"\n variant=\"transparent\"\n label=\"Show details\"\n size=\"xsmall\"\n @click=\"onShowDetailsClicked\"\n />\n <KdsButton\n v-if=\"canCopyToClipboard\"\n data-testid=\"copy-to-clipboard\"\n :label=\"copied ? 'Error was copied' : 'Copy error to clipboard'\"\n :leading-icon=\"copied ? 'checkmark' : 'copy'\"\n variant=\"transparent\"\n size=\"xsmall\"\n @click=\"copyToClipboard\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-25x);\n font: var(--kds-font-base-body-small);\n color: var(--kds-color-text-and-icon-neutral);\n}\n\n.details-list {\n padding-left: var(--kds-spacing-container-1-5x);\n margin-top: var(--kds-spacing-container-0-37x);\n margin-bottom: var(--kds-spacing-container-0-37x);\n}\n\n.actions-wrapper {\n display: flex;\n gap: var(--kds-spacing-container-0-5x);\n align-items: center;\n}\n</style>\n","/**\n * Type based on an RFC-9457 error standard (https://www.rfc-editor.org/rfc/rfc9457)\n * Also see:\n * https://knime-com.atlassian.net/wiki/spaces/SPECS/pages/4126769212/API+Errors+Problem+Details\n */\nexport type RFCErrorData = {\n /** Short human-readable summary of the error. */\n title: string;\n /** HTTP status code associated with the error. */\n status?: number;\n /** Date/time when the error occurred. */\n date?: Date;\n /** Additional human-readable detail messages. */\n details?: string[];\n /** Correlation id for the request that triggered the error. */\n requestId?: string;\n /**\n * Id used to find an error in the Hub logs. Specially relevant\n * when details of the error are not wanted to be exposed to the user.\n */\n errorId?: string;\n /**\n * Relevant only for the Analytics Platform, since the Hub does not expose\n * stack traces.\n */\n stacktrace?: string;\n};\n\nexport class RFCError extends Error {\n data: RFCErrorData;\n\n constructor(data: RFCErrorData) {\n super(data.title);\n this.data = data;\n }\n}\n\nexport type FetchError = {\n response: {\n headers: Headers;\n };\n statusCode: number;\n data: {\n title: string;\n details: string[];\n };\n};\n","import { h } from \"vue\";\n\nimport type { Toast } from \"../toasts\";\n\nimport RFCErrorToastTemplate from \"./RFCErrorToastTemplate.vue\";\nimport { type FetchError, RFCError, type RFCErrorData } from \"./types\";\n\n/**\n * Key in `Toast.meta` under which `toToast` keeps the error data, so the toast\n * can be rebuilt where its component cannot be rendered.\n */\nexport const RFC_ERROR_TOAST_META_KEY = \"rfcError\";\n\nexport type RFCErrorToastMeta = {\n data: RFCErrorData;\n canCopyToClipboard?: boolean;\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n};\n\n/**\n * Map to a toast template component compatible with an RFCError format\n */\nconst toToast = ({\n headline,\n rfcError,\n canCopyToClipboard = true,\n serializeErrorForClipboard = undefined,\n}: {\n headline: string;\n rfcError: RFCError;\n canCopyToClipboard?: boolean;\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n}): Toast => {\n const { data } = rfcError;\n\n const rfcErrorToastContent = h(RFCErrorToastTemplate, {\n headline,\n ...data,\n canCopyToClipboard,\n serializeErrorForClipboard,\n });\n\n return {\n type: \"error\",\n headline,\n component: rfcErrorToastContent,\n autoRemove: false,\n meta: {\n [RFC_ERROR_TOAST_META_KEY]: {\n data,\n canCopyToClipboard,\n serializeErrorForClipboard,\n } satisfies RFCErrorToastMeta,\n },\n };\n};\n\nconst isFetchError = (error: unknown): error is FetchError => {\n return (\n error !== null &&\n typeof error === \"object\" &&\n \"response\" in error &&\n \"statusCode\" in error &&\n \"data\" in error\n );\n};\n\n/**\n * Parse a generic request error to an `RFCError`.\n * When parsing is not possible it returns undefined.\n */\nconst tryParse = (error: unknown): RFCError | undefined => {\n if (!isFetchError(error)) {\n return undefined;\n }\n\n if (!error.response) {\n return undefined;\n }\n\n const responseDate = error.response.headers.get(\"date\")\n ? new Date(error.response.headers.get(\"date\")!)\n : undefined;\n\n const title =\n typeof error.data === \"string\" ? error.data : (error.data?.title ?? \"\");\n\n const rfcErrorData: RFCErrorData = {\n title: title as string,\n details: error.data?.details as string[] | undefined,\n status: error.statusCode as number,\n date: responseDate,\n requestId: error.response.headers.get(\"x-request-id\") ?? undefined,\n errorId: error.response.headers.get(\"x-error-id\") ?? undefined,\n };\n\n return new RFCError(rfcErrorData);\n};\n\nexport const rfcErrors = {\n toToast,\n tryParse,\n RFCError,\n};\n"],"mappings":";;;;;;AAEA,IAAa,8BACX,OACA,UACA,eACW;CACX,IAAI,UAAU;CACd,IAAI,MAAM,SAAS,QACjB,IAAI,MAAM,QAAQ,SAAS,GAIzB,UAAU,KAHU,MAAM,QACvB,KAAK,SAAS,UAAU,MAAM,CAAC,CAC/B,KAAK,IACO;MAEf,UAAU,MAAM,QAAQ;CAI5B,IAAI,YAAY,GAAG,SAAS;CAC5B,aAAa,GAAG,MAAM,MAAM;CAC5B,aAAa,UAAU,YAAY,QAAQ,QAAQ;CAEnD,IAAI,MAAM,WAAW,KAAA,GACnB,aAAa,WAAW,MAAM,OAAO;CAGvC,IAAI,MAAM,MACR,aAAa,SAAS,WAAW,MAAM,IAAI,EAAE;CAG/C,IAAI,MAAM,WACR,aAAa,eAAe,MAAM,UAAU;CAG9C,IAAI,MAAM,SACR,aAAa,aAAa,MAAM,QAAQ;CAG1C,IAAI,MAAM,YAAY;EACpB,aAAa;EACb,aAAa,kBA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,"file":"rfcErrors-DdxFC4Hg.js","names":[],"sources":["../src/rfcErrors/serializeRFCErrorData.ts","../src/rfcErrors/RFCErrorToastTemplate.vue","../src/rfcErrors/RFCErrorToastTemplate.vue","../src/rfcErrors/types.ts","../src/rfcErrors/index.ts"],"sourcesContent":["import type { RFCErrorData } from \"./types\";\n\nexport const serializeErrorForClipboard = (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n): string => {\n let details = \"\";\n if (error.details?.length) {\n if (error.details.length > 1) {\n const detailLines = error.details\n .map((item) => `\\u2022 ${item}`)\n .join(\"\\n\");\n details = `\\n${detailLines}`;\n } else {\n details = error.details[0];\n }\n }\n\n let errorText = `${headline}\\n\\n`;\n errorText += `${error.title}\\n\\n`;\n errorText += details ? `Details: ${details}\\n\\n` : \"\";\n\n if (error.status !== undefined) {\n errorText += `Status: ${error.status}\\n`;\n }\n\n if (error.date) {\n errorText += `Date: ${formatDate(error.date)}\\n`;\n }\n\n if (error.requestId) {\n errorText += `Request Id: ${error.requestId}\\n`;\n }\n\n if (error.errorId) {\n errorText += `Error Id: ${error.errorId}\\n`;\n }\n\n if (error.stacktrace) {\n errorText += \"------\\n\"; // separator\n errorText += `Stacktrace:\\n\\n${error.stacktrace}\\n`;\n }\n\n return errorText;\n};\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { useClipboard } from \"@vueuse/core\";\n\nimport { KdsButton } from \"@knime/kds-components\";\nimport { formatDateTimeString } from \"@knime/utils\";\n\nimport { serializeErrorForClipboard as defaultSerializeRFCErrorData } from \"./serializeRFCErrorData\";\nimport type { RFCErrorData } from \"./types\";\n\ntype Props = {\n /**\n * Toast headline shown in the toast title bar. Not rendered inside this\n * template, but included when serializing the error to the clipboard.\n */\n headline: string;\n /** Whether to show the \"Copy error to clipboard\" button. */\n canCopyToClipboard?: boolean;\n /**\n * Custom serializer for the clipboard payload. Defaults to\n * `serializeRFCErrorData` which formats the full error as text.\n */\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n} & RFCErrorData;\n\nconst {\n headline,\n canCopyToClipboard = true,\n serializeErrorForClipboard = defaultSerializeRFCErrorData,\n ...rfcError\n} = defineProps<Props>();\n\nconst emits = defineEmits([\"showMore\"]);\n\nconst { copy, copied } = useClipboard({\n copiedDuring: 3000,\n});\n\nconst hasDetails =\n rfcError.details?.length ||\n rfcError.status !== undefined ||\n rfcError.date !== undefined ||\n rfcError.requestId !== undefined ||\n rfcError.errorId !== undefined;\n// don't show 'Show details' button if there are no details to show\nconst showDetails = ref(!hasDetails);\n\nconst formatDate = (date: Date): string =>\n date ? formatDateTimeString(date.getTime()) : \"\";\n\nconst copyToClipboard = () => {\n if (copied.value) {\n return;\n }\n copy(serializeErrorForClipboard(rfcError, headline, formatDate)).catch(\n (error) => {\n consola.error(\"Failed to copy to clipboard\", { error });\n },\n );\n};\n\nconst onShowDetailsClicked = () => {\n showDetails.value = true;\n emits(\"showMore\");\n};\n</script>\n\n<template>\n <div class=\"wrapper\">\n <div class=\"title\">\n {{ title }}\n </div>\n <div v-if=\"showDetails\">\n <div v-if=\"details?.length\">\n <strong>Details: </strong>\n <template v-if=\"details.length === 1\">\n {{ details[0] }}\n </template>\n <template v-else>\n <ul class=\"details-list\">\n <li v-for=\"(item, index) in details\" :key=\"index\">{{ item }}</li>\n </ul>\n </template>\n </div>\n\n <div v-if=\"status !== undefined\">\n <strong>Status: </strong>{{ status }}\n </div>\n <div v-if=\"date\"><strong>Date: </strong>{{ formatDate(date) }}</div>\n <div v-if=\"requestId\"><strong>Request id: </strong>{{ requestId }}</div>\n <div v-if=\"errorId\"><strong>Error id: </strong>{{ errorId }}</div>\n <div v-if=\"stacktrace && canCopyToClipboard\">\n <strong>Stacktrace: </strong>Part of clipboard text\n </div>\n </div>\n <div class=\"actions-wrapper\">\n <KdsButton\n v-if=\"!showDetails\"\n data-testid=\"show-details\"\n variant=\"transparent\"\n label=\"Show details\"\n size=\"xsmall\"\n @click=\"onShowDetailsClicked\"\n />\n <KdsButton\n v-if=\"canCopyToClipboard\"\n data-testid=\"copy-to-clipboard\"\n :label=\"copied ? 'Error was copied' : 'Copy error to clipboard'\"\n :leading-icon=\"copied ? 'checkmark' : 'copy'\"\n variant=\"transparent\"\n size=\"xsmall\"\n @click=\"copyToClipboard\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-25x);\n font: var(--kds-font-base-body-small);\n color: var(--kds-color-text-and-icon-neutral);\n}\n\n.details-list {\n padding-left: var(--kds-spacing-container-1-5x);\n margin-top: var(--kds-spacing-container-0-37x);\n margin-bottom: var(--kds-spacing-container-0-37x);\n}\n\n.actions-wrapper {\n display: flex;\n gap: var(--kds-spacing-container-0-5x);\n align-items: center;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { useClipboard } from \"@vueuse/core\";\n\nimport { KdsButton } from \"@knime/kds-components\";\nimport { formatDateTimeString } from \"@knime/utils\";\n\nimport { serializeErrorForClipboard as defaultSerializeRFCErrorData } from \"./serializeRFCErrorData\";\nimport type { RFCErrorData } from \"./types\";\n\ntype Props = {\n /**\n * Toast headline shown in the toast title bar. Not rendered inside this\n * template, but included when serializing the error to the clipboard.\n */\n headline: string;\n /** Whether to show the \"Copy error to clipboard\" button. */\n canCopyToClipboard?: boolean;\n /**\n * Custom serializer for the clipboard payload. Defaults to\n * `serializeRFCErrorData` which formats the full error as text.\n */\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n} & RFCErrorData;\n\nconst {\n headline,\n canCopyToClipboard = true,\n serializeErrorForClipboard = defaultSerializeRFCErrorData,\n ...rfcError\n} = defineProps<Props>();\n\nconst emits = defineEmits([\"showMore\"]);\n\nconst { copy, copied } = useClipboard({\n copiedDuring: 3000,\n});\n\nconst hasDetails =\n rfcError.details?.length ||\n rfcError.status !== undefined ||\n rfcError.date !== undefined ||\n rfcError.requestId !== undefined ||\n rfcError.errorId !== undefined;\n// don't show 'Show details' button if there are no details to show\nconst showDetails = ref(!hasDetails);\n\nconst formatDate = (date: Date): string =>\n date ? formatDateTimeString(date.getTime()) : \"\";\n\nconst copyToClipboard = () => {\n if (copied.value) {\n return;\n }\n copy(serializeErrorForClipboard(rfcError, headline, formatDate)).catch(\n (error) => {\n consola.error(\"Failed to copy to clipboard\", { error });\n },\n );\n};\n\nconst onShowDetailsClicked = () => {\n showDetails.value = true;\n emits(\"showMore\");\n};\n</script>\n\n<template>\n <div class=\"wrapper\">\n <div class=\"title\">\n {{ title }}\n </div>\n <div v-if=\"showDetails\">\n <div v-if=\"details?.length\">\n <strong>Details: </strong>\n <template v-if=\"details.length === 1\">\n {{ details[0] }}\n </template>\n <template v-else>\n <ul class=\"details-list\">\n <li v-for=\"(item, index) in details\" :key=\"index\">{{ item }}</li>\n </ul>\n </template>\n </div>\n\n <div v-if=\"status !== undefined\">\n <strong>Status: </strong>{{ status }}\n </div>\n <div v-if=\"date\"><strong>Date: </strong>{{ formatDate(date) }}</div>\n <div v-if=\"requestId\"><strong>Request id: </strong>{{ requestId }}</div>\n <div v-if=\"errorId\"><strong>Error id: </strong>{{ errorId }}</div>\n <div v-if=\"stacktrace && canCopyToClipboard\">\n <strong>Stacktrace: </strong>Part of clipboard text\n </div>\n </div>\n <div class=\"actions-wrapper\">\n <KdsButton\n v-if=\"!showDetails\"\n data-testid=\"show-details\"\n variant=\"transparent\"\n label=\"Show details\"\n size=\"xsmall\"\n @click=\"onShowDetailsClicked\"\n />\n <KdsButton\n v-if=\"canCopyToClipboard\"\n data-testid=\"copy-to-clipboard\"\n :label=\"copied ? 'Error was copied' : 'Copy error to clipboard'\"\n :leading-icon=\"copied ? 'checkmark' : 'copy'\"\n variant=\"transparent\"\n size=\"xsmall\"\n @click=\"copyToClipboard\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-25x);\n font: var(--kds-font-base-body-small);\n color: var(--kds-color-text-and-icon-neutral);\n}\n\n.details-list {\n padding-left: var(--kds-spacing-container-1-5x);\n margin-top: var(--kds-spacing-container-0-37x);\n margin-bottom: var(--kds-spacing-container-0-37x);\n}\n\n.actions-wrapper {\n display: flex;\n gap: var(--kds-spacing-container-0-5x);\n align-items: center;\n}\n</style>\n","/**\n * Type based on an RFC-9457 error standard (https://www.rfc-editor.org/rfc/rfc9457)\n * Also see:\n * https://knime-com.atlassian.net/wiki/spaces/SPECS/pages/4126769212/API+Errors+Problem+Details\n */\nexport type RFCErrorData = {\n /** Short human-readable summary of the error. */\n title: string;\n /** HTTP status code associated with the error. */\n status?: number;\n /** Date/time when the error occurred. */\n date?: Date;\n /** Additional human-readable detail messages. */\n details?: string[];\n /** Correlation id for the request that triggered the error. */\n requestId?: string;\n /**\n * Id used to find an error in the Hub logs. Specially relevant\n * when details of the error are not wanted to be exposed to the user.\n */\n errorId?: string;\n /**\n * Relevant only for the Analytics Platform, since the Hub does not expose\n * stack traces.\n */\n stacktrace?: string;\n};\n\nexport class RFCError extends Error {\n data: RFCErrorData;\n\n constructor(data: RFCErrorData) {\n super(data.title);\n this.data = data;\n }\n}\n\nexport type FetchError = {\n response: {\n headers: Headers;\n };\n statusCode: number;\n data: {\n title: string;\n details: string[];\n };\n};\n","import { h } from \"vue\";\n\nimport type { Toast } from \"../toasts\";\n\nimport RFCErrorToastTemplate from \"./RFCErrorToastTemplate.vue\";\nimport { type FetchError, RFCError, type RFCErrorData } from \"./types\";\n\n/**\n * Key in `Toast.meta` under which `toToast` keeps the error data, so the toast\n * can be rebuilt where its component cannot be rendered.\n */\nexport const RFC_ERROR_TOAST_META_KEY = \"rfcError\";\n\nexport type RFCErrorToastMeta = {\n data: RFCErrorData;\n canCopyToClipboard?: boolean;\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n};\n\n/**\n * Map to a toast template component compatible with an RFCError format\n */\nconst toToast = ({\n headline,\n rfcError,\n canCopyToClipboard = true,\n serializeErrorForClipboard = undefined,\n}: {\n headline: string;\n rfcError: RFCError;\n canCopyToClipboard?: boolean;\n serializeErrorForClipboard?: (\n error: RFCErrorData,\n headline: string,\n formatDate: (date: Date) => string,\n ) => string;\n}): Toast => {\n const { data } = rfcError;\n\n const rfcErrorToastContent = h(RFCErrorToastTemplate, {\n headline,\n ...data,\n canCopyToClipboard,\n serializeErrorForClipboard,\n });\n\n return {\n type: \"error\",\n headline,\n component: rfcErrorToastContent,\n autoRemove: false,\n meta: {\n [RFC_ERROR_TOAST_META_KEY]: {\n data,\n canCopyToClipboard,\n serializeErrorForClipboard,\n } satisfies RFCErrorToastMeta,\n },\n };\n};\n\nconst isFetchError = (error: unknown): error is FetchError => {\n return (\n error !== null &&\n typeof error === \"object\" &&\n \"response\" in error &&\n \"statusCode\" in error &&\n \"data\" in error\n );\n};\n\n/**\n * Parse a generic request error to an `RFCError`.\n * When parsing is not possible it returns undefined.\n */\nconst tryParse = (error: unknown): RFCError | undefined => {\n if (!isFetchError(error)) {\n return undefined;\n }\n\n if (!error.response) {\n return undefined;\n }\n\n const responseDate = error.response.headers.get(\"date\")\n ? new Date(error.response.headers.get(\"date\")!)\n : undefined;\n\n const title =\n typeof error.data === \"string\" ? error.data : (error.data?.title ?? \"\");\n\n const rfcErrorData: RFCErrorData = {\n title: title as string,\n details: error.data?.details as string[] | undefined,\n status: error.statusCode as number,\n date: responseDate,\n requestId: error.response.headers.get(\"x-request-id\") ?? undefined,\n errorId: error.response.headers.get(\"x-error-id\") ?? undefined,\n };\n\n return new RFCError(rfcErrorData);\n};\n\nexport const rfcErrors = {\n toToast,\n tryParse,\n RFCError,\n};\n"],"mappings":";;;;;;AAEA,IAAa,8BACX,OACA,UACA,eACW;CACX,IAAI,UAAU;CACd,IAAI,MAAM,SAAS,QACjB,IAAI,MAAM,QAAQ,SAAS,GAIzB,UAA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AC,MAAM,UACT;CAGF,MAAM,eAAe,MAAM,SAAS,QAAQ,IAAI,MAAM,IAClD,IAAI,KAAK,MAAM,SAAS,QAAQ,IAAI,MAAM,CAAE,IAC5C,KAAA;CAcJ,OAAO,IAAI,SAAS;EARX,OAHP,OAAO,MAAM,SAAS,WAAW,MAAM,OAAQ,MAAM,MAAM,SAAS;EAIpE,SAAS,MAAM,MAAM;EACrB,QAAQ,MAAM;EACd,MAAM;EACN,WAAW,MAAM,SAAS,QAAQ,IAAI,cAAc,KAAK,KAAA;EACzD,SAAS,MAAM,SAAS,QAAQ,IAAI,YAAY,KAAK,KAAA;CAGnC,CAAY;AAClC;AAEA,IAAa,YAAY;CACvB;CACA;CACA;AACF"}
|
package/dist/rfcErrors.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as rfcErrors, t as RFC_ERROR_TOAST_META_KEY } from "./rfcErrors-
|
|
1
|
+
import { n as rfcErrors, t as RFC_ERROR_TOAST_META_KEY } from "./rfcErrors-DdxFC4Hg.js";
|
|
2
2
|
export { RFC_ERROR_TOAST_META_KEY, rfcErrors };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../../src/dataTransfer/upload/useFileUpload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,QAAQ,CAAC;AAYvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../../src/dataTransfer/upload/useFileUpload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,QAAQ,CAAC;AAYvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAc1C,KAAK,oBAAoB,GAAG;IAC1B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,IAAI,CAAC;IACX;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC7B,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,KAAK,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,CAAC;IACX;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D;;;OAGG;IACH,wBAAwB,CAAC,EAAE,YAAY,CAAC;IAExC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACtD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,aAAa,GAAI,UAAS,oBAAyB;;iCAQ1B,MAAM;kCAaL,MAAM,QAAQ,OAAO,CAAC,UAAU,CAAC;;;sBAmG5C,MAAM,SAAS,IAAI,EAAE,KAAG,OAAO,CAAC,MAAM,EAAE,CAAC;uBA8D9C,MAAM;;;;;;;CAO5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { contractVersion, resolveOutlets } from './capabilities';
|
|
2
2
|
export type { GuestCapabilities, HostCapabilities, ResolvedOutlets, } from './capabilities';
|
|
3
|
-
export type { HostCapabilitiesForOutlet, OutletHandle, OutletName, OutletRegistry, SpaceExplorerDragItem, SpaceExplorerFeatureAPI, SpaceExplorerItemDrop, SpaceExplorerOutletHandle, } from './outlets';
|
|
3
|
+
export type { HostCapabilitiesForOutlet, OutletHandle, OutletName, OutletRegistry, SpaceExplorerDragItem, SpaceExplorerFeatureAPI, SpaceExplorerItemDrop, SpaceExplorerOutletHandle, VersionsFeatureAPI, VersionsOutletHandle, } from './outlets';
|
|
4
4
|
export { fromHostToast, toHostToast } from './toasts';
|
|
5
5
|
export type { EmbeddedGuestAPI, EmbeddingContext, EmbeddingHostAPI, GuestEmbedModuleBootstrap, NavigationIntent, UserActivity, } from './types';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/embedding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,yBAAyB,EACzB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/embedding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,yBAAyB,EACzB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { SpaceExplorerFeatureAPI, SpaceExplorerGuestCapabilities, SpaceExplorerHostCapabilities, SpaceExplorerOutletHandle } from './spaceExplorer';
|
|
2
|
+
import { VersionsFeatureAPI, VersionsGuestCapabilities, VersionsHostCapabilities, VersionsOutletHandle } from './versions';
|
|
2
3
|
/**
|
|
3
4
|
* Outlets the guest can expose (the editor in this case). Each outlet contains one feature of the host.
|
|
4
5
|
*/
|
|
5
|
-
export type OutletHandle = SpaceExplorerOutletHandle;
|
|
6
|
+
export type OutletHandle = SpaceExplorerOutletHandle | VersionsOutletHandle;
|
|
6
7
|
export type OutletName = OutletHandle["name"];
|
|
7
8
|
export type OutletRegistry = {
|
|
8
9
|
spaceExplorer: SpaceExplorerFeatureAPI;
|
|
10
|
+
versions: VersionsFeatureAPI;
|
|
9
11
|
};
|
|
10
12
|
export type GuestCapabilitiesForOutlet = {
|
|
11
13
|
spaceExplorer: SpaceExplorerGuestCapabilities;
|
|
14
|
+
versions: VersionsGuestCapabilities;
|
|
12
15
|
};
|
|
13
16
|
export type HostCapabilitiesForOutlet = {
|
|
14
17
|
spaceExplorer: SpaceExplorerHostCapabilities;
|
|
18
|
+
versions: VersionsHostCapabilities;
|
|
15
19
|
};
|
|
16
20
|
export declare const outletCapabilityResolvers: {
|
|
17
21
|
[N in OutletName]: {
|
|
@@ -20,4 +24,5 @@ export declare const outletCapabilityResolvers: {
|
|
|
20
24
|
};
|
|
21
25
|
};
|
|
22
26
|
export type { SpaceExplorerDragItem, SpaceExplorerFeatureAPI, SpaceExplorerItemDrop, SpaceExplorerOutletHandle, } from './spaceExplorer';
|
|
27
|
+
export type { VersionsFeatureAPI, VersionsOutletHandle } from './versions';
|
|
23
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/embedding/outlets/index.ts"],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,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Announced by the guest when the element the outlet will render to exists.
|
|
3
|
+
*/
|
|
4
|
+
export type VersionsOutletHandle = {
|
|
5
|
+
name: "versions";
|
|
6
|
+
/**
|
|
7
|
+
* A stable, empty element. Must not be patched/removed by the guest
|
|
8
|
+
*/
|
|
9
|
+
element: HTMLElement;
|
|
10
|
+
/**
|
|
11
|
+
* Called when the host's close button is clicked, so the guest can hide the
|
|
12
|
+
* outlet. Present when the guest declares `close`.
|
|
13
|
+
*/
|
|
14
|
+
close?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Switches which version of the workflow the live editor loads: a version
|
|
17
|
+
* number, or `"current-state"`/`"most-recent"`. Present when the guest
|
|
18
|
+
* declares `switchVersion`.
|
|
19
|
+
*/
|
|
20
|
+
switchVersion?: (version: number | "current-state" | "most-recent") => void;
|
|
21
|
+
/**
|
|
22
|
+
* Called when the host wants the guest to sync its own unsaved live edits
|
|
23
|
+
* before proceeding with an action. Present when the guest declares
|
|
24
|
+
* `syncUnsavedChanges`.
|
|
25
|
+
*/
|
|
26
|
+
syncUnsavedChanges?: () => Promise<{
|
|
27
|
+
didSync: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Called after the host restores a version, so the editor can reload the
|
|
31
|
+
* now-current state. Present when the guest declares `onVersionRestored`.
|
|
32
|
+
*/
|
|
33
|
+
onVersionRestored?: (version: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Called after the host discards the unversioned savepoint, so the editor
|
|
36
|
+
* can reload the current state. Present when the guest declares
|
|
37
|
+
* `onChangesDiscarded`.
|
|
38
|
+
*/
|
|
39
|
+
onChangesDiscarded?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Called after the host deletes a version, so the editor can drop any
|
|
42
|
+
* cached data for it. Present when the guest declares `onVersionDeleted`.
|
|
43
|
+
*/
|
|
44
|
+
onVersionDeleted?: (version: number) => void;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The version history's public api. Returned after `announce`ing the feature.
|
|
48
|
+
*/
|
|
49
|
+
export type VersionsFeatureAPI = {
|
|
50
|
+
/**
|
|
51
|
+
* Resolves the display title of a version, e.g. for the editor's own
|
|
52
|
+
* version-aware UI. Present when the host declares `getVersionTitle`.
|
|
53
|
+
*/
|
|
54
|
+
getVersionTitle?: (version: number) => Promise<string | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* Called by the guest after it restores a version through its own UI
|
|
57
|
+
* (outside the host's panel), so the host can refresh its panel. Present
|
|
58
|
+
* when the host declares `reportVersionRestored`.
|
|
59
|
+
*/
|
|
60
|
+
reportVersionRestored?: (version: number) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Called by the guest after its content was saved, so the host can refresh
|
|
63
|
+
* its panel's data if needed (e.g. a draft that didn't exist before).
|
|
64
|
+
* Present when the host declares `refreshVersions`.
|
|
65
|
+
*/
|
|
66
|
+
refreshVersions?: () => void;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Capabilities the version history expects the guest to implement
|
|
70
|
+
*/
|
|
71
|
+
export type VersionsGuestCapabilities = {
|
|
72
|
+
close?: true;
|
|
73
|
+
switchVersion?: true;
|
|
74
|
+
syncUnsavedChanges?: true;
|
|
75
|
+
onVersionRestored?: true;
|
|
76
|
+
onChangesDiscarded?: true;
|
|
77
|
+
onVersionDeleted?: true;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Capabilities the version history of the host offers to the guest for public/direct usage
|
|
81
|
+
* (all behavior is normally self-contained).
|
|
82
|
+
*/
|
|
83
|
+
export type VersionsHostCapabilities = {
|
|
84
|
+
getVersionTitle?: true;
|
|
85
|
+
reportVersionRestored?: true;
|
|
86
|
+
refreshVersions?: true;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Keep only the capabilities that this contract version knows.
|
|
90
|
+
*/
|
|
91
|
+
export declare const resolveVersionsGuestCapabilities: (declared: VersionsGuestCapabilities) => VersionsGuestCapabilities;
|
|
92
|
+
export declare const resolveVersionsHostCapabilities: (declared: VersionsHostCapabilities) => VersionsHostCapabilities;
|
|
93
|
+
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../src/embedding/outlets/versions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,aAAa,KAAK,IAAI,CAAC;IAC5E;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACnE;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,IAAI,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,qBAAqB,CAAC,EAAE,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,UAAU,yBAAyB,KAClC,yBAOD,CAAC;AAEH,eAAO,MAAM,+BAA+B,GAC1C,UAAU,wBAAwB,KACjC,wBAID,CAAC"}
|
package/dist/toasts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
|
|
2
|
-
import { t as capitalize, u as truncateString_default } from "./dist-
|
|
2
|
+
import { t as capitalize, u as truncateString_default } from "./dist-D193M-Gt.js";
|
|
3
3
|
import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeProps, normalizeClass, onMounted, openBlock, provide, ref, renderList, resolveDynamicComponent, toDisplayString, unref, useCssVars, vShow, watch, withCtx, withDirectives } from "vue";
|
|
4
4
|
import { KdsButton, KdsIcon, KdsLinkButton, KdsProgressBar } from "@knime/kds-components";
|
|
5
5
|
import { cloneDeep } from "es-toolkit";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/product-features",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Package containing composition patterns of KDS Components and KNIME business logic",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,10 +56,6 @@
|
|
|
56
56
|
"./toasts": {
|
|
57
57
|
"types": "./dist/src/toasts/index.d.ts",
|
|
58
58
|
"import": "./dist/toasts.js"
|
|
59
|
-
},
|
|
60
|
-
"./versions": {
|
|
61
|
-
"types": "./dist/src/versions/index.d.ts",
|
|
62
|
-
"import": "./dist/versions.js"
|
|
63
59
|
}
|
|
64
60
|
},
|
|
65
61
|
"files": [
|
|
@@ -67,20 +63,20 @@
|
|
|
67
63
|
"CHANGELOG.md"
|
|
68
64
|
],
|
|
69
65
|
"peerDependencies": {
|
|
70
|
-
"@knime/kds-components": "^
|
|
71
|
-
"@knime/kds-styles": "^
|
|
66
|
+
"@knime/kds-components": "^14.0.0",
|
|
67
|
+
"@knime/kds-styles": "^14.0.0",
|
|
72
68
|
"@vueuse/core": "^14.0.0",
|
|
73
69
|
"es-toolkit": "^1.49.0",
|
|
74
70
|
"ofetch": "^1.5.1",
|
|
75
71
|
"vue": "~3.5.0"
|
|
76
72
|
},
|
|
77
73
|
"dependencies": {
|
|
78
|
-
"@knime/utils": "^
|
|
74
|
+
"@knime/utils": "^3.0.0",
|
|
79
75
|
"consola": "^3.4.2"
|
|
80
76
|
},
|
|
81
77
|
"devDependencies": {
|
|
82
|
-
"@knime/kds-components": "^
|
|
83
|
-
"@knime/kds-styles": "^
|
|
78
|
+
"@knime/kds-components": "^14.0.0",
|
|
79
|
+
"@knime/kds-styles": "^14.0.0",
|
|
84
80
|
"@storybook/addon-docs": "^10.6.2",
|
|
85
81
|
"@storybook/vue3-vite": "^10.6.2",
|
|
86
82
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
@@ -104,7 +100,7 @@
|
|
|
104
100
|
"vue-tsc": "^3.3.8"
|
|
105
101
|
},
|
|
106
102
|
"engines": {
|
|
107
|
-
"node": ">=
|
|
103
|
+
"node": ">=26"
|
|
108
104
|
},
|
|
109
105
|
"sideEffects": [
|
|
110
106
|
"dist/*.css"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CreateVersionFormProps } from './types';
|
|
2
|
-
declare const __VLS_export: import('vue').DefineComponent<CreateVersionFormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
-
cancel: (hasUnsavedChanges: boolean) => any;
|
|
4
|
-
create: (args_0: {
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
}) => any;
|
|
8
|
-
}, string, import('vue').PublicProps, Readonly<CreateVersionFormProps> & Readonly<{
|
|
9
|
-
onCancel?: ((hasUnsavedChanges: boolean) => any) | undefined;
|
|
10
|
-
onCreate?: ((args_0: {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
}) => any) | undefined;
|
|
14
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
declare const _default: typeof __VLS_export;
|
|
16
|
-
export default _default;
|
|
17
|
-
//# sourceMappingURL=CreateVersionForm.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateVersionForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/versions/CreateVersionForm/CreateVersionForm.vue"],"names":[],"mappings":"AA2IA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AA2LtD,QAAA,MAAM,YAAY;;;cApLC,MAAM;qBAAe,MAAM;;;;;cAA3B,MAAM;qBAAe,MAAM;;kFAuL5C,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/versions/CreateVersionForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,mBAAmB,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/versions/CreateVersionForm/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,uFAAuF;IACvF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ItemSavepoint, WithAvatar, WithLabels } from './types';
|
|
2
|
-
type Props = {
|
|
3
|
-
currentSavepoint: ItemSavepoint & WithAvatar & WithLabels;
|
|
4
|
-
isSelected: boolean;
|
|
5
|
-
hasEditCapability: boolean;
|
|
6
|
-
hasPreviousVersion: boolean;
|
|
7
|
-
hasVersionLimit: boolean;
|
|
8
|
-
isVersionLimitExceeded?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
-
select: () => any;
|
|
12
|
-
createVersion: () => any;
|
|
13
|
-
discard: () => any;
|
|
14
|
-
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
15
|
-
onSelect?: (() => any) | undefined;
|
|
16
|
-
onCreateVersion?: (() => any) | undefined;
|
|
17
|
-
onDiscard?: (() => any) | undefined;
|
|
18
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
declare const _default: typeof __VLS_export;
|
|
20
|
-
export default _default;
|
|
21
|
-
//# sourceMappingURL=CurrentState.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentState.vue.d.ts","sourceRoot":"","sources":["../../../../src/versions/VersionHistory/CurrentState.vue"],"names":[],"mappings":"AA0GA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErE,KAAK,KAAK,GAAG;IACX,gBAAgB,EAAE,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1D,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AA0KF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
isSelected: boolean;
|
|
3
|
-
isFirstItem: boolean;
|
|
4
|
-
isLastItem: boolean;
|
|
5
|
-
};
|
|
6
|
-
declare var __VLS_6: {};
|
|
7
|
-
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof __VLS_6) => any;
|
|
9
|
-
};
|
|
10
|
-
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
-
declare const _default: typeof __VLS_export;
|
|
13
|
-
export default _default;
|
|
14
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
-
new (): {
|
|
16
|
-
$slots: S;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=HistoryEvent.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryEvent.vue.d.ts","sourceRoot":"","sources":["../../../../src/versions/VersionHistory/HistoryEvent.vue"],"names":[],"mappings":"AAiFA,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAuEF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU,sRAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { WithAvatar } from './types';
|
|
2
|
-
type Props = WithAvatar & {
|
|
3
|
-
author: string;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=HistoryEventAuthor.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryEventAuthor.vue.d.ts","sourceRoot":"","sources":["../../../../src/versions/VersionHistory/HistoryEventAuthor.vue"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,KAAK,GAAG,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgDF,QAAA,MAAM,YAAY,sRAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NamedItemVersion } from './types';
|
|
2
|
-
type Props = {
|
|
3
|
-
date: string;
|
|
4
|
-
version?: NamedItemVersion["version"];
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
9
|
-
//# sourceMappingURL=HistoryEventFooter.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryEventFooter.vue.d.ts","sourceRoot":"","sources":["../../../../src/versions/VersionHistory/HistoryEventFooter.vue"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;CACvC,CAAC;AA2DF,QAAA,MAAM,YAAY,sRAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { VersionHistoryProps } from './types';
|
|
2
|
-
declare const __VLS_export: import('vue').DefineComponent<VersionHistoryProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
-
select: (version: number | "current-state" | "most-recent") => any;
|
|
4
|
-
delete: (version: number | "current-state" | "most-recent") => any;
|
|
5
|
-
close: () => any;
|
|
6
|
-
restore: (version: number | "current-state" | "most-recent") => any;
|
|
7
|
-
loadAll: () => any;
|
|
8
|
-
create: () => any;
|
|
9
|
-
discardCurrentState: () => any;
|
|
10
|
-
}, string, import('vue').PublicProps, Readonly<VersionHistoryProps> & Readonly<{
|
|
11
|
-
onSelect?: ((version: number | "current-state" | "most-recent") => any) | undefined;
|
|
12
|
-
onDelete?: ((version: number | "current-state" | "most-recent") => any) | undefined;
|
|
13
|
-
onClose?: (() => any) | undefined;
|
|
14
|
-
onRestore?: ((version: number | "current-state" | "most-recent") => any) | undefined;
|
|
15
|
-
onLoadAll?: (() => any) | undefined;
|
|
16
|
-
onCreate?: (() => any) | undefined;
|
|
17
|
-
onDiscardCurrentState?: (() => any) | undefined;
|
|
18
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
declare const _default: typeof __VLS_export;
|
|
20
|
-
export default _default;
|
|
21
|
-
//# sourceMappingURL=VersionHistory.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VersionHistory.vue.d.ts","sourceRoot":"","sources":["../../../../src/versions/VersionHistory/VersionHistory.vue"],"names":[],"mappings":"AAyIA,OAAO,KAAK,EAAoB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA2QrE,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|