rune-lab 0.3.0 → 0.4.0

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 (133) hide show
  1. package/README.md +1 -1
  2. package/dist/core/design-tokens/props.d.ts +52 -0
  3. package/dist/core/design-tokens/props.d.ts.map +1 -0
  4. package/dist/core/design-tokens/props.js +34 -0
  5. package/dist/core/exchange-rate/strategies.d.ts +52 -0
  6. package/dist/core/exchange-rate/strategies.d.ts.map +1 -0
  7. package/dist/core/exchange-rate/strategies.js +72 -0
  8. package/dist/core/index.d.ts +8 -3
  9. package/dist/core/index.d.ts.map +1 -1
  10. package/dist/core/index.js +8 -3
  11. package/dist/core/internal/message-resolver.d.ts +1 -1
  12. package/dist/core/internal/message-resolver.d.ts.map +1 -1
  13. package/dist/core/layout/types.d.ts +60 -0
  14. package/dist/core/layout/types.d.ts.map +1 -0
  15. package/dist/core/layout/types.js +4 -0
  16. package/dist/core/money/index.d.ts +1 -1
  17. package/dist/core/money/index.d.ts.map +1 -1
  18. package/dist/core/money/index.js +1 -1
  19. package/dist/core/money/money-primitive.d.ts +101 -0
  20. package/dist/core/money/money-primitive.d.ts.map +1 -0
  21. package/dist/core/money/money-primitive.js +161 -0
  22. package/dist/core/money/money.d.ts +74 -2
  23. package/dist/core/money/money.d.ts.map +1 -1
  24. package/dist/core/money/money.js +120 -2
  25. package/dist/core/shortcuts/types.d.ts +60 -0
  26. package/dist/core/shortcuts/types.d.ts.map +1 -0
  27. package/dist/core/shortcuts/types.js +4 -0
  28. package/dist/index.d.ts +4 -3
  29. package/dist/index.js +6 -4
  30. package/dist/state/api.svelte.js +2 -2
  31. package/dist/state/app.svelte.js +1 -1
  32. package/dist/state/auth/index.d.ts +2 -2
  33. package/dist/state/auth/index.js +1 -1
  34. package/dist/state/auth/session.svelte.d.ts +1 -1
  35. package/dist/state/auth/session.svelte.js +7 -5
  36. package/dist/state/auth/types.d.ts +1 -1
  37. package/dist/state/cart.svelte.d.ts +1 -1
  38. package/dist/state/cart.svelte.js +1 -1
  39. package/dist/state/commands.svelte.d.ts +7 -7
  40. package/dist/state/commands.svelte.js +1 -1
  41. package/dist/state/composables/useMoney.d.ts +19 -3
  42. package/dist/state/composables/useMoney.js +70 -6
  43. package/dist/state/composables/useMoneyFilter.d.ts +20 -0
  44. package/dist/state/composables/useMoneyFilter.js +81 -0
  45. package/dist/state/composables/usePersistence.d.ts +1 -1
  46. package/dist/state/composables/usePersistence.js +1 -1
  47. package/dist/state/composables/useRuneLab.d.ts +1 -1
  48. package/dist/state/composables/useRuneLab.js +2 -2
  49. package/dist/state/composables/useShortcuts.d.ts +33 -0
  50. package/dist/state/composables/useShortcuts.js +75 -0
  51. package/dist/state/context.d.ts +1 -0
  52. package/dist/state/context.js +1 -0
  53. package/dist/state/createConfigStore.svelte.d.ts +4 -31
  54. package/dist/state/createConfigStore.svelte.js +62 -51
  55. package/dist/state/currency.svelte.d.ts +13 -9
  56. package/dist/state/currency.svelte.js +26 -10
  57. package/dist/state/currency.test.d.ts +1 -0
  58. package/dist/state/currency.test.js +35 -0
  59. package/dist/state/exchange-rate.svelte.d.ts +43 -0
  60. package/dist/state/exchange-rate.svelte.js +145 -0
  61. package/dist/state/exchange-rate.test.d.ts +1 -0
  62. package/dist/state/exchange-rate.test.js +75 -0
  63. package/dist/state/index.d.ts +26 -19
  64. package/dist/state/index.js +25 -18
  65. package/dist/state/language.svelte.d.ts +3 -10
  66. package/dist/state/language.svelte.js +4 -5
  67. package/dist/state/layout.svelte.d.ts +1 -1
  68. package/dist/state/layout.svelte.js +4 -4
  69. package/dist/state/persistence/drivers.d.ts +1 -1
  70. package/dist/state/persistence/drivers.js +9 -7
  71. package/dist/state/persistence/drivers.test.d.ts +1 -0
  72. package/dist/state/persistence/drivers.test.js +79 -0
  73. package/dist/state/persistence/provider.d.ts +23 -0
  74. package/dist/state/persistence/provider.js +43 -0
  75. package/dist/state/persistence/provider.test.d.ts +1 -0
  76. package/dist/state/persistence/provider.test.js +51 -0
  77. package/dist/state/registry/index.d.ts +44 -0
  78. package/dist/state/registry/index.js +58 -0
  79. package/dist/state/registry/registry.test.d.ts +1 -0
  80. package/dist/state/registry/registry.test.js +112 -0
  81. package/dist/state/registry/types.d.ts +20 -0
  82. package/dist/state/registry/types.js +3 -0
  83. package/dist/state/shortcuts.svelte.js +4 -4
  84. package/dist/state/theme.svelte.d.ts +3 -10
  85. package/dist/state/theme.svelte.js +8 -8
  86. package/dist/state/toast-bridge.d.ts +1 -1
  87. package/dist/state/toast.svelte.js +1 -1
  88. package/dist/ui/components/ApiMonitor.svelte +2 -2
  89. package/dist/ui/components/Icon.svelte +1 -1
  90. package/dist/ui/components/RuneProvider.svelte +28 -8
  91. package/dist/ui/components/RuneProvider.svelte.d.ts +12 -5
  92. package/dist/ui/components/Toaster.svelte +1 -1
  93. package/dist/ui/components/money/MoneyDisplay.svelte +91 -18
  94. package/dist/ui/components/money/MoneyDisplay.svelte.d.ts +15 -3
  95. package/dist/ui/components/money/MoneyDisplay.svelte.test.d.ts +1 -1
  96. package/dist/ui/components/money/MoneyDisplay.svelte.test.js +45 -2
  97. package/dist/ui/components/money/MoneyInput.svelte +123 -42
  98. package/dist/ui/components/money/MoneyInput.svelte.d.ts +14 -5
  99. package/dist/ui/features/command-palette/CommandPalette.svelte +3 -3
  100. package/dist/ui/features/config/APP_CONFIGURATIONS.d.ts +29 -0
  101. package/dist/ui/features/config/APP_CONFIGURATIONS.js +38 -0
  102. package/dist/ui/features/config/CurrencySelector.svelte +10 -36
  103. package/dist/ui/features/config/LanguageSelector.svelte +10 -33
  104. package/dist/ui/features/config/ResourceSelector.svelte +92 -0
  105. package/dist/ui/features/config/ResourceSelector.svelte.d.ts +25 -0
  106. package/dist/ui/features/config/ThemeSelector.svelte +11 -34
  107. package/dist/ui/features/shortcuts/ShortcutBinder.svelte +17 -0
  108. package/dist/ui/features/shortcuts/ShortcutBinder.svelte.d.ts +7 -0
  109. package/dist/ui/features/shortcuts/ShortcutPalette.svelte +3 -3
  110. package/dist/ui/index.d.ts +5 -1
  111. package/dist/ui/index.js +8 -3
  112. package/dist/ui/layout/ConnectedNavigationPanel.svelte +7 -8
  113. package/dist/ui/layout/ConnectedNavigationPanel.svelte.d.ts +1 -1
  114. package/dist/ui/layout/ConnectedWorkspaceStrip.svelte +5 -3
  115. package/dist/ui/layout/ConnectedWorkspaceStrip.svelte.d.ts +1 -1
  116. package/dist/ui/layout/NavigationPanel.svelte +1 -1
  117. package/dist/ui/layout/NavigationPanel.svelte.d.ts +1 -1
  118. package/dist/ui/layout/WorkspaceLayout.svelte +9 -1
  119. package/dist/ui/layout/WorkspaceLayout.svelte.d.ts +7 -0
  120. package/dist/ui/layout/WorkspaceStrip.svelte +1 -1
  121. package/dist/ui/layout/WorkspaceStrip.svelte.d.ts +1 -1
  122. package/dist/ui/layout/connection-factory.d.ts +50 -0
  123. package/dist/ui/layout/connection-factory.js +58 -0
  124. package/dist/ui/layout/index.d.ts +2 -2
  125. package/dist/ui/layout/index.js +1 -1
  126. package/dist/ui/paraglide/README.md +53 -0
  127. package/dist/ui/paraglide/runtime.d.ts +105 -124
  128. package/dist/ui/paraglide/runtime.js +162 -127
  129. package/dist/ui/paraglide/server.d.ts +6 -17
  130. package/dist/ui/paraglide/server.js +11 -20
  131. package/dist/ui/primitives/DatePicker.svelte +1 -1
  132. package/package.json +8 -8
  133. package/dist/state/daisyui.d.ts +0 -4
