@window-splitter/state 0.4.1 → 0.4.2
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/.turbo/turbo-build.log +5 -4
- package/CHANGELOG.md +13 -0
- package/dist/commonjs/index.d.ts +7 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +13 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/index.d.ts +7 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +23 -2
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -1599
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/coverage-final.json +0 -2
- package/coverage/coverage-summary.json +0 -3
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -116
- package/coverage/index.ts.html +0 -6106
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
package/src/index.ts
CHANGED
|
@@ -176,6 +176,12 @@ interface RegisterPanelEvent {
|
|
|
176
176
|
data: Omit<PanelData, "type" | "currentValue" | "defaultCollapsed">;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
interface RebindPanelCallbacksEvent {
|
|
180
|
+
/** Rebind the panel callbacks */
|
|
181
|
+
type: "rebindPanelCallbacks";
|
|
182
|
+
data: Pick<PanelData, "id" | "onCollapseChange" | "onResize">;
|
|
183
|
+
}
|
|
184
|
+
|
|
179
185
|
interface RegisterDynamicPanelEvent extends Omit<RegisterPanelEvent, "type"> {
|
|
180
186
|
/** Register a new panel with the state machine */
|
|
181
187
|
type: "registerDynamicPanel";
|
|
@@ -329,8 +335,8 @@ export type GroupMachineEvent =
|
|
|
329
335
|
| ExpandPanelEvent
|
|
330
336
|
| SetPanelPixelSizeEvent
|
|
331
337
|
| ApplyDeltaEvent
|
|
332
|
-
| SetActualItemsSizeEvent
|
|
333
|
-
|
|
338
|
+
| SetActualItemsSizeEvent
|
|
339
|
+
| RebindPanelCallbacksEvent;
|
|
334
340
|
type EventForType<T extends GroupMachineEvent["type"]> = Extract<
|
|
335
341
|
GroupMachineEvent,
|
|
336
342
|
{ type: T }
|
|
@@ -1646,6 +1652,7 @@ export const groupMachine = createMachine(
|
|
|
1646
1652
|
on: {
|
|
1647
1653
|
setActualItemsSize: { actions: ["recordActualItemSize", "onResize"] },
|
|
1648
1654
|
registerPanel: { actions: ["assignPanelData"] },
|
|
1655
|
+
rebindPanelCallbacks: { actions: ["rebindPanelCallbacks"] },
|
|
1649
1656
|
registerDynamicPanel: {
|
|
1650
1657
|
actions: [
|
|
1651
1658
|
"prepare",
|
|
@@ -1857,6 +1864,20 @@ export const groupMachine = createMachine(
|
|
|
1857
1864
|
});
|
|
1858
1865
|
},
|
|
1859
1866
|
}),
|
|
1867
|
+
rebindPanelCallbacks: assign({
|
|
1868
|
+
items: ({ context, event }) => {
|
|
1869
|
+
isEvent(event, ["rebindPanelCallbacks"]);
|
|
1870
|
+
|
|
1871
|
+
for (const item of context.items) {
|
|
1872
|
+
if (isPanelData(item) && item.id === event.data.id) {
|
|
1873
|
+
item.onCollapseChange = event.data.onCollapseChange;
|
|
1874
|
+
item.onResize = event.data.onResize;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
return context.items;
|
|
1879
|
+
},
|
|
1880
|
+
}),
|
|
1860
1881
|
onRegisterDynamicPanel: assign({
|
|
1861
1882
|
items: ({ context, event }) => {
|
|
1862
1883
|
isEvent(event, ["registerDynamicPanel"]);
|
package/.turbo/turbo-lint.log
DELETED