@panomc/sdk 1.0.0-dev.5 → 1.0.0-dev.50
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 +3 -3
- package/core/favicon/apple-touch-icon.png +0 -0
- package/core/favicon/favicon-96x96.png +0 -0
- package/core/favicon/favicon.ico +0 -0
- package/core/favicon/favicon.svg +1 -0
- package/core/favicon/site.webmanifest +21 -0
- package/core/favicon/web-app-manifest-192x192.png +0 -0
- package/core/favicon/web-app-manifest-512x512.png +0 -0
- package/core/favicon_old/android-icon-144x144.png +0 -0
- package/core/favicon_old/android-icon-192x192.png +0 -0
- package/core/favicon_old/android-icon-36x36.png +0 -0
- package/core/favicon_old/android-icon-48x48.png +0 -0
- package/core/favicon_old/android-icon-72x72.png +0 -0
- package/core/favicon_old/android-icon-96x96.png +0 -0
- package/core/favicon_old/apple-icon-114x114.png +0 -0
- package/core/favicon_old/apple-icon-120x120.png +0 -0
- package/core/favicon_old/apple-icon-144x144.png +0 -0
- package/core/favicon_old/apple-icon-152x152.png +0 -0
- package/core/favicon_old/apple-icon-180x180.png +0 -0
- package/core/favicon_old/apple-icon-57x57.png +0 -0
- package/core/favicon_old/apple-icon-60x60.png +0 -0
- package/core/favicon_old/apple-icon-72x72.png +0 -0
- package/core/favicon_old/apple-icon-76x76.png +0 -0
- package/core/favicon_old/apple-icon-precomposed.png +0 -0
- package/core/favicon_old/apple-icon.png +0 -0
- package/core/favicon_old/browserconfig.xml +11 -0
- package/core/favicon_old/favicon-16x16.png +0 -0
- package/core/favicon_old/favicon-32x32.png +0 -0
- package/core/favicon_old/favicon-96x96.png +0 -0
- package/core/favicon_old/favicon.ico +0 -0
- package/core/favicon_old/manifest.json +41 -0
- package/core/favicon_old/ms-icon-144x144.png +0 -0
- package/core/favicon_old/ms-icon-150x150.png +0 -0
- package/core/favicon_old/ms-icon-310x310.png +0 -0
- package/core/favicon_old/ms-icon-70x70.png +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.eot +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.svg +483 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.ttf +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.woff +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.woff2 +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.eot +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.svg +486 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.ttf +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.woff +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.woff2 +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.eot +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.svg +484 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.ttf +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.woff +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.woff2 +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.eot +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.svg +486 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.ttf +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.woff +0 -0
- package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.woff2 +0 -0
- package/core/js/NotificationManager.js +19 -0
- package/core/js/PluginAPI.js +29 -0
- package/core/js/PluginManager.js +789 -0
- package/core/js/RouteMatcher.js +134 -0
- package/core/js/api.util.js +248 -0
- package/core/js/tooltip.util.js +59 -0
- package/core/js/variables.js +63 -0
- package/core/js/version.util.js +100 -0
- package/core/scss/custom-bootstrap.scss +187 -0
- package/core/scss/fonts.scss +85 -0
- package/core/scss/main.scss +385 -0
- package/core/scss/themes.scss +97 -0
- package/package.json +34 -10
- package/src/api/plugin-context.js +3 -3
- package/src/api/plugin.js +20 -3
- package/src/components/{index.js → panel.js} +12 -8
- package/src/components/theme.js +13 -0
- package/src/index.js +3 -3
- package/src/internal/index.js +1 -1
- package/src/internal/pano-context.js +14 -4
- package/src/svelte.js +7 -0
- package/src/toasts/index.js +2 -2
- package/src/types.js +40 -0
- package/src/utils/api.js +2 -2
- package/src/utils/auth.js +8 -0
- package/src/utils/component.js +11 -9
- package/src/utils/language.js +2 -2
- package/src/utils/text.js +8 -0
- package/src/utils/tooltip.js +1 -1
- package/src/variables.js +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Pano UI Themes
|
|
2
|
+
|
|
3
|
+
[data-bs-theme='dark'] {
|
|
4
|
+
--bs-body-bg: #0a1931;
|
|
5
|
+
--bs-body-bg-rgb: #{to-rgb(#0a1931)};
|
|
6
|
+
|
|
7
|
+
--bs-secondary-bg: #112240;
|
|
8
|
+
--bs-secondary-bg-rgb: #{to-rgb(#112240)};
|
|
9
|
+
|
|
10
|
+
--bs-tertiary-bg: #162b4e;
|
|
11
|
+
--bs-tertiary-bg-rgb: #{to-rgb(#162b4e)};
|
|
12
|
+
|
|
13
|
+
--bs-emphasis-color: #{$white};
|
|
14
|
+
--bs-emphasis-color-rgb: #{to-rgb($white)};
|
|
15
|
+
|
|
16
|
+
--bs-secondary-color: rgba(204, 209, 217, 0.75);
|
|
17
|
+
--bs-tertiary-color: rgba(204, 209, 217, 0.5);
|
|
18
|
+
|
|
19
|
+
--bs-border-color: rgba(255, 255, 255, 0.1);
|
|
20
|
+
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin define-theme($name, $primary, $secondary) {
|
|
24
|
+
[data-bs-theme='#{$name}'] {
|
|
25
|
+
@extend [data-bs-theme='dark'];
|
|
26
|
+
|
|
27
|
+
$body-bg: shade-color($primary, 90%) !default;
|
|
28
|
+
--bs-body-bg: #{$body-bg};
|
|
29
|
+
--bs-body-bg-rgb: #{to-rgb($body-bg)};
|
|
30
|
+
|
|
31
|
+
$secondary-bg: shade-color($primary, 85%) !default;
|
|
32
|
+
--bs-secondary-bg: #{$secondary-bg};
|
|
33
|
+
--bs-secondary-bg-rgb: #{to-rgb($secondary-bg)};
|
|
34
|
+
|
|
35
|
+
$tertiary-bg: shade-color($primary, 82%) !default;
|
|
36
|
+
--bs-tertiary-bg: #{$tertiary-bg};
|
|
37
|
+
--bs-tertiary-bg-rgb: #{to-rgb($tertiary-bg)};
|
|
38
|
+
|
|
39
|
+
--bs-primary: #{$primary};
|
|
40
|
+
--bs-primary-rgb: #{to-rgb($primary)};
|
|
41
|
+
|
|
42
|
+
--bs-secondary: #{$secondary};
|
|
43
|
+
--bs-secondary-rgb: #{to-rgb($secondary)};
|
|
44
|
+
|
|
45
|
+
// Links
|
|
46
|
+
--bs-link-color: #{$primary};
|
|
47
|
+
--bs-link-color-rgb: #{to-rgb($primary)};
|
|
48
|
+
|
|
49
|
+
// Hover dark tones
|
|
50
|
+
$primary-hover: shade-color($primary, 15%) !default;
|
|
51
|
+
$secondary-hover: shade-color($secondary, 15%) !default;
|
|
52
|
+
--bs-link-hover-color: #{$primary-hover};
|
|
53
|
+
--bs-link-hover-color-rgb: #{to-rgb($primary-hover)};
|
|
54
|
+
|
|
55
|
+
--bs-primary-text-emphasis: #{tint-color($primary, 40%)};
|
|
56
|
+
--bs-primary-bg-subtle: rgba($primary, 0.12);
|
|
57
|
+
--bs-primary-border-subtle: #{shade-color($primary, 25%)};
|
|
58
|
+
|
|
59
|
+
--bs-secondary-text-emphasis: #{tint-color($secondary, 40%)};
|
|
60
|
+
--bs-secondary-bg-subtle: rgba($secondary, 0.12);
|
|
61
|
+
--bs-secondary-border-subtle: #{shade-color($secondary, 25%)};
|
|
62
|
+
|
|
63
|
+
.btn-primary {
|
|
64
|
+
--bs-btn-color: #000;
|
|
65
|
+
--bs-btn-bg: #{$primary};
|
|
66
|
+
--bs-btn-border-color: #{$primary};
|
|
67
|
+
--bs-btn-hover-color: #000;
|
|
68
|
+
--bs-btn-hover-bg: #{$primary-hover};
|
|
69
|
+
--bs-btn-hover-border-color: #{$primary-hover};
|
|
70
|
+
--bs-btn-active-color: #000;
|
|
71
|
+
--bs-btn-active-bg: #{$primary};
|
|
72
|
+
--bs-btn-active-border-color: #{$primary};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.btn-secondary {
|
|
76
|
+
--bs-btn-color: #000;
|
|
77
|
+
--bs-btn-bg: #{$secondary};
|
|
78
|
+
--bs-btn-border-color: #{$secondary};
|
|
79
|
+
--bs-btn-hover-color: #000;
|
|
80
|
+
--bs-btn-hover-bg: #{$secondary-hover};
|
|
81
|
+
--bs-btn-hover-border-color: #{$secondary-hover};
|
|
82
|
+
--bs-btn-active-color: #000;
|
|
83
|
+
--bs-btn-active-bg: #{$secondary};
|
|
84
|
+
--bs-btn-active-border-color: #{$secondary};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.nav-pills {
|
|
88
|
+
--bs-nav-pills-link-active-bg: #{$primary};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Themes
|
|
94
|
+
@include define-theme('copper', #b87333, #44ffd2);
|
|
95
|
+
@include define-theme('emerald', #10b981, #60a5fa);
|
|
96
|
+
@include define-theme('midnight', #8b5cf6, #ec4899);
|
|
97
|
+
@include define-theme('crimson', #ef4444, #f59e0b);
|
package/package.json
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panomc/sdk",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.50",
|
|
4
4
|
"author": "PanoMC",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/PanoMC/sdk"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
9
|
-
"svelte": "
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"svelte": "5.55.4",
|
|
10
|
+
"tippy.js": "^6.3.7",
|
|
11
|
+
"adm-zip": "^0.5.17"
|
|
10
12
|
},
|
|
11
|
-
"
|
|
12
|
-
"svelte": "
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"svelte": "5.55.4"
|
|
13
15
|
},
|
|
14
16
|
"exports": {
|
|
15
17
|
".": {
|
|
16
18
|
"svelte": "./src/index.js",
|
|
17
19
|
"default": "./src/index.js"
|
|
18
20
|
},
|
|
19
|
-
"./components": {
|
|
20
|
-
"svelte": "./src/components/
|
|
21
|
-
"default": "./src/components/
|
|
21
|
+
"./components/panel": {
|
|
22
|
+
"svelte": "./src/components/panel.js",
|
|
23
|
+
"default": "./src/components/panel.js"
|
|
24
|
+
},
|
|
25
|
+
"./components/theme": {
|
|
26
|
+
"svelte": "./src/components/theme.js",
|
|
27
|
+
"default": "./src/components/theme.js"
|
|
22
28
|
},
|
|
23
29
|
"./internal": {
|
|
24
30
|
"svelte": "./src/internal/index.js",
|
|
@@ -32,6 +38,10 @@
|
|
|
32
38
|
"svelte": "./src/utils/api.js",
|
|
33
39
|
"default": "./src/utils/api.js"
|
|
34
40
|
},
|
|
41
|
+
"./utils/auth": {
|
|
42
|
+
"svelte": "./src/utils/auth.js",
|
|
43
|
+
"default": "./src/utils/auth.js"
|
|
44
|
+
},
|
|
35
45
|
"./utils/tooltip": {
|
|
36
46
|
"svelte": "./src/utils/tooltip.js",
|
|
37
47
|
"default": "./src/utils/tooltip.js"
|
|
@@ -44,13 +54,27 @@
|
|
|
44
54
|
"svelte": "./src/utils/component.js",
|
|
45
55
|
"default": "./src/utils/component.js"
|
|
46
56
|
},
|
|
57
|
+
"./utils/text": {
|
|
58
|
+
"svelte": "./src/utils/text.js",
|
|
59
|
+
"default": "./src/utils/text.js"
|
|
60
|
+
},
|
|
47
61
|
"./variables": {
|
|
48
62
|
"svelte": "./src/variables.js",
|
|
49
63
|
"default": "./src/variables.js"
|
|
50
|
-
}
|
|
64
|
+
},
|
|
65
|
+
"./svelte": {
|
|
66
|
+
"svelte": "./src/svelte.js",
|
|
67
|
+
"default": "./src/svelte.js"
|
|
68
|
+
},
|
|
69
|
+
"./core/*": {
|
|
70
|
+
"svelte": "./core/*",
|
|
71
|
+
"default": "./core/*"
|
|
72
|
+
},
|
|
73
|
+
"./package.json": "./package.json"
|
|
51
74
|
},
|
|
52
75
|
"files": [
|
|
53
|
-
"src"
|
|
76
|
+
"src",
|
|
77
|
+
"core"
|
|
54
78
|
],
|
|
55
79
|
"publishConfig": {
|
|
56
80
|
"access": "public"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const GLOBAL_KEY =
|
|
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(
|
|
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 !==
|
|
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,10 +1,25 @@
|
|
|
1
|
-
import { createPluginContext } from
|
|
1
|
+
import { createPluginContext } from './plugin-context.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../types.js').Pano} Pano
|
|
5
|
+
* @typedef {import('../types.js').PanoPluginContext} PanoPluginContext
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
8
|
export class PanoPlugin {
|
|
4
9
|
static isPanoPlugin = true;
|
|
10
|
+
|
|
11
|
+
/** @type {Pano} */
|
|
12
|
+
pano;
|
|
13
|
+
|
|
14
|
+
/** @type {PanoPluginContext} */
|
|
15
|
+
contextApi;
|
|
16
|
+
|
|
17
|
+
/** @type {any} */
|
|
18
|
+
context;
|
|
19
|
+
|
|
5
20
|
constructor({ pluginId, scope } = {}) {
|
|
6
21
|
if (!pluginId) {
|
|
7
|
-
throw new Error(
|
|
22
|
+
throw new Error('[PanoPlugin] pluginId is required');
|
|
8
23
|
}
|
|
9
24
|
|
|
10
25
|
// plugin-scoped context
|
|
@@ -14,7 +29,9 @@ export class PanoPlugin {
|
|
|
14
29
|
this._unsubscribers = [];
|
|
15
30
|
}
|
|
16
31
|
|
|
17
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* @param {Pano} pano
|
|
34
|
+
*/
|
|
18
35
|
onLoad(pano) {}
|
|
19
36
|
onUnload() {}
|
|
20
37
|
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { getPanoContext } from
|
|
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
|
+
export const NoContent = components.NoContent;
|
|
7
|
+
export const Editor = components.Editor;
|
|
8
|
+
export const DragAndDropZone = components.DragAndDropZone;
|
|
9
|
+
export const Date = components.Date;
|
|
10
|
+
export const Toast = components.Toast;
|
|
11
|
+
|
|
12
|
+
export const PageLoading = components.PageLoading;
|
|
6
13
|
export const PageActions = components.PageActions;
|
|
7
14
|
export const PageLoader = components.PageLoader;
|
|
8
15
|
export const PageNavItem = components.PageNavItem;
|
|
9
16
|
export const PageNav = components.PageNav;
|
|
10
17
|
export const Pagination = components.Pagination;
|
|
11
|
-
|
|
12
|
-
export const Toast = components.Toast;
|
|
18
|
+
|
|
13
19
|
export const CardFilters = components.CardFilters;
|
|
14
20
|
export const CardFiltersItem = components.CardFiltersItem;
|
|
15
21
|
export const CardHeader = components.CardHeader;
|
|
16
|
-
export const
|
|
17
|
-
export const CardMenuItem = components.CardMenuItem;
|
|
18
|
-
export const Date = components.Date;
|
|
22
|
+
export const SearchInput = components.SearchInput;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getPanoContext } from "../internal/index.js";
|
|
2
|
+
|
|
3
|
+
const panoContext = getPanoContext();
|
|
4
|
+
const components = panoContext.context.components;
|
|
5
|
+
|
|
6
|
+
export const PlayerHead = components.PlayerHead;
|
|
7
|
+
export const NoContent = components.NoContent;
|
|
8
|
+
export const Date = components.Date;
|
|
9
|
+
export const Toast = components.Toast;
|
|
10
|
+
|
|
11
|
+
export const PageTitle = components.PageTitle;
|
|
12
|
+
export const PageActions = components.PageActions;
|
|
13
|
+
export const Pagination = components.Pagination;
|
package/src/index.js
CHANGED
package/src/internal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './pano-context.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const GLOBAL_KEY =
|
|
1
|
+
const GLOBAL_KEY = '__PANO_CONTEXT__';
|
|
2
2
|
|
|
3
3
|
function getStore() {
|
|
4
4
|
if (!globalThis[GLOBAL_KEY]) {
|
|
@@ -10,11 +10,18 @@ function getStore() {
|
|
|
10
10
|
return globalThis[GLOBAL_KEY];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {import('../types.js').Pano} Pano
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {Partial<Pano>} partial
|
|
19
|
+
*/
|
|
13
20
|
export function setPanoContext(partial) {
|
|
14
21
|
const store = getStore();
|
|
15
22
|
|
|
16
|
-
if (typeof partial !==
|
|
17
|
-
console.warn(
|
|
23
|
+
if (typeof partial !== 'object' || partial === null) {
|
|
24
|
+
console.warn('[PanoSDK] setPanoContext expects an object');
|
|
18
25
|
return;
|
|
19
26
|
}
|
|
20
27
|
|
|
@@ -24,11 +31,14 @@ export function setPanoContext(partial) {
|
|
|
24
31
|
try {
|
|
25
32
|
fn(store.context);
|
|
26
33
|
} catch (e) {
|
|
27
|
-
console.error(
|
|
34
|
+
console.error('[PanoSDK] listener error', e);
|
|
28
35
|
}
|
|
29
36
|
});
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
/**
|
|
40
|
+
* @returns {{ context: Pano, subscribe: (fn: (ctx: Pano) => void) => () => void }}
|
|
41
|
+
*/
|
|
32
42
|
export function getPanoContext() {
|
|
33
43
|
const store = getStore();
|
|
34
44
|
|
package/src/svelte.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getPanoContext } from './internal/index.js';
|
|
2
|
+
|
|
3
|
+
const panoContext = getPanoContext();
|
|
4
|
+
const { page, base, navigating, browser, goto, invalidate, invalidateAll, error, redirect } =
|
|
5
|
+
panoContext.context;
|
|
6
|
+
|
|
7
|
+
export { page, base, navigating, browser, goto, invalidate, invalidateAll, error, redirect };
|
package/src/toasts/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPanoContext } from
|
|
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
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Pano
|
|
3
|
+
* @property {boolean} isPanel
|
|
4
|
+
* @property {any} page - SvelteKit page store
|
|
5
|
+
* @property {string} base
|
|
6
|
+
* @property {any} navigating - SvelteKit navigating store
|
|
7
|
+
* @property {boolean} browser
|
|
8
|
+
* @property {Object} ui
|
|
9
|
+
* @property {Object} ui.page
|
|
10
|
+
* @property {function({path: string, component: any, layout?: any, resetLayout?: boolean}): void} ui.page.register
|
|
11
|
+
* @property {Object} ui.nav
|
|
12
|
+
* @property {Object} ui.nav.site
|
|
13
|
+
* @property {function(function(any[]): any[]): void} ui.nav.site.editNavLinks
|
|
14
|
+
* @property {Object} utils
|
|
15
|
+
* @property {Object} utils.api
|
|
16
|
+
* @property {any} utils.api.ApiUtil
|
|
17
|
+
* @property {function(Record<string, any>): string} utils.api.buildQueryParams
|
|
18
|
+
* @property {string} utils.api.NETWORK_ERROR
|
|
19
|
+
* @property {Object} utils.api.networkErrorBody
|
|
20
|
+
* @property {string} utils.api.networkErrorBody.result
|
|
21
|
+
* @property {string} utils.api.networkErrorBody.error
|
|
22
|
+
* @property {Object} utils.language
|
|
23
|
+
* @property {any} utils.language.init
|
|
24
|
+
* @property {any} utils.language._ - i18n store or function
|
|
25
|
+
* @property {Object} utils.tooltip
|
|
26
|
+
* @property {any} utils.tooltip.tooltip
|
|
27
|
+
* @property {any} utils.toast
|
|
28
|
+
* @property {Record<string, any>} components
|
|
29
|
+
* @property {Record<string, any>} variables
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {Object} PanoPluginContext
|
|
34
|
+
* @property {any} context
|
|
35
|
+
* @property {function(any): void} set
|
|
36
|
+
* @property {function(function(any): void): function(): void} subscribe
|
|
37
|
+
* @property {function(): void} [destroy]
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
export {};
|
package/src/utils/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPanoContext } from
|
|
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;
|
package/src/utils/component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mount, unmount
|
|
1
|
+
import { hydrate, mount, unmount } 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,15 @@ import { mount, unmount, hydrate } from "svelte";
|
|
|
8
8
|
* @returns {() => Promise<any>} - Wrapped importer
|
|
9
9
|
*/
|
|
10
10
|
export function viewComponent(importer) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
11
|
+
const wrapper = 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
|
+
wrapper._importer = importer;
|
|
21
|
+
return wrapper;
|
|
20
22
|
}
|
package/src/utils/language.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPanoContext } from
|
|
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
|
};
|
package/src/utils/tooltip.js
CHANGED
package/src/variables.js
CHANGED