@cloudvoyant/helical-svelte 0.21.0 → 0.21.1

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/dist/Page.svelte CHANGED
@@ -2,11 +2,12 @@
2
2
  <!-- No upstream component; composed from @cloudvoyant/helical-ui page classes, mirrored from @cloudvoyant/helical-react -->
3
3
  <script lang="ts">
4
4
  import { Ark } from '@ark-ui/svelte/factory';
5
- import { pageVariants, cn } from '@cloudvoyant/helical-ui';
5
+ import { pageVariants, cn, type PagePaneRegistrationProps } from '@cloudvoyant/helical-ui';
6
+ import { useOptionalPaneRegistration } from './which-key/context.svelte';
6
7
  import type { Snippet } from 'svelte';
7
8
  import type { HTMLAttributes } from 'svelte/elements';
8
9
 
9
- type Props = {
10
+ type Props = PagePaneRegistrationProps & {
10
11
  class?: string;
11
12
  variant?: 'default' | 'landing';
12
13
  children?: Snippet;
@@ -15,13 +16,37 @@
15
16
  let {
16
17
  class: className = '',
17
18
  variant = 'default',
19
+ paneId,
20
+ paneTitle,
21
+ paneDisabled,
22
+ paneOrder,
18
23
  children,
19
24
  ...rest
20
25
  }: Props = $props();
21
26
 
27
+ let pageRef: Element | null = $state(null);
28
+
29
+ const pane = useOptionalPaneRegistration(
30
+ () => (pageRef instanceof HTMLElement ? pageRef : null),
31
+ () => ({
32
+ paneId,
33
+ paneTitle,
34
+ paneDisabled: paneDisabled ?? !paneId,
35
+ paneOrder,
36
+ defaultTitle: 'Page',
37
+ }),
38
+ );
39
+
22
40
  const rootClasses = $derived(cn(pageVariants({ variant }), className));
23
41
  </script>
24
42
 
25
- <Ark as="div" data-slot="page" class={rootClasses} {...rest}>
43
+ <Ark
44
+ as="div"
45
+ bind:ref={pageRef}
46
+ data-slot="page"
47
+ {...pane.dataAttributes}
48
+ class={rootClasses}
49
+ {...rest}
50
+ >
26
51
  {@render children?.()}
27
52
  </Ark>
@@ -1,6 +1,7 @@
1
+ import { type PagePaneRegistrationProps } from '@cloudvoyant/helical-ui';
1
2
  import type { Snippet } from 'svelte';
2
3
  import type { HTMLAttributes } from 'svelte/elements';
3
- type Props = {
4
+ type Props = PagePaneRegistrationProps & {
4
5
  class?: string;
5
6
  variant?: 'default' | 'landing';
6
7
  children?: Snippet;
@@ -29,7 +29,7 @@
29
29
  () => ({
30
30
  paneId,
31
31
  paneTitle,
32
- paneDisabled,
32
+ paneDisabled: paneDisabled ?? !paneId,
33
33
  paneOrder,
34
34
  defaultTitle: 'Section',
35
35
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudvoyant/helical-svelte",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "helical-ui Svelte UI components",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -47,7 +47,7 @@
47
47
  "lucide-svelte": "^0.577.0",
48
48
  "lowlight": "^3.3.0",
49
49
  "svelte-tiptap": "^3.0.1",
50
- "@cloudvoyant/helical-ui": "0.21.0"
50
+ "@cloudvoyant/helical-ui": "0.21.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@sveltejs/package": "^2.5.8",