@@ -1,11 +1,6 @@
1
1
  <script lang="ts">
2
- import AppSettingSelector from "./AppSettingSelector.svelte";
3
- import {
4
- getCurrencyStore,
5
- type Currency,
6
- } from "rune-lab/state";
7
- import * as rlMessages from "../../paraglide/messages.js";
8
- import { getContext } from "svelte";
2
+ import ResourceSelector from "./ResourceSelector.svelte";
3
+ import { getCurrencyStore } from "@internal/state";
9
4
 
10
5
  const currencyStore = getCurrencyStore();
11
6
 
@@ -18,36 +13,15 @@
18
13
  current?: string;
19
14
  onchange?: (value: string) => void;
20
15
  } = $props();
21
-
22
- const userDictionary =
23
- getContext<Record<string, any>>("rl:dictionary") ?? {};
24
-
25
- function getLabel(currency: Currency): string {
26
- const key = String(currency.code);
27
- if (typeof userDictionary[key] === "function")
28
- return userDictionary[key]();
29
- if (typeof (rlMessages as any)[key] === "function")
30
- return (rlMessages as any)[key]();
31
- return String(currency.code);
32
- }
33
-
34
- let active = $derived(
35
- currencyStore.get(currencyStore.current) ?? currencyStore.available[0],
36
- );
37
-
38
- let available = $derived(
39
- codes.length > 0
40
- ? currencyStore.available.filter((c) => codes.includes(c.code))
41
- : currencyStore.available,
42
- );
43
16
  </script>
