@panomc/widget-host 1.0.0-dev.61 → 1.0.0-dev.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panomc/widget-host",
3
- "version": "1.0.0-dev.61",
3
+ "version": "1.0.0-dev.63",
4
4
  "description": "Host modules and runtime that let Pano plugin views run as web-component widgets outside a theme.",
5
5
  "author": "PanoMC",
6
6
  "license": "MIT",
@@ -46,12 +46,16 @@
46
46
  "access": "public"
47
47
  },
48
48
  "dependencies": {
49
+ "@panomc/client": "1.0.0-dev.63",
50
+ "@panomc/plugin-kit": "1.0.0-dev.63",
49
51
  "svelte-i18n": "^4.0.1"
50
52
  },
51
53
  "peerDependencies": {
54
+ "@panomc/sdk": "^2.0.0-dev.63",
52
55
  "svelte": "*"
53
56
  },
54
57
  "devDependencies": {
58
+ "@panomc/sdk": "2.0.0-dev.63",
55
59
  "@rollup/plugin-node-resolve": "^16.0.0",
56
60
  "@rollup/plugin-terser": "^0.4.4",
57
61
  "happy-dom": "^20.0.0",
@@ -7,22 +7,14 @@
7
7
  //
8
8
  // plus `loader.js`, `css/pano-tokens.css`, `css/pano-fallback-icons.css`, `webfonts/*` and `runtime.json` (not specifiers).
9
9
  import { fileURLToPath } from 'node:url';
10
- import { RUNTIME_SPECIFIERS } from '../../theme-core/src/kit/specifiers.js';
10
+ import { RUNTIME_FILES, widgetImportPath } from '@panomc/sdk/runtime-specifiers';
11
11
  import { SPECIFIER_MODULES } from '../src/index.js';
12
12
 
13
13
  export const PACKAGE_DIR = fileURLToPath(new URL('..', import.meta.url));
14
14
  export const SRC_DIR = fileURLToPath(new URL('../src/', import.meta.url));
15
15
 
16
- /** Specifier -> file of the runtime directory, for every `svelte*` name and every `@panomc/sdk` facade. */
17
- export const RUNTIME_FILES = Object.freeze(
18
- Object.fromEntries(
19
- Object.entries(RUNTIME_SPECIFIERS).map(([specifier, file]) => {
20
- if (specifier === 'svelte-i18n') return [specifier, 'svelte-i18n.js'];
21
- if (file.startsWith('sdk/')) return [specifier, `host/${file.slice('sdk/'.length)}`];
22
- return [specifier, file];
23
- }),
24
- ),
25
- );
16
+ // RUNTIME_FILES and widgetImportPath are owned by @panomc/sdk (shared with the plugin kit); re-exported here.
17
+ export { RUNTIME_FILES, widgetImportPath };
26
18
 
27
19
  /** Specifier -> the source file of this package that implements it (`@panomc/sdk*` only). */
28
20
  export const HOST_SOURCES = Object.freeze(
@@ -39,14 +31,3 @@ export function runtimeInput(loaderFile) {
39
31
  input.loader = loaderFile;
40
32
  return input;
41
33
  }
42
-
43
- /**
44
- * Relative URL of a runtime file seen from a widget module that sits in `.../_/ui/widgets/` of a plugin
45
- * (`/api/v1/plugins/<id>/_/ui/widgets/` -> five levels up is `/api/v1/`, doc 06 section 3.3).
46
- * @param {string} specifier
47
- */
48
- export function widgetImportPath(specifier) {
49
- const file = RUNTIME_FILES[specifier];
50
- if (!file) throw new Error(`no runtime file for ${specifier}`);
51
- return `../../../../../widgets/runtime/${file}`;
52
- }
@@ -10,8 +10,8 @@ const hostSrc = resolve(here, '..');
10
10
  const sdkDir = resolve(here, '../../../sdk');
11
11
  const sdkPackage = JSON.parse(readFileSync(join(sdkDir, 'package.json'), 'utf8'));
12
12
 
13
- // exports that are not facades: build output, the engine's core files, package.json
14
- const NOT_FACADES = (key) => key === './package.json' || key.startsWith('./build/') || key.startsWith('./core/');
13
+ // exports that are not facades: build output, the engine's core files, the runtime table, package.json
14
+ const NOT_FACADES = (key) => key === './package.json' || key === './runtime-specifiers' || key.startsWith('./build/') || key.startsWith('./core/');
15
15
 
16
16
  /** A value that answers every property read and call: stands in for the theme's context while a facade module evaluates. */
17
17
  const deep = () => new Proxy(function () {}, { get: (_t, key) => (key === 'then' ? undefined : deep()), apply: () => deep() });
@@ -8,7 +8,7 @@ import { onMount } from './svelte-runtime.js';
8
8
  import { get } from 'svelte/store';
9
9
  import { _, locale } from 'svelte-i18n';
10
10
  import { createFetchHost } from '@panomc/plugin-kit/controller';
11
- import * as registry from '../../sdk/core/js/ControllerRegistry.js';
11
+ import * as registry from '@panomc/sdk/core/js/ControllerRegistry.js';
12
12
  import { getConfig, resolveUrl } from './config.js';
13
13
  import { hostRequest } from './api.js';
14
14
  import { getSession, onSession } from './session.js';