@uniformdev/uniform-nuxt 19.47.0 → 19.47.1-alpha.11

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.ts CHANGED
@@ -35,6 +35,10 @@ interface UniformModuleOptions {
35
35
  * @default true
36
36
  */
37
37
  enableContextDevTools?: boolean;
38
+ /**
39
+ * The path to the playground page, to live preview components and patterns.
40
+ */
41
+ playgroundPath?: string;
38
42
  }
39
43
  declare const _default: _nuxt_schema.NuxtModule<UniformModuleOptions>;
40
44
 
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "nuxt-uniform",
3
3
  "configKey": "uniform",
4
- "version": "19.47.0"
4
+ "version": "19.47.1-alpha.11+7b2a77395"
5
5
  }
package/dist/module.mjs CHANGED
@@ -17,7 +17,8 @@ const module = defineNuxtModule({
17
17
  outputType: "standard",
18
18
  uniformContextPath: void 0,
19
19
  defaultConsent: false,
20
- enableContextDevTools: true
20
+ enableContextDevTools: true,
21
+ playgroundPath: void 0
21
22
  },
22
23
  setup(options, nuxt) {
23
24
  if (!options.projectId || !options.readOnlyApiKey) {
@@ -0,0 +1 @@
1
+ export { UniformPlayground as default } from '@uniformdev/canvas-vue';
@@ -0,0 +1 @@
1
+ export { UniformPlayground as default } from "@uniformdev/canvas-vue";
@@ -19,5 +19,5 @@ export declare const UniformRichText: import("vue-demi").DefineComponent<{
19
19
  type: PropType<import("@uniformdev/canvas-vue").RenderRichTextComponentResolver | undefined>;
20
20
  required: false;
21
21
  };
22
- }>>, {}>;
22
+ }>>, {}, {}>;
23
23
  export default UniformRichText;
@@ -1,7 +1,7 @@
1
1
  import { RenderRichTextComponentResolver, UniformRichTextNodeProps } from '@uniformdev/canvas-vue';
2
2
  import { RichTextNode } from '@uniformdev/richtext';
3
3
  import { PropType } from 'vue-demi';
4
- export declare function getResolveVueRichTextRenderer(resolveRichTextRenderer: UniformRichTextNodeProps['resolveRichTextRenderer']): (node: RichTextNode) => import("vue-demi").ComponentOptions<import("@uniformdev/canvas-vue").RichTextComponentProps<RichTextNode>, any, any, import("vue-demi").ComputedOptions, import("vue-demi").MethodOptions, any, any, any> | import("vue-demi").FunctionalComponent<import("@uniformdev/canvas-vue").RichTextComponentProps<RichTextNode>, any> | null | undefined;
4
+ export declare function getResolveVueRichTextRenderer(resolveRichTextRenderer: UniformRichTextNodeProps['resolveRichTextRenderer']): (node: RichTextNode) => import("vue-demi").ComponentOptions<import("@uniformdev/canvas-vue").RichTextComponentProps<RichTextNode>, any, any, import("vue-demi").ComputedOptions, import("vue-demi").MethodOptions, any, any, any, any> | import("vue-demi").FunctionalComponent<import("@uniformdev/canvas-vue").RichTextComponentProps<RichTextNode>, any, any> | null | undefined;
5
5
  export declare const UniformRichTextNode: import("vue-demi").DefineComponent<{
6
6
  node: {
7
7
  type: PropType<RichTextNode>;
@@ -22,5 +22,5 @@ export declare const UniformRichTextNode: import("vue-demi").DefineComponent<{
22
22
  type: PropType<RenderRichTextComponentResolver | undefined>;
23
23
  required: false;
24
24
  };
25
- }>>, {}>;
25
+ }>>, {}, {}>;
26
26
  export default UniformRichTextNode;
@@ -2,6 +2,7 @@ import {
2
2
  CANVAS_DRAFT_STATE,
3
3
  CANVAS_PUBLISHED_STATE,
4
4
  CanvasClient,
5
+ IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
5
6
  IN_CONTEXT_EDITOR_QUERY_STRING_PARAM
6
7
  } from "@uniformdev/canvas";
7
8
  import { UniformComposition, UniformSlot, useCompositionEventEffect } from "@uniformdev/canvas-vue";
@@ -132,6 +133,19 @@ function setupPreview(nuxtApp) {
132
133
  };
133
134
  }
134
135
  nuxtApp.hook("app:beforeMount", () => {
136
+ const options = getModuleOptions();
137
+ if (preview && route.query[IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM] === "true" && options.playgroundPath) {
138
+ const pathParams = Object.fromEntries(
139
+ new URL(options.playgroundPath ?? "", "https://example.com").searchParams
140
+ );
141
+ router.push({
142
+ path: options.playgroundPath,
143
+ query: {
144
+ ...route.query,
145
+ ...pathParams
146
+ }
147
+ });
148
+ }
135
149
  if (preview && (route.query.slug || route.query.path)) {
136
150
  const path = preview?.path ?? preview?.slug;
137
151
  const pathParams = Object.fromEntries(new URL(path ?? "", "https://example.com").searchParams);
@@ -174,7 +188,7 @@ function setupLivePreview(currentCompositionId, isPreview = false) {
174
188
  await refreshNuxtData();
175
189
  };
176
190
  useHead({
177
- titleTemplate: (title) => enabled ? `\u26A1\uFE0F ${title}` : title
191
+ titleTemplate: (title = "") => enabled ? `\u26A1\uFE0F ${title}` : title
178
192
  });
179
193
  useCompositionEventEffect({
180
194
  compositionIdRef: currentCompositionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/uniform-nuxt",
3
- "version": "19.47.0",
3
+ "version": "19.47.1-alpha.11+7b2a77395",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,11 +24,11 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@nuxt/kit": "3.6.0",
27
- "@uniformdev/canvas": "19.47.0",
28
- "@uniformdev/canvas-vue": "19.47.0",
29
- "@uniformdev/context": "19.47.0",
30
- "@uniformdev/context-vue": "19.47.0",
31
- "@uniformdev/richtext": "19.47.0",
27
+ "@uniformdev/canvas": "19.47.1-alpha.11+7b2a77395",
28
+ "@uniformdev/canvas-vue": "19.47.1-alpha.11+7b2a77395",
29
+ "@uniformdev/context": "19.47.1-alpha.11+7b2a77395",
30
+ "@uniformdev/context-vue": "19.47.1-alpha.11+7b2a77395",
31
+ "@uniformdev/richtext": "19.47.1-alpha.11+7b2a77395",
32
32
  "vue-demi": "^0.14.0"
33
33
  },
34
34
  "devDependencies": {
@@ -38,11 +38,11 @@
38
38
  "esbuild": "0.19.2",
39
39
  "eslint": "^8.31.0",
40
40
  "nuxt": "3.6.0",
41
- "vue": "3.2.47",
41
+ "vue": "3.3.4",
42
42
  "vue-router": "4.1.6"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "66bb196919cc178fc94f4d0490d0ac517193304a"
47
+ "gitHead": "7b2a77395e250abc8e1d30cff034b421ac38c40f"
48
48
  }