@panomc/sdk 1.0.0-dev.6 → 1.0.0-dev.60

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.
Files changed (85) hide show
  1. package/README.md +3 -3
  2. package/core/favicon/apple-touch-icon.png +0 -0
  3. package/core/favicon/favicon-96x96.png +0 -0
  4. package/core/favicon/favicon.ico +0 -0
  5. package/core/favicon/favicon.svg +1 -0
  6. package/core/favicon/site.webmanifest +21 -0
  7. package/core/favicon/web-app-manifest-192x192.png +0 -0
  8. package/core/favicon/web-app-manifest-512x512.png +0 -0
  9. package/core/favicon_old/android-icon-144x144.png +0 -0
  10. package/core/favicon_old/android-icon-192x192.png +0 -0
  11. package/core/favicon_old/android-icon-36x36.png +0 -0
  12. package/core/favicon_old/android-icon-48x48.png +0 -0
  13. package/core/favicon_old/android-icon-72x72.png +0 -0
  14. package/core/favicon_old/android-icon-96x96.png +0 -0
  15. package/core/favicon_old/apple-icon-114x114.png +0 -0
  16. package/core/favicon_old/apple-icon-120x120.png +0 -0
  17. package/core/favicon_old/apple-icon-144x144.png +0 -0
  18. package/core/favicon_old/apple-icon-152x152.png +0 -0
  19. package/core/favicon_old/apple-icon-180x180.png +0 -0
  20. package/core/favicon_old/apple-icon-57x57.png +0 -0
  21. package/core/favicon_old/apple-icon-60x60.png +0 -0
  22. package/core/favicon_old/apple-icon-72x72.png +0 -0
  23. package/core/favicon_old/apple-icon-76x76.png +0 -0
  24. package/core/favicon_old/apple-icon-precomposed.png +0 -0
  25. package/core/favicon_old/apple-icon.png +0 -0
  26. package/core/favicon_old/browserconfig.xml +11 -0
  27. package/core/favicon_old/favicon-16x16.png +0 -0
  28. package/core/favicon_old/favicon-32x32.png +0 -0
  29. package/core/favicon_old/favicon-96x96.png +0 -0
  30. package/core/favicon_old/favicon.ico +0 -0
  31. package/core/favicon_old/manifest.json +41 -0
  32. package/core/favicon_old/ms-icon-144x144.png +0 -0
  33. package/core/favicon_old/ms-icon-150x150.png +0 -0
  34. package/core/favicon_old/ms-icon-310x310.png +0 -0
  35. package/core/favicon_old/ms-icon-70x70.png +0 -0
  36. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.eot +0 -0
  37. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.svg +483 -0
  38. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.ttf +0 -0
  39. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.woff +0 -0
  40. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-300.woff2 +0 -0
  41. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.eot +0 -0
  42. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.svg +486 -0
  43. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.ttf +0 -0
  44. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.woff +0 -0
  45. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-500.woff2 +0 -0
  46. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.eot +0 -0
  47. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.svg +484 -0
  48. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.ttf +0 -0
  49. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.woff +0 -0
  50. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-700.woff2 +0 -0
  51. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.eot +0 -0
  52. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.svg +486 -0
  53. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.ttf +0 -0
  54. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.woff +0 -0
  55. package/core/fonts/quicksand-v8-latin-ext_latin_vietnamese-regular.woff2 +0 -0
  56. package/core/js/NotificationManager.js +19 -0
  57. package/core/js/PluginAPI.js +29 -0
  58. package/core/js/PluginManager.js +789 -0
  59. package/core/js/RouteMatcher.js +134 -0
  60. package/core/js/api.util.js +270 -0
  61. package/core/js/tooltip.util.js +59 -0
  62. package/core/js/variables.js +75 -0
  63. package/core/js/version.util.js +100 -0
  64. package/core/scss/custom-bootstrap.scss +187 -0
  65. package/core/scss/fonts.scss +85 -0
  66. package/core/scss/main.scss +385 -0
  67. package/core/scss/themes.scss +97 -0
  68. package/package.json +30 -10
  69. package/src/api/plugin-context.js +3 -3
  70. package/src/api/plugin.js +6 -6
  71. package/src/components/{index.js → panel.js} +12 -8
  72. package/src/components/theme.js +13 -0
  73. package/src/index.js +3 -3
  74. package/src/internal/index.js +1 -1
  75. package/src/internal/pano-context.js +4 -4
  76. package/src/svelte.js +4 -3
  77. package/src/toasts/index.js +2 -2
  78. package/src/types.js +1 -1
  79. package/src/utils/api.js +2 -2
  80. package/src/utils/auth.js +8 -0
  81. package/src/utils/component.js +11 -9
  82. package/src/utils/language.js +2 -2
  83. package/src/utils/text.js +8 -0
  84. package/src/utils/tooltip.js +1 -1
  85. 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.6",
