@rosettadash/svelte 0.1.1 → 0.1.2

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": "@rosettadash/svelte",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "RosettaDash Svelte 5 runtime — same import paths as @rosettadash/web-components. Storybook: github.com/KevinEverywhere/rosettadash (port 6010).",
5
5
  "author": "Kevin Ready <kevin@planetkevin.com>",
6
6
  "type": "module",
@@ -15,6 +15,12 @@
15
15
  "import": "./src/index.js",
16
16
  "default": "./src/index.js"
17
17
  },
18
+ "./domain/i18n/app-language-select": {
19
+ "types": "./src/domain/i18n/app-language-select/types.d.ts",
20
+ "svelte": "./src/domain/i18n/app-language-select/AppLanguageSelect.svelte",
21
+ "import": "./src/domain/i18n/app-language-select/AppLanguageSelect.svelte",
22
+ "default": "./src/domain/i18n/app-language-select/AppLanguageSelect.svelte"
23
+ },
18
24
  "./domain/person-invite": {
19
25
  "types": "./src/domain/person-invite/types.d.ts",
20
26
  "svelte": "./src/domain/person-invite/PersonInvite.svelte",
@@ -201,6 +207,12 @@
201
207
  "import": "./src/visual/display/3d-scene/ThreeScenePointCloud.svelte",
202
208
  "default": "./src/visual/display/3d-scene/ThreeScenePointCloud.svelte"
203
209
  },
210
+ "./visual/display/geo-map": {
211
+ "types": "./src/visual/display/geo-map/types.d.ts",
212
+ "svelte": "./src/visual/display/geo-map/GeoMap.svelte",
213
+ "import": "./src/visual/display/geo-map/GeoMap.svelte",
214
+ "default": "./src/visual/display/geo-map/GeoMap.svelte"
215
+ },
204
216
  "./visual/input/checkbox": {
205
217
  "types": "./src/visual/input/checkbox/types.d.ts",
206
218
  "svelte": "./src/visual/input/checkbox/CheckboxInput.svelte",
@@ -267,6 +279,12 @@
267
279
  "import": "./src/visual/media/video-source/VideoSource.svelte",
268
280
  "default": "./src/visual/media/video-source/VideoSource.svelte"
269
281
  },
