svelte-flexiboards 0.1.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 (44) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/components/flexi-add.svelte +35 -0
  3. package/dist/components/flexi-add.svelte.d.ts +16 -0
  4. package/dist/components/flexi-board.svelte +30 -0
  5. package/dist/components/flexi-board.svelte.d.ts +11 -0
  6. package/dist/components/flexi-delete.svelte +22 -0
  7. package/dist/components/flexi-delete.svelte.d.ts +13 -0
  8. package/dist/components/flexi-grab.svelte +20 -0
  9. package/dist/components/flexi-grab.svelte.d.ts +12 -0
  10. package/dist/components/flexi-grid.svelte +19 -0
  11. package/dist/components/flexi-grid.svelte.d.ts +8 -0
  12. package/dist/components/flexi-layout-loader.svelte +10 -0
  13. package/dist/components/flexi-layout-loader.svelte.d.ts +18 -0
  14. package/dist/components/flexi-resize.svelte +20 -0
  15. package/dist/components/flexi-resize.svelte.d.ts +12 -0
  16. package/dist/components/flexi-target-loader.svelte +10 -0
  17. package/dist/components/flexi-target-loader.svelte.d.ts +18 -0
  18. package/dist/components/flexi-target.svelte +93 -0
  19. package/dist/components/flexi-target.svelte.d.ts +42 -0
  20. package/dist/components/flexi-widget.svelte +37 -0
  21. package/dist/components/flexi-widget.svelte.d.ts +9 -0
  22. package/dist/components/index.d.ts +1 -0
  23. package/dist/components/index.js +1 -0
  24. package/dist/components/rendered-flexi-widget.svelte +44 -0
  25. package/dist/components/rendered-flexi-widget.svelte.d.ts +7 -0
  26. package/dist/index.d.ts +16 -0
  27. package/dist/index.js +10 -0
  28. package/dist/system/grid.svelte.d.ts +146 -0
  29. package/dist/system/grid.svelte.js +815 -0
  30. package/dist/system/index.d.ts +1 -0
  31. package/dist/system/index.js +1 -0
  32. package/dist/system/manage.svelte.d.ts +25 -0
  33. package/dist/system/manage.svelte.js +54 -0
  34. package/dist/system/provider.svelte.d.ts +51 -0
  35. package/dist/system/provider.svelte.js +290 -0
  36. package/dist/system/target.svelte.d.ts +179 -0
  37. package/dist/system/target.svelte.js +397 -0
  38. package/dist/system/types.d.ts +91 -0
  39. package/dist/system/types.js +1 -0
  40. package/dist/system/utils.svelte.d.ts +21 -0
  41. package/dist/system/utils.svelte.js +156 -0
  42. package/dist/system/widget.svelte.d.ts +225 -0
  43. package/dist/system/widget.svelte.js +447 -0
  44. package/package.json +57 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Blakintosh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,35 @@
