@panomc/sdk 1.0.0-dev.7 → 1.0.0-dev.9

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 CHANGED
@@ -1,3 +1,3 @@
1
- # Pano Common Assets
2
-
3
- Pano common assets repository.
1
+ # Pano Common Assets
2
+
3
+ Pano common assets repository.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panomc/sdk",
3
- "version": "1.0.0-dev.7",
3
+ "version": "1.0.0-dev.9",
4
4
  "author": "PanoMC",
5
5
  "repository": {
6
6
  "url": "https://github.com/PanoMC/sdk"
@@ -1,4 +1,4 @@
1
- const GLOBAL_KEY = "__PANO_PLUGIN_CONTEXTS__";
1
+ const GLOBAL_KEY = '__PANO_PLUGIN_CONTEXTS__';
2
2
 
3
3
  function getStore() {
4
4
  if (!globalThis[GLOBAL_KEY]) {
@@ -9,7 +9,7 @@ function getStore() {
9
9
 
10
10
  export function createPluginContext(pluginId) {
11
11
  if (!pluginId) {
12
- throw new Error("[PanoSDK] pluginId is required");
12
+ throw new Error('[PanoSDK] pluginId is required');
13
13
  }
14
14
 
15
15
  const store = getStore();
@@ -27,7 +27,7 @@ export function createPluginContext(pluginId) {
27
27
  context: pluginStore.context,
28
28
 
29
29
  set(partial) {
30
- if (typeof partial !== "object" || partial === null) return;
30
+ if (typeof partial !== 'object' || partial === null) return;
31
31
 
32
32
  Object.assign(pluginStore.context, partial);
33
33
 
package/src/api/plugin.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createPluginContext } from "./plugin-context.js";
1
+ import { createPluginContext } from './plugin-context.js';
2
2
 
3
3
  /**
4
4
  * @typedef {import('../types.js').Pano} Pano
@@ -19,7 +19,7 @@ export class PanoPlugin {
19
19
 
20
20
  constructor({ pluginId, scope } = {}) {
21
21
  if (!pluginId) {
22
- throw new Error("[PanoPlugin] pluginId is required");
22
+ throw new Error('[PanoPlugin] pluginId is required');
23
23
  }
24
24
 
25
25
  // plugin-scoped context
@@ -29,11 +29,11 @@ export class PanoPlugin {
29
29
  this._unsubscribers = [];
30
30
  }
31
31
 
32
- /**
33
- * @param {Pano} pano
32
+ /**
33
+ * @param {Pano} pano
34
34
  */
35
- onLoad(pano) { }
36
- onUnload() { }
35
+ onLoad(pano) {}
36
+ onUnload() {}
37
37
 
38
38
  /** plugin context helper */
39
39
  setContext(partial) {
@@ -1,7 +1,7 @@
1
- import { getPanoContext } from "../internal/index.js";
1
+ import { getPanoContext } from '../internal/index.js';
2
2
 
3
- const panoContext = getPanoContext()
4
- const components = panoContext.context.components
3
+ const panoContext = getPanoContext();
4
+ const components = panoContext.context.components;
5
5
 
6
6
  export const PageActions = components.PageActions;
7
7
  export const PageLoader = components.PageLoader;
@@ -16,4 +16,5 @@ export const CardHeader = components.CardHeader;
16
16
  export const CardMenu = components.CardMenu;
17
17
  export const CardMenuItem = components.CardMenuItem;
18
18
  export const Date = components.Date;
19
- export const NoContent = components.NoContent;
19
+ export const NoContent = components.NoContent;
20
+ export const Editor = components.Editor;
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { getPanoContext } from "./internal"
1
+ export { getPanoContext } from './internal';
2
2
 
3
- export * from "./api/plugin.js"
3
+ export * from './api/plugin.js';
4
4
 
5
- export * from "./utils/component.js"
5
+ export * from './utils/component.js';
@@ -1 +1 @@
1
- export * from "./pano-context.js"
1
+ export * from './pano-context.js';
@@ -1,4 +1,4 @@
1
- const GLOBAL_KEY = "__PANO_CONTEXT__";
1
+ const GLOBAL_KEY = '__PANO_CONTEXT__';
2
2
 
3
3
  function getStore() {
4
4
  if (!globalThis[GLOBAL_KEY]) {
@@ -20,8 +20,8 @@ function getStore() {
20
20
  export function setPanoContext(partial) {
21
21
  const store = getStore();
22
22
 
23
- if (typeof partial !== "object" || partial === null) {
24
- console.warn("[PanoSDK] setPanoContext expects an object");
23
+ if (typeof partial !== 'object' || partial === null) {
24
+ console.warn('[PanoSDK] setPanoContext expects an object');
25
25
  return;
26
26
  }
27
27
 
@@ -31,7 +31,7 @@ export function setPanoContext(partial) {
31
31
  try {
32
32
  fn(store.context);
33
33
  } catch (e) {
34
- console.error("[PanoSDK] listener error", e);
34
+ console.error('[PanoSDK] listener error', e);
35
35
  }
36
36
  });
37
37
  }
package/src/svelte.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getPanoContext } from "./internal/index.js";
1
+ import { getPanoContext } from './internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
4
  const { page, base, navigating, browser } = panoContext.context;
@@ -1,4 +1,4 @@
1
- import { getPanoContext } from "../internal/index.js";
1
+ import { getPanoContext } from '../internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
4
  const toastStuff = panoContext.context.utils.toast;
@@ -6,4 +6,4 @@ const toastStuff = panoContext.context.utils.toast;
6
6
  const showToast = toastStuff.show;
7
7
  const limitTitle = toastStuff.limitTitle;
8
8
 
9
- export { showToast, limitTitle };
9
+ export { showToast, limitTitle };
package/src/types.js CHANGED
@@ -37,4 +37,4 @@
37
37
  * @property {function(): void} [destroy]
38
38
  */
39
39
 
40
- export { }
40
+ export {};
package/src/utils/api.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getPanoContext } from "../internal/index.js";
1
+ import { getPanoContext } from '../internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
4
  const apiStuff = panoContext.context.utils.api;
@@ -11,4 +11,4 @@ const buildQueryParams = apiStuff.buildQueryParams;
11
11
 
12
12
  export { ApiUtil, NETWORK_ERROR, networkErrorBody, buildQueryParams };
13
13
 
14
- export default ApiUtil
14
+ export default ApiUtil;
@@ -1,4 +1,4 @@
1
- import { mount, unmount, hydrate } from "svelte";
1
+ import { mount, unmount, hydrate } from 'svelte';
2
2
 
3
3
  /**
4
4
  * Wraps a dynamic component import to include the correct Svelte runtime mount/unmount methods.
@@ -8,13 +8,13 @@ import { mount, unmount, hydrate } from "svelte";
8
8
  * @returns {() => Promise<any>} - Wrapped importer
9
9
  */
10
10
  export function viewComponent(importer) {
11
- return async () => {
12
- const module = await importer();
13
- return {
14
- ...module,
15
- mount: (options) => mount(module.default, options),
16
- unmount: (instance) => unmount(instance),
17
- hydrate: (options) => hydrate(module.default, options)
18
- };
11
+ return async () => {
12
+ const module = await importer();
13
+ return {
14
+ ...module,
15
+ mount: (options) => mount(module.default, options),
16
+ unmount: (instance) => unmount(instance),
17
+ hydrate: (options) => hydrate(module.default, options),
19
18
  };
19
+ };
20
20
  }
@@ -1,4 +1,4 @@
1
- import { getPanoContext } from "../internal/index.js";
1
+ import { getPanoContext } from '../internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
4
  const languageStuff = panoContext.context.utils.language;
@@ -22,5 +22,5 @@ export {
22
22
  loadLanguage,
23
23
  changeLanguage,
24
24
  getLanguageByLocale,
25
- _
25
+ _,
26
26
  };
@@ -1,4 +1,4 @@
1
- import { getPanoContext } from "../internal/index.js";
1
+ import { getPanoContext } from '../internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
4
  const tooltipStuff = panoContext.context.utils.tooltip;
package/src/variables.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getPanoContext } from "./internal/index.js";
1
+ import { getPanoContext } from './internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
4
  const variableStuff = panoContext.context.variables;