282
+ "./visual/media/youtube-embed": {
283
+ "types": "./src/visual/media/youtube-embed/types.d.ts",
284
+ "svelte": "./src/visual/media/youtube-embed/YoutubeEmbed.svelte",
285
+ "import": "./src/visual/media/youtube-embed/YoutubeEmbed.svelte",
286
+ "default": "./src/visual/media/youtube-embed/YoutubeEmbed.svelte"
287
+ },
270
288
  "./visual/news/article-detail": {
271
289
  "types": "./src/visual/news/article-detail/types.d.ts",
272
290
  "svelte": "./src/visual/news/article-detail/NewsArticleDetail.svelte",
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import {
4
+ DB_APP_LANGUAGE_SELECT_TAG,
5
+ registerRdAppLanguageSelect,
6
+ } from '@rosettadash/web-components/domain/i18n/app-language-select';
7
+ import {
8
+ attachHostEvents,
9
+ setHostAttribute,
10
+ setHostProperty,
11
+ } from '../../../lib/custom-element-host';
12
+ import type { AppLanguageSelectProps } from './types';
13
+
14
+ let {
15
+ locales,
16
+ value,
17
+ defaultLocale,
18
+ label,
19
+ placeholder,
20
+ className,
21
+ onLocaleChange,
22
+ }: AppLanguageSelectProps = $props();
23
+
24
+ let host: HTMLElement;
25
+ let detachEvents = () => {};
26
+
27
+ onMount(() => {
28
+ registerRdAppLanguageSelect();
29
+ detachEvents = attachHostEvents(host, {
30
+ 'locale-change': (detail) =>
31
+ onLocaleChange?.(detail as { locale: string }),
32
+ });
33
+ return () => detachEvents();
34
+ });
35
+
36
+ $effect(() => {
37
+ if (!host) {
38
+ return;
39
+ }
40
+ setHostProperty(host, 'locales', locales);
41
+ setHostAttribute(host, 'value', value);
42
+ setHostAttribute(host, 'default-locale', defaultLocale);
43
+ setHostAttribute(host, 'label', label);
44
+ setHostAttribute(host, 'placeholder', placeholder);
45
+ });
46
+ </script>
47
+
48
+ <svelte:element this={DB_APP_LANGUAGE_SELECT_TAG} bind:this={host} class={className} />
@@ -0,0 +1,2 @@
1
+ export type { AppLanguageSelectProps, AppLocaleOption } from './types';
2
+ /** Component entry is `AppLanguageSelect.svelte` (see package exports). */
@@ -0,0 +1,3 @@
1
+ export {};
2
+ /** Component entry is `AppLanguageSelect.svelte` (see package exports). */
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/svelte/src/domain/i18n/app-language-select/index.ts"],"names":[],"mappings":";AACA,2EAA2E"}
@@ -0,0 +1,16 @@
1
+ export interface AppLocaleOption {
2
+ code: string;
3
+ label: string;
4
+ nativeLabel?: string;
5
+ }
6
+ export interface AppLanguageSelectProps {
7
+ locales?: AppLocaleOption[];
8
+ value?: string;
9
+ defaultLocale?: string;
10
+ label?: string;
11
+ placeholder?: string;
12
+ className?: string;
13
+ onLocaleChange?: (detail: {
14
+ locale: string;
15
+ }) => void;
16
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/svelte/src/domain/i18n/app-language-select/types.ts"],"names":[],"mappings":""}
package/src/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type { AppLocaleOption, AppLanguageSelectProps } from './domain/i18n/app-language-select/types';
1
2
  export type { PersonInviteProps } from './domain/person-invite/types';
2
3
  export type { RoleAssignProps } from './domain/role-assign/types';
3
4
  export type { RoleGateProps } from './domain/role-gate/types';
@@ -29,6 +30,7 @@ export type { ThreeGeoGlobeProps } from './visual/display/3d-geo-globe/types';
29
30
  export type { ThreeGltfModelProps } from './visual/display/3d-gltf-model/types';
30
31
  export type { ThreeScatterPlotProps } from './visual/display/3d-scatter/types';
31
32
  export type { ThreeScenePointCloudProps } from './visual/display/3d-scene/types';
33
+ export type { GeoMapProps } from './visual/display/geo-map/types';
32
34
  export type { CheckboxInputProps } from './visual/input/checkbox/types';
33
35
  export type { DateRangeFilterProps } from './visual/input/date-range/types';
34
36
  export type { NumberInputProps } from './visual/input/number/types';
@@ -40,6 +42,7 @@ export type { LinkListItem, LinkListProps } from './visual/link-list/types';
40
42
  export type { EquirectPreviewMode, EquirectViewportProps } from './visual/media/equirect-viewport/types';
41
43
  export type { LiveCaptureProps } from './visual/media/live-capture/types';
42
44
  export type { VideoFileDetail, VideoSourceProps } from './visual/media/video-source/types';
45
+ export type { YoutubeEmbedProps } from './visual/media/youtube-embed/types';
43
46
  export type { NewsArticleDetailProps } from './visual/news/article-detail/types';
44
47
  export type { NewsLanguageSelectProps } from './visual/news/language-select/types';
45
48
  export type { NewsRegionSelectProps } from './visual/news/region-select/types';
@@ -0,0 +1,52 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import {
4
+ DB_GEO_MAP_TAG,
5
+ registerRdGeoMap,
6
+ } from '@rosettadash/web-components/visual/display/geo-map';
7
+ import {
8
+ attachHostEvents,
9
+ setHostAttribute,
10
+ setHostProperty,
11
+ } from '../../../lib/custom-element-host';
12
+ import type { GeoMapProps } from './types';
13
+
14
+ let {
15
+ provider,
16
+ tileUrl,
17
+ apiKey,
18
+ center,
19
+ zoom,
20
+ markers,
21
+ selectedId,
22
+ className,
23
+ onMarkerSelect,
24
+ }: GeoMapProps = $props();
25
+
26
+ let host: HTMLElement;
27
+ let detachEvents = () => {};
28
+
29
+ onMount(() => {
30
+ registerRdGeoMap();
31
+ detachEvents = attachHostEvents(host, {
32
+ 'marker-select': (detail) =>
33
+ onMarkerSelect?.(detail as { id: string; lat: number; lng: number }),
34
+ });
35
+ return () => detachEvents();
36
+ });
37
+
38
+ $effect(() => {
39
+ if (!host) {
40
+ return;
41
+ }
42
+ setHostAttribute(host, 'provider', provider);
43
+ setHostAttribute(host, 'tile-url', tileUrl);
44
+ setHostAttribute(host, 'api-key', apiKey);
45
+ setHostAttribute(host, 'center', center);
46
+ setHostAttribute(host, 'zoom', zoom);
47
+ setHostProperty(host, 'markers', markers);
48
+ setHostAttribute(host, 'selected-id', selectedId);
49
+ });
50
+ </script>
51
+
52
+ <svelte:element this={DB_GEO_MAP_TAG} bind:this={host} class={className} />
@@ -0,0 +1,2 @@
1
+ export type { GeoMapProps, GeoMapMarker, GeoMapProvider } from './types';
2
+ /** Component entry is `GeoMap.svelte` (see package exports). */
@@ -0,0 +1,3 @@
1
+ export {};
2
+ /** Component entry is `GeoMap.svelte` (see package exports). */
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/svelte/src/visual/display/geo-map/index.ts"],"names":[],"mappings":";AACA,gEAAgE"}
@@ -0,0 +1,18 @@
1
+ import type { GeoMapMarker, GeoMapProvider } from '@rosettadash/web-components/visual/display/geo-map';
2
+ export type { GeoMapMarker, GeoMapProvider };
3
+ export interface GeoMapProps {
4
+ provider?: GeoMapProvider;
5
+ tileUrl?: string;
6
+ apiKey?: string;
7
+ center?: string;
8
+ zoom?: number;
9
+ markers?: GeoMapMarker[];
10
+ selectedId?: string;
11
+ className?: string;
12
+ onMarkerSelect?: (detail: {
13
+ id: string;
14
+ lat: number;
15
+ lng: number;
16
+ }) => void;
17
+ }
18
+ export { default as GeoMap } from './GeoMap.svelte';
@@ -0,0 +1,2 @@
1
+ export { default as GeoMap } from './GeoMap.svelte';
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/svelte/src/visual/display/geo-map/types.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import {
4
+ DB_YOUTUBE_EMBED_TAG,
5
+ registerRdYoutubeEmbed,
6
+ } from '@rosettadash/web-components/visual/media/youtube-embed';
7
+ import { setHostAttribute } from '../../../lib/custom-element-host';
8
+ import type { YoutubeEmbedProps } from './types';
9
+
10
+ let {
11
+ videoId,
12
+ url,
13
+ start,
14
+ autoplay,
15
+ mute,
16
+ controls,
17
+ title,
18
+ className,
19
+ }: YoutubeEmbedProps = $props();
20
+
21
+ let host: HTMLElement;
22
+
23
+ onMount(() => {
24
+ registerRdYoutubeEmbed();
25
+ });
26
+
27
+ $effect(() => {
28
+ if (!host) {
29
+ return;
30
+ }
31
+ setHostAttribute(host, 'video-id', videoId);
32
+ setHostAttribute(host, 'url', url);
33
+ setHostAttribute(host, 'start', start);
34
+ setHostAttribute(host, 'autoplay', autoplay);
35
+ setHostAttribute(host, 'mute', mute);
36
+ if (controls === false) {
37
+ host.setAttribute('controls', 'false');
38
+ } else {
39
+ host.removeAttribute('controls');
40
+ }
41
+ setHostAttribute(host, 'embed-title', title);
42
+ });
43
+ </script>
44
+
45
+ <svelte:element this={DB_YOUTUBE_EMBED_TAG} bind:this={host} class={className} />
@@ -0,0 +1,2 @@
1
+ export type { YoutubeEmbedProps } from './types';
2
+ /** Component entry is `YoutubeEmbed.svelte` (see package exports). */
@@ -0,0 +1,3 @@
1
+ export {};
2
+ /** Component entry is `YoutubeEmbed.svelte` (see package exports). */
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/svelte/src/visual/media/youtube-embed/index.ts"],"names":[],"mappings":";AACA,sEAAsE"}
@@ -0,0 +1,10 @@
1
+ export interface YoutubeEmbedProps {
2
+ videoId?: string;
3
+ url?: string;
4
+ start?: number;
5
+ autoplay?: boolean;
6
+ mute?: boolean;
7
+ controls?: boolean;
8
+ title?: string;
9
+ className?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/svelte/src/visual/media/youtube-embed/types.ts"],"names":[],"mappings":""}
@@ -26,11 +26,14 @@
26
26
  yaw,
27
27
  pitch,
28
28
  horizontalFov,
29
+ reverse,
29
30
  inputFile,
30
31
  cropRegion,
32
+ recordRange,
31
33
  className,
32
34
  onProgress,
33
35
  onExtractComplete,
36
+ onExtractError,
34
37
  onMetadata,
35
38
  }: WasmMediaProps = $props();
36
39
 
@@ -48,6 +51,7 @@
48
51
  metadata: Record<string, string | number | boolean | null | undefined>;
49
52
  },
50
53
  ),