44
17
 
45
- <AppSettingSelector
46
- value={active}
47
- options={available}
48
- tooltip={getLabel(active)}
18
+ <ResourceSelector
19
+ store={currencyStore}
20
+ idKey="code"
21
+ filterKeys={codes}
22
+ {onchange}
49
23
  >
50
- {#snippet triggerLabel()}
24
+ {#snippet triggerLabel(active)}
51
25
  <span class="font-bold">{active.symbol}</span>
52
26
  {/snippet}
53
27
 
@@ -61,7 +35,7 @@
61
35
  }}
62
36
  >
63
37
  <span class="badge badge-sm badge-ghost w-8">{c.symbol}</span>
64
- <span>{getLabel(c)}</span>
38
+ <span>{c.code}</span>
65
39
  </button>
66
40
  {/snippet}
67
- </AppSettingSelector>
41
+ </ResourceSelector>
@@ -1,8 +1,6 @@
1
1
  <script lang="ts">
2
- import AppSettingSelector from "./AppSettingSelector.svelte";
3
- import { getLanguageStore, type Language } from "rune-lab/state";
4
- import * as rlMessages from "../../paraglide/messages.js";
5
- import { getContext } from "svelte";
2
+ import ResourceSelector from "./ResourceSelector.svelte";
3
+ import { getLanguageStore } from "@internal/state";
6
4
  import { setLocale } from "../../paraglide/runtime";
7
5
 
8
6
  const languageStore = getLanguageStore();
@@ -16,36 +14,15 @@
16
14
  current?: string;
17
15
  onchange?: (value: string) => void;
18
16
  } = $props();
19
-
20
- const userDictionary =
21
- getContext<Record<string, any>>("rl:dictionary") ?? {};
22
-
23
- function getLabel(lang: Language): string {
24
- const key = lang.code;
25
- if (typeof userDictionary[key] === "function")
26
- return userDictionary[key]();
27
- if (typeof (rlMessages as any)[key] === "function")
28
- return (rlMessages as any)[key]();
29
- return lang.code.toUpperCase();
30
- }
31
-
32
- let active = $derived(
33
- languageStore.get(languageStore.current) ?? languageStore.available[0],
34
- );
35
-
36
- let available = $derived(
37
- languageStore.available.filter((l) =>
38
- allowedLocales.includes(l.code as any),
39
- ),
40
- );
41
17
  </script>
42
18
 
43
- <AppSettingSelector
44
- value={active}
45
- options={available}
46
- tooltip={getLabel(active)}
19
+ <ResourceSelector
20
+ store={languageStore}
21
+ idKey="code"
22
+ filterKeys={[...allowedLocales]}
23
+ {onchange}
47
24
  >
48
- {#snippet triggerLabel()}
25
+ {#snippet triggerLabel(active)}
49
26
  <span class="text-lg">{active.flag}</span>
50
27
  {/snippet}
51
28
 
@@ -60,7 +37,7 @@
60
37
  }}
61
38
  >
62
39
  <span class="text-lg">{l.flag}</span>
63
- <span>{getLabel(l)}</span>
40
+ <span>{l.code.toUpperCase()}</span>
64
41
  </button>
