@antcde/vue-utils 0.2.36-rc.4 → 0.2.36-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +29 -21
- package/dist/types/useOsTour.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2158,32 +2158,40 @@ function qn(e) {
|
|
|
2158
2158
|
};
|
|
2159
2159
|
}
|
|
2160
2160
|
// src/useOsTour.ts
|
|
2161
|
-
|
|
2161
|
+
var Jn = /* @__PURE__ */ new WeakMap();
|
|
2162
|
+
function Yn(e) {
|
|
2162
2163
|
let t = /* @__PURE__ */ new Set();
|
|
2163
2164
|
d() && h(() => {
|
|
2164
2165
|
for (let e of t) e();
|
|
2165
2166
|
});
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2167
|
+
let n = Jn.get(e.signal) ?? /* @__PURE__ */ new Map();
|
|
2168
|
+
Jn.set(e.signal, n);
|
|
2169
|
+
function r(r, i, a) {
|
|
2170
|
+
let o = n.get(r);
|
|
2171
|
+
if (o) return o;
|
|
2172
|
+
let s = !1, c = new Promise((o) => {
|
|
2173
|
+
let c = () => {}, l = () => u("dismissed");
|
|
2174
|
+
function u(e) {
|
|
2175
|
+
c(), t.delete(l), n.delete(r), s = !0, o(e);
|
|
2171
2176
|
}
|
|
2172
|
-
|
|
2173
|
-
e.tourEnded &&
|
|
2174
|
-
}), t.add(
|
|
2177
|
+
c = e.signal.receive((e) => {
|
|
2178
|
+
e.tourEnded && a(e.tourEnded) && u(e.tourEnded.outcome);
|
|
2179
|
+
}), t.add(l), e.signal({ startTour: i });
|
|
2175
2180
|
});
|
|
2181
|
+
return s || n.set(r, c), c;
|
|
2176
2182
|
}
|
|
2177
2183
|
return {
|
|
2178
|
-
pointAt: (e, t) =>
|
|
2184
|
+
pointAt: (e, t) => r(`zone:${e}`, {
|
|
2179
2185
|
zone: e,
|
|
2180
|
-
|
|
2186
|
+
title: t?.title,
|
|
2187
|
+
description: t?.description,
|
|
2188
|
+
tip: t?.tip
|
|
2181
2189
|
}, (t) => t.zone === e),
|
|
2182
|
-
startTour: (e) =>
|
|
2190
|
+
startTour: (e) => r(`tour:${e}`, { tour: e }, (t) => t.tour === e)
|
|
2183
2191
|
};
|
|
2184
2192
|
}
|
|
2185
2193
|
// src/usePermissions.ts
|
|
2186
|
-
function
|
|
2194
|
+
function Xn(e) {
|
|
2187
2195
|
let t = u(() => e.value?.user), n = u(() => e.value?.license), r = u(() => e.value?.project), i = u(() => !1), a = u(() => !!n.value?.user_is_admin), o = u(() => !!r.value?.user_is_admin || a.value);
|
|
2188
2196
|
function s(e) {
|
|
2189
2197
|
return !t.value || !n.value ? !1 : a.value ? !0 : (n.value.user_roles ?? []).some((t) => t.name === e);
|
|
@@ -2208,7 +2216,7 @@ function Yn(e) {
|
|
|
2208
2216
|
};
|
|
2209
2217
|
}
|
|
2210
2218
|
// src/useTemplateVersioning.ts
|
|
2211
|
-
function
|
|
2219
|
+
function Zn(e) {
|
|
2212
2220
|
let t = y(null), n = y(null), r = y(null), i = y(null), a = y([]), o = y(null), s = v(!1), c = v(!1), l = v(!1), d = v(!1), f = v(!1), p = v(!1), m = u(() => t.value?.has_update ?? !1), h = u(() => t.value?.current_version ?? null), g = u(() => t.value?.latest_version ?? null), _ = u(() => n.value ? n.value.added.length + n.value.removed.length + n.value.modified.length + n.value.relations_added.length + n.value.relations_removed.length : 0);
|
|
2213
2221
|
async function b(n) {
|
|
2214
2222
|
s.value = !0;
|
|
@@ -2356,7 +2364,7 @@ function Xn(e) {
|
|
|
2356
2364
|
};
|
|
2357
2365
|
}
|
|
2358
2366
|
// src/useTriggerDispatch.ts
|
|
2359
|
-
function
|
|
2367
|
+
function Qn(e, t = {}) {
|
|
2360
2368
|
let n = t.authorizationTimeoutMs ?? 3e5, r = /* @__PURE__ */ new Set();
|
|
2361
2369
|
h(() => {
|
|
2362
2370
|
for (let e of r) e();
|
|
@@ -2382,18 +2390,18 @@ function Zn(e, t = {}) {
|
|
|
2382
2390
|
return { dispatch: a };
|
|
2383
2391
|
}
|
|
2384
2392
|
// src/utils.ts
|
|
2385
|
-
function
|
|
2386
|
-
let [t, n] =
|
|
2393
|
+
function $n(e = "comms") {
|
|
2394
|
+
let [t, n] = er(e, () => Bn(), (e) => e.unsubscribe());
|
|
2387
2395
|
return {
|
|
2388
2396
|
provideComms: t,
|
|
2389
2397
|
injectComms: n
|
|
2390
2398
|
};
|
|
2391
2399
|
}
|
|
2392
|
-
function
|
|
2400
|
+
function er(e, t, n) {
|
|
2393
2401
|
let r, i = () => (!r && (r = t()), r);
|
|
2394
2402
|
return [(t) => (t.onUnmount(() => n && r && n(r)), t.provide(e, i)), () => f(e)()];
|
|
2395
2403
|
}
|
|
2396
|
-
function
|
|
2404
|
+
function tr(e, n, i) {
|
|
2397
2405
|
let a = r(e, n, {
|
|
2398
2406
|
immediate: !1,
|
|
2399
2407
|
...i
|
|
@@ -2403,8 +2411,8 @@ function er(e, n, i) {
|
|
|
2403
2411
|
executeDelayed: a.execute
|
|
2404
2412
|
});
|
|
2405
2413
|
}
|
|
2406
|
-
function
|
|
2414
|
+
function nr(e) {
|
|
2407
2415
|
let t, n = v(void 0);
|
|
2408
2416
|
return m(() => t = e.signal.receive((e) => n.value = e)), g(() => t?.()), [_(n), () => t?.()];
|
|
2409
2417
|
}
|
|
2410
|
-
export { Wn as DEVICE_BREAKPOINTS, Se as SCHEDULE_DAYS, On as TASK_PRIORITIES, ue as apiErrorMessage, Ee as browserZone, ke as buildScheduleRule, De as defaultScheduleSpec, Ne as describeRefresh, fe as deviceTypeIcon, ve as formatDate, ye as formatDateRange, xe as formatRefreshLabel, Dn as nextOccurrences, Me as parseScheduleRule, Mn as taskPriorityColor, jn as taskPriorityIcon, Nn as useAntColorMode, Pn as useAntI18n,
|
|
2418
|
+
export { Wn as DEVICE_BREAKPOINTS, Se as SCHEDULE_DAYS, On as TASK_PRIORITIES, ue as apiErrorMessage, Ee as browserZone, ke as buildScheduleRule, De as defaultScheduleSpec, Ne as describeRefresh, fe as deviceTypeIcon, ve as formatDate, ye as formatDateRange, xe as formatRefreshLabel, Dn as nextOccurrences, Me as parseScheduleRule, Mn as taskPriorityColor, jn as taskPriorityIcon, Nn as useAntColorMode, Pn as useAntI18n, tr as useApi, In as useAppQueryParam, zn as useAppTourMode, Bn as useCommsClient, Un as useCommsHost, $n as useCommsInjection, Gn as useDeviceClass, Kn as useFeature, qn as useHostDevice, Yn as useOsTour, Xn as usePermissions, nr as useSignal, er as useSingleton, Zn as useTemplateVersioning, Qn as useTriggerDispatch, Oe as weekdayOf };
|
|
@@ -3,7 +3,7 @@ import { UseCommsClient } from './useCommsClient';
|
|
|
3
3
|
export type TourOutcome = TourEndedSignal['outcome'];
|
|
4
4
|
export type OsTourCopy = Pick<StartTourSignal, 'title' | 'description' | 'tip'>;
|
|
5
5
|
export interface UseOsTourReturn {
|
|
6
|
-
/** Spotlight one OS zone, optionally with the app's own copy. Resolves when the user closes it. */
|
|
6
|
+
/** Spotlight one OS zone, optionally with the app's own copy. Resolves when the user closes it; a repeat while it is open shares that. */
|
|
7
7
|
pointAt: (zone: TourZoneId, copy?: OsTourCopy) => Promise<TourOutcome>;
|
|
8
8
|
/** Run one of the OS's guided tours. Resolves when it ends. */
|
|
9
9
|
startTour: (tour: TourId) => Promise<TourOutcome>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/vue-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.36-rc.
|
|
4
|
+
"version": "0.2.36-rc.6",
|
|
5
5
|
"description": "Helper to use ANT Comms in Vue 3",
|
|
6
6
|
"author": "CollaborAll",
|
|
7
7
|
"exports": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"vue-i18n": "^11.1.12"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@antcde/connect-ts": "0.4.41-rc.
|
|
36
|
+
"@antcde/connect-ts": "0.4.41-rc.6",
|
|
37
37
|
"rrule": "^2.8.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|