@pie-players/pie-section-player-tools-shared 0.3.3
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/PanelResizeHandle.svelte +25 -0
- package/PanelWindowControls.svelte +48 -0
- package/dist/PanelResizeHandle.svelte.d.ts +1 -0
- package/dist/PanelWindowControls.svelte.d.ts +1 -0
- package/dist/floating-panel.d.ts +37 -0
- package/dist/floating-panel.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1562 -0
- package/dist/section-controller.d.ts +19 -0
- package/dist/section-controller.d.ts.map +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/floating-panel.ts +165 -0
- package/index.ts +17 -0
- package/package.json +71 -0
- package/section-controller.ts +51 -0
- package/vite.config.ts +36 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
onPointerDown,
|
|
4
|
+
handleClass = "absolute bottom-0 right-0 w-4 h-4 cursor-se-resize",
|
|
5
|
+
iconClass = "w-full h-full text-base-content/30",
|
|
6
|
+
} = $props<{
|
|
7
|
+
onPointerDown?: (event: MouseEvent) => void;
|
|
8
|
+
handleClass?: string;
|
|
9
|
+
iconClass?: string;
|
|
10
|
+
}>();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
class={handleClass}
|
|
15
|
+
onmousedown={onPointerDown}
|
|
16
|
+
role="button"
|
|
17
|
+
tabindex="0"
|
|
18
|
+
title="Resize window"
|
|
19
|
+
>
|
|
20
|
+
<svg class={iconClass} viewBox="0 0 16 16" fill="currentColor">
|
|
21
|
+
<path d="M16 16V14H14V16H16Z" />
|
|
22
|
+
<path d="M16 11V9H14V11H16Z" />
|
|
23
|
+
<path d="M13 16V14H11V16H13Z" />
|
|
24
|
+
</svg>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
minimized = false,
|
|
4
|
+
onToggle,
|
|
5
|
+
onClose,
|
|
6
|
+
buttonClass = "btn btn-xs btn-ghost btn-circle",
|
|
7
|
+
} = $props<{
|
|
8
|
+
minimized?: boolean;
|
|
9
|
+
onToggle?: () => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
buttonClass?: string;
|
|
12
|
+
}>();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<button class={buttonClass} onclick={onToggle} title={minimized ? "Maximize" : "Minimize"}>
|
|
16
|
+
{#if minimized}
|
|
17
|
+
<svg
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
class="h-3 w-3"
|
|
20
|
+
fill="none"
|
|
21
|
+
viewBox="0 0 24 24"
|
|
22
|
+
stroke="currentColor"
|
|
23
|
+
>
|
|
24
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7" />
|
|
25
|
+
</svg>
|
|
26
|
+
{:else}
|
|
27
|
+
<svg
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
class="h-3 w-3"
|
|
30
|
+
fill="none"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
>
|
|
34
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
|
35
|
+
</svg>
|
|
36
|
+
{/if}
|
|
37
|
+
</button>
|
|
38
|
+
<button class={buttonClass} onclick={onClose} title="Close">
|
|
39
|
+
<svg
|
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
+
class="h-3 w-3"
|
|
42
|
+
fill="none"
|
|
43
|
+
viewBox="0 0 24 24"
|
|
44
|
+
stroke="currentColor"
|
|
45
|
+
>
|
|
46
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
47
|
+
</svg>
|
|
48
|
+
</button>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type FloatingPanelState = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
export type FloatingPanelViewportSizing = {
|
|
8
|
+
widthRatio: number;
|
|
9
|
+
heightRatio: number;
|
|
10
|
+
minWidth: number;
|
|
11
|
+
maxWidth: number;
|
|
12
|
+
minHeight: number;
|
|
13
|
+
maxHeight: number;
|
|
14
|
+
alignX: "left" | "center" | "right";
|
|
15
|
+
alignY: "top" | "center" | "bottom";
|
|
16
|
+
paddingX?: number;
|
|
17
|
+
paddingY?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function computePanelSizeFromViewport(viewport: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}, sizing: FloatingPanelViewportSizing): FloatingPanelState;
|
|
23
|
+
type PointerControllerArgs = {
|
|
24
|
+
getState: () => FloatingPanelState;
|
|
25
|
+
setState: (next: FloatingPanelState) => void;
|
|
26
|
+
minWidth: number;
|
|
27
|
+
minHeight: number;
|
|
28
|
+
padding?: number;
|
|
29
|
+
};
|
|
30
|
+
export type FloatingPanelPointerController = {
|
|
31
|
+
startDrag: (event: MouseEvent) => void;
|
|
32
|
+
startResize: (event: MouseEvent) => void;
|
|
33
|
+
stop: () => void;
|
|
34
|
+
};
|
|
35
|
+
export declare function createFloatingPanelPointerController(args: PointerControllerArgs): FloatingPanelPointerController;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=floating-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floating-panel.d.ts","sourceRoot":"","sources":["../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AAI,EAAE,qBAAqB,GACzB,8BAA8B,CA6FhC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as PanelWindowControls } from './PanelWindowControls.svelte';
|
|
2
|
+
export { default as PanelResizeHandle } from './PanelResizeHandle.svelte';
|
|
3
|
+
export { createFloatingPanelPointerController, computePanelSizeFromViewport, type FloatingPanelPointerController, type FloatingPanelState, type FloatingPanelViewportSizing, } from './floating-panel.js';
|
|
4
|
+
export { getSectionControllerFromCoordinator, isMatchingSectionControllerLifecycleEvent, optionalIdsEqual, type SectionControllerLifecycleEventLike, type SectionControllerKeyLike, type ToolkitCoordinatorWithSectionController, } from './section-controller.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EACN,oCAAoC,EACpC,4BAA4B,EAC5B,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mCAAmC,EACnC,yCAAyC,EACzC,gBAAgB,EAChB,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,uCAAuC,GAC5C,MAAM,yBAAyB,CAAC"}
|