54
+ 'extract-error': (detail) => onExtractError?.(detail as { message: string }),
51
55
  metadata: (detail) =>
52
56
  onMetadata?.(
53
57
  detail as Record<string, string | number | boolean | null | undefined>,
@@ -74,8 +78,10 @@
74
78
  setHostAttribute(host, 'yaw', yaw);
75
79
  setHostAttribute(host, 'pitch', pitch);
76
80
  setHostAttribute(host, 'horizontal-fov', horizontalFov);
81
+ setHostAttribute(host, 'reverse', reverse);
77
82
  setHostProperty(host, 'inputFile', inputFile);
78
83
  setHostProperty(host, 'cropRegion', cropRegion);
84
+ setHostProperty(host, 'recordRange', recordRange);
79
85
  });
80
86
  </script>
81
87
 
@@ -1,3 +1,4 @@
1
+ import type { AuthoringRecordRange } from '@rosettadash/core';
1
2
  export interface WasmMediaProps {
2
3
  label?: string;
3
4
  operation?: string;
@@ -13,8 +14,10 @@ export interface WasmMediaProps {
13
14
  yaw?: number;
14
15
  pitch?: number;
15
16
  horizontalFov?: number;
17
+ reverse?: boolean;
16
18
  inputFile?: File | Blob | null;
17
19
  cropRegion?: Record<string, string | number | boolean | null | undefined> | null;
20
+ recordRange?: AuthoringRecordRange | null;
18
21
  className?: string;
19
22
  onProgress?: (detail: {
20
23
  progress: number;
@@ -23,5 +26,8 @@ export interface WasmMediaProps {
23
26
  blob: Blob;
24
27
  metadata: Record<string, string | number | boolean | null | undefined>;
25
28
  }) => void;
29
+ onExtractError?: (detail: {
30
+ message: string;
31
+ }) => void;
26
32
  onMetadata?: (detail: Record<string, string | number | boolean | null | undefined>) => void;
27
33
  }