@abraca/nuxt 1.8.2 → 1.9.1

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.
Files changed (54) hide show
  1. package/README.md +27 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +42 -4
  4. package/dist/runtime/components/docs/ADocsNavigation.d.vue.ts +155 -0
  5. package/dist/runtime/components/docs/ADocsNavigation.vue +154 -0
  6. package/dist/runtime/components/docs/ADocsNavigation.vue.d.ts +155 -0
  7. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +249 -0
  8. package/dist/runtime/components/docs/ADocsSearch.vue +187 -0
  9. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +249 -0
  10. package/dist/runtime/components/docs/ADocsSearchButton.d.vue.ts +253 -0
  11. package/dist/runtime/components/docs/ADocsSearchButton.vue +99 -0
  12. package/dist/runtime/components/docs/ADocsSearchButton.vue.d.ts +253 -0
  13. package/dist/runtime/components/docs/ADocsSurround.d.vue.ts +56 -0
  14. package/dist/runtime/components/docs/ADocsSurround.vue +68 -0
  15. package/dist/runtime/components/docs/ADocsSurround.vue.d.ts +56 -0
  16. package/dist/runtime/components/docs/ADocsToc.d.vue.ts +117 -0
  17. package/dist/runtime/components/docs/ADocsToc.vue +194 -0
  18. package/dist/runtime/components/docs/ADocsToc.vue.d.ts +117 -0
  19. package/dist/runtime/components/editor/ADocLinkPopover.vue +1 -5
  20. package/dist/runtime/components/renderers/AMediaRenderer.vue +1 -1
  21. package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +32 -2
  22. package/dist/runtime/components/shell/ADocPanelSettings.vue +289 -2
  23. package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +32 -2
  24. package/dist/runtime/composables/useDocsSearch.d.ts +24 -0
  25. package/dist/runtime/composables/useDocsSearch.js +34 -0
  26. package/dist/runtime/extensions/doc-embed.js +2 -1
  27. package/dist/runtime/extensions/doc-link-drop.js +4 -4
  28. package/dist/runtime/extensions/doc-link.d.ts +12 -0
  29. package/dist/runtime/extensions/doc-link.js +60 -0
  30. package/dist/runtime/extensions/views/DocEmbedView.vue +18 -3
  31. package/dist/runtime/extensions/views/DocLinkView.d.vue.ts +4 -0
  32. package/dist/runtime/extensions/views/DocLinkView.vue +71 -0
  33. package/dist/runtime/extensions/views/DocLinkView.vue.d.ts +4 -0
  34. package/dist/runtime/plugin-abracadabra.client.js +18 -2
  35. package/dist/runtime/plugins/core.plugin.js +3 -0
  36. package/dist/runtime/server/plugins/abracadabra-service.js +3 -1
  37. package/dist/runtime/theme/content/_shared.d.ts +6 -0
  38. package/dist/runtime/theme/content/_shared.js +6 -0
  39. package/dist/runtime/theme/content/content-navigation.d.ts +120 -0
  40. package/dist/runtime/theme/content/content-navigation.js +155 -0
  41. package/dist/runtime/theme/content/content-search-button.d.ts +16 -0
  42. package/dist/runtime/theme/content/content-search-button.js +15 -0
  43. package/dist/runtime/theme/content/content-search.d.ts +24 -0
  44. package/dist/runtime/theme/content/content-search.js +23 -0
  45. package/dist/runtime/theme/content/content-surround.d.ts +22 -0
  46. package/dist/runtime/theme/content/content-surround.js +23 -0
  47. package/dist/runtime/theme/content/content-toc.d.ts +84 -0
  48. package/dist/runtime/theme/content/content-toc.js +94 -0
  49. package/dist/runtime/theme/content/index.d.ts +5 -0
  50. package/dist/runtime/theme/content/index.js +5 -0
  51. package/dist/runtime/utils/content.d.ts +19 -0
  52. package/dist/runtime/utils/content.js +23 -0
  53. package/dist/runtime/utils/docReferenceEdges.js +1 -1
  54. package/package.json +14 -7