1
+ <script module lang="ts">
2
+ import {
3
+ FlexiAddController,
4
+ flexiadd,
5
+ type FlexiAddWidgetFn
6
+ } from '../system/manage.svelte.js';
7
+ import FlexiWidget from './rendered-flexi-widget.svelte';
8
+ import type { FlexiWidgetConfiguration } from '../system/widget.svelte.js';
9
+ import type { Snippet } from 'svelte';
10
+ import type { FlexiCommonProps } from '../system/types.js';
11
+ import RenderedFlexiWidget from './rendered-flexi-widget.svelte';
12
+
13
+ type FlexiAddChildrenProps = {
14
+ onpointerdown: (event: PointerEvent) => void;
15
+ };
16
+
17
+ export type FlexiAddProps = FlexiCommonProps<FlexiAddController> & {
18
+ children?: Snippet<[{ adder: FlexiAddController; props: FlexiAddChildrenProps }]>;
19
+ addWidget: FlexiAddWidgetFn;
20
+ };
21
+ </script>
22
+
23
+ <script lang="ts">
24
+ let { children, addWidget, controller }: FlexiAddProps = $props();
25
+
26
+ const { adder, onpointerdown } = flexiadd(addWidget);
27
+ controller = adder;
28
+ </script>
29
+
30
+ {@render children?.({ adder, props: { onpointerdown } })}
31
+
32
+ <!-- Mimics the behaviour of a FlexiTarget, as we need to render the widget so that we can "drag it in" from -->
33
+ {#if adder.newWidget}
34
+ <RenderedFlexiWidget widget={adder.newWidget} />
35
+ {/if}
@@ -0,0 +1,16 @@
1
+ import { FlexiAddController, type FlexiAddWidgetFn } from '../system/manage.svelte.js';
2
+ import type { Snippet } from 'svelte';
3
+ import type { FlexiCommonProps } from '../system/types.js';
4
+ type FlexiAddChildrenProps = {
5
+ onpointerdown: (event: PointerEvent) => void;
6
+ };
7
+ export type FlexiAddProps = FlexiCommonProps<FlexiAddController> & {
8
+ children?: Snippet<[{
9
+ adder: FlexiAddController;
10
+ props: FlexiAddChildrenProps;
11
+ }]>;
12
+ addWidget: FlexiAddWidgetFn;
13
+ };
14
+ declare const FlexiAdd: import("svelte").Component<FlexiAddProps, {}, "">;
15
+ type FlexiAdd = ReturnType<typeof FlexiAdd>;
16
+ export default FlexiAdd;
@@ -0,0 +1,30 @@
1
+ <script module lang="ts">
2
+ import {
3
+ flexiboard,
4
+ type FlexiBoardConfiguration,
5
+ type FlexiBoardController
6
+ } from '../system/provider.svelte.js';
7
+ import type { Snippet } from 'svelte';
8
+ import type { FlexiCommonProps, SvelteClassValue } from '../system/types.js';
9
+ import FlexiLayoutLoader from './flexi-layout-loader.svelte';
10
+
11
+ export type FlexiBoardProps = FlexiCommonProps<FlexiBoardController> & {
12
+ children: Snippet;
13
+ config?: FlexiBoardConfiguration;
14
+ class?: SvelteClassValue;
15
+ };
16
+ </script>
17
+
18
+ <script lang="ts">
19
+ let { controller: board = $bindable(), onfirstcreate, ...props }: FlexiBoardProps = $props();
20
+
21
+ board = flexiboard(props);
22
+ onfirstcreate?.(board);
23
+ </script>
24
+
25
+ <div class={props.class} bind:this={board.ref} style={board.style}>
26
+ {@render props.children()}
27
+ </div>
28
+
29
+ <!-- Component that tells the board it can start importing stuff, if needed. -->
30
+ <FlexiLayoutLoader />
@@ -0,0 +1,11 @@
1
+ import { type FlexiBoardConfiguration, type FlexiBoardController } from '../system/provider.svelte.js';
2
+ import type { Snippet } from 'svelte';
3
+ import type { FlexiCommonProps, SvelteClassValue } from '../system/types.js';
4
+ export type FlexiBoardProps = FlexiCommonProps<FlexiBoardController> & {
5
+ children: Snippet;
6
+ config?: FlexiBoardConfiguration;
7
+ class?: SvelteClassValue;
8
+ };
9
+ declare const FlexiBoard: import("svelte").Component<FlexiBoardProps, {}, "controller">;
10
+ type FlexiBoard = ReturnType<typeof FlexiBoard>;
11
+ export default FlexiBoard;
@@ -0,0 +1,22 @@
1
+ <script module lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { FlexiCommonProps, SvelteClassValue } from '../system/types.js';
4
+ import { flexidelete } from '../system/manage.svelte.js';
5
+
6
+ type FlexiDeleteChildrenProps = {
7
+ onpointerenter: (event: PointerEvent) => void;
8
+ onpointerleave: (event: PointerEvent) => void;
9
+ };
10
+
11
+ export type FlexiDeleteProps = {
12
+ children?: Snippet<[{ props: FlexiDeleteChildrenProps }]>;
13
+ };
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ let { children }: FlexiDeleteProps = $props();
18
+
19
+ const { onpointerenter, onpointerleave } = flexidelete();
20
+ </script>
21
+
22
+ {@render children?.({ props: { onpointerenter, onpointerleave } })}
@@ -0,0 +1,13 @@
1
+ import type { Snippet } from 'svelte';
2
+ type FlexiDeleteChildrenProps = {
3
+ onpointerenter: (event: PointerEvent) => void;
4
+ onpointerleave: (event: PointerEvent) => void;
5
+ };
6
+ export type FlexiDeleteProps = {
7
+ children?: Snippet<[{
8
+ props: FlexiDeleteChildrenProps;
9
+ }]>;
10
+ };
11
+ declare const FlexiDelete: import("svelte").Component<FlexiDeleteProps, {}, "">;
12
+ type FlexiDelete = ReturnType<typeof FlexiDelete>;
13
+ export default FlexiDelete;
@@ -0,0 +1,20 @@
1
+ <script module lang="ts">
2
+ import { flexigrab, type FlexiWidgetController } from '../system/widget.svelte.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { SvelteClassValue } from '../system/types.js';
5
+
6
+ type FlexiGrabProps = {
7
+ children?: Snippet<[{ widget: FlexiWidgetController }]>;
8
+ class?: SvelteClassValue;
9
+ };
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ let { class: className, children }: FlexiGrabProps = $props();
14
+
15
+ const { widget, onpointerdown } = flexigrab();
16
+ </script>
17
+
18
+ <button class={className} {onpointerdown}>
19
+ {@render children?.({ widget })}
20
+ </button>
@@ -0,0 +1,12 @@
1
+ import { type FlexiWidgetController } from '../system/widget.svelte.js';
2
+ import type { Snippet } from 'svelte';
3
+ import type { SvelteClassValue } from '../system/types.js';
4
+ type FlexiGrabProps = {
5
+ children?: Snippet<[{
6
+ widget: FlexiWidgetController;
7
+ }]>;
8
+ class?: SvelteClassValue;
9
+ };
10
+ declare const FlexiGrab: import("svelte").Component<FlexiGrabProps, {}, "">;
11
+ type FlexiGrab = ReturnType<typeof FlexiGrab>;
12
+ export default FlexiGrab;
@@ -0,0 +1,19 @@
1
+ <script module lang="ts">
2
+ import { flexigrid } from '../system/grid.svelte';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ export type FlexiGridProps = {
6
+ children?: Snippet;
7
+ class?: string;
8
+ };
9
+ </script>
10
+
11
+ <script lang="ts">
12
+ let { children, class: className }: FlexiGridProps = $props();
13
+
14
+ const { grid } = flexigrid();
15
+ </script>
16
+
17
+ <div class={className} bind:this={grid.ref} style={grid?.style}>
18
+ {@render children?.()}
19
+ </div>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ export type FlexiGridProps = {
3
+ children?: Snippet;
4
+ class?: string;
5
+ };
6
+ declare const FlexiGrid: import("svelte").Component<FlexiGridProps, {}, "">;
7
+ type FlexiGrid = ReturnType<typeof FlexiGrid>;
8
+ export default FlexiGrid;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import { getInternalFlexiboardCtx } from '../system/provider.svelte.js';
3
+
4
+ // This is a simple component that triggers the initial layout load.
5
+ // We must do this after instantiating all other components, otherwise we won't have established
6
+ // the target layout of our Flexiboard.
7
+
8
+ const board = getInternalFlexiboardCtx();
9
+ board.oninitialloadcomplete();
10
+ </script>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const FlexiLayoutLoader: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type FlexiLayoutLoader = InstanceType<typeof FlexiLayoutLoader>;
18
+ export default FlexiLayoutLoader;
@@ -0,0 +1,20 @@
1
+ <script module lang="ts">
2
+ import { flexiresize, type FlexiWidgetController } from '../system/widget.svelte.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { SvelteClassValue } from '../system/types.js';
5
+
6
+ type FlexiResizeProps = {
7
+ children?: Snippet<[{ widget: FlexiWidgetController }]>;
8
+ class?: SvelteClassValue;
9
+ };
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ let { class: className, children }: FlexiResizeProps = $props();
14
+
15
+ const { widget, onpointerdown } = flexiresize();
16
+ </script>
17
+
18
+ <button class={className} {onpointerdown}>
19
+ {@render children?.({ widget })}
20
+ </button>
@@ -0,0 +1,12 @@
1
+ import { type FlexiWidgetController } from '../system/widget.svelte.js';
2
+ import type { Snippet } from 'svelte';
3
+ import type { SvelteClassValue } from '../system/types.js';
4
+ type FlexiResizeProps = {
5
+ children?: Snippet<[{
6
+ widget: FlexiWidgetController;
7
+ }]>;
8
+ class?: SvelteClassValue;
9
+ };
10
+ declare const FlexiResize: import("svelte").Component<FlexiResizeProps, {}, "">;
11
+ type FlexiResize = ReturnType<typeof FlexiResize>;
12
+ export default FlexiResize;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import { getInternalFlexitargetCtx } from '../system/target.svelte.js';
3
+
4
+ // This is a simple component that triggers the initial layout load.
5
+ // We must do this after instantiating all other components, otherwise we won't have established
6
+ // the target layout of our Flexiboard.
7
+
8
+ const target = getInternalFlexitargetCtx();
9
+ target.oninitialloadcomplete();
10
+ </script>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const FlexiTargetLoader: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type FlexiTargetLoader = InstanceType<typeof FlexiTargetLoader>;
18
+ export default FlexiTargetLoader;
@@ -0,0 +1,93 @@
1
+ <script module lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import {
4
+ flexitarget,
5
+ type FlexiTargetConfiguration,
6
+ type FlexiTargetController,
7
+ type FlexiTargetPartialConfiguration
8
+ } from '../system/target.svelte.js';
9
+ import type { FlexiCommonProps } from '../system/types.js';
10
+
11
+ export type FlexiTargetProps = FlexiCommonProps<FlexiTargetController> & {
12
+ /**
13
+ * The header content of the target, above the grid.
14
+ */
15
+ header?: Snippet<[{ target: FlexiTargetController }]>;
16
+
17
+ /**
18
+ * The child content of the target, which should contain inner FlexiWidget
19
+ * definitions.
20
+ */
21
+ children?: Snippet;
22
+
23
+ /**
24
+ * The footer content of the target, below the grid.
25
+ */
26
+ footer?: Snippet<[{ target: FlexiTargetController }]>;
27
+
28
+ /**
29
+ * The class names to apply to the target's container element.
30
+ */
31
+ containerClass?: string;
32
+
33
+ /**
34
+ * The class names to apply to the target's grid element.
35
+ */
36
+ class?: string;
37
+
38
+ /**
39
+ * The configuration object for the target.
40
+ */
41
+ config?: FlexiTargetPartialConfiguration;
42
+
43
+ /**
44
+ * The unique identifier for the target.
45
+ * Used to identify the target when layouts are imported or exported.
46
+ */
47
+ key?: string;
48
+ };
49
+ </script>
50
+
51
+ <script lang="ts">
52
+ import FlexiGrid from './flexi-grid.svelte';
53
+ import FlexiTargetLoader from './flexi-target-loader.svelte';
54
+ import RenderedFlexiWidget from './rendered-flexi-widget.svelte';
55
+
56
+ let {
57
+ children,
58
+ class: className,
59
+ header,
60
+ footer,
61
+ config,
62
+ containerClass,
63
+ controller = $bindable(),
64
+ key,
65
+ onfirstcreate
66
+ }: FlexiTargetProps = $props();
67
+
68
+ const { onpointerenter, onpointerleave, target } = flexitarget(config, key);
69
+
70
+ // Target created, allow the caller to access it.
71
+ controller = target;
72
+ onfirstcreate?.(target);
73
+ </script>
74
+
75
+ <div>
76
+ <div class={containerClass} {onpointerenter} {onpointerleave} role="grid" tabindex={0}>
77
+ {@render header?.({ target })}
78
+
79
+ <!-- Allow user to specify components directly via a registration component. Once that's done, mount them to the actual target list dynamically -->
80
+ <FlexiGrid class={className}>
81
+ {#if !target.prepared && children}
82
+ {@render children()}
83
+ {:else if target.prepared}
84
+ {#each target.widgets as widget (widget)}
85
+ <RenderedFlexiWidget {widget} />
86
+ {/each}
87
+ {/if}
88
+ </FlexiGrid>
89
+ {@render footer?.({ target })}
90
+ </div>
91
+ </div>
92
+
93
+ <FlexiTargetLoader />
@@ -0,0 +1,42 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type FlexiTargetController, type FlexiTargetPartialConfiguration } from '../system/target.svelte.js';
3
+ import type { FlexiCommonProps } from '../system/types.js';
4
+ export type FlexiTargetProps = FlexiCommonProps<FlexiTargetController> & {
5
+ /**
6
+ * The header content of the target, above the grid.
7
+ */
8
+ header?: Snippet<[{
9
+ target: FlexiTargetController;
10
+ }]>;
11
+ /**
12
+ * The child content of the target, which should contain inner FlexiWidget
13
+ * definitions.
14
+ */
15
+ children?: Snippet;
16
+ /**
17
+ * The footer content of the target, below the grid.
18
+ */
19
+ footer?: Snippet<[{
20
+ target: FlexiTargetController;
21
+ }]>;
22
+ /**
23
+ * The class names to apply to the target's container element.
24
+ */
25
+ containerClass?: string;
26
+ /**
27
+ * The class names to apply to the target's grid element.
28
+ */
29
+ class?: string;
30
+ /**
31
+ * The configuration object for the target.
32
+ */
33
+ config?: FlexiTargetPartialConfiguration;
34
+ /**
35
+ * The unique identifier for the target.
36
+ * Used to identify the target when layouts are imported or exported.
37
+ */
38
+ key?: string;
39
+ };
40
+ declare const FlexiTarget: import("svelte").Component<FlexiTargetProps, {}, "controller">;
41
+ type FlexiTarget = ReturnType<typeof FlexiTarget>;
42
+ export default FlexiTarget;
@@ -0,0 +1,37 @@
1
+ <script module lang="ts">
2
+ import {
3
+ type FlexiWidgetController,
4
+ flexiwidget,
5
+ type FlexiWidgetConfiguration,
6
+ type FlexiWidgetChildrenSnippet,
7
+ type FlexiWidgetClasses
8
+ } from '../system/widget.svelte.js';
9
+ import type { FlexiCommonProps } from '../system/types.js';
10
+
11
+ export type FlexiWidgetProps = FlexiCommonProps<FlexiWidgetController> &
12
+ Exclude<FlexiWidgetConfiguration, 'className' | 'snippet'> & {
13
+ class?: FlexiWidgetClasses;
14
+ children?: FlexiWidgetChildrenSnippet;
15
+ };
16
+ </script>
17
+
18
+ <script lang="ts">
19
+ let {
20
+ class: className = $bindable(),
21
+ children = $bindable(),
22
+ controller = $bindable(),
23
+ onfirstcreate,
24
+ ...propsConfig
25
+ }: FlexiWidgetProps = $props();
26
+
27
+ let config: FlexiWidgetConfiguration = $state({
28
+ ...propsConfig,
29
+ className: className,
30
+ snippet: children
31
+ });
32
+
33
+ const { widget } = flexiwidget(config);
34
+
35
+ controller = widget;
36
+ onfirstcreate?.(widget);
37
+ </script>
@@ -0,0 +1,9 @@
1
+ import { type FlexiWidgetController, type FlexiWidgetConfiguration, type FlexiWidgetChildrenSnippet, type FlexiWidgetClasses } from '../system/widget.svelte.js';
2
+ import type { FlexiCommonProps } from '../system/types.js';
3
+ export type FlexiWidgetProps = FlexiCommonProps<FlexiWidgetController> & Exclude<FlexiWidgetConfiguration, 'className' | 'snippet'> & {
4
+ class?: FlexiWidgetClasses;
5
+ children?: FlexiWidgetChildrenSnippet;
6
+ };
7
+ declare const FlexiWidget: import("svelte").Component<FlexiWidgetProps, {}, "children" | "class" | "controller">;
8
+ type FlexiWidget = ReturnType<typeof FlexiWidget>;
9
+ export default FlexiWidget;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,44 @@
1
+ <script module lang="ts">
2
+ import { renderedflexiwidget, type FlexiWidgetController } from '../system/widget.svelte.js';
3
+
4
+ export type RenderedFlexiWidgetProps = {
5
+ widget: FlexiWidgetController;
6
+ };
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ let { widget }: RenderedFlexiWidgetProps = $props();
11
+
12
+ const { onpointerdown } = renderedflexiwidget(widget);
13
+
14
+ let derivedClassName = $derived.by(() => {
15
+ if (typeof widget.className === 'function') {
16
+ return widget.className(widget);
17
+ }
18
+
19
+ return widget.className;
20
+ });
21
+ </script>
22
+
23
+ <div
24
+ class={derivedClassName}
25
+ style={widget.style}
26
+ {onpointerdown}
27
+ aria-grabbed={widget.isGrabbed}
28
+ aria-label="Flexi Widget"
29
+ aria-roledescription="Flexi Widget"
30
+ aria-dropeffect="move"
31
+ role="gridcell"
32
+ tabindex={0}
33
+ bind:this={widget.ref}
34
+ >
35
+ {#if widget.snippet}
36
+ {@render widget.snippet({
37
+ widget,
38
+ component: widget.component,
39
+ componentProps: widget.componentProps
40
+ })}
41
+ {:else if widget.component}
42
+ <widget.component {...widget.componentProps ?? {}} />
43
+ {/if}
44
+ </div>
@@ -0,0 +1,7 @@
1
+ import { type FlexiWidgetController } from '../system/widget.svelte.js';
2
+ export type RenderedFlexiWidgetProps = {
3
+ widget: FlexiWidgetController;
4
+ };
5
+ declare const RenderedFlexiWidget: import("svelte").Component<RenderedFlexiWidgetProps, {}, "">;
6
+ type RenderedFlexiWidget = ReturnType<typeof RenderedFlexiWidget>;
7
+ export default RenderedFlexiWidget;
@@ -0,0 +1,16 @@
1
+ import FlexiBoard, { type FlexiBoardProps } from "./components/flexi-board.svelte";
2
+ import FlexiTarget, { type FlexiTargetProps } from "./components/flexi-target.svelte";
3
+ import FlexiWidget, { type FlexiWidgetProps } from "./components/flexi-widget.svelte";
4
+ import FlexiGrab from "./components/flexi-grab.svelte";
5
+ import FlexiResize from "./components/flexi-resize.svelte";
6
+ import FlexiAdd from "./components/flexi-add.svelte";
7
+ import FlexiDelete from "./components/flexi-delete.svelte";
8
+ import type { FlexiBoardConfiguration } from "./system/provider.svelte.js";
9
+ import type { FlexiTargetConfiguration } from "./system/target.svelte.js";
10
+ import type { FlexiWidgetChildrenSnippet, FlexiWidgetChildrenSnippetParameters, FlexiWidgetConfiguration } from "./system/widget.svelte.js";
11
+ import type { FlexiBoardController } from "./system/provider.svelte.js";
12
+ import type { FlexiTargetController } from "./system/target.svelte.js";
13
+ import type { FlexiWidgetController } from "./system/widget.svelte.js";
14
+ import type { AdderWidgetConfiguration, FlexiAddController, FlexiAddWidgetFn } from "./system/manage.svelte.js";
15
+ export * from "./system/types.js";
16
+ export { FlexiBoard, type FlexiBoardConfiguration, type FlexiBoardProps, FlexiTarget, type FlexiTargetConfiguration, type FlexiTargetProps, FlexiWidget, type FlexiWidgetConfiguration, type FlexiWidgetProps, FlexiGrab, FlexiResize, FlexiAdd, FlexiDelete, type FlexiAddWidgetFn, type AdderWidgetConfiguration, type FlexiWidgetController, type FlexiBoardController, type FlexiTargetController, type FlexiAddController, type FlexiWidgetChildrenSnippet, type FlexiWidgetChildrenSnippetParameters };
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // Reexport your entry components here
2
+ import FlexiBoard, {} from "./components/flexi-board.svelte";
3
+ import FlexiTarget, {} from "./components/flexi-target.svelte";
4
+ import FlexiWidget, {} from "./components/flexi-widget.svelte";
5
+ import FlexiGrab from "./components/flexi-grab.svelte";
6
+ import FlexiResize from "./components/flexi-resize.svelte";
7
+ import FlexiAdd from "./components/flexi-add.svelte";
8
+ import FlexiDelete from "./components/flexi-delete.svelte";
9
+ export * from "./system/types.js";
10
+ export { FlexiBoard, FlexiTarget, FlexiWidget, FlexiGrab, FlexiResize, FlexiAdd, FlexiDelete };