@abraca/nuxt 2.97.0 → 2.100.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/module.json +1 -1
- package/dist/module.mjs +46 -0
- package/dist/runtime/components/ANotificationBell.vue +26 -19
- package/dist/runtime/components/ANotifications.vue +29 -19
- package/dist/runtime/components/aware/AInputNumber.d.vue.ts +13 -1
- package/dist/runtime/components/aware/AInputNumber.vue +20 -4
- package/dist/runtime/components/aware/AInputNumber.vue.d.ts +13 -1
- package/dist/runtime/components/aware/APagination.d.vue.ts +18 -2
- package/dist/runtime/components/aware/APagination.vue +11 -4
- package/dist/runtime/components/aware/APagination.vue.d.ts +18 -2
- package/dist/runtime/components/editor/ALocationPickerPopover.vue +6 -2
- package/dist/runtime/components/renderers/AMapRenderer.vue +3 -2
- package/dist/runtime/components/settings/APluginsTabInstalled.vue +1 -4
- package/dist/runtime/components/shell/AUserMenu.d.vue.ts +2 -2
- package/dist/runtime/components/shell/AUserMenu.vue.d.ts +2 -2
- package/dist/runtime/plugins/core.plugin.js +1 -5
- package/dist/runtime/utils/loadCodeMirror.js +14 -18
- package/dist/runtime/utils/loadKatex.js +1 -5
- package/dist/runtime/utils/loadThree.js +3 -15
- package/dist/runtime/utils/mapboxToken.d.ts +7 -0
- package/dist/runtime/utils/mapboxToken.js +7 -0
- package/dist/runtime/utils/missingPeer.d.mts +1 -0
- package/dist/runtime/utils/missingPeer.js +25 -0
- package/dist/runtime/utils/sanitizeSvg.js +1 -5
- package/package.json +9 -6
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -363,6 +363,52 @@ const module$1 = defineNuxtModule({
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
+
const optionalRuntimePeers = [
|
|
367
|
+
"jszip",
|
|
368
|
+
"katex",
|
|
369
|
+
"dompurify",
|
|
370
|
+
"three",
|
|
371
|
+
"three/examples/jsm/loaders/GLTFLoader.js",
|
|
372
|
+
"three/examples/jsm/loaders/DRACOLoader.js",
|
|
373
|
+
"@tiptap/extension-emoji",
|
|
374
|
+
"@codemirror/view",
|
|
375
|
+
"@codemirror/state",
|
|
376
|
+
"@codemirror/language",
|
|
377
|
+
"@codemirror/commands",
|
|
378
|
+
"@codemirror/autocomplete",
|
|
379
|
+
"@codemirror/search",
|
|
380
|
+
"@codemirror/lang-javascript",
|
|
381
|
+
"@codemirror/lang-css",
|
|
382
|
+
"@codemirror/lang-vue",
|
|
383
|
+
"@codemirror/lang-json",
|
|
384
|
+
"y-codemirror.next",
|
|
385
|
+
"@lezer/highlight"
|
|
386
|
+
];
|
|
387
|
+
const missingPeerStub = resolver.resolve("./runtime/utils/missingPeer.mjs");
|
|
388
|
+
const peerRequires = [
|
|
389
|
+
createRequire(`${nuxt.options.rootDir}/`),
|
|
390
|
+
createRequire(import.meta.url)
|
|
391
|
+
];
|
|
392
|
+
const missingPeers = optionalRuntimePeers.filter((pkg) => !peerRequires.some((req) => {
|
|
393
|
+
try {
|
|
394
|
+
req.resolve(pkg);
|
|
395
|
+
return true;
|
|
396
|
+
} catch {
|
|
397
|
+
return false;
|
|
398
|
+
}
|
|
399
|
+
}));
|
|
400
|
+
if (missingPeers.length) {
|
|
401
|
+
nuxt.hook("vite:extendConfig", (config) => {
|
|
402
|
+
config.resolve ??= {};
|
|
403
|
+
const resolveCfg = config.resolve;
|
|
404
|
+
const entries = missingPeers.map((pkg) => ({
|
|
405
|
+
find: new RegExp(`^${pkg.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`),
|
|
406
|
+
replacement: missingPeerStub
|
|
407
|
+
}));
|
|
408
|
+
const existing = Array.isArray(resolveCfg.alias) ? resolveCfg.alias : Object.entries(resolveCfg.alias ?? {}).map(([find, replacement]) => ({ find, replacement }));
|
|
409
|
+
resolveCfg.alias = [...existing, ...entries];
|
|
410
|
+
});
|
|
411
|
+
}
|
|
366
412
|
nuxt.options.vite.optimizeDeps.include = [
|
|
367
413
|
.../* @__PURE__ */ new Set([...includeList, ...prebundleDeps])
|
|
368
414
|
];
|
|
@@ -23,7 +23,7 @@ const ariaLabel = computed(
|
|
|
23
23
|
() => _autoCount.value > 0 ? `${props.tooltip} (${_autoCount.value} unread)` : props.tooltip
|
|
24
24
|
);
|
|
25
25
|
const chipText = computed(
|
|
26
|
-
() => _autoCount.value >
|
|
26
|
+
() => _autoCount.value > 99 ? "99+" : String(_autoCount.value)
|
|
27
27
|
);
|
|
28
28
|
</script>
|
|
29
29
|
|
|
@@ -32,24 +32,31 @@ const chipText = computed(
|
|
|
32
32
|
:text="tooltip"
|
|
33
33
|
:content="{ side: 'bottom' }"
|
|
34
34
|
>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
<!--
|
|
36
|
+
UChip WRAPS the thing it badges — it positions itself against its own
|
|
37
|
+
default slot. Rendering it as the button's `#trailing` instead (what this
|
|
38
|
+
component did until 2.100.0) gave it an empty slot to anchor to, so the
|
|
39
|
+
count collapsed into an unreadable 6px dot beside the bell.
|
|
40
|
+
|
|
41
|
+
`size="3xl"` is the smallest step whose badge actually fits text; the
|
|
42
|
+
default `md` is a dot with no room for digits. `:show` keeps the chip out
|
|
43
|
+
of the DOM entirely at zero rather than painting an empty bubble.
|
|
44
|
+
-->
|
|
45
|
+
<UChip
|
|
46
|
+
:text="chipText"
|
|
47
|
+
:color="chipColor"
|
|
48
|
+
:show="_autoCount > 0"
|
|
49
|
+
size="3xl"
|
|
50
|
+
:ui="{ base: 'font-medium tabular-nums px-1' }"
|
|
42
51
|
>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</template>
|
|
53
|
-
</UButton>
|
|
52
|
+
<UButton
|
|
53
|
+
:icon="icon"
|
|
54
|
+
:variant="variant"
|
|
55
|
+
:color="color"
|
|
56
|
+
:size="size"
|
|
57
|
+
:aria-label="ariaLabel"
|
|
58
|
+
@click="(e) => emit('click', e)"
|
|
59
|
+
/>
|
|
60
|
+
</UChip>
|
|
54
61
|
</UTooltip>
|
|
55
62
|
</template>
|
|
@@ -20,24 +20,27 @@ function openAndMarkFetched() {
|
|
|
20
20
|
<template>
|
|
21
21
|
<ClientOnly>
|
|
22
22
|
<div class="relative">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
<!--
|
|
24
|
+
The chip WRAPS the button (see <ANotificationBell> for the full note):
|
|
25
|
+
as a `#trailing` slot it has nothing to anchor against and the count
|
|
26
|
+
renders as an unreadable dot. `3xl` is the smallest size whose badge
|
|
27
|
+
fits digits.
|
|
28
|
+
-->
|
|
29
|
+
<UChip
|
|
30
|
+
:text="unreadCount > 99 ? '99+' : String(unreadCount)"
|
|
31
|
+
color="error"
|
|
32
|
+
:show="unreadCount > 0"
|
|
33
|
+
size="3xl"
|
|
34
|
+
:ui="{ base: 'font-medium tabular-nums px-1' }"
|
|
29
35
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/>
|
|
39
|
-
</template>
|
|
40
|
-
</UButton>
|
|
36
|
+
<UButton
|
|
37
|
+
icon="i-lucide-bell"
|
|
38
|
+
variant="ghost"
|
|
39
|
+
color="neutral"
|
|
40
|
+
:aria-label="`Notifications${unreadCount > 0 ? ` (${unreadCount} unread)` : ''}`"
|
|
41
|
+
@click="openAndMarkFetched"
|
|
42
|
+
/>
|
|
43
|
+
</UChip>
|
|
41
44
|
|
|
42
45
|
<USlideover
|
|
43
46
|
v-model:open="isOpen"
|
|
@@ -82,11 +85,18 @@ function openAndMarkFetched() {
|
|
|
82
85
|
{{ n.body }}
|
|
83
86
|
</div>
|
|
84
87
|
</div>
|
|
88
|
+
<!--
|
|
89
|
+
Standalone + inset: a chip with no default slot has nothing to
|
|
90
|
+
anchor to, so without `standalone` it is absolutely positioned
|
|
91
|
+
against a zero-size box and lands off the row.
|
|
92
|
+
-->
|
|
85
93
|
<UChip
|
|
86
94
|
v-if="!n.read"
|
|
95
|
+
standalone
|
|
96
|
+
inset
|
|
87
97
|
color="primary"
|
|
88
|
-
size="
|
|
89
|
-
class="shrink-0 mt-
|
|
98
|
+
size="sm"
|
|
99
|
+
class="shrink-0 mt-2"
|
|
90
100
|
/>
|
|
91
101
|
</div>
|
|
92
102
|
|
|
@@ -3,13 +3,25 @@ type __VLS_Props = {
|
|
|
3
3
|
awareness?: boolean;
|
|
4
4
|
sync?: boolean;
|
|
5
5
|
total?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* <UInputNumber>'s own upper bound — forwarded straight through.
|
|
8
|
+
*
|
|
9
|
+
* The aware family uses `max` for "how many peer avatars to overlay", which
|
|
10
|
+
* on THIS wrapper collided with the wrapped component's numeric `max`:
|
|
11
|
+
* because `max` was declared here it never reached `<UInputNumber>` via
|
|
12
|
+
* `v-bind="attrs"`, so `<AInputNumber :max="10">` silently left the input
|
|
13
|
+
* unbounded and capped the avatar row at ten instead. The avatar cap moved
|
|
14
|
+
* to `maxPeers` in 2.100.0; `max` now means what it means on the primitive.
|
|
15
|
+
*/
|
|
6
16
|
max?: number;
|
|
17
|
+
/** How many peer avatars to overlay. Was `max` before 2.100.0. */
|
|
18
|
+
maxPeers?: number;
|
|
7
19
|
};
|
|
8
20
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
21
|
sync: boolean;
|
|
10
22
|
awareness: boolean;
|
|
11
|
-
max: number;
|
|
12
23
|
total: boolean;
|
|
24
|
+
maxPeers: number;
|
|
13
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
26
|
declare const _default: typeof __VLS_export;
|
|
15
27
|
export default _default;
|
|
@@ -9,7 +9,8 @@ const props = defineProps({
|
|
|
9
9
|
awareness: { type: Boolean, required: false, default: true },
|
|
10
10
|
sync: { type: Boolean, required: false, default: false },
|
|
11
11
|
total: { type: Boolean, required: false, default: false },
|
|
12
|
-
max: { type: Number, required: false
|
|
12
|
+
max: { type: Number, required: false },
|
|
13
|
+
maxPeers: { type: Number, required: false, default: 3 }
|
|
13
14
|
});
|
|
14
15
|
const enableAwareness = computed(() => props.awareness || props.total);
|
|
15
16
|
const enableSync = computed(() => props.sync || props.total);
|
|
@@ -52,11 +53,26 @@ const eventHandlers = computed(() => enableAwareness.value ? handlers : {});
|
|
|
52
53
|
v-if="enableSync && !hasExternalModel"
|
|
53
54
|
v-model="synced"
|
|
54
55
|
v-bind="attrs"
|
|
56
|
+
:max="max"
|
|
57
|
+
/>
|
|
58
|
+
<UInputNumber
|
|
59
|
+
v-else
|
|
60
|
+
v-bind="attrs"
|
|
61
|
+
:max="max"
|
|
55
62
|
/>
|
|
56
|
-
<UInputNumber v-else v-bind="attrs" />
|
|
57
63
|
<Transition name="aa-peer">
|
|
58
|
-
<span
|
|
59
|
-
|
|
64
|
+
<span
|
|
65
|
+
v-if="overlayPeers.length"
|
|
66
|
+
class="aa-overlay"
|
|
67
|
+
>
|
|
68
|
+
<AAvatar
|
|
69
|
+
v-for="p in overlayPeers.slice(0, maxPeers)"
|
|
70
|
+
:key="p.clientId"
|
|
71
|
+
:user="p"
|
|
72
|
+
size="2xs"
|
|
73
|
+
:show-status="false"
|
|
74
|
+
:show-tooltip="true"
|
|
75
|
+
/>
|
|
60
76
|
</span>
|
|
61
77
|
</Transition>
|
|
62
78
|
</div>
|
|
@@ -3,13 +3,25 @@ type __VLS_Props = {
|
|
|
3
3
|
awareness?: boolean;
|
|
4
4
|
sync?: boolean;
|
|
5
5
|
total?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* <UInputNumber>'s own upper bound — forwarded straight through.
|
|
8
|
+
*
|
|
9
|
+
* The aware family uses `max` for "how many peer avatars to overlay", which
|
|
10
|
+
* on THIS wrapper collided with the wrapped component's numeric `max`:
|
|
11
|
+
* because `max` was declared here it never reached `<UInputNumber>` via
|
|
12
|
+
* `v-bind="attrs"`, so `<AInputNumber :max="10">` silently left the input
|
|
13
|
+
* unbounded and capped the avatar row at ten instead. The avatar cap moved
|
|
14
|
+
* to `maxPeers` in 2.100.0; `max` now means what it means on the primitive.
|
|
15
|
+
*/
|
|
6
16
|
max?: number;
|
|
17
|
+
/** How many peer avatars to overlay. Was `max` before 2.100.0. */
|
|
18
|
+
maxPeers?: number;
|
|
7
19
|
};
|
|
8
20
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
21
|
sync: boolean;
|
|
10
22
|
awareness: boolean;
|
|
11
|
-
max: number;
|
|
12
23
|
total: boolean;
|
|
24
|
+
maxPeers: number;
|
|
13
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
26
|
declare const _default: typeof __VLS_export;
|
|
15
27
|
export default _default;
|
|
@@ -2,12 +2,28 @@ type __VLS_Props = {
|
|
|
2
2
|
fieldKey: string;
|
|
3
3
|
awareness?: boolean;
|
|
4
4
|
live?: boolean;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Two meanings, disambiguated by TYPE — because the aware family's `total`
|
|
7
|
+
* shorthand collides head-on with `<UPagination>`'s own `total` (the number
|
|
8
|
+
* of items to paginate).
|
|
9
|
+
*
|
|
10
|
+
* - `total` / `:total="true"` — the family shorthand: turn every sharing
|
|
11
|
+
* mode this component supports on (awareness + live).
|
|
12
|
+
* - `:total="50"` — a NUMBER is UPagination's item count and is forwarded
|
|
13
|
+
* to it untouched; it does not imply the shorthand. Combine it with
|
|
14
|
+
* `awareness` / `live` when you want both.
|
|
15
|
+
*
|
|
16
|
+
* Until 2.100.0 the prop was typed `boolean`, so a numeric `total` was
|
|
17
|
+
* swallowed by this wrapper (Vue logged a type warning and dropped it) and
|
|
18
|
+
* every APagination rendered a single page no matter how many items it was
|
|
19
|
+
* given.
|
|
20
|
+
*/
|
|
21
|
+
total?: boolean | number;
|
|
6
22
|
};
|
|
7
23
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
24
|
awareness: boolean;
|
|
9
25
|
live: boolean;
|
|
10
|
-
total: boolean;
|
|
26
|
+
total: boolean | number;
|
|
11
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
28
|
declare const _default: typeof __VLS_export;
|
|
13
29
|
export default _default;
|
|
@@ -8,10 +8,12 @@ const props = defineProps({
|
|
|
8
8
|
fieldKey: { type: String, required: true },
|
|
9
9
|
awareness: { type: Boolean, required: false, default: true },
|
|
10
10
|
live: { type: Boolean, required: false, default: false },
|
|
11
|
-
total: { type: Boolean, required: false, default: false }
|
|
11
|
+
total: { type: [Boolean, Number], required: false, default: false }
|
|
12
12
|
});
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const shorthand = computed(() => props.total === true);
|
|
14
|
+
const enableAwareness = computed(() => props.awareness || shorthand.value);
|
|
15
|
+
const enableLive = computed(() => props.live || shorthand.value);
|
|
16
|
+
const itemTotal = computed(() => typeof props.total === "number" ? props.total : void 0);
|
|
15
17
|
const attrs = useAttrs();
|
|
16
18
|
const { hoverers, focusers, pressers, isPressed, hoverHandlers } = useAAField(() => props.fieldKey);
|
|
17
19
|
const livePage = useAAUIState(() => `${props.fieldKey}:page`, { defaultValue: 1 });
|
|
@@ -43,8 +45,13 @@ const ringStyle = computed(
|
|
|
43
45
|
v-if="enableLive && !hasExternalModel"
|
|
44
46
|
v-model="local"
|
|
45
47
|
v-bind="attrs"
|
|
48
|
+
:total="itemTotal"
|
|
49
|
+
/>
|
|
50
|
+
<UPagination
|
|
51
|
+
v-else
|
|
52
|
+
v-bind="attrs"
|
|
53
|
+
:total="itemTotal"
|
|
46
54
|
/>
|
|
47
|
-
<UPagination v-else v-bind="attrs" />
|
|
48
55
|
</div>
|
|
49
56
|
</template>
|
|
50
57
|
|
|
@@ -2,12 +2,28 @@ type __VLS_Props = {
|
|
|
2
2
|
fieldKey: string;
|
|
3
3
|
awareness?: boolean;
|
|
4
4
|
live?: boolean;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Two meanings, disambiguated by TYPE — because the aware family's `total`
|
|
7
|
+
* shorthand collides head-on with `<UPagination>`'s own `total` (the number
|
|
8
|
+
* of items to paginate).
|
|
9
|
+
*
|
|
10
|
+
* - `total` / `:total="true"` — the family shorthand: turn every sharing
|
|
11
|
+
* mode this component supports on (awareness + live).
|
|
12
|
+
* - `:total="50"` — a NUMBER is UPagination's item count and is forwarded
|
|
13
|
+
* to it untouched; it does not imply the shorthand. Combine it with
|
|
14
|
+
* `awareness` / `live` when you want both.
|
|
15
|
+
*
|
|
16
|
+
* Until 2.100.0 the prop was typed `boolean`, so a numeric `total` was
|
|
17
|
+
* swallowed by this wrapper (Vue logged a type warning and dropped it) and
|
|
18
|
+
* every APagination rendered a single page no matter how many items it was
|
|
19
|
+
* given.
|
|
20
|
+
*/
|
|
21
|
+
total?: boolean | number;
|
|
6
22
|
};
|
|
7
23
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
24
|
awareness: boolean;
|
|
9
25
|
live: boolean;
|
|
10
|
-
total: boolean;
|
|
26
|
+
total: boolean | number;
|
|
11
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
28
|
declare const _default: typeof __VLS_export;
|
|
13
29
|
export default _default;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, watch, nextTick, onUnmounted } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { mapboxAccessToken as resolveMapboxToken, MAPBOX_TOKEN_MISSING } from "../../utils/mapboxToken";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
latValue: { type: Number, required: false },
|
|
6
6
|
lngValue: { type: Number, required: false },
|
|
7
7
|
open: { type: Boolean, required: true }
|
|
8
8
|
});
|
|
9
9
|
const emit = defineEmits(["update:lat", "update:lng", "update:open", "clear"]);
|
|
10
|
-
const mapboxAccessToken =
|
|
10
|
+
const mapboxAccessToken = resolveMapboxToken();
|
|
11
11
|
let mapboxgl = null;
|
|
12
12
|
const mapboxError = ref(null);
|
|
13
13
|
async function loadMapbox() {
|
|
14
14
|
if (mapboxgl) return true;
|
|
15
|
+
if (!mapboxAccessToken) {
|
|
16
|
+
mapboxError.value = MAPBOX_TOKEN_MISSING;
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
15
19
|
try {
|
|
16
20
|
const mod = await import("mapbox-gl");
|
|
17
21
|
mapboxgl = mod.default || mod;
|
|
@@ -3,6 +3,7 @@ import { ref, computed, watch, nextTick, shallowRef, onMounted, onBeforeUnmount,
|
|
|
3
3
|
import { useRuntimeConfig, useColorMode, useAppConfig, useToast } from "#imports";
|
|
4
4
|
import { useRouter } from "vue-router";
|
|
5
5
|
import { avatarBorderStyle } from "../../utils/avatarStyle";
|
|
6
|
+
import { mapboxAccessToken as resolveMapboxToken, MAPBOX_TOKEN_MISSING } from "../../utils/mapboxToken";
|
|
6
7
|
import { useAbracadabra } from "../../composables/useAbracadabra";
|
|
7
8
|
import { useDocSlugs } from "../../composables/useDocSlugs";
|
|
8
9
|
import { useRendererBase } from "../../composables/useRendererBase";
|
|
@@ -1683,9 +1684,9 @@ onMounted(async () => {
|
|
|
1683
1684
|
}
|
|
1684
1685
|
if (!mapContainer.value) return;
|
|
1685
1686
|
window.addEventListener("keydown", onKeyDown);
|
|
1686
|
-
const token =
|
|
1687
|
+
const token = resolveMapboxToken();
|
|
1687
1688
|
if (!token) {
|
|
1688
|
-
mapboxError.value =
|
|
1689
|
+
mapboxError.value = MAPBOX_TOKEN_MISSING;
|
|
1689
1690
|
return;
|
|
1690
1691
|
}
|
|
1691
1692
|
mapboxgl.accessToken = token;
|
|
@@ -94,10 +94,7 @@ async function onFileChosen(ev) {
|
|
|
94
94
|
async function handleZipUpload(file) {
|
|
95
95
|
let JSZip = null;
|
|
96
96
|
try {
|
|
97
|
-
const mod = await import(
|
|
98
|
-
/* @vite-ignore */
|
|
99
|
-
"jszip"
|
|
100
|
-
);
|
|
97
|
+
const mod = await import("jszip");
|
|
101
98
|
JSZip = mod.default ?? mod;
|
|
102
99
|
} catch {
|
|
103
100
|
toast.add({
|
|
@@ -14,13 +14,13 @@ type __VLS_Props = {
|
|
|
14
14
|
extraItems?: DropdownMenuItem[][];
|
|
15
15
|
};
|
|
16
16
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
-
logout: () => any;
|
|
18
17
|
"open-settings": () => any;
|
|
19
18
|
"open-account": () => any;
|
|
19
|
+
logout: () => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
-
onLogout?: (() => any) | undefined;
|
|
22
21
|
"onOpen-settings"?: (() => any) | undefined;
|
|
23
22
|
"onOpen-account"?: (() => any) | undefined;
|
|
23
|
+
onLogout?: (() => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
25
|
color: string;
|
|
26
26
|
collapsed: boolean;
|
|
@@ -14,13 +14,13 @@ type __VLS_Props = {
|
|
|
14
14
|
extraItems?: DropdownMenuItem[][];
|
|
15
15
|
};
|
|
16
16
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
-
logout: () => any;
|
|
18
17
|
"open-settings": () => any;
|
|
19
18
|
"open-account": () => any;
|
|
19
|
+
logout: () => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
-
onLogout?: (() => any) | undefined;
|
|
22
21
|
"onOpen-settings"?: (() => any) | undefined;
|
|
23
22
|
"onOpen-account"?: (() => any) | undefined;
|
|
23
|
+
onLogout?: (() => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
25
|
color: string;
|
|
26
26
|
collapsed: boolean;
|
|
@@ -224,11 +224,7 @@ async function loadClientExtensions() {
|
|
|
224
224
|
TimelineItem
|
|
225
225
|
];
|
|
226
226
|
try {
|
|
227
|
-
const
|
|
228
|
-
const { Emoji } = await import(
|
|
229
|
-
/* @vite-ignore */
|
|
230
|
-
emojiPkg
|
|
231
|
-
);
|
|
227
|
+
const { Emoji } = await import("@tiptap/extension-emoji");
|
|
232
228
|
if (Emoji) extensions.push(Emoji);
|
|
233
229
|
} catch {
|
|
234
230
|
}
|
|
@@ -6,20 +6,6 @@ export async function loadCodeMirror() {
|
|
|
6
6
|
if (loading) return loading;
|
|
7
7
|
loading = (async () => {
|
|
8
8
|
try {
|
|
9
|
-
const names = [
|
|
10
|
-
"@codemirror/view",
|
|
11
|
-
"@codemirror/state",
|
|
12
|
-
"@codemirror/language",
|
|
13
|
-
"@codemirror/commands",
|
|
14
|
-
"@codemirror/autocomplete",
|
|
15
|
-
"@codemirror/search",
|
|
16
|
-
"@codemirror/lang-javascript",
|
|
17
|
-
"@codemirror/lang-css",
|
|
18
|
-
"@codemirror/lang-vue",
|
|
19
|
-
"@codemirror/lang-json",
|
|
20
|
-
"y-codemirror.next",
|
|
21
|
-
"@lezer/highlight"
|
|
22
|
-
];
|
|
23
9
|
const [
|
|
24
10
|
view,
|
|
25
11
|
state,
|
|
@@ -33,10 +19,20 @@ export async function loadCodeMirror() {
|
|
|
33
19
|
langJson,
|
|
34
20
|
yCollab,
|
|
35
21
|
lezerHighlight
|
|
36
|
-
] = await Promise.all(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
] = await Promise.all([
|
|
23
|
+
import("@codemirror/view"),
|
|
24
|
+
import("@codemirror/state"),
|
|
25
|
+
import("@codemirror/language"),
|
|
26
|
+
import("@codemirror/commands"),
|
|
27
|
+
import("@codemirror/autocomplete"),
|
|
28
|
+
import("@codemirror/search"),
|
|
29
|
+
import("@codemirror/lang-javascript"),
|
|
30
|
+
import("@codemirror/lang-css"),
|
|
31
|
+
import("@codemirror/lang-vue"),
|
|
32
|
+
import("@codemirror/lang-json"),
|
|
33
|
+
import("y-codemirror.next"),
|
|
34
|
+
import("@lezer/highlight")
|
|
35
|
+
]);
|
|
40
36
|
cache = {
|
|
41
37
|
view,
|
|
42
38
|
state,
|
|
@@ -6,11 +6,7 @@ export async function loadKatex() {
|
|
|
6
6
|
if (katexLoading) return katexLoading;
|
|
7
7
|
katexLoading = (async () => {
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
const mod = await import(
|
|
11
|
-
/* @vite-ignore */
|
|
12
|
-
pkg
|
|
13
|
-
);
|
|
9
|
+
const mod = await import("katex");
|
|
14
10
|
katexCache = mod?.default ?? mod;
|
|
15
11
|
return katexCache;
|
|
16
12
|
} catch {
|
|
@@ -6,22 +6,10 @@ export async function loadThree() {
|
|
|
6
6
|
if (loading) return loading;
|
|
7
7
|
loading = (async () => {
|
|
8
8
|
try {
|
|
9
|
-
const threePkg = "three";
|
|
10
|
-
const gltfPkg = "three/examples/jsm/loaders/GLTFLoader.js";
|
|
11
|
-
const dracoPkg = "three/examples/jsm/loaders/DRACOLoader.js";
|
|
12
9
|
const [three, gltf, draco] = await Promise.all([
|
|
13
|
-
import(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
),
|
|
17
|
-
import(
|
|
18
|
-
/* @vite-ignore */
|
|
19
|
-
gltfPkg
|
|
20
|
-
),
|
|
21
|
-
import(
|
|
22
|
-
/* @vite-ignore */
|
|
23
|
-
dracoPkg
|
|
24
|
-
)
|
|
10
|
+
import("three"),
|
|
11
|
+
import("three/examples/jsm/loaders/GLTFLoader.js"),
|
|
12
|
+
import("three/examples/jsm/loaders/DRACOLoader.js")
|
|
25
13
|
]);
|
|
26
14
|
cache = {
|
|
27
15
|
Raycaster: three.Raycaster,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The token, or `''` when the app has not configured one. */
|
|
2
|
+
export declare function mapboxAccessToken(): string;
|
|
3
|
+
/**
|
|
4
|
+
* The sentence a map surface shows when there is no token — one wording, so a
|
|
5
|
+
* renderer and a picker on the same page do not blame different things.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAPBOX_TOKEN_MISSING = "Mapbox access token not configured. Set `abracadabra.mapboxToken` in your Nuxt config.";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
export function mapboxAccessToken() {
|
|
3
|
+
const pub = useRuntimeConfig().public;
|
|
4
|
+
const token = pub?.abracadabra?.mapboxToken ?? pub?.abracadabra?.mapboxAccessToken ?? pub?.mapboxAccessToken ?? "";
|
|
5
|
+
return typeof token === "string" ? token.trim() : "";
|
|
6
|
+
}
|
|
7
|
+
export const MAPBOX_TOKEN_MISSING = "Mapbox access token not configured. Set `abracadabra.mapboxToken` in your Nuxt config.";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub for an OPTIONAL peer the consuming app did not install.
|
|
3
|
+
*
|
|
4
|
+
* `src/module.ts` aliases every entry of `OPTIONAL_RUNTIME_PEERS` that it
|
|
5
|
+
* cannot resolve from the app root to this file, so the loaders in
|
|
6
|
+
* `runtime/utils/*` can use LITERAL dynamic imports and still degrade
|
|
7
|
+
* gracefully.
|
|
8
|
+
*
|
|
9
|
+
* Why literal imports matter: Vite only rewrites a dynamic import whose
|
|
10
|
+
* specifier it can read statically. The old trick —
|
|
11
|
+
* `const pkg = 'katex'; await import(/* @vite-ignore *\/ pkg)` — was emitted
|
|
12
|
+
* untouched, so the BROWSER received a bare specifier it cannot resolve and
|
|
13
|
+
* every one of these optional features (CodeMirror, KaTeX, three.js, DOMPurify,
|
|
14
|
+
* TipTap emoji) failed at runtime even when the package WAS installed. The
|
|
15
|
+
* try/catch around each loader then reported the peer as "not installed",
|
|
16
|
+
* which is why the failure looked like configuration rather than a bug.
|
|
17
|
+
*
|
|
18
|
+
* Throwing at module scope makes the dynamic import reject, which is exactly
|
|
19
|
+
* what those loaders already handle.
|
|
20
|
+
*/
|
|
21
|
+
throw new Error(
|
|
22
|
+
'[abracadabra] optional peer dependency not installed — '
|
|
23
|
+
+ 'this module is a stub injected by @abraca/nuxt. Install the package to '
|
|
24
|
+
+ 'enable the feature that imported it.',
|
|
25
|
+
)
|
|
@@ -6,11 +6,7 @@ async function tryLoadDomPurify() {
|
|
|
6
6
|
if (loadingPromise) return loadingPromise;
|
|
7
7
|
loadingPromise = (async () => {
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
const mod = await import(
|
|
11
|
-
/* @vite-ignore */
|
|
12
|
-
pkg
|
|
13
|
-
);
|
|
9
|
+
const mod = await import("dompurify");
|
|
14
10
|
domPurifyCache = mod?.default ?? mod;
|
|
15
11
|
return domPurifyCache;
|
|
16
12
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abraca/nuxt",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.100.0",
|
|
4
4
|
"description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
|
|
5
5
|
"repository": "abracadabra/abracadabra-nuxt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -173,10 +173,10 @@
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
"devDependencies": {
|
|
176
|
-
"@abraca/convert": "^2.
|
|
177
|
-
"@abraca/dabra": "^2.
|
|
178
|
-
"@abraca/plugin": "^2.
|
|
179
|
-
"@abraca/schema": "^2.
|
|
176
|
+
"@abraca/convert": "^2.99.0",
|
|
177
|
+
"@abraca/dabra": "^2.99.0",
|
|
178
|
+
"@abraca/plugin": "^2.99.0",
|
|
179
|
+
"@abraca/schema": "^2.99.0",
|
|
180
180
|
"@codemirror/autocomplete": "^6.18.0",
|
|
181
181
|
"@codemirror/commands": "^6.7.0",
|
|
182
182
|
"@codemirror/lang-css": "^6.3.1",
|
|
@@ -221,7 +221,10 @@
|
|
|
221
221
|
"yjs": "^13.6.30"
|
|
222
222
|
},
|
|
223
223
|
"scripts": {
|
|
224
|
-
"dev": "
|
|
224
|
+
"dev": "node scripts/dev.mjs",
|
|
225
|
+
"dev:nuxt": "npm run dev:prepare && nuxt dev playground",
|
|
226
|
+
"dev:backend": "node scripts/dev-backend.mjs",
|
|
227
|
+
"dev:clean": "node scripts/dev-clean.mjs",
|
|
225
228
|
"dev:build": "nuxt build playground",
|
|
226
229
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
227
230
|
"release": "npm run lint && npm run prepack",
|