@abraca/nuxt 0.1.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/README.md +84 -0
- package/dist/module.d.mts +201 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +170 -0
- package/dist/runtime/components/ACollaborationUsers.d.vue.ts +11 -0
- package/dist/runtime/components/ACollaborationUsers.vue +48 -0
- package/dist/runtime/components/ACollaborationUsers.vue.d.ts +11 -0
- package/dist/runtime/components/AColorPicker.d.vue.ts +13 -0
- package/dist/runtime/components/AColorPicker.vue +71 -0
- package/dist/runtime/components/AColorPicker.vue.d.ts +13 -0
- package/dist/runtime/components/ACommandPalette.d.vue.ts +13 -0
- package/dist/runtime/components/ACommandPalette.vue +31 -0
- package/dist/runtime/components/ACommandPalette.vue.d.ts +13 -0
- package/dist/runtime/components/AConnectionStatus.d.vue.ts +13 -0
- package/dist/runtime/components/AConnectionStatus.vue +50 -0
- package/dist/runtime/components/AConnectionStatus.vue.d.ts +13 -0
- package/dist/runtime/components/ADocTypeSelect.d.vue.ts +10 -0
- package/dist/runtime/components/ADocTypeSelect.vue +34 -0
- package/dist/runtime/components/ADocTypeSelect.vue.d.ts +10 -0
- package/dist/runtime/components/ADocumentTree.d.vue.ts +53 -0
- package/dist/runtime/components/ADocumentTree.vue +350 -0
- package/dist/runtime/components/ADocumentTree.vue.d.ts +53 -0
- package/dist/runtime/components/AEditor.d.vue.ts +60 -0
- package/dist/runtime/components/AEditor.vue +174 -0
- package/dist/runtime/components/AEditor.vue.d.ts +60 -0
- package/dist/runtime/components/AFloatingWindow.d.vue.ts +24 -0
- package/dist/runtime/components/AFloatingWindow.vue +232 -0
- package/dist/runtime/components/AFloatingWindow.vue.d.ts +24 -0
- package/dist/runtime/components/AIconPicker.d.vue.ts +13 -0
- package/dist/runtime/components/AIconPicker.vue +257 -0
- package/dist/runtime/components/AIconPicker.vue.d.ts +13 -0
- package/dist/runtime/components/ANodePanel.d.vue.ts +15 -0
- package/dist/runtime/components/ANodePanel.vue +541 -0
- package/dist/runtime/components/ANodePanel.vue.d.ts +15 -0
- package/dist/runtime/components/ANotifications.d.vue.ts +7 -0
- package/dist/runtime/components/ANotifications.vue +75 -0
- package/dist/runtime/components/ANotifications.vue.d.ts +7 -0
- package/dist/runtime/components/APermissionGuard.d.vue.ts +21 -0
- package/dist/runtime/components/APermissionGuard.vue +22 -0
- package/dist/runtime/components/APermissionGuard.vue.d.ts +21 -0
- package/dist/runtime/components/APresence.d.vue.ts +43 -0
- package/dist/runtime/components/APresence.vue +36 -0
- package/dist/runtime/components/APresence.vue.d.ts +43 -0
- package/dist/runtime/components/AProvider.d.vue.ts +27 -0
- package/dist/runtime/components/AProvider.vue +42 -0
- package/dist/runtime/components/AProvider.vue.d.ts +27 -0
- package/dist/runtime/components/ARoleBadge.d.vue.ts +11 -0
- package/dist/runtime/components/ARoleBadge.vue +29 -0
- package/dist/runtime/components/ARoleBadge.vue.d.ts +11 -0
- package/dist/runtime/components/AVoiceBar.d.vue.ts +13 -0
- package/dist/runtime/components/AVoiceBar.vue +379 -0
- package/dist/runtime/components/AVoiceBar.vue.d.ts +13 -0
- package/dist/runtime/components/AVoiceTile.d.vue.ts +10 -0
- package/dist/runtime/components/AVoiceTile.vue +48 -0
- package/dist/runtime/components/AVoiceTile.vue.d.ts +10 -0
- package/dist/runtime/components/AWindowLayer.d.vue.ts +3 -0
- package/dist/runtime/components/AWindowLayer.vue +17 -0
- package/dist/runtime/components/AWindowLayer.vue.d.ts +3 -0
- package/dist/runtime/components/aware/AArea.d.vue.ts +42 -0
- package/dist/runtime/components/aware/AArea.vue +45 -0
- package/dist/runtime/components/aware/AArea.vue.d.ts +42 -0
- package/dist/runtime/components/aware/AAvatar.d.vue.ts +25 -0
- package/dist/runtime/components/aware/AAvatar.vue +86 -0
- package/dist/runtime/components/aware/AAvatar.vue.d.ts +25 -0
- package/dist/runtime/components/aware/AButton.d.vue.ts +7 -0
- package/dist/runtime/components/aware/AButton.vue +39 -0
- package/dist/runtime/components/aware/AButton.vue.d.ts +7 -0
- package/dist/runtime/components/aware/ACursorLabel.d.vue.ts +12 -0
- package/dist/runtime/components/aware/ACursorLabel.vue +44 -0
- package/dist/runtime/components/aware/ACursorLabel.vue.d.ts +12 -0
- package/dist/runtime/components/aware/ADocBadge.d.vue.ts +11 -0
- package/dist/runtime/components/aware/ADocBadge.vue +27 -0
- package/dist/runtime/components/aware/ADocBadge.vue.d.ts +11 -0
- package/dist/runtime/components/aware/AFacepile.d.vue.ts +20 -0
- package/dist/runtime/components/aware/AFacepile.vue +92 -0
- package/dist/runtime/components/aware/AFacepile.vue.d.ts +20 -0
- package/dist/runtime/components/aware/AInput.d.vue.ts +7 -0
- package/dist/runtime/components/aware/AInput.vue +44 -0
- package/dist/runtime/components/aware/AInput.vue.d.ts +7 -0
- package/dist/runtime/components/aware/ASelect.d.vue.ts +7 -0
- package/dist/runtime/components/aware/ASelect.vue +51 -0
- package/dist/runtime/components/aware/ASelect.vue.d.ts +7 -0
- package/dist/runtime/components/aware/ATextarea.d.vue.ts +7 -0
- package/dist/runtime/components/aware/ATextarea.vue +44 -0
- package/dist/runtime/components/aware/ATextarea.vue.d.ts +7 -0
- package/dist/runtime/components/aware/AUserList.d.vue.ts +17 -0
- package/dist/runtime/components/aware/AUserList.vue +72 -0
- package/dist/runtime/components/aware/AUserList.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +154 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.vue +88 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +179 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue +180 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/ATableRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/ATableRenderer.vue +191 -0
- package/dist/runtime/components/renderers/ATableRenderer.vue.d.ts +8 -0
- package/dist/runtime/composables/useAAField.d.ts +42 -0
- package/dist/runtime/composables/useAAField.js +62 -0
- package/dist/runtime/composables/useAbraLocale.d.ts +14 -0
- package/dist/runtime/composables/useAbraLocale.js +11 -0
- package/dist/runtime/composables/useAbracadabra.d.ts +11 -0
- package/dist/runtime/composables/useAbracadabra.js +3 -0
- package/dist/runtime/composables/useAbracadabraAuth.d.ts +23 -0
- package/dist/runtime/composables/useAbracadabraAuth.js +22 -0
- package/dist/runtime/composables/useAwareness.d.ts +22 -0
- package/dist/runtime/composables/useAwareness.js +48 -0
- package/dist/runtime/composables/useAwarenessPeers.d.ts +34 -0
- package/dist/runtime/composables/useAwarenessPeers.js +33 -0
- package/dist/runtime/composables/useBackgroundSync.d.ts +37 -0
- package/dist/runtime/composables/useBackgroundSync.js +73 -0
- package/dist/runtime/composables/useChat.d.ts +65 -0
- package/dist/runtime/composables/useChat.js +210 -0
- package/dist/runtime/composables/useChatUsers.d.ts +21 -0
- package/dist/runtime/composables/useChatUsers.js +39 -0
- package/dist/runtime/composables/useChildTree.d.ts +119 -0
- package/dist/runtime/composables/useChildTree.js +100 -0
- package/dist/runtime/composables/useCommandPalette.d.ts +58 -0
- package/dist/runtime/composables/useCommandPalette.js +94 -0
- package/dist/runtime/composables/useConnectionStatus.d.ts +17 -0
- package/dist/runtime/composables/useConnectionStatus.js +37 -0
- package/dist/runtime/composables/useDashboard.d.ts +3 -0
- package/dist/runtime/composables/useDashboard.js +23 -0
- package/dist/runtime/composables/useDocExport.d.ts +5 -0
- package/dist/runtime/composables/useDocExport.js +256 -0
- package/dist/runtime/composables/useDocImport.d.ts +10 -0
- package/dist/runtime/composables/useDocImport.js +227 -0
- package/dist/runtime/composables/useDocJump.d.ts +29 -0
- package/dist/runtime/composables/useDocJump.js +17 -0
- package/dist/runtime/composables/useDocumentPermissions.d.ts +20 -0
- package/dist/runtime/composables/useDocumentPermissions.js +33 -0
- package/dist/runtime/composables/useEditor.d.ts +45 -0
- package/dist/runtime/composables/useEditor.js +121 -0
- package/dist/runtime/composables/useEditorDragHandle.d.ts +26 -0
- package/dist/runtime/composables/useEditorDragHandle.js +219 -0
- package/dist/runtime/composables/useEditorMentions.d.ts +28 -0
- package/dist/runtime/composables/useEditorMentions.js +40 -0
- package/dist/runtime/composables/useEditorSuggestions.d.ts +18 -0
- package/dist/runtime/composables/useEditorSuggestions.js +45 -0
- package/dist/runtime/composables/useEditorToolbar.d.ts +22 -0
- package/dist/runtime/composables/useEditorToolbar.js +60 -0
- package/dist/runtime/composables/useFileBlobStore.d.ts +15 -0
- package/dist/runtime/composables/useFileBlobStore.js +22 -0
- package/dist/runtime/composables/useFileIndex.d.ts +20 -0
- package/dist/runtime/composables/useFileIndex.js +69 -0
- package/dist/runtime/composables/useFollowUser.d.ts +5 -0
- package/dist/runtime/composables/useFollowUser.js +40 -0
- package/dist/runtime/composables/useNotifications.d.ts +82 -0
- package/dist/runtime/composables/useNotifications.js +171 -0
- package/dist/runtime/composables/useOfflineUploadQueue.d.ts +90 -0
- package/dist/runtime/composables/useOfflineUploadQueue.js +33 -0
- package/dist/runtime/composables/usePasskeyAccounts.d.ts +32 -0
- package/dist/runtime/composables/usePasskeyAccounts.js +46 -0
- package/dist/runtime/composables/usePluginRegistry.d.ts +6 -0
- package/dist/runtime/composables/usePluginRegistry.js +3 -0
- package/dist/runtime/composables/useRendererBase.d.ts +186 -0
- package/dist/runtime/composables/useRendererBase.js +46 -0
- package/dist/runtime/composables/useSearchIndex.d.ts +20 -0
- package/dist/runtime/composables/useSearchIndex.js +104 -0
- package/dist/runtime/composables/useTrash.d.ts +50 -0
- package/dist/runtime/composables/useTrash.js +127 -0
- package/dist/runtime/composables/useVoice.d.ts +51 -0
- package/dist/runtime/composables/useVoice.js +220 -0
- package/dist/runtime/composables/useWindowManager.d.ts +122 -0
- package/dist/runtime/composables/useWindowManager.js +141 -0
- package/dist/runtime/composables/useYDoc.d.ts +142 -0
- package/dist/runtime/composables/useYDoc.js +172 -0
- package/dist/runtime/extensions/accordion.d.ts +3 -0
- package/dist/runtime/extensions/accordion.js +49 -0
- package/dist/runtime/extensions/badge.d.ts +2 -0
- package/dist/runtime/extensions/badge.js +39 -0
- package/dist/runtime/extensions/callout.d.ts +2 -0
- package/dist/runtime/extensions/callout.js +28 -0
- package/dist/runtime/extensions/card.d.ts +3 -0
- package/dist/runtime/extensions/card.js +53 -0
- package/dist/runtime/extensions/code-collapse.d.ts +2 -0
- package/dist/runtime/extensions/code-collapse.js +32 -0
- package/dist/runtime/extensions/code-group.d.ts +2 -0
- package/dist/runtime/extensions/code-group.js +17 -0
- package/dist/runtime/extensions/collapsible.d.ts +2 -0
- package/dist/runtime/extensions/collapsible.js +35 -0
- package/dist/runtime/extensions/document-header.d.ts +11 -0
- package/dist/runtime/extensions/document-header.js +82 -0
- package/dist/runtime/extensions/document-meta.d.ts +20 -0
- package/dist/runtime/extensions/document-meta.js +121 -0
- package/dist/runtime/extensions/document.d.ts +6 -0
- package/dist/runtime/extensions/document.js +6 -0
- package/dist/runtime/extensions/file-block.d.ts +15 -0
- package/dist/runtime/extensions/file-block.js +34 -0
- package/dist/runtime/extensions/file-drop.d.ts +6 -0
- package/dist/runtime/extensions/file-drop.js +65 -0
- package/dist/runtime/extensions/kbd.d.ts +2 -0
- package/dist/runtime/extensions/kbd.js +33 -0
- package/dist/runtime/extensions/prose-icon.d.ts +2 -0
- package/dist/runtime/extensions/prose-icon.js +33 -0
- package/dist/runtime/extensions/search-highlight.d.ts +10 -0
- package/dist/runtime/extensions/search-highlight.js +129 -0
- package/dist/runtime/extensions/steps.d.ts +2 -0
- package/dist/runtime/extensions/steps.js +32 -0
- package/dist/runtime/extensions/tabs.d.ts +3 -0
- package/dist/runtime/extensions/tabs.js +49 -0
- package/dist/runtime/extensions/views/AccordionItemView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/AccordionItemView.vue +41 -0
- package/dist/runtime/extensions/views/AccordionItemView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/AccordionView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/AccordionView.vue +22 -0
- package/dist/runtime/extensions/views/AccordionView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/BadgeView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/BadgeView.vue +23 -0
- package/dist/runtime/extensions/views/BadgeView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CalloutView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CalloutView.vue +43 -0
- package/dist/runtime/extensions/views/CalloutView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CardGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CardGroupView.vue +22 -0
- package/dist/runtime/extensions/views/CardGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CardView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CardView.vue +28 -0
- package/dist/runtime/extensions/views/CardView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CodeCollapseView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodeCollapseView.vue +45 -0
- package/dist/runtime/extensions/views/CodeCollapseView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CodeGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue +53 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CollapsibleView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CollapsibleView.vue +42 -0
- package/dist/runtime/extensions/views/CollapsibleView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.vue +140 -0
- package/dist/runtime/extensions/views/FileNodeView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/KbdView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/KbdView.vue +23 -0
- package/dist/runtime/extensions/views/KbdView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/ProseIconView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/ProseIconView.vue +23 -0
- package/dist/runtime/extensions/views/ProseIconView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/StepsView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/StepsView.vue +32 -0
- package/dist/runtime/extensions/views/StepsView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/TabsItemView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/TabsItemView.vue +22 -0
- package/dist/runtime/extensions/views/TabsItemView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/TabsView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/TabsView.vue +56 -0
- package/dist/runtime/extensions/views/TabsView.vue.d.ts +4 -0
- package/dist/runtime/locale.d.ts +134 -0
- package/dist/runtime/locale.js +119 -0
- package/dist/runtime/middleware/abracadabra-auth.d.ts +11 -0
- package/dist/runtime/middleware/abracadabra-auth.js +9 -0
- package/dist/runtime/plugin-abracadabra.client.d.ts +7 -0
- package/dist/runtime/plugin-abracadabra.client.js +898 -0
- package/dist/runtime/plugin-abracadabra.server.d.ts +2 -0
- package/dist/runtime/plugin-abracadabra.server.js +71 -0
- package/dist/runtime/plugin-registry.d.ts +34 -0
- package/dist/runtime/plugin-registry.js +83 -0
- package/dist/runtime/plugin-shared-globals.client.d.ts +2 -0
- package/dist/runtime/plugin-shared-globals.client.js +20 -0
- package/dist/runtime/plugins/core.plugin.d.ts +12 -0
- package/dist/runtime/plugins/core.plugin.js +179 -0
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.d.ts +18 -0
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.js +51 -0
- package/dist/runtime/server/api/_abracadabra/spaces.get.d.ts +11 -0
- package/dist/runtime/server/api/_abracadabra/spaces.get.js +16 -0
- package/dist/runtime/server/plugins/abracadabra-service.d.ts +2 -0
- package/dist/runtime/server/plugins/abracadabra-service.js +116 -0
- package/dist/runtime/server/runners/doc-tree-cache.d.ts +11 -0
- package/dist/runtime/server/runners/doc-tree-cache.js +65 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/docCache.d.ts +25 -0
- package/dist/runtime/server/utils/docCache.js +131 -0
- package/dist/runtime/server/utils/serverRunner.d.ts +28 -0
- package/dist/runtime/server/utils/serverRunner.js +58 -0
- package/dist/runtime/types.d.ts +444 -0
- package/dist/runtime/types.js +93 -0
- package/dist/runtime/utils/VoiceClient.d.ts +94 -0
- package/dist/runtime/utils/VoiceClient.js +599 -0
- package/dist/runtime/utils/avatarStyle.d.ts +15 -0
- package/dist/runtime/utils/avatarStyle.js +20 -0
- package/dist/runtime/utils/colorPalettes.d.ts +13 -0
- package/dist/runtime/utils/colorPalettes.js +49 -0
- package/dist/runtime/utils/docTypes.d.ts +129 -0
- package/dist/runtime/utils/docTypes.js +116 -0
- package/dist/runtime/utils/markdownToYjs.d.ts +23 -0
- package/dist/runtime/utils/markdownToYjs.js +440 -0
- package/dist/runtime/utils/metaFieldDefinitions.d.ts +7 -0
- package/dist/runtime/utils/metaFieldDefinitions.js +182 -0
- package/dist/runtime/utils/voiceErrors.d.ts +33 -0
- package/dist/runtime/utils/voiceErrors.js +54 -0
- package/dist/runtime/utils/yjsConvert.d.ts +14 -0
- package/dist/runtime/utils/yjsConvert.js +331 -0
- package/dist/types.d.mts +13 -0
- package/package.json +100 -0
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Get your module up and running quickly.
|
|
3
|
+
|
|
4
|
+
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
+
- Name: My Module
|
|
6
|
+
- Package name: my-module
|
|
7
|
+
- Description: My new Nuxt module
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# My Module
|
|
11
|
+
|
|
12
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
+
[![License][license-src]][license-href]
|
|
15
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
+
|
|
17
|
+
My new Nuxt module for doing amazing things.
|
|
18
|
+
|
|
19
|
+
- [✨ Release Notes](/CHANGELOG.md)
|
|
20
|
+
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
|
|
21
|
+
<!-- - [📖 Documentation](https://example.com) -->
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
<!-- Highlight some of the features your module provide here -->
|
|
26
|
+
- ⛰ Foo
|
|
27
|
+
- 🚠 Bar
|
|
28
|
+
- 🌲 Baz
|
|
29
|
+
|
|
30
|
+
## Quick Setup
|
|
31
|
+
|
|
32
|
+
Install the module to your Nuxt application with one command:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx nuxt module add my-module
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That's it! You can now use My Module in your Nuxt app ✨
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Contribution
|
|
42
|
+
|
|
43
|
+
<details>
|
|
44
|
+
<summary>Local development</summary>
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Install dependencies
|
|
48
|
+
npm install
|
|
49
|
+
|
|
50
|
+
# Generate type stubs
|
|
51
|
+
npm run dev:prepare
|
|
52
|
+
|
|
53
|
+
# Develop with the playground
|
|
54
|
+
npm run dev
|
|
55
|
+
|
|
56
|
+
# Build the playground
|
|
57
|
+
npm run dev:build
|
|
58
|
+
|
|
59
|
+
# Run ESLint
|
|
60
|
+
npm run lint
|
|
61
|
+
|
|
62
|
+
# Run Vitest
|
|
63
|
+
npm run test
|
|
64
|
+
npm run test:watch
|
|
65
|
+
|
|
66
|
+
# Release new version
|
|
67
|
+
npm run release
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
</details>
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<!-- Badges -->
|
|
74
|
+
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
75
|
+
[npm-version-href]: https://npmjs.com/package/my-module
|
|
76
|
+
|
|
77
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
|
78
|
+
[npm-downloads-href]: https://npm.chart.dev/my-module
|
|
79
|
+
|
|
80
|
+
[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
|
81
|
+
[license-href]: https://npmjs.com/package/my-module
|
|
82
|
+
|
|
83
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
|
|
84
|
+
[nuxt-href]: https://nuxt.com
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import * as __runtime_types from '../dist/runtime/types.js';
|
|
3
|
+
export { AbracadabraPlugin, AbracadabraState, CachedTreeNode, DocCacheAPI, DocPageMeta, RunnerCleanup, ServerRunnerContext, ServerRunnerDefinition, TreeEntry, UserMetaField } from '../dist/runtime/types.js';
|
|
4
|
+
import { AbracadabraLocale } from '../dist/runtime/locale.js';
|
|
5
|
+
export { AbracadabraLocale } from '../dist/runtime/locale.js';
|
|
6
|
+
export { avatarBorderStyle, avatarGradient, avatarStyleFromName } from '../dist/runtime/utils/avatarStyle.js';
|
|
7
|
+
export { COLOR_PALETTES, ColorPalette, ColorShade, findPaletteByHex } from '../dist/runtime/utils/colorPalettes.js';
|
|
8
|
+
export { META_FIELD_DEFINITIONS, MetaFieldDefinition } from '../dist/runtime/utils/metaFieldDefinitions.js';
|
|
9
|
+
|
|
10
|
+
declare module '#app' {
|
|
11
|
+
interface NuxtApp {
|
|
12
|
+
$abracadabra: __runtime_types.AbracadabraState;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
declare module '@nuxt/schema' {
|
|
16
|
+
interface PublicRuntimeConfig {
|
|
17
|
+
abracadabra: {
|
|
18
|
+
url: string;
|
|
19
|
+
entryDocId: string;
|
|
20
|
+
persistAuth: boolean;
|
|
21
|
+
authStorageKey: string;
|
|
22
|
+
disabledBuiltins: string[];
|
|
23
|
+
features: {
|
|
24
|
+
editor?: boolean;
|
|
25
|
+
search?: boolean;
|
|
26
|
+
backgroundSync?: boolean;
|
|
27
|
+
renderers?: boolean;
|
|
28
|
+
serverCache?: boolean;
|
|
29
|
+
};
|
|
30
|
+
locale: AbracadabraLocale;
|
|
31
|
+
auth: {
|
|
32
|
+
middleware?: boolean;
|
|
33
|
+
globalMiddleware?: boolean;
|
|
34
|
+
loginPath?: string;
|
|
35
|
+
};
|
|
36
|
+
server: {
|
|
37
|
+
render?: boolean;
|
|
38
|
+
cacheMaxAge?: number;
|
|
39
|
+
};
|
|
40
|
+
debug: boolean;
|
|
41
|
+
docBasePath: string;
|
|
42
|
+
guestName: {
|
|
43
|
+
adjectives: string[];
|
|
44
|
+
nouns: string[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface RuntimeConfig {
|
|
49
|
+
abracadabra: {
|
|
50
|
+
servicePublicKey: string;
|
|
51
|
+
servicePrivateKey: string;
|
|
52
|
+
serviceRootDocId: string;
|
|
53
|
+
serviceDisabled: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
interface ModuleOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Abracadabra server base URL (http/https).
|
|
60
|
+
* Can be overridden at runtime via NUXT_PUBLIC_ABRACADABRA_URL.
|
|
61
|
+
*/
|
|
62
|
+
url?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Root document ID to connect to on boot.
|
|
65
|
+
* When set, skips server-info / spaces discovery and connects directly.
|
|
66
|
+
* Useful when your server uses spaces and you know the hub or space doc ID.
|
|
67
|
+
* Can be overridden at runtime via NUXT_PUBLIC_ABRACADABRA_ENTRY_DOC_ID.
|
|
68
|
+
*
|
|
69
|
+
* Discovery priority (first non-empty wins):
|
|
70
|
+
* entryDocId > hubDocId (from /spaces/hub) > first space > server index_doc_id
|
|
71
|
+
*/
|
|
72
|
+
entryDocId?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Whether to persist the JWT token across page reloads via localStorage.
|
|
75
|
+
* Default: true.
|
|
76
|
+
*/
|
|
77
|
+
persistAuth?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* localStorage key used by AbracadabraClient for token persistence.
|
|
80
|
+
* Default: 'abracadabra:auth'
|
|
81
|
+
*/
|
|
82
|
+
authStorageKey?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Built-in plugin names to disable at module level.
|
|
85
|
+
* Users can also disable via localStorage 'abracadabra_disabled_builtins'.
|
|
86
|
+
* Example: ['core'] to ship with no default TipTap extensions.
|
|
87
|
+
*/
|
|
88
|
+
disabledBuiltins?: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Feature flags — each controls whether optional feature code is included.
|
|
91
|
+
*/
|
|
92
|
+
features?: {
|
|
93
|
+
/** Include TipTap collaboration editor. Default: true. */
|
|
94
|
+
editor?: boolean;
|
|
95
|
+
/** Include SearchIndex (trigram full-text search). Default: true. */
|
|
96
|
+
search?: boolean;
|
|
97
|
+
/** Include BackgroundSyncManager for offline background sync. Default: true. */
|
|
98
|
+
backgroundSync?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Register built-in page type renderers (Kanban, Table, Calendar, Gallery, Outline).
|
|
101
|
+
* Disable for apps that only need the sync layer and bring their own renderers.
|
|
102
|
+
* Default: true.
|
|
103
|
+
*/
|
|
104
|
+
renderers?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Register the built-in doc-tree-cache server runner.
|
|
107
|
+
* Keeps all documents pre-rendered in Nitro storage for instant SSR.
|
|
108
|
+
* Requires service.publicKey + service.privateKey to be configured.
|
|
109
|
+
* Default: true.
|
|
110
|
+
*/
|
|
111
|
+
serverCache?: boolean;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Automatically add Vite resolve.dedupe entries for ProseMirror, TipTap, and Yjs.
|
|
115
|
+
* Prevents duplicate module instances from breaking the editor.
|
|
116
|
+
* Default: true.
|
|
117
|
+
*/
|
|
118
|
+
addViteDedupe?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Prefix applied to auto-imported components.
|
|
121
|
+
* Default: '' (no prefix — AEditor, AProvider, etc.)
|
|
122
|
+
*/
|
|
123
|
+
prefix?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Module-wide locale overrides. Merged with English defaults.
|
|
126
|
+
* Any subset can be overridden; unset keys fall back to English.
|
|
127
|
+
*
|
|
128
|
+
* Example:
|
|
129
|
+
* abracadabra: { locale: { documentTree: { newDocument: 'Nuevo documento' } } }
|
|
130
|
+
*/
|
|
131
|
+
locale?: Partial<AbracadabraLocale>;
|
|
132
|
+
/**
|
|
133
|
+
* Auth middleware configuration.
|
|
134
|
+
*/
|
|
135
|
+
auth?: {
|
|
136
|
+
/** Register the abracadabra-auth route middleware. Default: false. */
|
|
137
|
+
middleware?: boolean;
|
|
138
|
+
/** Apply the middleware globally to all routes. Default: false. */
|
|
139
|
+
globalMiddleware?: boolean;
|
|
140
|
+
/** Path to redirect unauthenticated users. Default: '/login'. */
|
|
141
|
+
loginPath?: string;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* SSR API route configuration.
|
|
145
|
+
*/
|
|
146
|
+
server?: {
|
|
147
|
+
/** Register /api/_abracadabra/* render routes. Default: true. */
|
|
148
|
+
render?: boolean;
|
|
149
|
+
/** Cache max-age in seconds for SSR routes. Default: 60. */
|
|
150
|
+
cacheMaxAge?: number;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Enable structured debug logging at boot and on connection events.
|
|
154
|
+
* Default: false.
|
|
155
|
+
*/
|
|
156
|
+
debug?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Base path for document routes. Used when navigating to a doc (e.g. after
|
|
159
|
+
* import, from the command palette, or when following a user).
|
|
160
|
+
* Default: '/doc' → /doc/{docId}
|
|
161
|
+
*
|
|
162
|
+
* Override to match your app's route structure:
|
|
163
|
+
* docBasePath: '/documents' → /documents/{docId}
|
|
164
|
+
* docBasePath: '' → /{docId}
|
|
165
|
+
*/
|
|
166
|
+
docBasePath?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Word lists for generating random guest display names.
|
|
169
|
+
* Defaults to a fantasy-theme set ('Swift-Wizard', 'Bright-Mage', etc.).
|
|
170
|
+
* Supply your own to match your app's tone.
|
|
171
|
+
*/
|
|
172
|
+
guestName?: {
|
|
173
|
+
adjectives?: string[];
|
|
174
|
+
nouns?: string[];
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Service-role provider configuration for server-side background runners.
|
|
178
|
+
* When publicKey + privateKey are set, a Nitro plugin connects to the
|
|
179
|
+
* Abracadabra server with service credentials and boots registered runners.
|
|
180
|
+
*
|
|
181
|
+
* Keys can alternatively be set via environment variables:
|
|
182
|
+
* NUXT_ABRACADABRA_SERVICE_PUBLIC_KEY
|
|
183
|
+
* NUXT_ABRACADABRA_SERVICE_PRIVATE_KEY
|
|
184
|
+
*
|
|
185
|
+
* IMPORTANT: Never expose privateKey in public runtime config.
|
|
186
|
+
*/
|
|
187
|
+
service?: {
|
|
188
|
+
/** Ed25519 public key (base64url) for service-role authentication. */
|
|
189
|
+
publicKey?: string;
|
|
190
|
+
/** Ed25519 private key (base64url). Stored in private runtime config only. */
|
|
191
|
+
privateKey?: string;
|
|
192
|
+
/** Root document ID to connect to. Defaults to the server's index_doc_id. */
|
|
193
|
+
rootDocId?: string;
|
|
194
|
+
/** Disable the service provider even if keys are present. Default: false. */
|
|
195
|
+
disabled?: boolean;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
199
|
+
|
|
200
|
+
export { _default as default };
|
|
201
|
+
export type { ModuleOptions };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addComponentsDir, addServerHandler, addRouteMiddleware, addServerPlugin, addServerImportsDir } from '@nuxt/kit';
|
|
2
|
+
import { defu } from 'defu';
|
|
3
|
+
export { avatarBorderStyle, avatarGradient, avatarStyleFromName } from '../dist/runtime/utils/avatarStyle.js';
|
|
4
|
+
export { COLOR_PALETTES, findPaletteByHex } from '../dist/runtime/utils/colorPalettes.js';
|
|
5
|
+
export { META_FIELD_DEFINITIONS } from '../dist/runtime/utils/metaFieldDefinitions.js';
|
|
6
|
+
|
|
7
|
+
const module$1 = defineNuxtModule({
|
|
8
|
+
meta: {
|
|
9
|
+
name: "abracadabra-nuxt",
|
|
10
|
+
configKey: "abracadabra",
|
|
11
|
+
compatibility: { nuxt: ">=4.0.0" }
|
|
12
|
+
},
|
|
13
|
+
defaults: {
|
|
14
|
+
url: process.env.ABRACADABRA_URL ?? "https://abra.cou.sh",
|
|
15
|
+
persistAuth: true,
|
|
16
|
+
authStorageKey: "abracadabra:auth",
|
|
17
|
+
disabledBuiltins: [],
|
|
18
|
+
features: {
|
|
19
|
+
editor: true,
|
|
20
|
+
search: true,
|
|
21
|
+
backgroundSync: true,
|
|
22
|
+
renderers: true,
|
|
23
|
+
serverCache: true
|
|
24
|
+
},
|
|
25
|
+
addViteDedupe: true,
|
|
26
|
+
prefix: "",
|
|
27
|
+
locale: {},
|
|
28
|
+
auth: {
|
|
29
|
+
middleware: false,
|
|
30
|
+
globalMiddleware: false,
|
|
31
|
+
loginPath: "/login"
|
|
32
|
+
},
|
|
33
|
+
server: {
|
|
34
|
+
render: true,
|
|
35
|
+
cacheMaxAge: 60
|
|
36
|
+
},
|
|
37
|
+
debug: false,
|
|
38
|
+
docBasePath: "/doc",
|
|
39
|
+
guestName: {},
|
|
40
|
+
service: {
|
|
41
|
+
disabled: false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
setup(options, nuxt) {
|
|
45
|
+
const resolver = createResolver(import.meta.url);
|
|
46
|
+
nuxt.options.runtimeConfig.public = defu(
|
|
47
|
+
nuxt.options.runtimeConfig.public,
|
|
48
|
+
{
|
|
49
|
+
abracadabra: {
|
|
50
|
+
url: options.url,
|
|
51
|
+
entryDocId: options.entryDocId ?? "",
|
|
52
|
+
persistAuth: options.persistAuth,
|
|
53
|
+
authStorageKey: options.authStorageKey,
|
|
54
|
+
disabledBuiltins: options.disabledBuiltins,
|
|
55
|
+
features: options.features,
|
|
56
|
+
locale: options.locale ?? {},
|
|
57
|
+
auth: options.auth ?? {},
|
|
58
|
+
server: options.server ?? {},
|
|
59
|
+
debug: options.debug ?? false,
|
|
60
|
+
docBasePath: options.docBasePath ?? "/doc",
|
|
61
|
+
guestName: {
|
|
62
|
+
adjectives: options.guestName?.adjectives ?? [],
|
|
63
|
+
nouns: options.guestName?.nouns ?? []
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
nuxt.options.runtimeConfig = defu(nuxt.options.runtimeConfig, {
|
|
69
|
+
abracadabra: {
|
|
70
|
+
servicePublicKey: options.service?.publicKey ?? "",
|
|
71
|
+
servicePrivateKey: options.service?.privateKey ?? "",
|
|
72
|
+
serviceRootDocId: options.service?.rootDocId ?? "",
|
|
73
|
+
serviceDisabled: options.service?.disabled ?? false
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
if (options.addViteDedupe) {
|
|
77
|
+
const dedupePackages = [
|
|
78
|
+
"prosemirror-view",
|
|
79
|
+
"prosemirror-state",
|
|
80
|
+
"prosemirror-model",
|
|
81
|
+
"prosemirror-transform",
|
|
82
|
+
"prosemirror-schema-list",
|
|
83
|
+
"prosemirror-keymap",
|
|
84
|
+
"prosemirror-inputrules",
|
|
85
|
+
"prosemirror-history",
|
|
86
|
+
"prosemirror-gapcursor",
|
|
87
|
+
"yjs",
|
|
88
|
+
"@tiptap/core",
|
|
89
|
+
"@tiptap/pm",
|
|
90
|
+
"@tiptap/vue-3"
|
|
91
|
+
];
|
|
92
|
+
nuxt.options.vite = defu(nuxt.options.vite, { resolve: { dedupe: [] } });
|
|
93
|
+
const existing = nuxt.options.vite.resolve?.dedupe ?? [];
|
|
94
|
+
nuxt.options.vite.resolve = defu(nuxt.options.vite.resolve, { dedupe: [] });
|
|
95
|
+
nuxt.options.vite.resolve.dedupe = [
|
|
96
|
+
.../* @__PURE__ */ new Set([...existing, ...dedupePackages])
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
nuxt.options.vite.optimizeDeps = defu(nuxt.options.vite.optimizeDeps, { include: [] });
|
|
100
|
+
const includeList = nuxt.options.vite.optimizeDeps.include ?? [];
|
|
101
|
+
const prosemirrorDeps = [
|
|
102
|
+
"prosemirror-view",
|
|
103
|
+
"prosemirror-state",
|
|
104
|
+
"prosemirror-model",
|
|
105
|
+
"prosemirror-transform",
|
|
106
|
+
"prosemirror-tables",
|
|
107
|
+
"@tiptap/extension-table",
|
|
108
|
+
"@tiptap/extension-table-row",
|
|
109
|
+
"@tiptap/extension-table-header",
|
|
110
|
+
"@tiptap/extension-table-cell",
|
|
111
|
+
"nanoevents"
|
|
112
|
+
];
|
|
113
|
+
nuxt.options.vite.optimizeDeps.include = [
|
|
114
|
+
.../* @__PURE__ */ new Set([...includeList, ...prosemirrorDeps])
|
|
115
|
+
];
|
|
116
|
+
addPlugin({
|
|
117
|
+
src: resolver.resolve("./runtime/plugin-abracadabra.server"),
|
|
118
|
+
mode: "server"
|
|
119
|
+
});
|
|
120
|
+
addPlugin({
|
|
121
|
+
src: resolver.resolve("./runtime/plugin-shared-globals.client"),
|
|
122
|
+
mode: "client"
|
|
123
|
+
});
|
|
124
|
+
addPlugin({
|
|
125
|
+
src: resolver.resolve("./runtime/plugin-abracadabra.client"),
|
|
126
|
+
mode: "client"
|
|
127
|
+
});
|
|
128
|
+
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
129
|
+
addComponentsDir({
|
|
130
|
+
path: resolver.resolve("./runtime/components/aware"),
|
|
131
|
+
prefix: options.prefix ?? "",
|
|
132
|
+
pathPrefix: false
|
|
133
|
+
});
|
|
134
|
+
if (options.features?.renderers !== false) {
|
|
135
|
+
addComponentsDir({
|
|
136
|
+
path: resolver.resolve("./runtime/components/renderers"),
|
|
137
|
+
prefix: options.prefix ?? "",
|
|
138
|
+
pathPrefix: false
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
addComponentsDir({
|
|
142
|
+
path: resolver.resolve("./runtime/components"),
|
|
143
|
+
prefix: options.prefix ?? ""
|
|
144
|
+
});
|
|
145
|
+
if (options.server?.render !== false) {
|
|
146
|
+
addServerHandler({
|
|
147
|
+
route: "/api/_abracadabra/render/:docId",
|
|
148
|
+
handler: resolver.resolve("./runtime/server/api/_abracadabra/render/[docId].get")
|
|
149
|
+
});
|
|
150
|
+
addServerHandler({
|
|
151
|
+
route: "/api/_abracadabra/spaces",
|
|
152
|
+
handler: resolver.resolve("./runtime/server/api/_abracadabra/spaces.get")
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (options.auth?.middleware) {
|
|
156
|
+
addRouteMiddleware({
|
|
157
|
+
name: "abracadabra-auth",
|
|
158
|
+
path: resolver.resolve("./runtime/middleware/abracadabra-auth"),
|
|
159
|
+
global: options.auth.globalMiddleware ?? false
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
addServerPlugin(resolver.resolve("./runtime/server/plugins/abracadabra-service"));
|
|
163
|
+
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
164
|
+
nuxt.hook("prepare:types", ({ tsConfig }) => {
|
|
165
|
+
tsConfig.include = tsConfig.include ?? [];
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
provider?: any;
|
|
3
|
+
max?: number;
|
|
4
|
+
size?: 'xs' | 'sm' | 'md';
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
size: "xs" | "sm" | "md";
|
|
8
|
+
max: number;
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, shallowRef, watch } from "vue";
|
|
3
|
+
import { useAwarenessOf } from "../composables/useYDoc";
|
|
4
|
+
import { avatarBorderStyle } from "../utils/avatarStyle";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
provider: { type: null, required: false },
|
|
7
|
+
max: { type: Number, required: false, default: 5 },
|
|
8
|
+
size: { type: String, required: false, default: "xs" }
|
|
9
|
+
});
|
|
10
|
+
const providerRef = shallowRef(null);
|
|
11
|
+
watch(() => props.provider, (p) => {
|
|
12
|
+
providerRef.value = p;
|
|
13
|
+
}, { immediate: true });
|
|
14
|
+
const { states } = useAwarenessOf(providerRef);
|
|
15
|
+
const visibleUsers = computed(() => states.value.slice(0, props.max));
|
|
16
|
+
const overflow = computed(() => Math.max(0, states.value.length - props.max));
|
|
17
|
+
const avatarSize = {
|
|
18
|
+
xs: "size-6",
|
|
19
|
+
sm: "size-8",
|
|
20
|
+
md: "size-10"
|
|
21
|
+
};
|
|
22
|
+
const appConfig = useAppConfig();
|
|
23
|
+
const neutral = computed(() => appConfig.ui?.colors?.neutral ?? "zinc");
|
|
24
|
+
function userStyle(color) {
|
|
25
|
+
if (!color) return "";
|
|
26
|
+
return avatarBorderStyle(color, neutral.value);
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="flex items-center gap-0.5">
|
|
32
|
+
<UTooltip
|
|
33
|
+
v-for="u in visibleUsers"
|
|
34
|
+
:key="u.clientId"
|
|
35
|
+
:text="u.user?.name || 'Anonymous'"
|
|
36
|
+
>
|
|
37
|
+
<UAvatar
|
|
38
|
+
:alt="u.user?.name || 'Anonymous'"
|
|
39
|
+
:class="avatarSize[size]"
|
|
40
|
+
:style="userStyle(u.user?.color)"
|
|
41
|
+
/>
|
|
42
|
+
</UTooltip>
|
|
43
|
+
<span
|
|
44
|
+
v-if="overflow > 0"
|
|
45
|
+
class="text-xs text-muted px-1"
|
|
46
|
+
>+{{ overflow }}</span>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
provider?: any;
|
|
3
|
+
max?: number;
|
|
4
|
+
size?: 'xs' | 'sm' | 'md';
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
size: "xs" | "sm" | "md";
|
|
8
|
+
max: number;
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
labels?: Partial<AbracadabraLocale['colorPicker']>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { COLOR_PALETTES, findPaletteByHex } from "../utils/colorPalettes";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
modelValue: { type: String, required: false },
|
|
5
|
+
placeholder: { type: String, required: false },
|
|
6
|
+
labels: { type: Object, required: false }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
9
|
+
const locale = computed(() => useAbraLocale("colorPicker", props.labels));
|
|
10
|
+
const open = ref(false);
|
|
11
|
+
const swatches = computed(() => COLOR_PALETTES.map((p) => ({
|
|
12
|
+
name: p.name,
|
|
13
|
+
hex: p.shades.find((s) => s.shade === 400)?.hex ?? p.shades[Math.floor(p.shades.length / 2)].hex
|
|
14
|
+
})));
|
|
15
|
+
const currentMatch = computed(() => props.modelValue ? findPaletteByHex(props.modelValue) : null);
|
|
16
|
+
function select(hex) {
|
|
17
|
+
if (props.modelValue === hex) {
|
|
18
|
+
emit("update:modelValue", void 0);
|
|
19
|
+
} else {
|
|
20
|
+
emit("update:modelValue", hex);
|
|
21
|
+
}
|
|
22
|
+
open.value = false;
|
|
23
|
+
}
|
|
24
|
+
function clear() {
|
|
25
|
+
emit("update:modelValue", void 0);
|
|
26
|
+
open.value = false;
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<UPopover v-model:open="open">
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
class="flex items-center gap-2 h-8 px-2 rounded-md border border-default hover:bg-elevated/60 transition-colors text-sm"
|
|
35
|
+
>
|
|
36
|
+
<span
|
|
37
|
+
class="size-4 rounded-full shrink-0 border border-default/40"
|
|
38
|
+
:style="modelValue ? `background: ${modelValue}` : 'background: var(--ui-color-neutral-200)'"
|
|
39
|
+
/>
|
|
40
|
+
<span class="text-xs text-muted truncate">
|
|
41
|
+
{{ modelValue ?? placeholder ?? locale.none }}
|
|
42
|
+
</span>
|
|
43
|
+
</button>
|
|
44
|
+
|
|
45
|
+
<template #content>
|
|
46
|
+
<div class="p-2 w-56">
|
|
47
|
+
<!-- Swatch grid -->
|
|
48
|
+
<div class="grid grid-cols-9 gap-1 mb-2">
|
|
49
|
+
<button
|
|
50
|
+
v-for="swatch in swatches"
|
|
51
|
+
:key="swatch.name"
|
|
52
|
+
type="button"
|
|
53
|
+
class="size-5 rounded-full border-2 transition-transform hover:scale-110 focus:outline-none"
|
|
54
|
+
:style="`background: ${swatch.hex}`"
|
|
55
|
+
:class="modelValue === swatch.hex ? 'border-default ring-2 ring-primary ring-offset-1' : 'border-transparent'"
|
|
56
|
+
:title="swatch.name"
|
|
57
|
+
@click="select(swatch.hex)"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
<!-- Clear -->
|
|
61
|
+
<button
|
|
62
|
+
type="button"
|
|
63
|
+
class="w-full text-xs text-muted hover:text-default text-left px-1 py-0.5 rounded hover:bg-elevated/60 transition-colors"
|
|
64
|
+
@click="clear"
|
|
65
|
+
>
|
|
66
|
+
{{ locale.none }}
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
</UPopover>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
labels?: Partial<AbracadabraLocale['colorPicker']>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
labels?: Partial<AbracadabraLocale['commandPalette']>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:open": (value: boolean) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|