@@ -0,0 +1,94 @@
1
+ import { themeOptions } from "./_shared.js";
2
+ const contentToc = (options) => ({
3
+ slots: {
4
+ root: "sticky top-(--ui-header-height) z-10 bg-default/75 lg:bg-[initial] backdrop-blur -mx-4 px-4 sm:px-6 sm:-mx-6 lg:ms-0 overflow-y-auto max-h-[calc(100vh-var(--ui-header-height))]",
5
+ container: "pt-4 sm:pt-6 pb-2.5 sm:pb-4.5 lg:py-8 border-b border-dashed border-default lg:border-0 flex flex-col",
6
+ top: "",
7
+ bottom: "hidden lg:flex lg:flex-col gap-6",
8
+ trigger: "group text-sm font-semibold flex-1 flex items-center gap-1.5 py-1.5 -mt-1.5 focus-visible:outline-primary",
9
+ title: "truncate",
10
+ trailing: "ms-auto inline-flex gap-1.5 items-center",
11
+ trailingIcon: "size-5 transform transition-transform duration-200 shrink-0 group-data-[state=open]:rotate-180 lg:hidden",
12
+ content: "relative data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden focus:outline-none",
13
+ list: "min-w-0",
14
+ listWithChildren: "ms-3",
15
+ item: "min-w-0",
16
+ itemWithChildren: "",
17
+ link: "group relative text-sm flex items-center focus-visible:outline-primary py-1",
18
+ linkText: "truncate",
19
+ indicator: "",
20
+ indicatorLine: "",
21
+ indicatorActive: ""
22
+ },
23
+ variants: {
24
+ color: {
25
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
26
+ neutral: ""
27
+ },
28
+ highlightColor: {
29
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
30
+ indicatorActive: `bg-${color}`
31
+ }])),
32
+ neutral: {
33
+ indicatorActive: "bg-inverted"
34
+ }
35
+ },
36
+ active: {
37
+ false: {
38
+ link: ["text-muted hover:text-default", options.theme.transitions && "transition-colors"]
39
+ }
40
+ },
41
+ highlight: {
42
+ true: ""
43
+ },
44
+ highlightVariant: {
45
+ straight: "",
46
+ circuit: ""
47
+ },
48
+ body: {
49
+ true: {
50
+ bottom: "mt-6"
51
+ }
52
+ }
53
+ },
54
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
55
+ color,
56
+ active: true,
57
+ class: {
58
+ link: `text-${color}`
59
+ }
60
+ })), {
61
+ color: "neutral",
62
+ active: true,
63
+ class: {
64
+ link: "text-highlighted"
65
+ }
66
+ }, {
67
+ highlight: true,
68
+ highlightVariant: "straight",
69
+ class: {
70
+ list: "ms-2.5 ps-4 border-s border-default",
71
+ item: "-ms-px",
72
+ indicator: "absolute ms-2.5 transition-[translate,height] duration-200 h-(--indicator-size) translate-y-(--indicator-position) w-px rounded-full",
73
+ indicatorLine: "hidden",
74
+ indicatorActive: "w-full h-full"
75
+ }
76
+ }, {
77
+ highlight: true,
78
+ highlightVariant: "circuit",
79
+ class: {
80
+ list: "ps-6.5",
81
+ item: "-ms-px",
82
+ itemWithChildren: "ps-px",
83
+ indicator: "absolute ms-2.5 start-0 top-0 rtl:-scale-x-100",
84
+ indicatorLine: "absolute inset-0 bg-(--ui-border)",
85
+ indicatorActive: "absolute w-full h-(--indicator-size) translate-y-(--indicator-position) transition-[translate,height] duration-200 ease-out"
86
+ }
87
+ }],
88
+ defaultVariants: {
89
+ color: "primary",
90
+ highlightColor: "primary",
91
+ highlightVariant: "straight"
92
+ }
93
+ });
94
+ export default contentToc(themeOptions);
@@ -0,0 +1,5 @@
1
+ export { default as contentNavigation } from './content-navigation.js';
2
+ export { default as contentSearch } from './content-search.js';
3
+ export { default as contentSearchButton } from './content-search-button.js';
4
+ export { default as contentSurround } from './content-surround.js';
5
+ export { default as contentToc } from './content-toc.js';
@@ -0,0 +1,5 @@
1
+ export { default as contentNavigation } from "./content-navigation.js";
2
+ export { default as contentSearch } from "./content-search.js";
3
+ export { default as contentSearchButton } from "./content-search-button.js";
4
+ export { default as contentSurround } from "./content-surround.js";
5
+ export { default as contentToc } from "./content-toc.js";
@@ -0,0 +1,19 @@
1
+ export interface ContentNavigationItem {
2
+ title?: string;
3
+ path?: string;
4
+ icon?: string;
5
+ children?: ContentNavigationItem[];
6
+ [key: string]: any;
7
+ }
8
+ export interface MapContentNavigationItemOptions {
9
+ labelAttribute?: string;
10
+ deep?: number;
11
+ }
12
+ export declare function mapContentNavigationItem(item: ContentNavigationItem, options?: MapContentNavigationItemOptions, currentDepth?: number): Omit<ContentNavigationItem, 'title' | 'path'> & {
13
+ label?: string;
14
+ to?: string;
15
+ };
16
+ export declare function mapContentNavigation(navigation: ContentNavigationItem[], options?: MapContentNavigationItemOptions): (Omit<ContentNavigationItem, "path" | "title"> & {
17
+ label?: string;
18
+ to?: string;
19
+ })[];
@@ -0,0 +1,23 @@
1
+ export function mapContentNavigationItem(item, options, currentDepth = 0) {
2
+ const navMap = {
3
+ [options?.labelAttribute || "title"]: "label",
4
+ path: "to"
5
+ };
6
+ const link = Object.keys(item).reduce((acc, key) => {
7
+ if (item[key]) {
8
+ const mappedKey = navMap[key] || key;
9
+ acc[mappedKey] = item[key];
10
+ }
11
+ return acc;
12
+ }, {});
13
+ const shouldRecurse = typeof options?.deep === "undefined" || currentDepth < options.deep;
14
+ if (shouldRecurse && Array.isArray(item.children)) {
15
+ link.children = item.children.map((child) => mapContentNavigationItem(child, options, currentDepth + 1));
16
+ } else {
17
+ link.children = [];
18
+ }
19
+ return link;
20
+ }
21
+ export function mapContentNavigation(navigation, options) {
22
+ return navigation.map((item) => mapContentNavigationItem(item, options));
23
+ }
@@ -14,7 +14,7 @@ export function scanDocReferences(fragment) {
14
14
  }