65
42
  {/snippet}
66
- </AppSettingSelector>
43
+ </ResourceSelector>
@@ -0,0 +1,92 @@
1
+ <script lang="ts">
2
+ import AppSettingSelector from "./AppSettingSelector.svelte";
3
+ import type { ConfigStore } from "@internal/state";
4
+ import * as rlMessages from "../../paraglide/messages.js";
5
+ import { getContext, type Snippet } from "svelte";
6
+
7
+ /**
8
+ * ResourceSelector — Generic configuration picker.
9
+ * Wraps AppSettingSelector with automatic label resolution and store binding.
10
+ *
11
+ * @example
12
+ * ```svelte
13
+ * <ResourceSelector store={themeStore} idKey="name">
14
+ * {#snippet triggerLabel(item)}<span>{item.icon}</span>{/snippet}
15
+ * {#snippet item(t)}<button onclick={() => store.set(t.name)}>{t.name}</button>{/snippet}
16
+ * </ResourceSelector>
17
+ * ```
18
+ */
19
+ let {
20
+ store,
21
+ idKey,
22
+ filterKeys = [],
23
+ triggerLabel,
24
+ item,
25
+ onchange,
26
+ direction = "bottom",
27
+ responsive = true,
28
+ }: {
29
+ /** ConfigStore instance to bind to */
30
+ store: ConfigStore<any>;
31
+ /** Key to use as identifier (e.g., "name", "code") */
32
+ idKey: string;
33
+ /** Optional subset of IDs to show */
34
+ filterKeys?: string[];
35
+ /** Snippet to render the trigger button content */
36
+ triggerLabel: Snippet<[any]>;
37
+ /** Snippet to render each option in the dropdown */
38
+ item: Snippet<[any]>;
39
+ /** Callback when selection changes */
40
+ onchange?: (value: string) => void;
41
+ /** Dropdown direction */
42
+ direction?: "top" | "bottom" | "left" | "right" | "end" | "auto";
43
+ /** Whether to show responsive mobile modal */
44
+ responsive?: boolean;
45
+ } = $props();
46
+
47
+ const userDictionary =
48
+ getContext<Record<string, any>>("rl:dictionary") ?? {};
49
+
50
+ /**
51
+ * Resolve a label for an item through the message chain:
52
+ * 1. User-provided dictionary
53
+ * 2. Paraglide messages
54
+ * 3. Raw key fallback
55
+ */
56
+ export function resolveLabel(item: any): string {
57
+ const key = String(item[idKey]);
58
+ if (typeof userDictionary[key] === "function")
59
+ return userDictionary[key]();
60
+ if (typeof (rlMessages as any)[key] === "function")
61
+ return (rlMessages as any)[key]();
62
+ return key;
63
+ }
64
+
65
+ let active = $derived(
66
+ store.get(store.current) ?? store.available[0],
67
+ );
68
+
69
+ let available = $derived(
70
+ filterKeys.length > 0
71
+ ? store.available.filter((item: any) =>
72
+ filterKeys.includes(String(item[idKey])),
73
+ )
74
+ : store.available,
75
+ );
76
+ </script>
77
+
78
+ <AppSettingSelector
79
+ value={active}
80
+ options={available}
81
+ tooltip={resolveLabel(active)}
82
+ {direction}
83
+ {responsive}
84
+ >
85
+ {#snippet triggerLabel(value)}
86
+ {@render triggerLabel(value)}
87
+ {/snippet}
88
+
89
+ {#snippet item(option)}
90
+ {@render item(option)}
91
+ {/snippet}
92
+ </AppSettingSelector>
@@ -0,0 +1,25 @@
1
+ import type { ConfigStore } from "@internal/state";
2
+ import { type Snippet } from "svelte";
3
+ type $$ComponentProps = {
4
+ /** ConfigStore instance to bind to */
5
+ store: ConfigStore<any>;
6
+ /** Key to use as identifier (e.g., "name", "code") */
7
+ idKey: string;
8
+ /** Optional subset of IDs to show */
9
+ filterKeys?: string[];
10
+ /** Snippet to render the trigger button content */
11
+ triggerLabel: Snippet<[any]>;
12
+ /** Snippet to render each option in the dropdown */
13
+ item: Snippet<[any]>;
14
+ /** Callback when selection changes */
15
+ onchange?: (value: string) => void;
16
+ /** Dropdown direction */
17
+ direction?: "top" | "bottom" | "left" | "right" | "end" | "auto";
18
+ /** Whether to show responsive mobile modal */
19
+ responsive?: boolean;
20
+ };
21
+ declare const ResourceSelector: import("svelte").Component<$$ComponentProps, {
22
+ resolveLabel: (item: any) => string;
23
+ }, "">;
24
+ type ResourceSelector = ReturnType<typeof ResourceSelector>;
25
+ export default ResourceSelector;
@@ -1,8 +1,6 @@
1
1
  <script lang="ts">
2
- import AppSettingSelector from "./AppSettingSelector.svelte";
3
- import { getThemeStore, type Theme } from "rune-lab/state";
4
- import * as rlMessages from "../../paraglide/messages.js";
5
- import { getContext } from "svelte";
2
+ import ResourceSelector from "./ResourceSelector.svelte";
3
+ import { getThemeStore, type Theme } from "@internal/state";
6
4
 
7
5
  const themeStore = getThemeStore();
8
6
 
@@ -15,37 +13,16 @@
15
13
  current?: string;
16
14
  onchange?: (value: string) => void;
17
15
  } = $props();
18
-
19
- const userDictionary =
20
- getContext<Record<string, any>>("rl:dictionary") ?? {};
21
-
22
- function getThemeLabel(theme: Theme): string {
23
- const key = theme.name;
24
- if (typeof userDictionary[key] === "function")
25
- return userDictionary[key]();
26
- if (typeof (rlMessages as any)[key] === "function")
27
- return (rlMessages as any)[key]();
28
- return theme.name;
29
- }
30
-
31
- let activeTheme = $derived(
32
- themeStore.get(themeStore.current) ?? themeStore.available[0],
33
- );
34
-
35
- let available = $derived(
36
- themes.length > 0
37
- ? themeStore.available.filter((t) => themes.includes(t.name))
38
- : themeStore.available,
39
- );
40
16
  </script>
41
17
 
42
- <AppSettingSelector
43
- value={activeTheme}
44
- options={available}
45
- tooltip={getThemeLabel(activeTheme)}
18
+ <ResourceSelector
19
+ store={themeStore}
20
+ idKey="name"
21
+ filterKeys={themes}
22
+ {onchange}
46
23
  >
47
- {#snippet triggerLabel()}
48
- <span class="text-lg">{activeTheme.icon}</span>
24
+ {#snippet triggerLabel(active)}
25
+ <span class="text-lg">{active.icon}</span>
49
26
  {/snippet}
50
27
 
51
28
  {#snippet item(t)}
@@ -66,8 +43,8 @@
66
43
  />
67
44
  <span class="text-lg">{t.icon}</span>
68
45
  <span class="capitalize">
69
- {getThemeLabel(t)}
46
+ {t.name}
70
47
  </span>
71
48
  </button>
72
49
  {/snippet}
73
- </AppSettingSelector>
50
+ </ResourceSelector>
@@ -0,0 +1,17 @@
1
+ <!--
2
+ ShortcutBinder — Declarative shortcut registration component.
3
+ No visual output — purely a lifecycle binder.
4
+
5
+ Usage:
6
+ <ShortcutBinder shortcuts={[
7
+ { id: "save:doc", keys: "ctrl+s", handler: save, label: "Save" },
8
+ ]} />
9
+ -->
10
+ <script lang="ts">
11
+ import type { ShortcutConfig } from "@internal/core";
12
+ import { useShortcuts } from "@internal/state";
13
+
14
+ let { shortcuts }: { shortcuts: ShortcutConfig[] } = $props();
15
+
16
+ useShortcuts(shortcuts);
17
+ </script>
@@ -0,0 +1,7 @@
1
+ import type { ShortcutConfig } from "@internal/core";
2
+ type $$ComponentProps = {
3
+ shortcuts: ShortcutConfig[];
4
+ };
5
+ declare const ShortcutBinder: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ShortcutBinder = ReturnType<typeof ShortcutBinder>;
7
+ export default ShortcutBinder;
@@ -1,13 +1,13 @@
1
1
  <!-- src/lib/features/shortcuts/ShortcutPalette.svelte -->
2
2
  <script lang="ts">
3
3
  import { tick } from "svelte";
4
- import type { ShortcutEntry } from "rune-lab/state";
4
+ import type { ShortcutEntry } from "@internal/state";
5
5
  import {
6
6
  getAppStore,
7
7
  getShortcutStore,
8
8
  LAYOUT_SHORTCUTS,
9
- } from "rune-lab/state";
10
- import { Icon } from "rune-lab/ui";
9
+ } from "@internal/state";
10
+ import { Icon } from "@internal/ui";
11
11
 
12
12
  const appStore = getAppStore();
13
13
  const shortcutStore = getShortcutStore();
@@ -1,4 +1,4 @@
1
- export { portal } from "./actions/portal.js";
1
+ export { portal } from "./actions/portal.ts";
2
2
  export { default as RuneProvider } from "./components/RuneProvider.svelte";
3
3
  export { default as Icon } from "./components/Icon.svelte";
4
4
  export { default as Toaster } from "./components/Toaster.svelte";
@@ -6,7 +6,10 @@ export { default as ApiMonitor } from "./components/ApiMonitor.svelte";
6
6
  export { default as Kyntharil } from "./components/Kyntharil.svelte";
7
7
  export { default as CommandPalette } from "./features/command-palette/CommandPalette.svelte";
8
8
  export { default as ShortcutPalette } from "./features/shortcuts/ShortcutPalette.svelte";
9
+ export { default as ShortcutBinder } from "./features/shortcuts/ShortcutBinder.svelte";
9
10
  export { default as AppSettingSelector } from "./features/config/AppSettingSelector.svelte";
11
+ export { default as ResourceSelector } from "./features/config/ResourceSelector.svelte";
12
+ export { APP_CONFIGURATIONS, type ConfigDimension, } from "./features/config/APP_CONFIGURATIONS.ts";
10
13
  export { default as ThemeSelector } from "./features/config/ThemeSelector.svelte";
11
14
  export { default as LanguageSelector } from "./features/config/LanguageSelector.svelte";
12
15
  export { default as CurrencySelector } from "./features/config/CurrencySelector.svelte";
@@ -17,6 +20,7 @@ export { default as ContentArea } from "./layout/ContentArea.svelte";
17
20
  export { default as DetailPanel } from "./layout/DetailPanel.svelte";
18
21
  export { default as ConnectedNavigationPanel } from "./layout/ConnectedNavigationPanel.svelte";
19
22
  export { default as ConnectedWorkspaceStrip } from "./layout/ConnectedWorkspaceStrip.svelte";
23
+ export { createNavigationConnection, createWorkspaceConnection, type NavigationConnection, type WorkspaceConnection, } from "./layout/connection-factory.ts";
20
24
  export { default as DatePicker } from "./primitives/DatePicker.svelte";
21
25
  export { default as UserAvatar } from "./components/user/UserAvatar.svelte";
22
26
  export { default as UserProfile } from "./components/user/UserProfile.svelte";
package/dist/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // All components, actions, and layout primitives
2
2
  // ── Actions ───────────────────────────────────────────────────────────────────
3
- export { portal } from "./actions/portal.js";
3
+ export { portal } from "./actions/portal.ts";
4
4
  // ── Core Components ───────────────────────────────────────────────────────────
5
5
  export { default as RuneProvider } from "./components/RuneProvider.svelte";
6
6
  export { default as Icon } from "./components/Icon.svelte";
@@ -10,8 +10,11 @@ export { default as Kyntharil } from "./components/Kyntharil.svelte";
10
10
  // ── Features ──────────────────────────────────────────────────────────────────
11
11
  export { default as CommandPalette } from "./features/command-palette/CommandPalette.svelte";
12
12
  export { default as ShortcutPalette } from "./features/shortcuts/ShortcutPalette.svelte";
13
+ export { default as ShortcutBinder } from "./features/shortcuts/ShortcutBinder.svelte";
13
14
  // Setting Selectors
14
15
  export { default as AppSettingSelector } from "./features/config/AppSettingSelector.svelte";
16
+ export { default as ResourceSelector } from "./features/config/ResourceSelector.svelte";
17
+ export { APP_CONFIGURATIONS, } from "./features/config/APP_CONFIGURATIONS.ts";
15
18
  export { default as ThemeSelector } from "./features/config/ThemeSelector.svelte";
16
19
  export { default as LanguageSelector } from "./features/config/LanguageSelector.svelte";
17
20
  export { default as CurrencySelector } from "./features/config/CurrencySelector.svelte";
@@ -24,6 +27,8 @@ export { default as DetailPanel } from "./layout/DetailPanel.svelte";
24
27
  // ── Connected (Smart) Components ──────────────────────────────────────────────
25
28
  export { default as ConnectedNavigationPanel } from "./layout/ConnectedNavigationPanel.svelte";
26
29
  export { default as ConnectedWorkspaceStrip } from "./layout/ConnectedWorkspaceStrip.svelte";
30
+ // ── Connection Factory (Phase 3) ──────────────────────────────────────────────
31
+ export { createNavigationConnection, createWorkspaceConnection, } from "./layout/connection-factory.ts";
27
32
  // ── Primitives ────────────────────────────────────────────────────────────────
28
33
  export { default as DatePicker } from "./primitives/DatePicker.svelte";
29
34
  // ── User Components ───────────────────────────────────────────────────────────
@@ -37,5 +42,5 @@ export { default as MoneyInput } from "./components/money/MoneyInput.svelte";
37
42
  // ── Paraglide messages ────────────────────────────────────────────────────────
38
43
  export * as sdkMessages from "./paraglide/messages.js";
39
44
  // // Consumers shouldn't need rune-lab/state just to get cookieDriver, stores, etc.
40
- // export * from "rune-lab/state";
41
- // export * from "rune-lab/core";
45
+ // export * from "@internal/state";
46
+ // export * from "@internal/core";
@@ -1,7 +1,8 @@
1
1
  <!-- src/lib/features/layout/smart/ConnectedNavigationPanel.svelte -->
2
2
  <script lang="ts">
3
- import { getLayoutStore, type NavigationSection } from "rune-lab/state";
3
+ import { getLayoutStore, type NavigationSection } from "@internal/state";
4
4
  import NavigationPanel from "./NavigationPanel.svelte";
5
+ import { createNavigationConnection } from "./connection-factory.ts";
5
6
  import type { Snippet } from "svelte";
6
7
 
7
8
  let { sections, header, footer } = $props<{
@@ -11,17 +12,15 @@
11
12
  }>();
12
13
 
13
14
  const layoutStore = getLayoutStore();
15
+ const connection = createNavigationConnection(layoutStore);
14
16
  </script>
15
17
 
16
18
  <NavigationPanel
17
19
  {sections}
18
20
  {header}
19
21
  {footer}
20
- activeId={layoutStore.activeNavItemId}
21
- collapsedIds={layoutStore.collapsedSections}
22
- onSelect={(item) => layoutStore.navigate(item.id!)}
23
- onToggle={(id, isOpen) =>
24
- isOpen
25
- ? layoutStore.expandSection(id)
26
- : layoutStore.collapseSection(id)}
22
+ activeId={connection.activeId}
23
+ collapsedIds={connection.collapsedIds}
24
+ onSelect={connection.onSelect}
25
+ onToggle={connection.onToggle}
27
26
  />
@@ -1,4 +1,4 @@
1
- import { type NavigationSection } from "rune-lab/state";
1
+ import { type NavigationSection } from "@internal/state";
2
2
  import type { Snippet } from "svelte";
3
3
  type $$ComponentProps = {
4
4
  sections: NavigationSection[];
@@ -1,7 +1,8 @@
1
1
  <!-- src/lib/features/layout/smart/ConnectedWorkspaceStrip.svelte -->
2
2
  <script lang="ts">
3
- import { getLayoutStore, type WorkspaceItem } from "rune-lab/state";
3
+ import { getLayoutStore, type WorkspaceItem } from "@internal/state";
4
4
  import WorkspaceStrip from "./WorkspaceStrip.svelte";
5
+ import { createWorkspaceConnection } from "./connection-factory.ts";
5
6
  import type { Snippet } from "svelte";
6
7
 
7
8
  let { items, globalActions } = $props<{
@@ -10,11 +11,12 @@
10
11
  }>();
11
12
 
12
13
  const layoutStore = getLayoutStore();
14
+ const connection = createWorkspaceConnection(layoutStore);
13
15
  </script>
14
16
 
15
17
  <WorkspaceStrip
16
18
  {items}
17
19
  {globalActions}
18
- activeId={layoutStore.activeWorkspaceId}
19
- onSelect={(id) => layoutStore.activateWorkspace(id)}
20
+ activeId={connection.activeId}
21
+ onSelect={connection.onSelect}
20
22
  />
@@ -1,4 +1,4 @@
1
- import { type WorkspaceItem } from "rune-lab/state";
1
+ import { type WorkspaceItem } from "@internal/state";
2
2
  import type { Snippet } from "svelte";
3
3
  type $$ComponentProps = {
4
4
  items: WorkspaceItem[];
@@ -4,7 +4,7 @@
4
4
  import type {
5
5
  NavigationItem,
6
6
  NavigationSection,
7
- } from "rune-lab/state";
7
+ } from "@internal/state";
8
8
 
9
9
  let {
10
10
  header,
@@ -1,5 +1,5 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { NavigationItem, NavigationSection } from "rune-lab/state";
2
+ import type { NavigationItem, NavigationSection } from "@internal/state";
3
3
  type $$ComponentProps = {
4
4
  header?: Snippet;
5
5
  sections: NavigationSection[];
@@ -1,6 +1,7 @@
1
1
  <!-- src/lib/layout/WorkspaceLayout.svelte -->
2
2
  <script module lang="ts">
3
3
  import type { Snippet } from "svelte";
4
+ import type { LayoutConfig } from "@internal/core";
4
5
 
5
6
  export interface WorkspaceLayoutProps {
6
7
  /** Content for the far-left vertical strip */
@@ -13,6 +14,13 @@
13
14
  detailPanel?: Snippet;
14
15
  namespace?: string;
15
16
 
17
+ /**
18
+ * Declarative layout configuration.
19
+ * When provided, zones can be rendered from config entries.
20
+ * Snippet props take priority when both are provided.
21
+ */
22
+ config?: LayoutConfig;
23
+
16
24
  /** Width of the left workspace strip */
17
25
  stripWidth?: string;
18
26
  /** Width of the navigation tree panel */
@@ -34,7 +42,7 @@
34
42
  getLanguageStore,
35
43
  shortcutListener,
36
44
  LAYOUT_SHORTCUTS,
37
- } from "rune-lab/state";
45
+ } from "@internal/state";
38
46
  import { onMount } from "svelte";
39
47
 
40
48
  /**
@@ -1,4 +1,5 @@
1
1
  import type { Snippet } from "svelte";
2
+ import type { LayoutConfig } from "@internal/core";
2
3
  export interface WorkspaceLayoutProps {
3
4
  /** Content for the far-left vertical strip */
4
5
  workspaceStrip?: Snippet;
@@ -9,6 +10,12 @@ export interface WorkspaceLayoutProps {
9
10
  /** Right-side contextual detail panel */
10
11
  detailPanel?: Snippet;
11
12
  namespace?: string;
13
+ /**
14
+ * Declarative layout configuration.
15
+ * When provided, zones can be rendered from config entries.
16
+ * Snippet props take priority when both are provided.
17
+ */
18
+ config?: LayoutConfig;
12
19
  /** Width of the left workspace strip */
13
20
  stripWidth?: string;
14
21
  /** Width of the navigation tree panel */
@@ -1,7 +1,7 @@
1
1
  <!-- src/lib/layout/WorkspaceStrip.svelte -->
2
2
  <script lang="ts">
3
3
  import type { Snippet } from "svelte";
4
- import type { WorkspaceItem } from "rune-lab/state";
4
+ import type { WorkspaceItem } from "@internal/state";
5
5
 
6
6
  let {
7
7
  items = [],
@@ -1,5 +1,5 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { WorkspaceItem } from "rune-lab/state";
2
+ import type { WorkspaceItem } from "@internal/state";
3
3
  type $$ComponentProps = {
4
4
  items: WorkspaceItem[];
5
5
  globalActions?: Snippet;
@@ -0,0 +1,50 @@
1
+ import type { LayoutStore } from "@internal/state";
2
+ /**
3
+ * Reactive prop binding for the NavigationPanel component.
4
+ */
5
+ export interface NavigationConnection {
6
+ /** Currently active navigation item ID */
7
+ readonly activeId: string | null;
8
+ /** Set of collapsed section IDs */
9
+ readonly collapsedIds: Set<string>;
10
+ /** Handler for when a navigation item is selected */
11
+ onSelect: (item: {
12
+ id?: string;
13
+ }) => void;
14
+ /** Handler for when a section is toggled */
15
+ onToggle: (id: string, isOpen: boolean) => void;
16
+ }
17
+ /**
18
+ * Reactive prop binding for the WorkspaceStrip component.
19
+ */
20
+ export interface WorkspaceConnection {
21
+ /** Currently active workspace ID */
22
+ readonly activeId: string | null;
23
+ /** Handler for when a workspace is selected */
24
+ onSelect: (id: string) => void;
25
+ }
26
+ /**
27
+ * Creates reactive prop bindings for connecting NavigationPanel to LayoutStore.
28
+ * Returns an object with getter properties that track LayoutStore state.
29
+ *
30
+ * @param layoutStore - The LayoutStore instance from context
31
+ * @returns Prop bindings compatible with NavigationPanel
32
+ *
33
+ * @example
34
+ * ```svelte
35
+ * <script>
36
+ * const layoutStore = getLayoutStore();
37
+ * const nav = createNavigationConnection(layoutStore);
38
+ * </script>
39
+ * <NavigationPanel {sections} activeId={nav.activeId} collapsedIds={nav.collapsedIds}
40
+ * onSelect={nav.onSelect} onToggle={nav.onToggle} />
41
+ * ```
42
+ */
43
+ export declare function createNavigationConnection(layoutStore: LayoutStore): NavigationConnection;
44
+ /**
45
+ * Creates reactive prop bindings for connecting WorkspaceStrip to LayoutStore.
46
+ *
47
+ * @param layoutStore - The LayoutStore instance from context
48
+ * @returns Prop bindings compatible with WorkspaceStrip
49
+ */
50
+ export declare function createWorkspaceConnection(layoutStore: LayoutStore): WorkspaceConnection;