3
+ "version": "1.0.0-dev.60",
4
4
  "author": "PanoMC",
5
5
  "repository": {
6
6
  "url": "https://github.com/PanoMC/sdk"
7
7
  },
8
- "devDependencies": {
9
- "svelte": "^5.46.1"
8
+ "dependencies": {
9
+ "svelte": "5.55.9",
10
+ "tippy.js": "^6.3.7",
11
+ "adm-zip": "^0.6.1"
10
12
  },
11
- "peerDependencies": {
12
- "svelte": "^5.46.1"
13
+ "devDependencies": {
14
+ "svelte": "5.55.9"
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/index.js",
21
- "default": "./src/components/index.js"
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,6 +54,10 @@
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"
@@ -51,10 +65,16 @@
51
65
  "./svelte": {
52
66
  "svelte": "./src/svelte.js",
53
67
  "default": "./src/svelte.js"
54
- }
68
+ },
69
+ "./core/*": {
70
+ "svelte": "./core/*",
71
+ "default": "./core/*"
72
+ },
73
+ "./package.json": "./package.json"
55
74
  },
56
75
  "files": [
57
- "src"
76
+ "src",
77
+ "core"
58
78
  ],
59
79
  "publishConfig": {
60
80
  "access": "public"
@@ -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,18 +1,22 @@
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
+ 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
- export const PageLoading = components.PageLoading;
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 CardMenu = components.CardMenu;
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
@@ -1,5 +1,5 @@
1
- export { getPanoContext } from "./internal"
1
+ export { getPanoContext } from "./internal/index.js";
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,6 +1,7 @@
1
- import { getPanoContext } from "./internal/index.js";
1
+ import { getPanoContext } from './internal/index.js';
2
2
 
3
3
  const panoContext = getPanoContext();
4
- const { page, base, navigating, browser } = panoContext.context;
4
+ const { page, base, navigating, browser, goto, invalidate, invalidateAll, error, redirect } =
5
+ panoContext.context;
5
6
 
6
- export { page, base, navigating, browser };
7
+ export { page, base, navigating, browser, goto, invalidate, invalidateAll, error, redirect };
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { getPanoContext } from '../internal/index.js';
2
+
3
+ const panoContext = getPanoContext();
4
+ const authStuff = panoContext.context.utils.auth;
5
+
6
+ const hasPermission = authStuff.hasPermission;
7
+
8
+ export { hasPermission };
@@ -1,4 +1,4 @@
1
- import { mount, unmount, hydrate } from "svelte";
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
- 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
+ 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
  }
@@ -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
  };
@@ -0,0 +1,8 @@
1
+ import { getPanoContext } from '../internal/index.js';
2
+
3
+ const panoContext = getPanoContext();
4
+ const textStuff = panoContext.context.utils.text;
5
+
6
+ const copy = textStuff.copy;
7
+
8
+ export { copy };
@@ -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;