@abraca/nuxt 2.26.0 → 2.27.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.d.mts +15 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/components/ADocumentTree.vue +29 -24
- package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
- package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
- package/dist/runtime/plugin-abracadabra.client.js +21 -1
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
|
@@ -32,6 +32,7 @@ declare module '@nuxt/schema' {
|
|
|
32
32
|
entryDocId: string;
|
|
33
33
|
pinServer: boolean;
|
|
34
34
|
persistAuth: boolean;
|
|
35
|
+
deferConnect: boolean;
|
|
35
36
|
authStorageKey: string;
|
|
36
37
|
disabledBuiltins: string[];
|
|
37
38
|
features: {
|
|
@@ -136,6 +137,20 @@ interface ModuleOptions {
|
|
|
136
137
|
* Default: true.
|
|
137
138
|
*/
|
|
138
139
|
persistAuth?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Defer the SDK import + provider connection (auth challenge, WebSocket,
|
|
142
|
+
* initial sync) until after the app's first paint, instead of starting it
|
|
143
|
+
* during plugin setup. The heavy `@abraca/dabra` chunk and the network
|
|
144
|
+
* round-trips then stop competing with above-the-fold content for the main
|
|
145
|
+
* thread and the (often slow, mobile) network — a large LCP win on
|
|
146
|
+
* content-first sites that don't need live data above the fold.
|
|
147
|
+
*
|
|
148
|
+
* Live features (awareness, sync, chat) come online a beat after first
|
|
149
|
+
* paint rather than during it. Recommended for marketing / landing / docs
|
|
150
|
+
* sites; leave OFF for editor-first apps (dashboards) that want the provider
|
|
151
|
+
* connected as early as possible. Default: false.
|
|
152
|
+
*/
|
|
153
|
+
deferConnect?: boolean;
|
|
139
154
|
/**
|
|
140
155
|
* localStorage key used by AbracadabraClient for token persistence.
|
|
141
156
|
* Default: 'abracadabra:auth'
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -21,6 +21,7 @@ const module$1 = defineNuxtModule({
|
|
|
21
21
|
url: process.env.ABRACADABRA_URL ?? "https://abra.cou.sh",
|
|
22
22
|
pinServer: false,
|
|
23
23
|
persistAuth: true,
|
|
24
|
+
deferConnect: false,
|
|
24
25
|
authStorageKey: "abracadabra:auth",
|
|
25
26
|
disabledBuiltins: [],
|
|
26
27
|
features: {
|
|
@@ -90,6 +91,7 @@ const module$1 = defineNuxtModule({
|
|
|
90
91
|
entryDocId: options.entryDocId ?? "",
|
|
91
92
|
pinServer: options.pinServer ?? false,
|
|
92
93
|
persistAuth: options.persistAuth,
|
|
94
|
+
deferConnect: options.deferConnect ?? false,
|
|
93
95
|
authStorageKey: options.authStorageKey,
|
|
94
96
|
disabledBuiltins: options.disabledBuiltins,
|
|
95
97
|
features: options.features,
|
|
@@ -1189,36 +1189,40 @@ defineExpose({
|
|
|
1189
1189
|
|
|
1190
1190
|
<ClientOnly>
|
|
1191
1191
|
<template v-if="isReady">
|
|
1192
|
-
<
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
description="Create your first page."
|
|
1197
|
-
size="sm"
|
|
1198
|
-
/>
|
|
1199
|
-
|
|
1200
|
-
<TransitionGroup
|
|
1201
|
-
v-else
|
|
1202
|
-
name="tree-item"
|
|
1203
|
-
tag="div"
|
|
1204
|
-
:class="['px-1', { 'is-dragging': dragId }]"
|
|
1192
|
+
<div
|
|
1193
|
+
ref="scrollParent"
|
|
1194
|
+
class="flex-1 min-h-0 overflow-y-auto px-1"
|
|
1195
|
+
:class="{ 'is-dragging': dragId }"
|
|
1205
1196
|
@dragover.prevent
|
|
1206
1197
|
@dragleave="onListDragLeave"
|
|
1207
1198
|
>
|
|
1199
|
+
<UEmpty
|
|
1200
|
+
v-if="flatItems.length === 0"
|
|
1201
|
+
icon="i-lucide-file-text"
|
|
1202
|
+
title="No pages"
|
|
1203
|
+
description="Create your first page."
|
|
1204
|
+
size="sm"
|
|
1205
|
+
/>
|
|
1206
|
+
|
|
1208
1207
|
<div
|
|
1209
|
-
v-
|
|
1210
|
-
:
|
|
1211
|
-
|
|
1212
|
-
|
|
1208
|
+
v-else
|
|
1209
|
+
:style="{ height: `${rowVirtualizer.getTotalSize()}px`, position: 'relative', width: '100%' }"
|
|
1210
|
+
>
|
|
1211
|
+
<div
|
|
1212
|
+
v-for="{ vRow, item, idx } in virtualRows"
|
|
1213
|
+
:key="item.id"
|
|
1214
|
+
class="tree-item absolute left-0 right-0"
|
|
1215
|
+
:class="[
|
|
1213
1216
|
dragId === item.id && !item.isTrashRoot ? 'opacity-30' : '',
|
|
1214
1217
|
focusedIndex === idx ? 'ring-1 ring-inset ring-(--ui-primary)/50 rounded-sm' : ''
|
|
1215
1218
|
]"
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1219
|
+
:data-focused="focusedIndex === idx ? '' : void 0"
|
|
1220
|
+
:style="{ transform: `translateY(${vRow.start}px)`, height: `${vRow.size}px` }"
|
|
1221
|
+
role="treeitem"
|
|
1222
|
+
@dragover="onDragOver($event, item)"
|
|
1223
|
+
@drop.stop="onDrop"
|
|
1224
|
+
@click="focusedIndex = idx"
|
|
1225
|
+
>
|
|
1222
1226
|
<!-- Drop indicator: line BEFORE -->
|
|
1223
1227
|
<div
|
|
1224
1228
|
v-if="dropIndicator?.targetId === item.id && dropIndicator.position === 'before' && !item.isTrashRoot"
|
|
@@ -1541,8 +1545,9 @@ defineExpose({
|
|
|
1541
1545
|
/>
|
|
1542
1546
|
</UDropdownMenu>
|
|
1543
1547
|
</div>
|
|
1548
|
+
</div>
|
|
1544
1549
|
</div>
|
|
1545
|
-
</
|
|
1550
|
+
</div>
|
|
1546
1551
|
|
|
1547
1552
|
<!-- External drag hint bar -->
|
|
1548
1553
|
<Transition name="drop-hint">
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
awareness: boolean;
|
|
13
13
|
tag: "video" | "audio";
|
|
14
14
|
live: boolean;
|
|
15
|
-
total: boolean;
|
|
16
15
|
controls: boolean;
|
|
16
|
+
total: boolean;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
19
19
|
export default _default;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
awareness: boolean;
|
|
13
13
|
tag: "video" | "audio";
|
|
14
14
|
live: boolean;
|
|
15
|
-
total: boolean;
|
|
16
15
|
controls: boolean;
|
|
16
|
+
total: boolean;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
19
19
|
export default _default;
|
|
@@ -210,6 +210,7 @@ export default defineNuxtPlugin({
|
|
|
210
210
|
const debug = abraConfig.debug ?? false;
|
|
211
211
|
const configEntryDocId = abraConfig.entryDocId || void 0;
|
|
212
212
|
const pinServer = abraConfig.pinServer ?? false;
|
|
213
|
+
const deferConnect = abraConfig.deferConnect ?? false;
|
|
213
214
|
const registry = new PluginRegistry();
|
|
214
215
|
const storedDisabledBuiltins = JSON.parse(
|
|
215
216
|
localStorage.getItem(STORAGE_KEY_DISABLED_BUILTINS) ?? "[]"
|
|
@@ -1512,7 +1513,26 @@ export default defineNuxtPlugin({
|
|
|
1512
1513
|
initialUrl = currentServerUrl.value || savedServers.value[0]?.url || defaultUrl;
|
|
1513
1514
|
}
|
|
1514
1515
|
if (initialUrl !== currentServerUrl.value) currentServerUrl.value = initialUrl;
|
|
1515
|
-
|
|
1516
|
+
if (deferConnect) {
|
|
1517
|
+
_initPromise = new Promise((resolve, reject) => {
|
|
1518
|
+
let started = false;
|
|
1519
|
+
const run = () => {
|
|
1520
|
+
if (started) return;
|
|
1521
|
+
started = true;
|
|
1522
|
+
init(initialUrl).then(resolve, reject);
|
|
1523
|
+
};
|
|
1524
|
+
nuxtApp.hooks.hookOnce("app:suspense:resolve", () => {
|
|
1525
|
+
if (typeof requestIdleCallback === "function") {
|
|
1526
|
+
requestIdleCallback(run, { timeout: 2e3 });
|
|
1527
|
+
} else {
|
|
1528
|
+
setTimeout(run, 200);
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
setTimeout(run, 3e3);
|
|
1532
|
+
});
|
|
1533
|
+
} else {
|
|
1534
|
+
_initPromise = init(initialUrl);
|
|
1535
|
+
}
|
|
1516
1536
|
if (!pinServer && deepLinkServer && !savedServers.value.some((s) => s.url === deepLinkServer)) {
|
|
1517
1537
|
void addServer(deepLinkServer).catch(() => {
|
|
1518
1538
|
});
|