@nookuio/iframe 0.5.0 → 0.6.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.
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * The path of the editor page which will be rendered in canvas
3
3
  */
4
- export declare const EDITOR_PAGE_PATH = "/__nooku/editor";
5
- export declare const COMPONENT_PREVIEW_PAGE_PATH = "/__nooku/component-preview";
4
+ export declare const EDITOR_PAGE_PATH = "/__nooku__/editor";
5
+ export declare const COMPONENT_PREVIEW_PAGE_PATH = "/__nooku__/component-preview";
6
+ export declare const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = "/__nooku__/virtual-sfc-preview";
6
7
  export declare const IFRAME_SOURCE_NAME = "nooku-frame";
7
8
  export declare const EDITOR_SOURCE_NAME = "nooku-editor";
package/dist/constants.js CHANGED
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.IFRAME_SOURCE_NAME = exports.EDITOR_SOURCE_NAME = exports.EDITOR_PAGE_PATH = exports.COMPONENT_PREVIEW_PAGE_PATH = void 0;
7
- const EDITOR_PAGE_PATH = exports.EDITOR_PAGE_PATH = `/__nooku/editor`;
8
- const COMPONENT_PREVIEW_PAGE_PATH = exports.COMPONENT_PREVIEW_PAGE_PATH = `/__nooku/component-preview`;
6
+ exports.VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = exports.IFRAME_SOURCE_NAME = exports.EDITOR_SOURCE_NAME = exports.EDITOR_PAGE_PATH = exports.COMPONENT_PREVIEW_PAGE_PATH = void 0;
7
+ const EDITOR_PAGE_PATH = exports.EDITOR_PAGE_PATH = `/__nooku__/editor`;
8
+ const COMPONENT_PREVIEW_PAGE_PATH = exports.COMPONENT_PREVIEW_PAGE_PATH = `/__nooku__/component-preview`;
9
+ const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = exports.VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = `/__nooku__/virtual-sfc-preview`;
9
10
  const IFRAME_SOURCE_NAME = exports.IFRAME_SOURCE_NAME = "nooku-frame";
10
11
  const EDITOR_SOURCE_NAME = exports.EDITOR_SOURCE_NAME = "nooku-editor";
@@ -1,4 +1,5 @@
1
- export const EDITOR_PAGE_PATH = `/__nooku/editor`;
2
- export const COMPONENT_PREVIEW_PAGE_PATH = `/__nooku/component-preview`;
1
+ export const EDITOR_PAGE_PATH = `/__nooku__/editor`;
2
+ export const COMPONENT_PREVIEW_PAGE_PATH = `/__nooku__/component-preview`;
3
+ export const VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH = `/__nooku__/virtual-sfc-preview`;
3
4
  export const IFRAME_SOURCE_NAME = "nooku-frame";
4
5
  export const EDITOR_SOURCE_NAME = "nooku-editor";
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './constants';
2
2
  export * from './types';
3
+ export * from './iframe';
4
+ export * from './editor';
package/dist/index.js CHANGED
@@ -24,4 +24,26 @@ Object.keys(_types).forEach(function (key) {
24
24
  return _types[key];
25
25
  }
26
26
  });
27
+ });
28
+ var _iframe = require("./iframe");
29
+ Object.keys(_iframe).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _iframe[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _iframe[key];
36
+ }
37
+ });
38
+ });
39
+ var _editor = require("./editor");
40
+ Object.keys(_editor).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _editor[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _editor[key];
47
+ }
48
+ });
27
49
  });
package/dist/index.mjs CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from "./constants.mjs";
2
2
  export * from "./types.mjs";
3
+ export * from "./iframe.mjs";
4
+ export * from "./editor.mjs";
package/dist/types.d.ts CHANGED
@@ -54,23 +54,25 @@ export interface CoreIframeEvents {
54
54
  }
55
55
  export interface VueIframeContext extends CoreIframeContext {
56
56
  navigateTo: (to: string) => void;
57
- getValue: (opts: {
57
+ getValue: (options: {
58
58
  code: string;
59
59
  path?: string;
60
60
  onTemplateContext?: boolean;
61
61
  context?: Record<string, any>;
62
62
  }) => any;
63
63
  getInstanceData: (path: string /** filepath path of the component */) => Record<string, any>;
64
- runCode: (opts: {
64
+ runCode: (options: {
65
65
  path?: string;
66
66
  code: string;
67
67
  onTemplateContext?: boolean;
68
68
  context?: Record<string, any>;
69
69
  }) => any;
70
- updatePreview?: (options: {
71
- path: string;
72
- code: string;
73
- }) => void;
70
+ /**
71
+ * For virtual SFC preview
72
+ *
73
+ * Works only on VIRTUAL_VUE_SFC_RENDERER_PAGE_PATH
74
+ */
75
+ updateVirtualSfcCode?: (path: string, code: string) => void;
74
76
  }
75
77
  export interface VueIframeEvents extends CoreIframeEvents {
76
78
  'route-change': (to: string) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nookuio/iframe",
3
3
  "description": "",
4
- "version": "0.5.0",
4
+ "version": "0.6.0",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "exports": {