@cwa/nuxt-edge 0.0.0-29853496.7de669c → 0.0.0-29854751.0f3ff4e

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 CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@cwa/nuxt",
3
3
  "configKey": "cwa",
4
4
  "compatibility": {
5
- "nuxt": ">=4.5.2"
5
+ "nuxt": ">=4.6.0"
6
6
  },
7
- "version": "2.0.0-alpha.5",
7
+ "version": "2.0.0-alpha.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { join } from 'path';
2
2
  import path from 'node:path';
3
- import { readFileSync, realpathSync, statSync } from 'node:fs';
3
+ import { readFileSync, statSync } from 'node:fs';
4
4
  import { defu } from 'defu';
5
5
  import mergeWith from 'lodash-es/mergeWith';
6
6
  import isArray from 'lodash-es/isArray';
@@ -325,7 +325,7 @@ const module$1 = defineNuxtModule({
325
325
  name: NAME,
326
326
  configKey: "cwa",
327
327
  compatibility: {
328
- nuxt: ">=4.5.2"
328
+ nuxt: ">=4.6.0"
329
329
  }
330
330
  },
331
331
  defaults: {
@@ -385,26 +385,6 @@ const module$1 = defineNuxtModule({
385
385
  }
386
386
  pages.forEach(applyDefaultLayout);
387
387
  });
388
- if (!nuxt.options.dev) {
389
- const toRealPath = (file) => {
390
- try {
391
- return realpathSync(file);
392
- } catch {
393
- return file;
394
- }
395
- };
396
- const realpathPages = (pages) => {
397
- for (const page of pages) {
398
- if (page.file) {
399
- page.file = toRealPath(page.file);
400
- }
401
- if (page.children) {
402
- realpathPages(page.children);
403
- }
404
- }
405
- };
406
- nuxt.hook("pages:extend", realpathPages);
407
- }
408
388
  const cwaVueComponentsDir = join(vueTemplatesDir, "components");
409
389
  const adminSourceDirs = [
410
390
  join(cwaVueComponentsDir, "main", "admin"),
@@ -4,6 +4,7 @@ import { consola } from "consola";
4
4
  import throttle from "lodash-es/throttle";
5
5
  import {
6
6
  computed,
7
+ Fragment,
7
8
  markRaw,
8
9
  nextTick,
9
10
  ref,
@@ -152,7 +153,8 @@ export default class ManageableResource {
152
153
  // GET DOM ELEMENTS TO ADD CLICK EVENTS TO
153
154
  getAllEls() {
154
155
  const allSiblings = [];
155
- let currentEl = this.component.$el;
156
+ const subTree = this.component.$?.subTree;
157
+ let currentEl = subTree?.type === Fragment ? subTree.el : this.component.$el;
156
158
  if (!currentEl) {
157
159
  return [];
158
160
  }
@@ -210,9 +210,14 @@ export default class Mercure {
210
210
  positionsBoundToChangedPageData(pageData) {
211
211
  const stored = this.resourcesStore.current.byId[pageData["@id"]]?.data;
212
212
  const changed = (property) => property in pageData && pageData[property] !== stored?.[property];
213
+ const isComponentIri = (value) => typeof value === "string" && getResourceTypeFromIri(value) === CwaResourceTypes.COMPONENT;
214
+ const anyComponentChanged = Object.keys(pageData).some((property) => changed(property) && (isComponentIri(pageData[property]) || isComponentIri(stored?.[property])));
213
215
  return this.resourcesStore.current.currentIds.filter((iri) => {
214
- const property = this.resourcesStore.current.byId[iri]?.data?.pageDataProperty;
215
- return !!property && changed(property);
216
+ const position = this.resourcesStore.current.byId[iri]?.data;
217
+ if (position?.pageDataProperty) {
218
+ return changed(position.pageDataProperty);
219
+ }
220
+ return !!position?._metadata?.isDynamicPosition && anyComponentChanged;
216
221
  });
217
222
  }
218
223
  async fetch(paths) {
@@ -10,7 +10,7 @@ export default defineNuxtPlugin({
10
10
  return;
11
11
  }
12
12
  event.context.cwaPageCache = {};
13
- const isErrorRender = !!event.headers.get("x-nuxt-error");
13
+ const isErrorRender = !!nuxtApp.ssrContext?.error;
14
14
  nuxtApp.hook("app:rendered", () => {
15
15
  if (isErrorRender) {
16
16
  event.context.cwaPageCache = { unstorable: true };
@@ -207,7 +207,7 @@ export class Resources {
207
207
  return computed(() => {
208
208
  const position = this.getResource(positionIri).value;
209
209
  const storedComponent = position?.data?.component;
210
- if (!position?.data?.pageDataProperty) {
210
+ if (!position?.data?._metadata?.isDynamicPosition) {
211
211
  return storedComponent;
212
212
  }
213
213
  const manifest = this.displayFetchStatus?.manifest;
@@ -80,7 +80,7 @@ export default function(resourcesState, resourcesGetters) {
80
80
  if (!positionResource?.data) {
81
81
  continue;
82
82
  }
83
- if (!positionResource.data.pageDataProperty) {
83
+ if (!positionResource.data._metadata?.isDynamicPosition) {
84
84
  deleteResource({
85
85
  resource: positionIri
86
86
  });
@@ -3,11 +3,11 @@ type __VLS_Props = {
3
3
  hideViewLink?: boolean;
4
4
  };
5
5
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
- reload: () => any;
7
6
  close: () => any;
7
+ reload: () => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onReload?: (() => any) | undefined;
10
9
  onClose?: (() => any) | undefined;
10
+ onReload?: (() => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -3,11 +3,11 @@ type __VLS_Props = {
3
3
  hideViewLink?: boolean;
4
4
  };
5
5
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
- reload: () => any;
7
6
  close: () => any;
7
+ reload: () => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onReload?: (() => any) | undefined;
10
9
  onClose?: (() => any) | undefined;
10
+ onReload?: (() => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  resourceType: string;
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- reload: () => any;
8
7
  close: () => any;
8
+ reload: () => any;
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onReload?: (() => any) | undefined;
11
10
  onClose?: (() => any) | undefined;
11
+ onReload?: (() => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  resourceType: string;
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- reload: () => any;
8
7
  close: () => any;
8
+ reload: () => any;
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onReload?: (() => any) | undefined;
11
10
  onClose?: (() => any) | undefined;
11
+ onReload?: (() => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  resourceType: string;
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- reload: () => any;
8
7
  close: () => any;
8
+ reload: () => any;
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onReload?: (() => any) | undefined;
11
10
  onClose?: (() => any) | undefined;
11
+ onReload?: (() => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  resourceType: string;
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- reload: () => any;
8
7
  close: () => any;
8
+ reload: () => any;
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onReload?: (() => any) | undefined;
11
10
  onClose?: (() => any) | undefined;
11
+ onReload?: (() => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  pageResource: CwaResource;
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- reload: () => any;
8
7
  close: () => any;
8
+ reload: () => any;
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onReload?: (() => any) | undefined;
11
10
  onClose?: (() => any) | undefined;
11
+ onReload?: (() => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  pageResource: CwaResource;
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- reload: () => any;
8
7
  close: () => any;
8
+ reload: () => any;
9
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onReload?: (() => any) | undefined;
11
10
  onClose?: (() => any) | undefined;
11
+ onReload?: (() => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cwa/nuxt-edge",
3
- "version": "0.0.0-29853496.7de669c",
3
+ "version": "0.0.0-29854751.0f3ff4e",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Components Web Apps Nuxt Module. UI for creating component-driven web apps with the API Components Bundle",
@@ -40,8 +40,8 @@
40
40
  "dependencies": {
41
41
  "@headlessui/vue": "^1.7.23",
42
42
  "@internationalized/date": "^3.12.4",
43
- "@nuxt/kit": "^4.5.2",
44
- "@nuxt/schema": "^4.5.2",
43
+ "@nuxt/kit": "^4.6.0",
44
+ "@nuxt/schema": "^4.6.0",
45
45
  "@nuxtjs/robots": "^6.1.5",
46
46
  "@nuxtjs/seo": "^5.3.13",
47
47
  "@nuxtjs/sitemap": "^8.3.4",
@@ -66,7 +66,7 @@
66
66
  "set-cookie-parser": "^3.1.2",
67
67
  "slugify": "^1.6.9",
68
68
  "uuid": "^14.0.2",
69
- "vue": "^3.5.41",
69
+ "vue": "^3.5.43",
70
70
  "vue-input-autowidth": "^2.2.1",
71
71
  "vuejs-confirm-dialog": "^0.5.2"
72
72
  },
@@ -108,7 +108,7 @@
108
108
  "eslint": "^10.8.1",
109
109
  "globby": "^16.2.4",
110
110
  "happy-dom": "^20.11.6",
111
- "nuxt": "^4.5.2",
111
+ "nuxt": "^4.6.0",
112
112
  "pathe": "^2.0.3",
113
113
  "playwright-core": "^1.62.1",
114
114
  "postcss": "^8.5.26",