@n8n/composables 1.21.0 → 1.23.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/injectionKeys.cjs +3 -0
- package/dist/injectionKeys.d.cts +7 -0
- package/dist/injectionKeys.d.mts +7 -0
- package/dist/injectionKeys.mjs +3 -0
- package/dist/injectionKeys2.cjs +17 -0
- package/dist/injectionKeys2.cjs.map +1 -0
- package/dist/injectionKeys2.mjs +11 -0
- package/dist/injectionKeys2.mjs.map +1 -0
- package/dist/structuralComputed.cjs +1 -0
- package/dist/structuralComputed.cjs.map +1 -1
- package/dist/useClipboard.cjs +62 -0
- package/dist/useClipboard.cjs.map +1 -0
- package/dist/useClipboard.d.cts +18 -0
- package/dist/useClipboard.d.mts +18 -0
- package/dist/useClipboard.mjs +61 -0
- package/dist/useClipboard.mjs.map +1 -0
- package/dist/useDebounce.cjs +65 -0
- package/dist/useDebounce.cjs.map +1 -0
- package/dist/useDebounce.d.cts +17 -0
- package/dist/useDebounce.d.mts +17 -0
- package/dist/useDebounce.mjs +39 -0
- package/dist/useDebounce.mjs.map +1 -0
- package/dist/useDeviceSupport.cjs +1 -0
- package/dist/useDeviceSupport.cjs.map +1 -1
- package/dist/useDeviceSupport.d.cts +2 -2
- package/dist/useDocumentTitle.cjs +1 -0
- package/dist/useDocumentTitle.cjs.map +1 -1
- package/dist/useExternalHooks.cjs +5 -0
- package/dist/useExternalHooks.d.cts +12 -0
- package/dist/useExternalHooks.d.mts +12 -0
- package/dist/useExternalHooks.mjs +3 -0
- package/dist/useExternalHooks2.cjs +56 -0
- package/dist/useExternalHooks2.cjs.map +1 -0
- package/dist/useExternalHooks2.mjs +38 -0
- package/dist/useExternalHooks2.mjs.map +1 -0
- package/dist/useShortKeyPress.cjs +1 -0
- package/dist/useShortKeyPress.cjs.map +1 -1
- package/dist/useStyles.cjs +19 -0
- package/dist/useStyles.cjs.map +1 -0
- package/dist/useStyles.d.cts +31 -0
- package/dist/useStyles.d.mts +31 -0
- package/dist/useStyles.mjs +18 -0
- package/dist/useStyles.mjs.map +1 -0
- package/dist/useTelemetry.cjs +5 -0
- package/dist/useTelemetry.d.cts +42 -0
- package/dist/useTelemetry.d.mts +42 -0
- package/dist/useTelemetry.mjs +3 -0
- package/dist/useTelemetry2.cjs +76 -0
- package/dist/useTelemetry2.cjs.map +1 -0
- package/dist/useTelemetry2.mjs +58 -0
- package/dist/useTelemetry2.mjs.map +1 -0
- package/dist/useThrottleWithReactiveDelay.cjs +1 -0
- package/dist/useThrottleWithReactiveDelay.cjs.map +1 -1
- package/dist/useToast.cjs +175 -0
- package/dist/useToast.cjs.map +1 -0
- package/dist/useToast.d.cts +32 -0
- package/dist/useToast.d.mts +32 -0
- package/dist/useToast.mjs +173 -0
- package/dist/useToast.mjs.map +1 -0
- package/package.json +20 -7
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VIEWS } from "@n8n/frontend-constants/views";
|
|
2
|
+
import { NotificationOptions } from "@n8n/stores/notifications.store";
|
|
3
|
+
|
|
4
|
+
//#region src/useToast.d.ts
|
|
5
|
+
interface NotificationHandle {
|
|
6
|
+
close: () => void;
|
|
7
|
+
}
|
|
8
|
+
type NotificationType = '' | 'success' | 'warning' | 'info' | 'error';
|
|
9
|
+
type NotifyFn = (options: Record<string, unknown>) => NotificationHandle;
|
|
10
|
+
declare function setNotify(fn: NotifyFn): void;
|
|
11
|
+
declare function useToast(): {
|
|
12
|
+
showMessage: (messageData: Partial<NotificationOptions>, track?: boolean) => NotificationHandle;
|
|
13
|
+
showToast: (config: {
|
|
14
|
+
title: string;
|
|
15
|
+
message: NotificationOptions["message"];
|
|
16
|
+
onClick?: (event?: MouseEvent) => void;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
duration?: number;
|
|
19
|
+
customClass?: string;
|
|
20
|
+
closeOnClick?: boolean;
|
|
21
|
+
type?: NotificationType;
|
|
22
|
+
}) => NotificationHandle;
|
|
23
|
+
showError: (e: unknown, title: string, options?: {
|
|
24
|
+
message?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
clearAllStickyNotifications: () => void;
|
|
28
|
+
showNotificationForViews: (views: VIEWS[]) => void;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { NotificationHandle, NotificationType, setNotify, useToast };
|
|
32
|
+
//# sourceMappingURL=useToast.d.mts.map
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { r as useExternalHooks } from "./useExternalHooks2.mjs";
|
|
2
|
+
import { r as useTelemetry } from "./useTelemetry2.mjs";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { APP_Z_INDEXES } from "@n8n/frontend-constants/z-indexes";
|
|
5
|
+
import { VIEWS } from "@n8n/frontend-constants/views";
|
|
6
|
+
import { sanitizeHtml } from "@n8n/frontend-utils/htmlUtils";
|
|
7
|
+
import { useI18n } from "@n8n/i18n";
|
|
8
|
+
import { useNotificationsStore } from "@n8n/stores/notifications.store";
|
|
9
|
+
import { useRoute } from "vue-router";
|
|
10
|
+
|
|
11
|
+
//#region src/useToast.ts
|
|
12
|
+
let registeredNotify;
|
|
13
|
+
/**
|
|
14
|
+
* Register the notification function. Called once at bootstrap by
|
|
15
|
+
* `editor-ui` (passing `ElNotification` from element-plus) so `useToast`
|
|
16
|
+
* can issue notifications without importing element-plus directly — keeping
|
|
17
|
+
* the DTS build lightweight.
|
|
18
|
+
*/
|
|
19
|
+
function setNotify(fn) {
|
|
20
|
+
registeredNotify = fn;
|
|
21
|
+
}
|
|
22
|
+
const noopHandle = { close() {} };
|
|
23
|
+
const noopNotify = () => noopHandle;
|
|
24
|
+
const stickyNotificationQueue = [];
|
|
25
|
+
function useToast() {
|
|
26
|
+
const notify = registeredNotify ?? noopNotify;
|
|
27
|
+
const telemetry = useTelemetry();
|
|
28
|
+
const route = useRoute();
|
|
29
|
+
const workflowId = computed(() => {
|
|
30
|
+
if (route?.name === VIEWS.DEMO || route?.name === VIEWS.DEMO_DIFF) return "demo";
|
|
31
|
+
const id = route?.params?.workflowId;
|
|
32
|
+
return (Array.isArray(id) ? id[0] : id) ?? "";
|
|
33
|
+
});
|
|
34
|
+
const notificationsStore = useNotificationsStore();
|
|
35
|
+
const externalHooks = useExternalHooks();
|
|
36
|
+
const i18n = useI18n();
|
|
37
|
+
function causedByCredential(message) {
|
|
38
|
+
if (!message || typeof message !== "string") return false;
|
|
39
|
+
return message.includes("Credentials for") && message.includes("are not set");
|
|
40
|
+
}
|
|
41
|
+
function showMessage(messageData, track = true) {
|
|
42
|
+
const suppressed = notificationsStore.areNotificationsSuppressed;
|
|
43
|
+
const allowErrors = notificationsStore.allowErrorNotificationsWhenSuppressed;
|
|
44
|
+
if (suppressed && !(allowErrors && messageData.type === "error")) return { close: () => {} };
|
|
45
|
+
const messageDefaults = {
|
|
46
|
+
dangerouslyUseHTMLString: true,
|
|
47
|
+
position: "bottom-right",
|
|
48
|
+
zIndex: APP_Z_INDEXES.TOASTS,
|
|
49
|
+
appendTo: "#n8n-app",
|
|
50
|
+
customClass: "content-toast"
|
|
51
|
+
};
|
|
52
|
+
const { message, title } = messageData;
|
|
53
|
+
const params = {
|
|
54
|
+
...messageDefaults,
|
|
55
|
+
...messageData
|
|
56
|
+
};
|
|
57
|
+
if (typeof message === "string") params.message = sanitizeHtml(message);
|
|
58
|
+
if (typeof title === "string") params.title = sanitizeHtml(title);
|
|
59
|
+
const notification = notify(params);
|
|
60
|
+
if (params.duration === 0) stickyNotificationQueue.push(notification);
|
|
61
|
+
if (params.type === "error" && track) {
|
|
62
|
+
let messageForTelemetry;
|
|
63
|
+
if (typeof params.message === "string") messageForTelemetry = params.message;
|
|
64
|
+
else if (params.message && typeof params.message === "object" && "props" in params.message && params.message.props) {
|
|
65
|
+
const props = params.message.props;
|
|
66
|
+
const hasErrorMessage = typeof props === "object" && props !== null && "errorMessage" in props;
|
|
67
|
+
const hasMessage = typeof props === "object" && props !== null && "message" in props;
|
|
68
|
+
if (hasErrorMessage) messageForTelemetry = String(props.errorMessage);
|
|
69
|
+
else if (hasMessage) messageForTelemetry = String(props.message);
|
|
70
|
+
else messageForTelemetry = "Unknown error";
|
|
71
|
+
} else messageForTelemetry = "Unknown error";
|
|
72
|
+
telemetry.track("Instance FE emitted error", {
|
|
73
|
+
error_title: params.title,
|
|
74
|
+
error_message: messageForTelemetry,
|
|
75
|
+
caused_by_credential: causedByCredential(messageForTelemetry),
|
|
76
|
+
workflow_id: workflowId.value
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return notification;
|
|
80
|
+
}
|
|
81
|
+
function showToast(config) {
|
|
82
|
+
let notification;
|
|
83
|
+
if (config.closeOnClick) {
|
|
84
|
+
const originalOnClick = config.onClick;
|
|
85
|
+
config.onClick = () => {
|
|
86
|
+
if (notification) notification.close();
|
|
87
|
+
if (originalOnClick) originalOnClick();
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
notification = showMessage({
|
|
91
|
+
title: config.title,
|
|
92
|
+
message: config.message,
|
|
93
|
+
onClick: config.onClick,
|
|
94
|
+
onClose: config.onClose,
|
|
95
|
+
duration: config.duration,
|
|
96
|
+
customClass: config.customClass,
|
|
97
|
+
type: config.type
|
|
98
|
+
});
|
|
99
|
+
return notification;
|
|
100
|
+
}
|
|
101
|
+
function collapsableDetails(description) {
|
|
102
|
+
const errorDescription = description.length > 500 ? `${description.slice(0, 500)}...` : description;
|
|
103
|
+
return `
|
|
104
|
+
<br>
|
|
105
|
+
<br>
|
|
106
|
+
<details>
|
|
107
|
+
<summary
|
|
108
|
+
style="color: #ff6d5a; font-weight: bold; cursor: pointer;"
|
|
109
|
+
>
|
|
110
|
+
${i18n.baseText("showMessage.showDetails")}
|
|
111
|
+
</summary>
|
|
112
|
+
<p>${errorDescription}</p>
|
|
113
|
+
</details>
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
function showError(e, title, options) {
|
|
117
|
+
const error = e;
|
|
118
|
+
const message = options?.message;
|
|
119
|
+
const description = options?.description ?? error.description;
|
|
120
|
+
showMessage({
|
|
121
|
+
title,
|
|
122
|
+
message: `
|
|
123
|
+
${message ? `${message}<br/>` : ""}
|
|
124
|
+
<i>${error.message}</i>
|
|
125
|
+
${description ? collapsableDetails(description) : ""}`,
|
|
126
|
+
type: "error",
|
|
127
|
+
duration: 0
|
|
128
|
+
}, false);
|
|
129
|
+
externalHooks.run("showMessage.showError", {
|
|
130
|
+
title,
|
|
131
|
+
message,
|
|
132
|
+
errorMessage: error.message
|
|
133
|
+
});
|
|
134
|
+
telemetry.track("Instance FE emitted error", {
|
|
135
|
+
error_title: title,
|
|
136
|
+
error_description: message,
|
|
137
|
+
error_message: error.message,
|
|
138
|
+
caused_by_credential: causedByCredential(error.message),
|
|
139
|
+
workflow_id: workflowId.value
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function clearAllStickyNotifications() {
|
|
143
|
+
stickyNotificationQueue.forEach((notification) => {
|
|
144
|
+
if (notification) notification.close();
|
|
145
|
+
});
|
|
146
|
+
stickyNotificationQueue.length = 0;
|
|
147
|
+
}
|
|
148
|
+
function showNotificationForViews(views) {
|
|
149
|
+
const notifications = [];
|
|
150
|
+
views.forEach((view) => {
|
|
151
|
+
notifications.push(...notificationsStore.pendingNotificationsForViews[view] ?? []);
|
|
152
|
+
});
|
|
153
|
+
if (notifications.length) {
|
|
154
|
+
notifications.forEach((notification) => {
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
showMessage(notification);
|
|
157
|
+
}, 5);
|
|
158
|
+
});
|
|
159
|
+
notificationsStore.setNotificationsForView(VIEWS.WORKFLOW, []);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
showMessage,
|
|
164
|
+
showToast,
|
|
165
|
+
showError,
|
|
166
|
+
clearAllStickyNotifications,
|
|
167
|
+
showNotificationForViews
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
//#endregion
|
|
172
|
+
export { setNotify, useToast };
|
|
173
|
+
//# sourceMappingURL=useToast.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToast.mjs","names":["registeredNotify: NotifyFn | undefined","noopHandle: NotificationHandle","noopNotify: NotifyFn","stickyNotificationQueue: NotificationHandle[]","messageDefaults: Partial<Omit<NotificationOptions, 'message'>>","messageForTelemetry: string","notification: NotificationHandle","notifications: NotificationOptions[]"],"sources":["../src/useToast.ts"],"sourcesContent":["import { VIEWS } from '@n8n/frontend-constants/views';\nimport { APP_Z_INDEXES } from '@n8n/frontend-constants/z-indexes';\nimport { sanitizeHtml } from '@n8n/frontend-utils/htmlUtils';\nimport { useI18n } from '@n8n/i18n';\nimport type { NotificationOptions } from '@n8n/stores/notifications.store';\nimport { useNotificationsStore } from '@n8n/stores/notifications.store';\nimport { computed } from 'vue';\nimport { useRoute } from 'vue-router';\n\nimport { useExternalHooks } from './useExternalHooks';\nimport { useTelemetry } from './useTelemetry';\n\n/**\n * Handle returned by the notification function. Declared locally so the DTS\n * build stays free of the full element-plus type graph.\n */\nexport interface NotificationHandle {\n\tclose: () => void;\n}\n\n/** Notification severity — mirrors `MessageBoxState['type']` from element-plus. */\nexport type NotificationType = '' | 'success' | 'warning' | 'info' | 'error';\n\n/**\n * Notification function contract — matches `ElNotification` from element-plus.\n * The application registers the concrete implementation at bootstrap via\n * {@link setNotify}; this package owns only the contract.\n */\ntype NotifyFn = (options: Record<string, unknown>) => NotificationHandle;\n\nlet registeredNotify: NotifyFn | undefined;\n\n/**\n * Register the notification function. Called once at bootstrap by\n * `editor-ui` (passing `ElNotification` from element-plus) so `useToast`\n * can issue notifications without importing element-plus directly — keeping\n * the DTS build lightweight.\n */\nexport function setNotify(fn: NotifyFn): void {\n\tregisteredNotify = fn;\n}\n\nconst noopHandle: NotificationHandle = { close() {} };\nconst noopNotify: NotifyFn = () => noopHandle;\n\nconst stickyNotificationQueue: NotificationHandle[] = [];\n\nexport function useToast() {\n\tconst notify = registeredNotify ?? noopNotify;\n\tconst telemetry = useTelemetry();\n\tconst route = useRoute();\n\tconst workflowId = computed(() => {\n\t\tif (route?.name === VIEWS.DEMO || route?.name === VIEWS.DEMO_DIFF) return 'demo';\n\t\tconst id = route?.params?.workflowId;\n\t\treturn (Array.isArray(id) ? id[0] : id) ?? '';\n\t});\n\tconst notificationsStore = useNotificationsStore();\n\tconst externalHooks = useExternalHooks();\n\tconst i18n = useI18n();\n\n\tfunction causedByCredential(message: string | undefined) {\n\t\tif (!message || typeof message !== 'string') return false;\n\n\t\treturn message.includes('Credentials for') && message.includes('are not set');\n\t}\n\n\tfunction showMessage(messageData: Partial<NotificationOptions>, track = true) {\n\t\tconst suppressed = notificationsStore.areNotificationsSuppressed;\n\t\tconst allowErrors = notificationsStore.allowErrorNotificationsWhenSuppressed;\n\t\tif (suppressed && !(allowErrors && messageData.type === 'error')) {\n\t\t\treturn { close: () => {} } as NotificationHandle;\n\t\t}\n\n\t\tconst messageDefaults: Partial<Omit<NotificationOptions, 'message'>> = {\n\t\t\tdangerouslyUseHTMLString: true,\n\t\t\tposition: 'bottom-right',\n\t\t\t// Layer above NDV and modal overlays, sourced from the shared scale.\n\t\t\tzIndex: APP_Z_INDEXES.TOASTS,\n\t\t\tappendTo: '#n8n-app',\n\t\t\tcustomClass: 'content-toast',\n\t\t};\n\t\tconst { message, title } = messageData;\n\t\tconst params = { ...messageDefaults, ...messageData };\n\n\t\tif (typeof message === 'string') {\n\t\t\tparams.message = sanitizeHtml(message);\n\t\t}\n\n\t\tif (typeof title === 'string') {\n\t\t\tparams.title = sanitizeHtml(title);\n\t\t}\n\n\t\tconst notification = notify(params as unknown as Record<string, unknown>);\n\n\t\tif (params.duration === 0) {\n\t\t\tstickyNotificationQueue.push(notification);\n\t\t}\n\n\t\tif (params.type === 'error' && track) {\n\t\t\t// Extract string message for telemetry - don't send VNode objects as they have circular refs\n\t\t\tlet messageForTelemetry: string;\n\t\t\tif (typeof params.message === 'string') {\n\t\t\t\tmessageForTelemetry = params.message;\n\t\t\t} else if (\n\t\t\t\tparams.message &&\n\t\t\t\ttypeof params.message === 'object' &&\n\t\t\t\t'props' in params.message &&\n\t\t\t\tparams.message.props\n\t\t\t) {\n\t\t\t\t// Extract error message from VNode props (e.g., NodeExecutionErrorMessage component)\n\t\t\t\tconst props = params.message.props;\n\t\t\t\tconst hasErrorMessage =\n\t\t\t\t\ttypeof props === 'object' && props !== null && 'errorMessage' in props;\n\t\t\t\tconst hasMessage = typeof props === 'object' && props !== null && 'message' in props;\n\n\t\t\t\tif (hasErrorMessage) {\n\t\t\t\t\tmessageForTelemetry = String(props.errorMessage);\n\t\t\t\t} else if (hasMessage) {\n\t\t\t\t\tmessageForTelemetry = String(props.message);\n\t\t\t\t} else {\n\t\t\t\t\tmessageForTelemetry = 'Unknown error';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmessageForTelemetry = 'Unknown error';\n\t\t\t}\n\n\t\t\ttelemetry.track('Instance FE emitted error', {\n\t\t\t\terror_title: params.title,\n\t\t\t\terror_message: messageForTelemetry,\n\t\t\t\tcaused_by_credential: causedByCredential(messageForTelemetry),\n\t\t\t\tworkflow_id: workflowId.value,\n\t\t\t});\n\t\t}\n\n\t\treturn notification;\n\t}\n\n\tfunction showToast(config: {\n\t\ttitle: string;\n\t\tmessage: NotificationOptions['message'];\n\t\tonClick?: (event?: MouseEvent) => void;\n\t\tonClose?: () => void;\n\t\tduration?: number;\n\t\tcustomClass?: string;\n\t\tcloseOnClick?: boolean;\n\t\ttype?: NotificationType;\n\t}) {\n\t\t// eslint-disable-next-line prefer-const\n\t\tlet notification: NotificationHandle;\n\t\tif (config.closeOnClick) {\n\t\t\tconst originalOnClick = config.onClick;\n\t\t\tconfig.onClick = () => {\n\t\t\t\tif (notification) {\n\t\t\t\t\tnotification.close();\n\t\t\t\t}\n\n\t\t\t\tif (originalOnClick) {\n\t\t\t\t\toriginalOnClick();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tnotification = showMessage({\n\t\t\ttitle: config.title,\n\t\t\tmessage: config.message,\n\t\t\tonClick: config.onClick,\n\t\t\tonClose: config.onClose,\n\t\t\tduration: config.duration,\n\t\t\tcustomClass: config.customClass,\n\t\t\ttype: config.type,\n\t\t});\n\n\t\treturn notification;\n\t}\n\n\tfunction collapsableDetails(description: string) {\n\t\tconst errorDescription =\n\t\t\tdescription.length > 500 ? `${description.slice(0, 500)}...` : description;\n\n\t\treturn `\n\t\t\t\t<br>\n\t\t\t\t<br>\n\t\t\t\t<details>\n\t\t\t\t\t<summary\n\t\t\t\t\t\tstyle=\"color: #ff6d5a; font-weight: bold; cursor: pointer;\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${i18n.baseText('showMessage.showDetails')}\n\t\t\t\t\t</summary>\n\t\t\t\t\t<p>${errorDescription}</p>\n\t\t\t\t</details>\n\t\t\t`;\n\t}\n\n\tfunction showError(\n\t\te: unknown,\n\t\ttitle: string,\n\t\toptions?: { message?: string; description?: string },\n\t) {\n\t\tconst error = e as Error & { description?: string };\n\t\tconst message = options?.message;\n\t\tconst description = options?.description ?? error.description;\n\t\tconst messageLine = message ? `${message}<br/>` : '';\n\t\tshowMessage(\n\t\t\t{\n\t\t\t\ttitle,\n\t\t\t\tmessage: `\n\t\t\t\t\t${messageLine}\n\t\t\t\t\t<i>${error.message}</i>\n\t\t\t\t\t${description ? collapsableDetails(description) : ''}`,\n\t\t\t\ttype: 'error',\n\t\t\t\tduration: 0,\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tvoid externalHooks.run('showMessage.showError', {\n\t\t\ttitle,\n\t\t\tmessage,\n\t\t\terrorMessage: error.message,\n\t\t});\n\n\t\ttelemetry.track('Instance FE emitted error', {\n\t\t\terror_title: title,\n\t\t\terror_description: message,\n\t\t\terror_message: error.message,\n\t\t\tcaused_by_credential: causedByCredential(error.message),\n\t\t\tworkflow_id: workflowId.value,\n\t\t});\n\t}\n\n\tfunction clearAllStickyNotifications() {\n\t\tstickyNotificationQueue.forEach((notification) => {\n\t\t\tif (notification) {\n\t\t\t\tnotification.close();\n\t\t\t}\n\t\t});\n\n\t\tstickyNotificationQueue.length = 0;\n\t}\n\n\t// Pick up and display notifications for the given list of views\n\tfunction showNotificationForViews(views: VIEWS[]) {\n\t\tconst notifications: NotificationOptions[] = [];\n\t\tviews.forEach((view) => {\n\t\t\tnotifications.push(...(notificationsStore.pendingNotificationsForViews[view] ?? []));\n\t\t});\n\t\tif (notifications.length) {\n\t\t\tnotifications.forEach((notification) => {\n\t\t\t\t// Notifications show on top of each other without this timeout\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tshowMessage(notification);\n\t\t\t\t}, 5);\n\t\t\t});\n\t\t\t// Clear the queue once all notifications are shown\n\t\t\tnotificationsStore.setNotificationsForView(VIEWS.WORKFLOW, []);\n\t\t}\n\t}\n\n\treturn {\n\t\tshowMessage,\n\t\tshowToast,\n\t\tshowError,\n\t\tclearAllStickyNotifications,\n\t\tshowNotificationForViews,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AA8BA,IAAIA;;;;;;;AAQJ,SAAgB,UAAU,IAAoB;AAC7C,oBAAmB;;AAGpB,MAAMC,aAAiC,EAAE,QAAQ,IAAI;AACrD,MAAMC,mBAA6B;AAEnC,MAAMC,0BAAgD,EAAE;AAExD,SAAgB,WAAW;CAC1B,MAAM,SAAS,oBAAoB;CACnC,MAAM,YAAY,cAAc;CAChC,MAAM,QAAQ,UAAU;CACxB,MAAM,aAAa,eAAe;AACjC,MAAI,OAAO,SAAS,MAAM,QAAQ,OAAO,SAAS,MAAM,UAAW,QAAO;EAC1E,MAAM,KAAK,OAAO,QAAQ;AAC1B,UAAQ,MAAM,QAAQ,GAAG,GAAG,GAAG,KAAK,OAAO;GAC1C;CACF,MAAM,qBAAqB,uBAAuB;CAClD,MAAM,gBAAgB,kBAAkB;CACxC,MAAM,OAAO,SAAS;CAEtB,SAAS,mBAAmB,SAA6B;AACxD,MAAI,CAAC,WAAW,O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QAAQ;AACzB,iBAAc,SAAS,iBAAiB;AAEvC,qBAAiB;AAChB,iBAAY,aAAa;OACvB,EAAE;KACJ;AAEF,sBAAmB,wBAAwB,MAAM,UAAU,EAAE,CAAC;;;AAIhE,QAAO;EACN;EACA;EACA;EACA;EACA;EACA"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/composables",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.23.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"LICENSE_EE.md",
|
|
8
|
+
"LICENSE.md"
|
|
9
9
|
],
|
|
10
10
|
"exports": {
|
|
11
11
|
"./*": {
|
|
@@ -15,24 +15,37 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@vueuse/core": "^
|
|
19
|
-
"
|
|
18
|
+
"@vueuse/core": "^14.3.0",
|
|
19
|
+
"lodash": "4.18.1",
|
|
20
|
+
"vue": "^3.5.13",
|
|
21
|
+
"vue-router": "^4.5.0",
|
|
22
|
+
"@n8n/frontend-constants": "0.2.0",
|
|
23
|
+
"@n8n/frontend-utils": "0.2.0",
|
|
24
|
+
"@n8n/api-types": "1.33.0",
|
|
25
|
+
"@n8n/i18n": "2.33.0",
|
|
26
|
+
"@n8n/stores": "2.33.0",
|
|
27
|
+
"n8n-workflow": "2.33.0"
|
|
20
28
|
},
|
|
21
29
|
"devDependencies": {
|
|
30
|
+
"@pinia/testing": "^0.1.6",
|
|
31
|
+
"element-plus": "2.4.3",
|
|
22
32
|
"@testing-library/vue": "^8.1.0",
|
|
23
33
|
"@testing-library/jest-dom": "^6.6.3",
|
|
24
34
|
"@testing-library/user-event": "^14.6.1",
|
|
35
|
+
"@types/lodash": "4.17.17",
|
|
25
36
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
26
37
|
"@vue/tsconfig": "^0.7.0",
|
|
38
|
+
"pinia": "^2.2.4",
|
|
27
39
|
"tsdown": "^0.16.5",
|
|
28
40
|
"typescript": "6.0.2",
|
|
29
41
|
"vite": "^8.0.2",
|
|
30
42
|
"vitest": "^4.1.9",
|
|
31
43
|
"vue-tsc": "^2.2.8",
|
|
32
44
|
"@n8n/eslint-config": "0.0.1",
|
|
45
|
+
"@n8n/telemetry": "1.1.0",
|
|
46
|
+
"@n8n/vitest-config": "1.19.0",
|
|
33
47
|
"@n8n/playwright-janitor": "0.1.0",
|
|
34
|
-
"@n8n/typescript-config": "1.9.0"
|
|
35
|
-
"@n8n/vitest-config": "1.18.0"
|
|
48
|
+
"@n8n/typescript-config": "1.9.0"
|
|
36
49
|
},
|
|
37
50
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
38
51
|
"homepage": "https://n8n.io",
|