15
15
  }
16
16
  } else if (child instanceof Y.XmlElement) {
17
- if (child.nodeName === "docEmbed") {
17
+ if (child.nodeName === "docEmbed" || child.nodeName === "docLink") {
18
18
  const docId = child.getAttribute("docId");
19
19
  if (docId) refs.push(docId);
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",
@@ -35,6 +35,10 @@
35
35
  "test": "vitest run",
36
36
  "test:watch": "vitest watch",
37
37
  "test:integration": "vitest run --config test/integration/vitest.config.ts --reporter=verbose",
38
+ "test:unit": "vitest run --config test/unit/vitest.config.ts",
39
+ "test:e2e": "playwright test",
40
+ "test:e2e:headed": "playwright test --headed",
41
+ "test:e2e:ui": "playwright test --ui",
38
42
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
39
43
  },
40
44
  "dependencies": {
@@ -45,8 +49,8 @@
45
49
  },
46
50
  "peerDependencies": {
47
51
  "@abraca/dabra": "^1.5.0",
48
- "@noble/ed25519": "^3.0.0",
49
- "@noble/hashes": "^1.0.0",
52
+ "@noble/ed25519": "~2.3.0",
53
+ "@noble/hashes": "^1.8.0",
50
54
  "@nuxt/ui": "^3.0.0",
51
55
  "@tiptap/core": "^3.0.0",
52
56
  "@tiptap/extension-collaboration": "^3.0.0",
@@ -83,14 +87,15 @@
83
87
  }
84
88
  },
85
89
  "devDependencies": {
86
- "@abraca/dabra": "1.8.2",
87
- "@noble/ed25519": "^3.0.1",
90
+ "@abraca/dabra": "1.9.1",
91
+ "@noble/ed25519": "~2.3.0",
88
92
  "@noble/hashes": "^1.8.0",
89
93
  "@nuxt/eslint-config": "^1.15.2",
90
94
  "@nuxt/module-builder": "^1.0.2",
91
95
  "@nuxt/schema": "^4.4.2",
92
96
  "@nuxt/test-utils": "^4.0.2",
93
97
  "@nuxt/ui": "^4.6.1",
98
+ "@playwright/test": "^1.59.1",
94
99
  "@tiptap/core": "^3.22.4",
95
100
  "@tiptap/extension-collaboration": "^3.22.4",
96
101
  "@tiptap/extension-collaboration-caret": "^3.22.4",
@@ -98,14 +103,16 @@
98
103
  "@types/d3-force": "^3.0.10",
99
104
  "@types/node": "latest",
100
105
  "@types/ws": "^8.18.1",
106
+ "@vue/test-utils": "^2.4.6",
101
107
  "changelogen": "^0.6.2",
102
108
  "d3-force": "^3.0.0",
103
109
  "eslint": "^10.2.1",
110
+ "happy-dom": "^20.9.0",
104
111
  "nuxt": "^4.4.2",
105
112
  "tslib": "^2.8.1",
106
113
  "typescript": "~6.0.3",
107
- "vitest": "^4.1.4",
108
- "vue": "^3.5.32",
114
+ "vitest": "^4.1.5",
115
+ "vue": "^3.5.33",
109
116
  "vue-tsc": "^3.2.7",
110
117
  "ws": "^8.20.0",
111
118
  "yjs": "^13.6.30"