@inflatable-cookie/longhorn-poodle-svelte 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.
- package/LICENSE +21 -0
- package/README.md +37 -0
- package/package.json +171 -0
- package/src/bindings/index.ts +4 -0
- package/src/bindings/layout.svelte.ts +143 -0
- package/src/bindings/lifecycle.svelte.ts +246 -0
- package/src/bindings/optimistic.svelte.ts +96 -0
- package/src/bindings/scheduler.ts +13 -0
- package/src/bindings/surface-transfer-actions.ts +281 -0
- package/src/bindings/surface-transfer.svelte.ts +230 -0
- package/src/bindings/surfaces.svelte.ts +179 -0
- package/src/bindings/transfer-actions.ts +240 -0
- package/src/bindings/transfer-model.ts +138 -0
- package/src/bindings/transfer.svelte.ts +388 -0
- package/src/bindings/window-chrome.ts +63 -0
- package/src/bindings/window-drag.ts +161 -0
- package/src/commands/poodle/CommandPaletteBinding.svelte +51 -0
- package/src/commands/poodle/KeybindingSettings.svelte +138 -0
- package/src/commands/poodle/projectors.ts +37 -0
- package/src/commands/poodle.ts +9 -0
- package/src/commands/svelte/lifecycle.ts +13 -0
- package/src/commands/svelte/session.svelte.ts +212 -0
- package/src/commands/svelte.ts +2 -0
- package/src/config/poodle/BackupSettingsPage.svelte +295 -0
- package/src/config/poodle/RestoreSettingsPage.svelte +535 -0
- package/src/config/poodle/StorageSettingsPage.svelte +361 -0
- package/src/config/poodle/restore-model.ts +63 -0
- package/src/config/poodle/types.ts +11 -0
- package/src/config/poodle.ts +8 -0
- package/src/history/svelte/lifecycle.ts +13 -0
- package/src/history/svelte/session.svelte.ts +97 -0
- package/src/history/svelte.ts +2 -0
- package/src/history-tree/svelte/lifecycle.ts +11 -0
- package/src/history-tree/svelte/session.svelte.ts +27 -0
- package/src/history-tree/svelte.ts +3 -0
- package/src/licence/poodle/LicenceActivation.svelte +62 -0
- package/src/licence/poodle/LicenceSeats.svelte +57 -0
- package/src/licence/poodle/LicenceStatus.svelte +34 -0
- package/src/licence/poodle/LicenceSurface.svelte.ts +43 -0
- package/src/licence/poodle.ts +3 -0
- package/src/native-content/index.ts +4 -0
- package/src/native-content/lifecycle.ts +13 -0
- package/src/native-content/session.svelte.ts +526 -0
- package/src/native-content/viewport.ts +27 -0
- package/src/native-content/visibility.ts +19 -0
- package/src/notifications/poodle/NotificationPanel.svelte +66 -0
- package/src/notifications/poodle/NotificationToastHost.svelte +40 -0
- package/src/notifications/poodle/NotificationToastStack.svelte +22 -0
- package/src/notifications/poodle/projectors.ts +30 -0
- package/src/notifications/poodle.ts +4 -0
- package/src/notifications/svelte/lifecycle.ts +11 -0
- package/src/notifications/svelte/session.svelte.ts +57 -0
- package/src/notifications/svelte.ts +2 -0
- package/src/operation/poodle/OperationPanel.svelte +200 -0
- package/src/operation/poodle/projectors.ts +78 -0
- package/src/operation/poodle.ts +2 -0
- package/src/operation/svelte/lifecycle.ts +13 -0
- package/src/operation/svelte/session.svelte.ts +80 -0
- package/src/operation/svelte.ts +2 -0
- package/src/poodle/LayoutDockRegion.svelte +148 -0
- package/src/poodle/LayoutSplitView.svelte +120 -0
- package/src/poodle/LayoutTabs.svelte +91 -0
- package/src/poodle/binding.ts +401 -0
- package/src/poodle/document.ts +117 -0
- package/src/poodle/index.ts +8 -0
- package/src/poodle/projectors.ts +125 -0
- package/src/poodle/transfer.ts +188 -0
- package/src/poodle/types.ts +89 -0
- package/src/settings/poodle/SettingsShell.svelte +382 -0
- package/src/settings/poodle.ts +2 -0
- package/src/settings/svelte/context.ts +61 -0
- package/src/settings/svelte/document.svelte.ts +202 -0
- package/src/settings/svelte/errors.ts +84 -0
- package/src/settings/svelte/lifecycle.ts +18 -0
- package/src/settings/svelte/page.svelte.ts +266 -0
- package/src/settings/svelte/runtime.svelte.ts +187 -0
- package/src/settings/svelte/scope.svelte.ts +123 -0
- package/src/settings/svelte/session.svelte.ts +288 -0
- package/src/settings/svelte/types.ts +90 -0
- package/src/settings/svelte.ts +6 -0
- package/src/svelte.d.ts +6 -0
- package/src/update/poodle/UpdateCentre.svelte +64 -0
- package/src/update/poodle/UpdateSettings.svelte +64 -0
- package/src/update/poodle/UpdateStatus.svelte +51 -0
- package/src/update/poodle/UpdateSurface.svelte.ts +88 -0
- package/src/update/poodle.ts +3 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DockRegion } from "@inflatable-cookie/poodle-svelte";
|
|
3
|
+
import type {
|
|
4
|
+
CrossWindowDragSourceBridge,
|
|
5
|
+
CrossWindowDragTargetBridge,
|
|
6
|
+
} from "@inflatable-cookie/poodle-core";
|
|
7
|
+
import type {
|
|
8
|
+
DockCollapsedPosture,
|
|
9
|
+
DockEdge,
|
|
10
|
+
DockEmphasis,
|
|
11
|
+
DockSizing,
|
|
12
|
+
ControlDensity,
|
|
13
|
+
ControlSize,
|
|
14
|
+
PanelTabItem,
|
|
15
|
+
SemanticControlSizeRole,
|
|
16
|
+
TabVariant,
|
|
17
|
+
} from "@inflatable-cookie/poodle-svelte";
|
|
18
|
+
import type {
|
|
19
|
+
RegionId,
|
|
20
|
+
} from "@inflatable-cookie/longhorn/layout";
|
|
21
|
+
import type {
|
|
22
|
+
SurfaceId,
|
|
23
|
+
} from "@inflatable-cookie/longhorn/surfaces";
|
|
24
|
+
import type { Snippet } from "svelte";
|
|
25
|
+
|
|
26
|
+
import type { PoodleLayoutBinding } from "./binding.ts";
|
|
27
|
+
import type {
|
|
28
|
+
PanelPresentationResolver,
|
|
29
|
+
PanelRenderContext,
|
|
30
|
+
} from "./types.ts";
|
|
31
|
+
|
|
32
|
+
interface Props {
|
|
33
|
+
binding: PoodleLayoutBinding;
|
|
34
|
+
containerId: SurfaceId;
|
|
35
|
+
regionId: RegionId;
|
|
36
|
+
edge: DockEdge;
|
|
37
|
+
resolvePanel: PanelPresentationResolver;
|
|
38
|
+
ariaLabel: string;
|
|
39
|
+
sizing?: DockSizing;
|
|
40
|
+
collapsedPosture?: DockCollapsedPosture;
|
|
41
|
+
/** Forwarded to the dock strip; false when divider-level collapse pills
|
|
42
|
+
* own the affordance. */
|
|
43
|
+
showCollapseToggle?: boolean;
|
|
44
|
+
/** Forwarded to DockRegion; false when the host renders tabs elsewhere. */
|
|
45
|
+
showTabs?: boolean;
|
|
46
|
+
emphasis?: DockEmphasis;
|
|
47
|
+
tabVariant?: TabVariant;
|
|
48
|
+
size?: ControlSize | null;
|
|
49
|
+
sizeRole?: SemanticControlSizeRole;
|
|
50
|
+
density?: ControlDensity | null;
|
|
51
|
+
crossWindowDragSource?: CrossWindowDragSourceBridge | null;
|
|
52
|
+
crossWindowDropTarget?: CrossWindowDragTargetBridge | null;
|
|
53
|
+
body?: Snippet<[PanelRenderContext]>;
|
|
54
|
+
panel?: Snippet<[PanelRenderContext]>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let {
|
|
58
|
+
binding,
|
|
59
|
+
containerId,
|
|
60
|
+
regionId,
|
|
61
|
+
edge,
|
|
62
|
+
resolvePanel,
|
|
63
|
+
ariaLabel,
|
|
64
|
+
sizing = "flexible",
|
|
65
|
+
collapsedPosture = "icon-strip",
|
|
66
|
+
showCollapseToggle = true,
|
|
67
|
+
showTabs = true,
|
|
68
|
+
emphasis = "standard",
|
|
69
|
+
// Poodle's g13-b020 deleted the strip variant: block absorbed its list
|
|
70
|
+
// padding, hover and close-button margin, and the indicator moved to the
|
|
71
|
+
// active-edge axis. Poodle migrated its own DockRegion the same way.
|
|
72
|
+
tabVariant = "block",
|
|
73
|
+
size = null,
|
|
74
|
+
sizeRole = "chrome",
|
|
75
|
+
density = null,
|
|
76
|
+
crossWindowDragSource = null,
|
|
77
|
+
crossWindowDropTarget = null,
|
|
78
|
+
body,
|
|
79
|
+
panel,
|
|
80
|
+
}: Props = $props();
|
|
81
|
+
|
|
82
|
+
const projection = $derived(
|
|
83
|
+
binding.region(containerId, regionId, resolvePanel),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
function activate(panelInstanceId: string): void {
|
|
87
|
+
if (panelInstanceId !== projection.state.active_panel_instance_id) {
|
|
88
|
+
binding.activate(panelInstanceId);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function movePanel(panelInstanceId: string): void {
|
|
93
|
+
if (binding.canMove(panelInstanceId, containerId, regionId)) {
|
|
94
|
+
binding.move(
|
|
95
|
+
panelInstanceId,
|
|
96
|
+
containerId,
|
|
97
|
+
regionId,
|
|
98
|
+
projection.state.panel_instance_ids.length,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
{#snippet renderBody(item: PanelTabItem | null)}
|
|
105
|
+
{@const context = item ? projection.panels.get(item.value) : undefined}
|
|
106
|
+
{#if context}
|
|
107
|
+
{@render body?.(context)}
|
|
108
|
+
{/if}
|
|
109
|
+
{/snippet}
|
|
110
|
+
|
|
111
|
+
{#snippet renderPanel(item: PanelTabItem)}
|
|
112
|
+
{@const context = projection.panels.get(item.value)}
|
|
113
|
+
{#if context}
|
|
114
|
+
{@render panel?.(context)}
|
|
115
|
+
{/if}
|
|
116
|
+
{/snippet}
|
|
117
|
+
|
|
118
|
+
<DockRegion
|
|
119
|
+
{edge}
|
|
120
|
+
{sizing}
|
|
121
|
+
collapsible={projection.definition.collapsible}
|
|
122
|
+
{showCollapseToggle}
|
|
123
|
+
{showTabs}
|
|
124
|
+
collapsed={projection.state.collapsed ?? false}
|
|
125
|
+
{collapsedPosture}
|
|
126
|
+
{emphasis}
|
|
127
|
+
{tabVariant}
|
|
128
|
+
{size}
|
|
129
|
+
{sizeRole}
|
|
130
|
+
{density}
|
|
131
|
+
crossWindowDragSource={crossWindowDragSource ?? undefined}
|
|
132
|
+
crossWindowDropTarget={crossWindowDropTarget ?? undefined}
|
|
133
|
+
dragZoneId={regionId}
|
|
134
|
+
items={[...projection.items]}
|
|
135
|
+
value={projection.state.active_panel_instance_id}
|
|
136
|
+
{ariaLabel}
|
|
137
|
+
canAcceptPanel={(panelInstanceId) =>
|
|
138
|
+
binding.canMove(panelInstanceId, containerId, regionId)}
|
|
139
|
+
onValueChange={activate}
|
|
140
|
+
onCollapsedChange={(collapsed) =>
|
|
141
|
+
binding.setCollapsed(containerId, regionId, collapsed)}
|
|
142
|
+
onClose={(panelInstanceId) => binding.close(panelInstanceId)}
|
|
143
|
+
onReorder={(panelInstanceIds) =>
|
|
144
|
+
binding.reorder(containerId, regionId, panelInstanceIds)}
|
|
145
|
+
onPanelDrop={({ panel: dropped }) => movePanel(dropped.panelId)}
|
|
146
|
+
children={body ? renderBody : undefined}
|
|
147
|
+
panel={panel ? renderPanel : undefined}
|
|
148
|
+
/>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SplitView } from "@inflatable-cookie/poodle-svelte";
|
|
3
|
+
import type {
|
|
4
|
+
ControlDensity,
|
|
5
|
+
ControlSize,
|
|
6
|
+
SemanticControlSizeRole,
|
|
7
|
+
SplitOrientation,
|
|
8
|
+
} from "@inflatable-cookie/poodle-svelte";
|
|
9
|
+
import {
|
|
10
|
+
layoutRatioFromMillionths,
|
|
11
|
+
layoutRatioToUnitInterval,
|
|
12
|
+
type SurfaceId,
|
|
13
|
+
type RegionId,
|
|
14
|
+
type SizingSlotId,
|
|
15
|
+
} from "@inflatable-cookie/longhorn/layout";
|
|
16
|
+
import type { ComponentProps, Snippet } from "svelte";
|
|
17
|
+
|
|
18
|
+
import type { PoodleLayoutBinding } from "./binding.ts";
|
|
19
|
+
|
|
20
|
+
// Poodle 0.1.0 defines SplitToggleVisibility but does not re-export it from
|
|
21
|
+
// its package root, and contract 012 forbids reaching past that root.
|
|
22
|
+
// Derive it from the public component instead of mirroring the union.
|
|
23
|
+
type SplitToggleVisibility = NonNullable<
|
|
24
|
+
ComponentProps<typeof SplitView>["toggleVisibility"]
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
binding: PoodleLayoutBinding;
|
|
29
|
+
containerId: SurfaceId;
|
|
30
|
+
sizingSlotId: SizingSlotId;
|
|
31
|
+
orientation?: SplitOrientation;
|
|
32
|
+
primaryRegionId?: RegionId | null;
|
|
33
|
+
secondaryRegionId?: RegionId | null;
|
|
34
|
+
primaryHidden?: boolean;
|
|
35
|
+
secondaryHidden?: boolean;
|
|
36
|
+
/** Forwarded to SplitView; "hover" hides the collapse pills until the
|
|
37
|
+
* divider is hovered or focused. */
|
|
38
|
+
toggleVisibility?: SplitToggleVisibility;
|
|
39
|
+
size?: ControlSize | null;
|
|
40
|
+
sizeRole?: SemanticControlSizeRole;
|
|
41
|
+
density?: ControlDensity | null;
|
|
42
|
+
ariaLabel: string;
|
|
43
|
+
primary?: Snippet<[]>;
|
|
44
|
+
secondary?: Snippet<[]>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let {
|
|
48
|
+
binding,
|
|
49
|
+
containerId,
|
|
50
|
+
sizingSlotId,
|
|
51
|
+
orientation = "horizontal",
|
|
52
|
+
primaryRegionId = null,
|
|
53
|
+
secondaryRegionId = null,
|
|
54
|
+
primaryHidden = false,
|
|
55
|
+
secondaryHidden = false,
|
|
56
|
+
toggleVisibility = "always",
|
|
57
|
+
size = null,
|
|
58
|
+
sizeRole = "chrome",
|
|
59
|
+
density = null,
|
|
60
|
+
ariaLabel,
|
|
61
|
+
primary,
|
|
62
|
+
secondary,
|
|
63
|
+
}: Props = $props();
|
|
64
|
+
|
|
65
|
+
const sizing = $derived(binding.sizingSlot(containerId, sizingSlotId));
|
|
66
|
+
// Non-collapsible regions are valid split members; they just have no pill.
|
|
67
|
+
// collapsibleRegionState throws for those — probe the definition first.
|
|
68
|
+
const primaryRegion = $derived.by(() => {
|
|
69
|
+
if (!primaryRegionId) return null;
|
|
70
|
+
const definition = binding.regionDefinition(containerId, primaryRegionId);
|
|
71
|
+
if (!definition.collapsible) return null;
|
|
72
|
+
return binding.collapsibleRegionState(containerId, primaryRegionId);
|
|
73
|
+
});
|
|
74
|
+
const secondaryRegion = $derived.by(() => {
|
|
75
|
+
if (!secondaryRegionId) return null;
|
|
76
|
+
const definition = binding.regionDefinition(containerId, secondaryRegionId);
|
|
77
|
+
if (!definition.collapsible) return null;
|
|
78
|
+
return binding.collapsibleRegionState(containerId, secondaryRegionId);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
function setRatio(ratio: number): void {
|
|
82
|
+
binding.setSizingSlot(
|
|
83
|
+
containerId,
|
|
84
|
+
sizingSlotId,
|
|
85
|
+
layoutRatioFromMillionths(Math.round(ratio * 1_000_000)),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<SplitView
|
|
91
|
+
{orientation}
|
|
92
|
+
ratio={layoutRatioToUnitInterval(sizing.ratio)}
|
|
93
|
+
minRatio={layoutRatioToUnitInterval(sizing.definition.minimum)}
|
|
94
|
+
maxRatio={layoutRatioToUnitInterval(sizing.definition.maximum)}
|
|
95
|
+
primaryCollapsed={primaryRegion?.collapsed ?? false}
|
|
96
|
+
secondaryCollapsed={secondaryRegion?.collapsed ?? false}
|
|
97
|
+
primaryHidden={primaryHidden}
|
|
98
|
+
secondaryHidden={secondaryHidden}
|
|
99
|
+
showCollapsePrimary={!primaryHidden && primaryRegion !== null}
|
|
100
|
+
showCollapseSecondary={!secondaryHidden && secondaryRegion !== null}
|
|
101
|
+
disabled={primaryHidden || secondaryHidden}
|
|
102
|
+
{size}
|
|
103
|
+
{sizeRole}
|
|
104
|
+
{density}
|
|
105
|
+
{toggleVisibility}
|
|
106
|
+
{ariaLabel}
|
|
107
|
+
onRatioChange={setRatio}
|
|
108
|
+
onPrimaryCollapsedChange={(collapsed) => {
|
|
109
|
+
if (!primaryHidden && primaryRegionId) {
|
|
110
|
+
binding.setCollapsed(containerId, primaryRegionId, collapsed);
|
|
111
|
+
}
|
|
112
|
+
}}
|
|
113
|
+
onSecondaryCollapsedChange={(collapsed) => {
|
|
114
|
+
if (!secondaryHidden && secondaryRegionId) {
|
|
115
|
+
binding.setCollapsed(containerId, secondaryRegionId, collapsed);
|
|
116
|
+
}
|
|
117
|
+
}}
|
|
118
|
+
{primary}
|
|
119
|
+
{secondary}
|
|
120
|
+
/>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Tabs } from "@inflatable-cookie/poodle-svelte";
|
|
3
|
+
import type {
|
|
4
|
+
Orientation,
|
|
5
|
+
TabActivationMode,
|
|
6
|
+
TabVariant,
|
|
7
|
+
} from "@inflatable-cookie/poodle-svelte";
|
|
8
|
+
import type {
|
|
9
|
+
RegionId,
|
|
10
|
+
} from "@inflatable-cookie/longhorn/layout";
|
|
11
|
+
import type {
|
|
12
|
+
SurfaceId,
|
|
13
|
+
} from "@inflatable-cookie/longhorn/surfaces";
|
|
14
|
+
import type { Snippet } from "svelte";
|
|
15
|
+
|
|
16
|
+
import type { PoodleLayoutBinding } from "./binding.ts";
|
|
17
|
+
import type {
|
|
18
|
+
PanelPresentationResolver,
|
|
19
|
+
PanelRenderContext,
|
|
20
|
+
} from "./types.ts";
|
|
21
|
+
|
|
22
|
+
interface Props {
|
|
23
|
+
binding: PoodleLayoutBinding;
|
|
24
|
+
containerId: SurfaceId;
|
|
25
|
+
regionId: RegionId;
|
|
26
|
+
resolvePanel: PanelPresentationResolver;
|
|
27
|
+
ariaLabel: string;
|
|
28
|
+
variant?: TabVariant;
|
|
29
|
+
/**
|
|
30
|
+
* The border under the tab list. Defaults true, which is what this
|
|
31
|
+
* projection rendered before Poodle flipped the Tabs default to false;
|
|
32
|
+
* a consumer that wants the borderless list now has to say so.
|
|
33
|
+
*/
|
|
34
|
+
bordered?: boolean;
|
|
35
|
+
orientation?: Orientation;
|
|
36
|
+
activationMode?: TabActivationMode;
|
|
37
|
+
body?: Snippet<[PanelRenderContext]>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let {
|
|
41
|
+
binding,
|
|
42
|
+
containerId,
|
|
43
|
+
regionId,
|
|
44
|
+
resolvePanel,
|
|
45
|
+
ariaLabel,
|
|
46
|
+
// Poodle collapsed five Tabs variants to four: the old `text` was renamed
|
|
47
|
+
// `card` and the old `card` deleted, with no alias window. Same appearance,
|
|
48
|
+
// new name.
|
|
49
|
+
variant = "card",
|
|
50
|
+
bordered = true,
|
|
51
|
+
orientation = "horizontal",
|
|
52
|
+
activationMode = "automatic",
|
|
53
|
+
body,
|
|
54
|
+
}: Props = $props();
|
|
55
|
+
|
|
56
|
+
const projection = $derived(
|
|
57
|
+
binding.region(containerId, regionId, resolvePanel),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
function activate(panelInstanceId: string): void {
|
|
61
|
+
if (panelInstanceId !== projection.state.active_panel_instance_id) {
|
|
62
|
+
binding.activate(panelInstanceId);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
{#snippet renderBody(panelInstanceId: string)}
|
|
68
|
+
{@const context = projection.panels.get(panelInstanceId)}
|
|
69
|
+
{#if context}
|
|
70
|
+
{@render body?.(context)}
|
|
71
|
+
{/if}
|
|
72
|
+
{/snippet}
|
|
73
|
+
|
|
74
|
+
<Tabs
|
|
75
|
+
items={projection.items.map((item) => ({
|
|
76
|
+
...item,
|
|
77
|
+
icon: item.icon ?? undefined,
|
|
78
|
+
}))}
|
|
79
|
+
value={projection.state.active_panel_instance_id ?? ""}
|
|
80
|
+
{variant}
|
|
81
|
+
{bordered}
|
|
82
|
+
{orientation}
|
|
83
|
+
{activationMode}
|
|
84
|
+
reorderable={true}
|
|
85
|
+
{ariaLabel}
|
|
86
|
+
onValueChange={activate}
|
|
87
|
+
onClose={(panelInstanceId) => binding.close(panelInstanceId)}
|
|
88
|
+
onReorder={(panelInstanceIds) =>
|
|
89
|
+
binding.reorder(containerId, regionId, panelInstanceIds)}
|
|
90
|
+
children={body ? renderBody : undefined}
|
|
91
|
+
/>
|