@sectile/terminal 0.1.0 → 0.2.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/README.md +15 -1
- package/package.json +103 -3
- package/dist/accordion.d.ts +0 -31
- package/dist/accordion.d.ts.map +0 -1
- package/dist/accordion.js +0 -76
- package/dist/accordion.js.map +0 -1
- package/dist/alert-dialog.d.ts +0 -18
- package/dist/alert-dialog.d.ts.map +0 -1
- package/dist/alert-dialog.js +0 -12
- package/dist/alert-dialog.js.map +0 -1
- package/dist/calendar.d.ts +0 -75
- package/dist/calendar.d.ts.map +0 -1
- package/dist/calendar.js +0 -217
- package/dist/calendar.js.map +0 -1
- package/dist/carousel.d.ts +0 -44
- package/dist/carousel.d.ts.map +0 -1
- package/dist/carousel.js +0 -129
- package/dist/carousel.js.map +0 -1
- package/dist/checkbox-group.d.ts +0 -19
- package/dist/checkbox-group.d.ts.map +0 -1
- package/dist/checkbox-group.js +0 -14
- package/dist/checkbox-group.js.map +0 -1
- package/dist/checkbox.d.ts +0 -17
- package/dist/checkbox.d.ts.map +0 -1
- package/dist/checkbox.js +0 -12
- package/dist/checkbox.js.map +0 -1
- package/dist/combobox.d.ts +0 -100
- package/dist/combobox.d.ts.map +0 -1
- package/dist/combobox.js +0 -286
- package/dist/combobox.js.map +0 -1
- package/dist/date-field.d.ts +0 -36
- package/dist/date-field.d.ts.map +0 -1
- package/dist/date-field.js +0 -46
- package/dist/date-field.js.map +0 -1
- package/dist/date-picker.d.ts +0 -38
- package/dist/date-picker.d.ts.map +0 -1
- package/dist/date-picker.js +0 -40
- package/dist/date-picker.js.map +0 -1
- package/dist/date-range-picker.d.ts +0 -38
- package/dist/date-range-picker.d.ts.map +0 -1
- package/dist/date-range-picker.js +0 -29
- package/dist/date-range-picker.js.map +0 -1
- package/dist/date-time-field.d.ts +0 -36
- package/dist/date-time-field.d.ts.map +0 -1
- package/dist/date-time-field.js +0 -133
- package/dist/date-time-field.js.map +0 -1
- package/dist/date-time-picker.d.ts +0 -38
- package/dist/date-time-picker.d.ts.map +0 -1
- package/dist/date-time-picker.js +0 -127
- package/dist/date-time-picker.js.map +0 -1
- package/dist/date-time-range-picker.d.ts +0 -38
- package/dist/date-time-range-picker.d.ts.map +0 -1
- package/dist/date-time-range-picker.js +0 -136
- package/dist/date-time-range-picker.js.map +0 -1
- package/dist/dialog.d.ts +0 -17
- package/dist/dialog.d.ts.map +0 -1
- package/dist/dialog.js +0 -12
- package/dist/dialog.js.map +0 -1
- package/dist/disclosure.d.ts +0 -22
- package/dist/disclosure.d.ts.map +0 -1
- package/dist/disclosure.js +0 -56
- package/dist/disclosure.js.map +0 -1
- package/dist/feed.d.ts +0 -28
- package/dist/feed.d.ts.map +0 -1
- package/dist/feed.js +0 -32
- package/dist/feed.js.map +0 -1
- package/dist/grid.d.ts +0 -40
- package/dist/grid.d.ts.map +0 -1
- package/dist/grid.js +0 -68
- package/dist/grid.js.map +0 -1
- package/dist/index.d.ts +0 -46
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -44
- package/dist/index.js.map +0 -1
- package/dist/internal/checked-control.d.ts +0 -23
- package/dist/internal/checked-control.d.ts.map +0 -1
- package/dist/internal/checked-control.js +0 -22
- package/dist/internal/checked-control.js.map +0 -1
- package/dist/internal/controller.d.ts +0 -6
- package/dist/internal/controller.d.ts.map +0 -1
- package/dist/internal/controller.js +0 -35
- package/dist/internal/controller.js.map +0 -1
- package/dist/internal/disabled-items.d.ts +0 -6
- package/dist/internal/disabled-items.d.ts.map +0 -1
- package/dist/internal/disabled-items.js +0 -15
- package/dist/internal/disabled-items.js.map +0 -1
- package/dist/internal/facade.d.ts +0 -44
- package/dist/internal/facade.d.ts.map +0 -1
- package/dist/internal/facade.js +0 -58
- package/dist/internal/facade.js.map +0 -1
- package/dist/internal/menu-control.d.ts +0 -34
- package/dist/internal/menu-control.d.ts.map +0 -1
- package/dist/internal/menu-control.js +0 -48
- package/dist/internal/menu-control.js.map +0 -1
- package/dist/internal/popup-control.d.ts +0 -24
- package/dist/internal/popup-control.d.ts.map +0 -1
- package/dist/internal/popup-control.js +0 -23
- package/dist/internal/popup-control.js.map +0 -1
- package/dist/internal/semantic-controller.d.ts +0 -20
- package/dist/internal/semantic-controller.d.ts.map +0 -1
- package/dist/internal/semantic-controller.js +0 -42
- package/dist/internal/semantic-controller.js.map +0 -1
- package/dist/internal/text-input.d.ts +0 -5
- package/dist/internal/text-input.d.ts.map +0 -1
- package/dist/internal/text-input.js +0 -53
- package/dist/internal/text-input.js.map +0 -1
- package/dist/keyboard.d.ts +0 -10
- package/dist/keyboard.d.ts.map +0 -1
- package/dist/keyboard.js +0 -16
- package/dist/keyboard.js.map +0 -1
- package/dist/layout.d.ts +0 -2
- package/dist/layout.d.ts.map +0 -1
- package/dist/layout.js +0 -24
- package/dist/layout.js.map +0 -1
- package/dist/listbox.d.ts +0 -87
- package/dist/listbox.d.ts.map +0 -1
- package/dist/listbox.js +0 -323
- package/dist/listbox.js.map +0 -1
- package/dist/menu-button.d.ts +0 -8
- package/dist/menu-button.d.ts.map +0 -1
- package/dist/menu-button.js +0 -11
- package/dist/menu-button.js.map +0 -1
- package/dist/menu.d.ts +0 -8
- package/dist/menu.d.ts.map +0 -1
- package/dist/menu.js +0 -11
- package/dist/menu.js.map +0 -1
- package/dist/menubar.d.ts +0 -8
- package/dist/menubar.d.ts.map +0 -1
- package/dist/menubar.js +0 -11
- package/dist/menubar.js.map +0 -1
- package/dist/multi-thumb-slider.d.ts +0 -32
- package/dist/multi-thumb-slider.d.ts.map +0 -1
- package/dist/multi-thumb-slider.js +0 -67
- package/dist/multi-thumb-slider.js.map +0 -1
- package/dist/node.d.ts +0 -15
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -78
- package/dist/node.js.map +0 -1
- package/dist/number-field.d.ts +0 -44
- package/dist/number-field.d.ts.map +0 -1
- package/dist/number-field.js +0 -157
- package/dist/number-field.js.map +0 -1
- package/dist/pagination.d.ts +0 -35
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -103
- package/dist/pagination.js.map +0 -1
- package/dist/pin-input.d.ts +0 -25
- package/dist/pin-input.d.ts.map +0 -1
- package/dist/pin-input.js +0 -30
- package/dist/pin-input.js.map +0 -1
- package/dist/quantity-field.d.ts +0 -45
- package/dist/quantity-field.d.ts.map +0 -1
- package/dist/quantity-field.js +0 -168
- package/dist/quantity-field.js.map +0 -1
- package/dist/radio-group.d.ts +0 -37
- package/dist/radio-group.d.ts.map +0 -1
- package/dist/radio-group.js +0 -126
- package/dist/radio-group.js.map +0 -1
- package/dist/rating.d.ts +0 -22
- package/dist/rating.d.ts.map +0 -1
- package/dist/rating.js +0 -38
- package/dist/rating.js.map +0 -1
- package/dist/select.d.ts +0 -41
- package/dist/select.d.ts.map +0 -1
- package/dist/select.js +0 -50
- package/dist/select.js.map +0 -1
- package/dist/slider.d.ts +0 -59
- package/dist/slider.d.ts.map +0 -1
- package/dist/slider.js +0 -156
- package/dist/slider.js.map +0 -1
- package/dist/spin-button.d.ts +0 -35
- package/dist/spin-button.d.ts.map +0 -1
- package/dist/spin-button.js +0 -78
- package/dist/spin-button.js.map +0 -1
- package/dist/stepper.d.ts +0 -19
- package/dist/stepper.d.ts.map +0 -1
- package/dist/stepper.js +0 -14
- package/dist/stepper.js.map +0 -1
- package/dist/switch.d.ts +0 -15
- package/dist/switch.d.ts.map +0 -1
- package/dist/switch.js +0 -12
- package/dist/switch.js.map +0 -1
- package/dist/tabs.d.ts +0 -42
- package/dist/tabs.d.ts.map +0 -1
- package/dist/tabs.js +0 -128
- package/dist/tabs.js.map +0 -1
- package/dist/tags-input.d.ts +0 -29
- package/dist/tags-input.d.ts.map +0 -1
- package/dist/tags-input.js +0 -27
- package/dist/tags-input.js.map +0 -1
- package/dist/text.d.ts +0 -60
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js +0 -143
- package/dist/text.js.map +0 -1
- package/dist/time-field.d.ts +0 -36
- package/dist/time-field.d.ts.map +0 -1
- package/dist/time-field.js +0 -40
- package/dist/time-field.js.map +0 -1
- package/dist/toggle-button.d.ts +0 -15
- package/dist/toggle-button.d.ts.map +0 -1
- package/dist/toggle-button.js +0 -12
- package/dist/toggle-button.js.map +0 -1
- package/dist/toolbar.d.ts +0 -34
- package/dist/toolbar.d.ts.map +0 -1
- package/dist/toolbar.js +0 -108
- package/dist/toolbar.js.map +0 -1
- package/dist/tooltip.d.ts +0 -15
- package/dist/tooltip.d.ts.map +0 -1
- package/dist/tooltip.js +0 -12
- package/dist/tooltip.js.map +0 -1
- package/dist/tree-grid.d.ts +0 -94
- package/dist/tree-grid.d.ts.map +0 -1
- package/dist/tree-grid.js +0 -308
- package/dist/tree-grid.js.map +0 -1
- package/dist/tree-view.d.ts +0 -75
- package/dist/tree-view.d.ts.map +0 -1
- package/dist/tree-view.js +0 -213
- package/dist/tree-view.js.map +0 -1
- package/dist/window-splitter.d.ts +0 -19
- package/dist/window-splitter.d.ts.map +0 -1
- package/dist/window-splitter.js +0 -48
- package/dist/window-splitter.js.map +0 -1
package/dist/disclosure.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../src/disclosure.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAEmB,KAAK,eAAe,EAAE,KAAK,eAAe,EACnE,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAG3D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AACD,MAAM,WAAW,oBAAoB;IACnC,WAAW,IAAI,gBAAgB,CAAC,eAAe,CAAC,CAAC;IACjD,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9E,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;IAC7C,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC;CAC5D;AACD,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CAAC,oBAAoB,CAAC,CAExG;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAEnH;AAeD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,eAAe,GAAG,IAAI,CAEtF"}
|
package/dist/disclosure.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { createFacadeConnection } from './internal/facade.js';
|
|
2
|
-
import { unwrap } from '@sectile/core/result';
|
|
3
|
-
import { applyDisclosureEvent, createDisclosureState, } from '@sectile/core/disclosure';
|
|
4
|
-
import { createSemanticController } from './internal/semantic-controller.js';
|
|
5
|
-
export function createDisclosure(options = {}) {
|
|
6
|
-
return unwrap(tryCreateDisclosure(options));
|
|
7
|
-
}
|
|
8
|
-
export function tryCreateDisclosure(options = {}) {
|
|
9
|
-
return createFacadeConnection(options, (options) => tryCreateDisclosureConnection(options));
|
|
10
|
-
}
|
|
11
|
-
function tryCreateDisclosureConnection(options = {}) {
|
|
12
|
-
const controlled = options.open !== undefined;
|
|
13
|
-
const runtime = createSemanticController({
|
|
14
|
-
initial: createDisclosureState(options.open ?? options.defaultOpen ?? false),
|
|
15
|
-
reducer: applyDisclosureEvent,
|
|
16
|
-
reconcile: (previous, proposed) => createDisclosureState(controlled ? previous.open : proposed.open),
|
|
17
|
-
notify: (previous, proposed) => { if (previous.open !== proposed.open)
|
|
18
|
-
options.onOpenChange?.(proposed.open); },
|
|
19
|
-
toEffect: (command) => command,
|
|
20
|
-
interaction: options,
|
|
21
|
-
});
|
|
22
|
-
if (!runtime.ok)
|
|
23
|
-
return runtime;
|
|
24
|
-
return { ok: true, value: new TerminalDisclosureConnection(options, runtime.value, controlled) };
|
|
25
|
-
}
|
|
26
|
-
export function toDisclosureEvent(input) {
|
|
27
|
-
return input.key === 'enter' || input.key === 'space' ? 'toggle' : null;
|
|
28
|
-
}
|
|
29
|
-
class TerminalDisclosureConnection {
|
|
30
|
-
#options;
|
|
31
|
-
#runtime;
|
|
32
|
-
#controlled;
|
|
33
|
-
constructor(options, runtime, controlled) {
|
|
34
|
-
this.#options = options;
|
|
35
|
-
this.#runtime = runtime;
|
|
36
|
-
this.#controlled = controlled;
|
|
37
|
-
}
|
|
38
|
-
getSnapshot() { return this.#runtime.getSnapshot(); }
|
|
39
|
-
syncControlledValue(open) {
|
|
40
|
-
if (!this.#controlled)
|
|
41
|
-
return { ok: false, error: { class: 'construction', code: 'uncontrolled-controller-sync', message: 'An uncontrolled disclosure cannot be synchronized externally.' } };
|
|
42
|
-
const result = this.#runtime.replace(createDisclosureState(open));
|
|
43
|
-
if (result.ok)
|
|
44
|
-
this.#options.onUpdate?.();
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
handleEvent(event) { const result = this.#runtime.handle(event); if (result.ok)
|
|
48
|
-
this.#options.onUpdate?.(); return result.ok; }
|
|
49
|
-
handleKeyboardInput(input) {
|
|
50
|
-
const event = toDisclosureEvent(input);
|
|
51
|
-
if (event === null)
|
|
52
|
-
return false;
|
|
53
|
-
return this.handleEvent(event);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=disclosure.js.map
|
package/dist/disclosure.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure.js","sourceRoot":"","sources":["../src/disclosure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EACL,oBAAoB,EAAE,qBAAqB,GAE5C,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,wBAAwB,EAA2B,MAAM,mCAAmC,CAAC;AAetG,MAAM,UAAU,gBAAgB,CAAC,OAAO,GAAsB,EAAE;IAC9D,OAAO,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAO,GAAsB,EAAE;IACjE,OAAO,sBAAsB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9F,CAAC;AAED,SAAS,6BAA6B,CAAC,OAAO,GAAsB,EAAE;IACpE,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;IAC9C,MAAM,OAAO,GAAG,wBAAwB,CAAyE;QAC/G,OAAO,EAAE,qBAAqB,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,WAAW,IAAI,KAAK,CAAC;QAC5E,OAAO,EAAE,oBAAoB;QAC7B,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QACpG,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,QAAQ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C,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,IAAI,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC1C,OAAO,MAAM,CAAC;IAChB,CAAC;IACM,WAAW,CAAC,KAAsB,IAAa,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACzJ,mBAAmB,CAAC,KAA4B;QACrD,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAAC,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QAAC,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC3G,CAAC;CACF"}
|
package/dist/feed.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type FacadeConnection } from './internal/facade.js';
|
|
2
|
-
import type { Result, StableID } from '@sectile/core';
|
|
3
|
-
import { type FeedDirection, type FeedEvent, type FeedState } from '@sectile/core/feed';
|
|
4
|
-
import type { RevisionSnapshot } from '@sectile/core/revision';
|
|
5
|
-
import type { TerminalKeyboardInput } from './keyboard.js';
|
|
6
|
-
export interface FeedOptions<ID extends StableID = StableID> {
|
|
7
|
-
readonly items: readonly ID[];
|
|
8
|
-
readonly revision?: number;
|
|
9
|
-
readonly defaultHighlightedValue?: ID | null;
|
|
10
|
-
readonly disabled?: boolean;
|
|
11
|
-
readonly onHighlightedValueChange?: (value: ID | null) => void;
|
|
12
|
-
readonly onRequestWindow?: (direction: FeedDirection, anchor: ID | null, revision: number) => void;
|
|
13
|
-
readonly onUpdate?: () => void;
|
|
14
|
-
}
|
|
15
|
-
export interface FeedWindow<ID extends StableID = StableID> {
|
|
16
|
-
readonly items: readonly ID[];
|
|
17
|
-
readonly revision: number;
|
|
18
|
-
readonly highlightedValue?: ID | null;
|
|
19
|
-
}
|
|
20
|
-
export interface FeedConnection<ID extends StableID = StableID> {
|
|
21
|
-
getSnapshot(): RevisionSnapshot<FeedState<ID>>;
|
|
22
|
-
syncWindow(window: FeedWindow<ID>): Result<RevisionSnapshot<FeedState<ID>>>;
|
|
23
|
-
handleEvent(event: FeedEvent<ID>): boolean;
|
|
24
|
-
handleKeyboardInput(input: TerminalKeyboardInput): boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare function createFeed<ID extends StableID>(options: FeedOptions<ID>): FacadeConnection<FeedConnection<ID>>;
|
|
27
|
-
export declare function tryCreateFeed<ID extends StableID>(options: FeedOptions<ID>): Result<FacadeConnection<FeedConnection<ID>>>;
|
|
28
|
-
//# sourceMappingURL=feed.d.ts.map
|
package/dist/feed.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAAyE,OAAO,EAAqD,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAAC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAAC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtY,MAAM,WAAW,WAAW,CAAC,EAAE,SAAS,QAAQ,GAAG,QAAQ;IAAI,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,EAAE,GAAG,IAA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AAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAEzH"}
|
package/dist/feed.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createFacadeConnection } from './internal/facade.js';
|
|
2
|
-
import { unwrap } from '@sectile/core/result';
|
|
3
|
-
import { createSequence } from '@sectile/core/sequence';
|
|
4
|
-
import { applyFeedEvent, createFeedState } from '@sectile/core/feed';
|
|
5
|
-
import { createSemanticController } from './internal/semantic-controller.js';
|
|
6
|
-
export function createFeed(options) {
|
|
7
|
-
return unwrap(tryCreateFeed(options));
|
|
8
|
-
}
|
|
9
|
-
export function tryCreateFeed(options) {
|
|
10
|
-
return createFacadeConnection(options, (options) => tryCreateFeedConnection(options));
|
|
11
|
-
}
|
|
12
|
-
function tryCreateFeedConnection(options) { const items = createSequence(options.items); if (!items.ok)
|
|
13
|
-
return items; const model = { value: items.value }; const runtime = createSemanticController({ initial: createFeedState(items.value, options.defaultHighlightedValue ?? options.items[0] ?? null, options.revision ?? 0), reducer: (state, event) => applyFeedEvent(model.value, state, event), notify: (previous, proposed) => { if (previous.cursor.current !== proposed.cursor.current)
|
|
14
|
-
options.onHighlightedValueChange?.(proposed.cursor.current); }, toEffect: (command) => command, interaction: options }); return runtime.ok ? { ok: true, value: new TerminalFeed(options, model, runtime.value) } : runtime; }
|
|
15
|
-
class TerminalFeed {
|
|
16
|
-
#options;
|
|
17
|
-
#model;
|
|
18
|
-
#runtime;
|
|
19
|
-
constructor(options, model, runtime) { this.#options = options; this.#model = model; this.#runtime = runtime; }
|
|
20
|
-
getSnapshot() { return this.#runtime.getSnapshot(); }
|
|
21
|
-
syncWindow(window) { if (window.revision <= this.getSnapshot().state.revision)
|
|
22
|
-
return { ok: false, error: { class: 'construction', code: 'stale-feed-window', message: 'Feed window revision must increase.' } }; const items = createSequence(window.items); if (!items.ok)
|
|
23
|
-
return items; const state = createFeedState(items.value, window.highlightedValue ?? this.getSnapshot().state.cursor.current ?? window.items[0] ?? null, window.revision, null); if (!state.ok)
|
|
24
|
-
return state; this.#model.value = items.value; const result = this.#runtime.replace(state); if (result.ok)
|
|
25
|
-
this.#options.onUpdate?.(); return result; }
|
|
26
|
-
handleEvent(event) { const result = this.#runtime.handle(event); if (result.ok)
|
|
27
|
-
for (const command of result.commands)
|
|
28
|
-
if (command.type === 'request-window')
|
|
29
|
-
this.#options.onRequestWindow?.(command.direction, command.anchor, command.revision); this.#options.onUpdate?.(); return true; }
|
|
30
|
-
handleKeyboardInput(input) { const event = input.key === 'down' || input.key === 'page-down' ? 'next' : input.key === 'up' || input.key === 'page-up' ? 'previous' : input.key === 'load-before' ? 'request-before' : input.key === 'load-after' ? 'request-after' : null; return event === null ? false : this.handleEvent(event); }
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=feed.js.map
|
package/dist/feed.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feed.js","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACS,OAAO,EAAE,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAAC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAwE,MAAM,oBAAoB,CAAC;AAA6H,OAAO,EAAE,wBAAwB,EAA2B,MAAM,mCAAmC,CAAC;AAE7e,MAAM,UAAU,UAAU,CAAsB,OAAwB;IACtE,OAAO,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,aAAa,CAAsB,OAAwB;IACzE,OAAO,sBAAsB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,SAAS,uBAAuB,CAAsB,OAAwB,IAAgC,MAAM,KAAK,GAAG,cAAc,CA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AI,MAAM,CAAC,EAAE;QAAE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ;YAAE,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB;gBAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;IAAQ,mBAAmB,CAAC,KAA4B,IAAa,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAAE"}
|
package/dist/grid.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type FacadeConnection } from './internal/facade.js';
|
|
2
|
-
import type { Result, StableID } from '@sectile/core';
|
|
3
|
-
import { type Grid, type GridEditMode, type GridEvent, type GridOptions as StructureGridOptions, type GridPolicies, type GridState } from '@sectile/core/grid';
|
|
4
|
-
import type { RevisionSnapshot } from '@sectile/core/revision';
|
|
5
|
-
import type { TerminalKeyboardInput } from './keyboard.js';
|
|
6
|
-
export interface GridOptions<ID extends StableID = StableID> extends StructureGridOptions {
|
|
7
|
-
readonly rows: readonly (readonly (ID | null)[])[];
|
|
8
|
-
readonly value?: ID | null;
|
|
9
|
-
readonly defaultValue?: ID | null;
|
|
10
|
-
readonly highlightedValue?: ID | null;
|
|
11
|
-
readonly defaultHighlightedValue?: ID | null;
|
|
12
|
-
readonly editMode?: GridEditMode;
|
|
13
|
-
readonly defaultEditMode?: GridEditMode;
|
|
14
|
-
readonly policies?: GridPolicies<ID>;
|
|
15
|
-
readonly disabledItems?: readonly ID[];
|
|
16
|
-
readonly disabled?: boolean;
|
|
17
|
-
readonly readOnly?: boolean;
|
|
18
|
-
readonly onValueChange?: (value: ID | null) => void;
|
|
19
|
-
readonly onHighlightedValueChange?: (value: ID | null) => void;
|
|
20
|
-
readonly onEditModeChange?: (mode: GridEditMode) => void;
|
|
21
|
-
readonly onEditStart?: (id: ID) => void;
|
|
22
|
-
readonly onEditCommit?: (id: ID) => void;
|
|
23
|
-
readonly onEditCancel?: (id: ID) => void;
|
|
24
|
-
readonly onUpdate?: () => void;
|
|
25
|
-
}
|
|
26
|
-
export interface GridControlledValues<ID extends StableID = StableID> {
|
|
27
|
-
readonly value?: ID | null;
|
|
28
|
-
readonly highlightedValue?: ID | null;
|
|
29
|
-
readonly editMode?: GridEditMode;
|
|
30
|
-
}
|
|
31
|
-
export interface GridConnection<ID extends StableID = StableID> {
|
|
32
|
-
readonly grid: Grid<ID>;
|
|
33
|
-
getSnapshot(): RevisionSnapshot<GridState<ID>>;
|
|
34
|
-
syncControlledValues(values: GridControlledValues<ID>): Result<RevisionSnapshot<GridState<ID>>>;
|
|
35
|
-
handleEvent(event: GridEvent<ID>): boolean;
|
|
36
|
-
handleKeyboardInput(input: TerminalKeyboardInput): boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare function createGridControl<ID extends StableID>(options: GridOptions<ID>): FacadeConnection<GridConnection<ID>>;
|
|
39
|
-
export declare function tryCreateGridControl<ID extends StableID>(options: GridOptions<ID>): Result<FacadeConnection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AAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;IAAC,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAA;CAAE;AAEpV,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAErH;AAED,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAEhI"}
|
package/dist/grid.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { createFacadeConnection } from './internal/facade.js';
|
|
2
|
-
import { unwrap } from '@sectile/core/result';
|
|
3
|
-
import { applyGridEvent, createGrid, createGridState } from '@sectile/core/grid';
|
|
4
|
-
import { createSemanticController } from './internal/semantic-controller.js';
|
|
5
|
-
export function createGridControl(options) {
|
|
6
|
-
return unwrap(tryCreateGridControl(options));
|
|
7
|
-
}
|
|
8
|
-
export function tryCreateGridControl(options) {
|
|
9
|
-
return createFacadeConnection(options, (options) => tryCreateGridControlConnection(options));
|
|
10
|
-
}
|
|
11
|
-
function tryCreateGridControlConnection(options) {
|
|
12
|
-
const grid = createGrid(options.rows, options);
|
|
13
|
-
if (!grid.ok)
|
|
14
|
-
return grid;
|
|
15
|
-
const disabled = new Set(options.disabledItems ?? []);
|
|
16
|
-
for (const id of disabled)
|
|
17
|
-
if (grid.value.positionOf(id) === null)
|
|
18
|
-
return { ok: false, error: { class: 'construction', code: 'disabled-item-outside-domain', message: 'Every disabled grid cell must exist in the grid.', details: { id } } };
|
|
19
|
-
const supplied = options.policies?.eligible;
|
|
20
|
-
const policies = { ...options.policies, eligible: (id) => !disabled.has(id) && (supplied?.(id) ?? true) };
|
|
21
|
-
const vc = options.value !== undefined, hc = options.highlightedValue !== undefined, ec = options.editMode !== undefined;
|
|
22
|
-
const selected = options.value !== undefined ? options.value : options.defaultValue ?? null;
|
|
23
|
-
const runtime = createSemanticController({ initial: createGridState(grid.value, { current: options.highlightedValue !== undefined ? options.highlightedValue : options.defaultHighlightedValue ?? null, selected: selected === null ? [] : [selected], anchor: selected, editMode: options.editMode ?? options.defaultEditMode ?? 'navigation' }), reducer: (state, event) => applyGridEvent(grid.value, state, event, policies), reconcile: (previous, proposed) => createGridState(grid.value, { current: hc ? previous.cursor.current : proposed.cursor.current, selected: vc ? previous.selection.selected : proposed.selection.selected, anchor: vc ? previous.selection.anchor : proposed.selection.anchor, editMode: ec ? previous.editMode : proposed.editMode }), notify: (previous, proposed) => { const before = previous.selection.selected[0] ?? null; const after = proposed.selection.selected[0] ?? null; if (before !== after)
|
|
24
|
-
options.onValueChange?.(after); if (previous.cursor.current !== proposed.cursor.current)
|
|
25
|
-
options.onHighlightedValueChange?.(proposed.cursor.current); if (previous.editMode !== proposed.editMode)
|
|
26
|
-
options.onEditModeChange?.(proposed.editMode); }, toEffect: (command) => command, interaction: options, interactionIntent: gridIntent });
|
|
27
|
-
if (!runtime.ok)
|
|
28
|
-
return runtime;
|
|
29
|
-
return { ok: true, value: new TerminalGrid(options, grid.value, runtime.value, vc, hc, ec) };
|
|
30
|
-
}
|
|
31
|
-
class TerminalGrid {
|
|
32
|
-
grid;
|
|
33
|
-
#options;
|
|
34
|
-
#runtime;
|
|
35
|
-
#vc;
|
|
36
|
-
#hc;
|
|
37
|
-
#ec;
|
|
38
|
-
constructor(options, grid, runtime, vc, hc, ec) { this.#options = options; this.grid = grid; this.#runtime = runtime; this.#vc = vc; this.#hc = hc; this.#ec = ec; }
|
|
39
|
-
getSnapshot() { return this.#runtime.getSnapshot(); }
|
|
40
|
-
syncControlledValues(values) { if (this.#vc !== (values.value !== undefined) || this.#hc !== (values.highlightedValue !== undefined) || this.#ec !== (values.editMode !== undefined))
|
|
41
|
-
return { ok: false, error: { class: 'construction', code: 'controlled-shape-mismatch', message: 'Controlled grid values must preserve their construction-time shape.' } }; const current = this.getSnapshot().state; const selected = values.value === undefined ? current.selection.selected : values.value === null ? [] : [values.value]; const result = this.#runtime.replace(createGridState(this.grid, { current: values.highlightedValue === undefined ? current.cursor.current : values.highlightedValue, selected, anchor: values.value === undefined ? current.selection.anchor : values.value, editMode: values.editMode ?? current.editMode })); if (result.ok)
|
|
42
|
-
this.#options.onUpdate?.(); return result; }
|
|
43
|
-
handleEvent(event) { const result = this.#runtime.handle(event); if (result.ok)
|
|
44
|
-
for (const command of result.commands) {
|
|
45
|
-
if (command.type === 'begin-edit')
|
|
46
|
-
this.#options.onEditStart?.(command.id);
|
|
47
|
-
else if (command.type === 'commit-edit')
|
|
48
|
-
this.#options.onEditCommit?.(command.id);
|
|
49
|
-
else if (command.type === 'cancel-edit')
|
|
50
|
-
this.#options.onEditCancel?.(command.id);
|
|
51
|
-
} if (result.ok)
|
|
52
|
-
this.#options.onUpdate?.(); return result.ok; }
|
|
53
|
-
handleKeyboardInput(input) { const event = toGridEvent(input, this.getSnapshot().state.editMode); return event === null ? false : this.handleEvent(event); }
|
|
54
|
-
}
|
|
55
|
-
function gridIntent(event) { const type = typeof event === 'object' ? event.type : event; return type === 'start-edit' || type === 'commit-edit' || type === 'cancel-edit' ? 'mutate' : 'navigate'; }
|
|
56
|
-
function toGridEvent(input, editMode) { if (input.ctrlKey)
|
|
57
|
-
return null; if (editMode === 'editing') {
|
|
58
|
-
if (input.key === 'enter')
|
|
59
|
-
return 'commit-edit';
|
|
60
|
-
if (input.key === 'escape')
|
|
61
|
-
return 'cancel-edit';
|
|
62
|
-
return null;
|
|
63
|
-
} if (input.altKey)
|
|
64
|
-
return null; if (input.key === 'left' || input.key === 'right' || input.key === 'up' || input.key === 'down')
|
|
65
|
-
return input.key; if (input.key === 'space')
|
|
66
|
-
return 'select'; if (input.key === 'enter' || input.key === 'edit')
|
|
67
|
-
return 'start-edit'; return null; }
|
|
68
|
-
//# sourceMappingURL=grid.js.map
|
package/dist/grid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../src/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAA+I,MAAM,oBAAoB,CAAC;AAG9N,OAAO,EAAE,wBAAwB,EAA2B,MAAM,mCAAmC,CAAC;AAMtG,MAAM,UAAU,iBAAiB,CAAsB,OAAwB;IAC7E,OAAO,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAsB,OAAwB;IAChF,OAAO,sBAAsB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,8BAA8B,CAAsB,OAAwB;IACnF,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IAAC,MAAM,QAAQ,GAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,IAAE,EAAE,CAAC,CAAC;IAAA,KAAI,MAAM,EAAE,IAAI,QAAQ;QAAC,IAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,KAAG,IAAI;YAAC,OAAM,EAAC,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,EAAC,KAAK,EAAC,cAAc,EAAC,IAAI,EAAC,8BAA8B,EAAC,OAAO,EAAC,kDAAkD,EAAC,OAAO,EAAC,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AK,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,aAAa,CAAC;IAAC,OAAO,IAAI,CAAC;AAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM;IAAE,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM;IAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO;IAAE,OAAO,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM;IAAE,OAAO,YAAY,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export type { FacadeConnection } from './internal/facade.js';
|
|
2
|
-
export { connectListbox, createListbox, tryCreateListbox, createListboxController, toListboxEffect, toListboxEvent, type KeyboardInput, type ListboxControlledValues, type ListboxConnection, type ListboxConnectionOptions, type ListboxController, type ListboxControllerOptions, type ListboxEffect, type ListboxHighlightChangeDetails, type ListboxOptions, type ListboxTransitionDetails, type ListboxValueChangeDetails, } from './listbox.js';
|
|
3
|
-
export { createCheckboxGroup, tryCreateCheckboxGroup, type CheckboxGroupConnection, type CheckboxGroupOptions } from './checkbox-group.js';
|
|
4
|
-
export { createSelect, tryCreateSelect, type SelectConnection, type SelectEffect, type SelectOptions } from './select.js';
|
|
5
|
-
export { createPagination, tryCreatePagination, type PaginationConnection, type PaginationControlledValues, type PaginationOptions, } from './pagination.js';
|
|
6
|
-
export { createStepper, tryCreateStepper, type StepperConnection, type StepperOptions } from './stepper.js';
|
|
7
|
-
export { createRating, tryCreateRating, type RatingConnection, type RatingOptions } from './rating.js';
|
|
8
|
-
export { createPinInput, tryCreatePinInput, type PinInputConnection, type PinInputOptions } from './pin-input.js';
|
|
9
|
-
export { createTagsInput, tryCreateTagsInput, type TagsInputConnection, type TagsInputOptions } from './tags-input.js';
|
|
10
|
-
export { createTabs, tryCreateTabs, toTabsEffect, toTabsEvent, type TabsConnection, type TabsEffect, type TabsOptions, } from './tabs.js';
|
|
11
|
-
export { createRadioGroup, tryCreateRadioGroup, toRadioGroupEvent, type RadioGroupConnection, type RadioGroupEffect, type RadioGroupOptions, } from './radio-group.js';
|
|
12
|
-
export { createToolbar, tryCreateToolbar, toToolbarEvent, type ToolbarConnection, type ToolbarEffect, type ToolbarOptions, } from './toolbar.js';
|
|
13
|
-
export { createAccordion, tryCreateAccordion, toAccordionEvent, type AccordionConnection, type AccordionOptions, } from './accordion.js';
|
|
14
|
-
export { createDisclosure, tryCreateDisclosure, toDisclosureEvent, type DisclosureConnection, type DisclosureOptions, } from './disclosure.js';
|
|
15
|
-
export { createCheckbox, tryCreateCheckbox, type CheckboxConnection, type CheckboxOptions, } from './checkbox.js';
|
|
16
|
-
export { createSwitch, tryCreateSwitch, type SwitchConnection, type SwitchOptions } from './switch.js';
|
|
17
|
-
export { createToggleButton, tryCreateToggleButton, type ToggleButtonConnection, type ToggleButtonOptions } from './toggle-button.js';
|
|
18
|
-
export { createWindowSplitter, tryCreateWindowSplitter, type WindowSplitterConnection, type WindowSplitterOptions } from './window-splitter.js';
|
|
19
|
-
export { createSpinButton, tryCreateSpinButton, toSpinButtonEvent, type SpinButtonConnection, type SpinButtonOptions } from './spin-button.js';
|
|
20
|
-
export { createNumberField, tryCreateNumberField, type NumberFieldConnection, type NumberFieldOptions, type NumberFieldValueChangeDetails } from './number-field.js';
|
|
21
|
-
export { createQuantityField, tryCreateQuantityField, type QuantityFieldConnection, type QuantityFieldOptions, type QuantityFieldValueChangeDetails } from './quantity-field.js';
|
|
22
|
-
export { createDialog, tryCreateDialog, type DialogConnection, type DialogOptions } from './dialog.js';
|
|
23
|
-
export { createAlertDialog, tryCreateAlertDialog, type AlertDialogConnection, type AlertDialogOptions } from './alert-dialog.js';
|
|
24
|
-
export { createTooltip, tryCreateTooltip, type TooltipConnection, type TooltipOptions } from './tooltip.js';
|
|
25
|
-
export { createMultiThumbSlider, tryCreateMultiThumbSlider, type MultiThumbSliderConnection, type MultiThumbSliderOptions } from './multi-thumb-slider.js';
|
|
26
|
-
export { createMenu, tryCreateMenu, type MenuConnection, type MenuOptions } from './menu.js';
|
|
27
|
-
export { createMenubar, tryCreateMenubar, type MenubarConnection, type MenubarOptions } from './menubar.js';
|
|
28
|
-
export { createMenuButton, tryCreateMenuButton, type MenuButtonConnection, type MenuButtonOptions } from './menu-button.js';
|
|
29
|
-
export { createCarousel, tryCreateCarousel, type CarouselAutoplayOptions, type CarouselConnection, type CarouselControlledValues, type CarouselOptions, type CarouselScheduler, } from './carousel.js';
|
|
30
|
-
export { createFeed, tryCreateFeed, type FeedConnection, type FeedOptions, type FeedWindow } from './feed.js';
|
|
31
|
-
export { createGridControl, tryCreateGridControl, type GridConnection, type GridControlledValues, type GridOptions } from './grid.js';
|
|
32
|
-
export { connectCalendar, createCalendar, tryCreateCalendar, createCalendarController, toCalendarEffect, toCalendarEvent, type CalendarControlledValues, type CalendarConnection, type CalendarConnectionOptions, type CalendarController, type CalendarControllerOptions, type CalendarEffect, type CalendarHighlightChangeDetails, type CalendarOptions, type CalendarPageRequestDetails, type CalendarTransitionDetails, type CalendarValueChangeDetails, type KeyboardInput as CalendarKeyboardInput, } from './calendar.js';
|
|
33
|
-
export { connectCombobox, createCombobox, tryCreateCombobox, createComboboxController, toComboboxEffect, toComboboxEvent, toComboboxTextEvent, type ComboboxControlledValues, type ComboboxConnection, type ComboboxConnectionOptions, type ComboboxController, type ComboboxControllerOptions, type ComboboxEffect, type ComboboxHighlightChangeDetails, type ComboboxItem, type ComboboxOptions, type ComboboxInputStateChangeDetails, type ComboboxOpenChangeDetails, type ComboboxValueChangeDetails, type ComboboxTransitionDetails, type KeyboardInput as ComboboxKeyboardInput, } from './combobox.js';
|
|
34
|
-
export { connectSlider, createSlider, tryCreateSlider, createSliderController, toSliderEffect, toSliderEvent, type KeyboardInput as SliderKeyboardInput, type SliderControlledValues, type SliderConnection, type SliderConnectionOptions, type SliderController, type SliderControllerOptions, type SliderEffect, type SliderOptions, type SliderTransitionDetails, type SliderValueChangeDetails, } from './slider.js';
|
|
35
|
-
export { connectTreeView, createTreeView, tryCreateTreeView, createTreeViewController, toTreeViewEffect, toTreeViewEvent, type KeyboardInput as TreeViewKeyboardInput, type TreeViewControlledValues, type TreeViewConnection, type TreeViewConnectionOptions, type TreeViewController, type TreeViewControllerOptions, type TreeViewEffect, type TreeViewExpandedChangeDetails, type TreeViewHighlightChangeDetails, type TreeViewOptions, type TreeViewTransitionDetails, type TreeViewValueChangeDetails, } from './tree-view.js';
|
|
36
|
-
export { connectTreeGrid, createTreeGrid, tryCreateTreeGrid, createTreeGridController, toTreeGridEffect, toTreeGridEvent, type KeyboardInput as TreeGridKeyboardInput, type TreeGridControlledValues, type TreeGridConnection, type TreeGridConnectionOptions, type TreeGridController, type TreeGridControllerOptions, type TreeGridEditModeChangeDetails, type TreeGridEffect, type TreeGridExpandedChangeDetails, type TreeGridHighlightChangeDetails, type TreeGridOptions, type TreeGridTransitionDetails, type TreeGridValueChangeDetails, } from './tree-grid.js';
|
|
37
|
-
export { connectText, createText, tryCreateText, createTextController, toTextEvent, type TextControlledValues, type TextConnection, type TextConnectionOptions, type TextController, type TextControllerOptions, type TextInput as TerminalTextInput, type TextOptions, type TextTransitionDetails, type TextValueChangeDetails, } from './text.js';
|
|
38
|
-
export type { TerminalKeyboardInput } from './keyboard.js';
|
|
39
|
-
export { createDateField, tryCreateDateField, type DateFieldConnection, type DateFieldControlledValues, type DateFieldOptions } from './date-field.js';
|
|
40
|
-
export { createDateTimeField, tryCreateDateTimeField, type DateTimeFieldConnection, type DateTimeFieldControlledValues, type DateTimeFieldOptions } from './date-time-field.js';
|
|
41
|
-
export { createTimeField, tryCreateTimeField, type TimeFieldConnection, type TimeFieldControlledValues, type TimeFieldOptions } from './time-field.js';
|
|
42
|
-
export { createDatePicker, tryCreateDatePicker, toDatePickerEvent, type DatePickerConnection, type DatePickerControlledValues, type DatePickerOptions } from './date-picker.js';
|
|
43
|
-
export { createDateRangePicker, tryCreateDateRangePicker, type DateRangePickerConnection, type DateRangePickerControlledValues, type DateRangePickerOptions } from './date-range-picker.js';
|
|
44
|
-
export { createDateTimePicker, tryCreateDateTimePicker, type DateTimePickerConnection, type DateTimePickerControlledValues, type DateTimePickerOptions } from './date-time-picker.js';
|
|
45
|
-
export { createDateTimeRangePicker, tryCreateDateTimeRangePicker, type DateTimeRangePickerConnection, type DateTimeRangePickerControlledValues, type DateTimeRangePickerOptions } from './date-time-range-picker.js';
|
|
46
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,aAAa,EAAE,gBAAgB,EAC/B,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3I,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,M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EAAE,yBAAyB,EAAE,4BAA4B,EAAE,KAAK,6BAA6B,EAAE,KAAK,mCAAmC,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export { connectListbox, createListbox, tryCreateListbox, createListboxController, toListboxEffect, toListboxEvent, } from './listbox.js';
|
|
2
|
-
export { createCheckboxGroup, tryCreateCheckboxGroup } from './checkbox-group.js';
|
|
3
|
-
export { createSelect, tryCreateSelect } from './select.js';
|
|
4
|
-
export { createPagination, tryCreatePagination, } from './pagination.js';
|
|
5
|
-
export { createStepper, tryCreateStepper } from './stepper.js';
|
|
6
|
-
export { createRating, tryCreateRating } from './rating.js';
|
|
7
|
-
export { createPinInput, tryCreatePinInput } from './pin-input.js';
|
|
8
|
-
export { createTagsInput, tryCreateTagsInput } from './tags-input.js';
|
|
9
|
-
export { createTabs, tryCreateTabs, toTabsEffect, toTabsEvent, } from './tabs.js';
|
|
10
|
-
export { createRadioGroup, tryCreateRadioGroup, toRadioGroupEvent, } from './radio-group.js';
|
|
11
|
-
export { createToolbar, tryCreateToolbar, toToolbarEvent, } from './toolbar.js';
|
|
12
|
-
export { createAccordion, tryCreateAccordion, toAccordionEvent, } from './accordion.js';
|
|
13
|
-
export { createDisclosure, tryCreateDisclosure, toDisclosureEvent, } from './disclosure.js';
|
|
14
|
-
export { createCheckbox, tryCreateCheckbox, } from './checkbox.js';
|
|
15
|
-
export { createSwitch, tryCreateSwitch } from './switch.js';
|
|
16
|
-
export { createToggleButton, tryCreateToggleButton } from './toggle-button.js';
|
|
17
|
-
export { createWindowSplitter, tryCreateWindowSplitter } from './window-splitter.js';
|
|
18
|
-
export { createSpinButton, tryCreateSpinButton, toSpinButtonEvent } from './spin-button.js';
|
|
19
|
-
export { createNumberField, tryCreateNumberField } from './number-field.js';
|
|
20
|
-
export { createQuantityField, tryCreateQuantityField } from './quantity-field.js';
|
|
21
|
-
export { createDialog, tryCreateDialog } from './dialog.js';
|
|
22
|
-
export { createAlertDialog, tryCreateAlertDialog } from './alert-dialog.js';
|
|
23
|
-
export { createTooltip, tryCreateTooltip } from './tooltip.js';
|
|
24
|
-
export { createMultiThumbSlider, tryCreateMultiThumbSlider } from './multi-thumb-slider.js';
|
|
25
|
-
export { createMenu, tryCreateMenu } from './menu.js';
|
|
26
|
-
export { createMenubar, tryCreateMenubar } from './menubar.js';
|
|
27
|
-
export { createMenuButton, tryCreateMenuButton } from './menu-button.js';
|
|
28
|
-
export { createCarousel, tryCreateCarousel, } from './carousel.js';
|
|
29
|
-
export { createFeed, tryCreateFeed } from './feed.js';
|
|
30
|
-
export { createGridControl, tryCreateGridControl } from './grid.js';
|
|
31
|
-
export { connectCalendar, createCalendar, tryCreateCalendar, createCalendarController, toCalendarEffect, toCalendarEvent, } from './calendar.js';
|
|
32
|
-
export { connectCombobox, createCombobox, tryCreateCombobox, createComboboxController, toComboboxEffect, toComboboxEvent, toComboboxTextEvent, } from './combobox.js';
|
|
33
|
-
export { connectSlider, createSlider, tryCreateSlider, createSliderController, toSliderEffect, toSliderEvent, } from './slider.js';
|
|
34
|
-
export { connectTreeView, createTreeView, tryCreateTreeView, createTreeViewController, toTreeViewEffect, toTreeViewEvent, } from './tree-view.js';
|
|
35
|
-
export { connectTreeGrid, createTreeGrid, tryCreateTreeGrid, createTreeGridController, toTreeGridEffect, toTreeGridEvent, } from './tree-grid.js';
|
|
36
|
-
export { connectText, createText, tryCreateText, createTextController, toTextEvent, } from './text.js';
|
|
37
|
-
export { createDateField, tryCreateDateField } from './date-field.js';
|
|
38
|
-
export { createDateTimeField, tryCreateDateTimeField } from './date-time-field.js';
|
|
39
|
-
export { createTimeField, tryCreateTimeField } from './time-field.js';
|
|
40
|
-
export { createDatePicker, tryCreateDatePicker, toDatePickerEvent } from './date-picker.js';
|
|
41
|
-
export { createDateRangePicker, tryCreateDateRangePicker } from './date-range-picker.js';
|
|
42
|
-
export { createDateTimePicker, tryCreateDateTimePicker } from './date-time-picker.js';
|
|
43
|
-
export { createDateTimeRangePicker, tryCreateDateTimeRangePicker } from './date-time-range-picker.js';
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,aAAa,EAAE,gBAAgB,EAC/B,uBAAuB,EACvB,eAAe,EACf,cAAc,GAYf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAA2D,MAAM,qBAAqB,CAAC;AAC3I,OAAO,EAAE,YAAY,EAAE,eAAe,EAAgE,MAAM,aAAa,CAAC;AAC1H,OAAO,EACL,gBAAgB,EAAE,mBAAmB,GAItC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAA+C,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,eAAe,EAA6C,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAiD,MAAM,gBAAgB,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAmD,MAAM,iBAAiB,CAAC;AACvH,OAAO,EACL,UAAU,EAAE,aAAa,EACzB,YAAY,EACZ,WAAW,GAIZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAAE,mBAAmB,EACrC,iBAAiB,GAIlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EAAE,gBAAgB,EAC/B,cAAc,GAIf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EAAE,kBAAkB,EACnC,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAAE,mBAAmB,EACrC,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EAAE,iB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L,eAAe,EACf,cAAc,EAAE,iBAAiB,EACjC,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,GAepB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,YAAY,EAAE,eAAe,EAC7B,sBAAsB,EACtB,cAAc,EACd,aAAa,GAWd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,cAAc,EAAE,iBAAiB,EACjC,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAahB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,cAAc,EAAE,iBAAiB,EACjC,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAchB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,UAAU,EAAE,aAAa,EACzB,oBAAoB,EACpB,WAAW,GAUZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAmF,MAAM,iBAAiB,CAAC;AACvJ,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAA+F,MAAM,sBAAsB,CAAC;AAChL,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAmF,MAAM,iBAAiB,CAAC;AACvJ,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAsF,MAAM,kBAAkB,CAAC;AAChL,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAqG,MAAM,wBAAwB,CAAC;AAC5L,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAkG,MAAM,uBAAuB,CAAC;AACtL,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAiH,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Result } from '@sectile/core';
|
|
2
|
-
import type { InteractionStateInput } from '@sectile/core/interaction';
|
|
3
|
-
import type { MachineUpdate, RevisionSnapshot } from '@sectile/core/revision';
|
|
4
|
-
import type { TerminalKeyboardInput } from '../keyboard.js';
|
|
5
|
-
export interface TerminalCheckedControl<State, Event, Value> {
|
|
6
|
-
getSnapshot(): RevisionSnapshot<State>;
|
|
7
|
-
syncControlledValue(value: Value): Result<RevisionSnapshot<State>>;
|
|
8
|
-
handleEvent(event: Event): boolean;
|
|
9
|
-
handleKeyboardInput(input: TerminalKeyboardInput): boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface Options<State, Event, Command, Value> {
|
|
12
|
-
readonly controlled: boolean;
|
|
13
|
-
readonly initial: Result<State>;
|
|
14
|
-
readonly toggleEvent: Event;
|
|
15
|
-
readonly reducer: (state: State, event: Event) => Result<MachineUpdate<State, Command>>;
|
|
16
|
-
readonly create: (value: Value) => Result<State>;
|
|
17
|
-
readonly read: (state: State) => Value;
|
|
18
|
-
readonly onChange: ((value: Value) => void) | undefined;
|
|
19
|
-
readonly onUpdate: (() => void) | undefined;
|
|
20
|
-
readonly interaction?: InteractionStateInput;
|
|
21
|
-
}
|
|
22
|
-
export declare function createTerminalCheckedControl<State, Event, Command, Value>(options: Options<State, Event, Command, Value>): Result<TerminalCheckedControl<State, Event, Value>>;
|
|
23
|
-
//# sourceMappingURL=checked-control.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checked-control.d.ts","sourceRoot":"","sources":["../../src/internal/checked-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAAC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAAC,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAAC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEhQ,MAAM,WAAW,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK;IAAI,WAAW,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAAC,mBAAmB,CAAC,KAAK,EAAE,K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antic-controller.js';
|
|
2
|
-
export function createTerminalCheckedControl(options) {
|
|
3
|
-
const runtime = createSemanticController({ initial: options.initial, reducer: options.reducer, reconcile: (previous, proposed) => options.controlled ? options.create(options.read(previous)) : options.create(options.read(proposed)), notify: (previous, proposed) => { if (options.read(previous) !== options.read(proposed))
|
|
4
|
-
options.onChange?.(options.read(proposed)); }, toEffect: (command) => command, interaction: options.interaction });
|
|
5
|
-
if (!runtime.ok)
|
|
6
|
-
return runtime;
|
|
7
|
-
return { ok: true, value: new Impl(options, runtime.value) };
|
|
8
|
-
}
|
|
9
|
-
class Impl {
|
|
10
|
-
#options;
|
|
11
|
-
#runtime;
|
|
12
|
-
constructor(options, runtime) { this.#options = options; this.#runtime = runtime; }
|
|
13
|
-
getSnapshot() { return this.#runtime.getSnapshot(); }
|
|
14
|
-
syncControlledValue(value) { if (!this.#options.controlled)
|
|
15
|
-
return { ok: false, error: { class: 'construction', code: 'uncontrolled-controller-sync', message: 'An uncontrolled checked control cannot be synchronized externally.' } }; const result = this.#runtime.replace(this.#options.create(value)); if (result.ok)
|
|
16
|
-
this.#options.onUpdate?.(); return result; }
|
|
17
|
-
handleEvent(event) { const result = this.#runtime.handle(event); if (result.ok)
|
|
18
|
-
this.#options.onUpdate?.(); return result.ok; }
|
|
19
|
-
handleKeyboardInput(input) { if (input.key !== 'enter' && input.key !== 'space')
|
|
20
|
-
return false; return this.handleEvent(this.#options.toggleEvent); }
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=checked-control.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checked-control.js","sourceRoot":"","sources":["../../src/internal/checked-control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA2B,MAAM,0BAA0B,CAAC;AAG7F,MAAM,UAAU,4BAA4B,CAA+B,OAA8C;IACvH,MAAM,OAAO,GAAG,wBAAwB,CAAiC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,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,EAAE,cAAc,EAAE,IAAI,EAAE,8BAA8B,EAAE,OAAO,EAAE,oEAAoE,EAAE,EAAE,CAAC,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;IAC/Y,WAAW,CAAC,KAAY,IAAa,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/I,mBAAmB,CAAC,KAA4B,IAAa,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC5L"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Result } from '@sectile/core';
|
|
2
|
-
import { type EventReducer, type RevisionResult, type RevisionSnapshot } from '@sectile/core/revision';
|
|
3
|
-
export declare function applyControllerEvent<State, Event, Command, Effect>(current: RevisionSnapshot<State>, expectedRevision: number, event: Event, reducer: EventReducer<State, Event, Command>, reconcile: (previous: State, proposed: State) => Result<State>, notify: (previous: State, proposed: State) => void, toEffect: (command: Command) => Effect): RevisionResult<State, Effect>;
|
|
4
|
-
export declare function synchronizeControllerState<State>(current: RevisionSnapshot<State>, state: Result<State>): Result<RevisionSnapshot<State>>;
|
|
5
|
-
export declare function sameControllerState<State>(left: State, right: State): boolean;
|
|
6
|
-
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/internal/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAChE,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAChC,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAC5C,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,EAC9D,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,KAAK,IAAI,EAClD,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,GACrC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAc/B;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAC9C,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAChC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GACnB,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAcjC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAE7E"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { applyRevisionedEvent, createRevisionSnapshot, mapRevisionCommands, rejectRevisionInput, } from '@sectile/core/revision';
|
|
2
|
-
export function applyControllerEvent(current, expectedRevision, event, reducer, reconcile, notify, toEffect) {
|
|
3
|
-
const semantic = applyRevisionedEvent(current, expectedRevision, event, reducer);
|
|
4
|
-
if (!semantic.ok)
|
|
5
|
-
return semantic;
|
|
6
|
-
const committed = reconcile(current.state, semantic.snapshot.state);
|
|
7
|
-
if (!committed.ok)
|
|
8
|
-
return rejectRevisionInput(current, committed.error);
|
|
9
|
-
const snapshot = Object.freeze({
|
|
10
|
-
revision: semantic.snapshot.revision,
|
|
11
|
-
state: committed.value,
|
|
12
|
-
});
|
|
13
|
-
notify(current.state, semantic.snapshot.state);
|
|
14
|
-
return mapRevisionCommands(Object.freeze({ ok: true, snapshot, commands: semantic.commands }), toEffect);
|
|
15
|
-
}
|
|
16
|
-
export function synchronizeControllerState(current, state) {
|
|
17
|
-
if (!state.ok)
|
|
18
|
-
return state;
|
|
19
|
-
if (current.revision === Number.MAX_SAFE_INTEGER) {
|
|
20
|
-
return {
|
|
21
|
-
ok: false,
|
|
22
|
-
error: {
|
|
23
|
-
class: 'resource-rejection',
|
|
24
|
-
code: 'revision-ceiling-reached',
|
|
25
|
-
message: 'Controller revision cannot advance beyond the safe-integer ceiling.',
|
|
26
|
-
details: { revision: current.revision },
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return createRevisionSnapshot(state.value, current.revision + 1);
|
|
31
|
-
}
|
|
32
|
-
export function sameControllerState(left, right) {
|
|
33
|
-
return JSON.stringify(left) === JSON.stringify(right);
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/internal/controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GAIpB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,oBAAoB,CAClC,OAAgC,EAChC,gBAAwB,EACxB,KAAY,EACZ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ACF,CAAC;IACJ,CAAC;IACD,OAAO,sBAAsB,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAQ,IAAW,EAAE,KAAY;IAClE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Result, StableID } from '@sectile/core';
|
|
2
|
-
export interface IdentityDomain<ID extends StableID> {
|
|
3
|
-
contains(id: ID): boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare function createDisabledItems<ID extends StableID>(domain: IdentityDomain<ID>, items?: readonly ID[]): Result<ReadonlySet<ID>>;
|
|
6
|
-
//# sourceMappingURL=disabled-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disabled-items.d.ts","sourceRoot":"","sources":["../../src/internal/disabled-items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,cAAc,CAAC,EAAE,SAAS,QAAQ;IACjD,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,QAAQ,EACrD,MAAM,EAAE,cAAc,CAAC,EAAE,CAAC,EAC1B,KAAK,GAAE,SAAS,EAAE,EAAO,GACxB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAazB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function createDisabledItems(domain, items = []) {
|
|
2
|
-
const disabled = new Set(items);
|
|
3
|
-
for (const id of disabled) {
|
|
4
|
-
if (!domain.contains(id)) {
|
|
5
|
-
return { ok: false, error: {
|
|
6
|
-
class: 'construction',
|
|
7
|
-
code: 'disabled-item-outside-domain',
|
|
8
|
-
message: 'Every disabled item must exist in the component domain.',
|
|
9
|
-
details: { id },
|
|
10
|
-
} };
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return { ok: true, value: disabled };
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=disabled-items.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disabled-items.js","sourceRoot":"","sources":["../../src/internal/disabled-items.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,mBAAmB,CACjC,MAA0B,EAC1B,KAAK,GAAkB,EAAE;IAEzB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;oBACzB,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,8BAA8B;oBACpC,OAAO,EAAE,yDAAyD;oBAClE,OAAO,EAAE,EAAE,EAAE,EAAE;iBAChB,EAAE,CAAC;QACN,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Result } from '@sectile/core';
|
|
2
|
-
interface SnapshotConnection {
|
|
3
|
-
getSnapshot(): {
|
|
4
|
-
readonly state: unknown;
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
interface FacadeOptions {
|
|
8
|
-
readonly onUpdate?: () => void;
|
|
9
|
-
}
|
|
10
|
-
type SnapshotOf<Connection extends SnapshotConnection> = ReturnType<Connection['getSnapshot']>;
|
|
11
|
-
type StateOf<Connection extends SnapshotConnection> = SnapshotOf<Connection>['state'];
|
|
12
|
-
type SendInput<Connection> = Connection extends {
|
|
13
|
-
handleEvent(input: infer Input): boolean;
|
|
14
|
-
} ? Input : Connection extends {
|
|
15
|
-
handleKeyboardInput(input: infer Input): boolean;
|
|
16
|
-
} ? Input : Connection extends {
|
|
17
|
-
handleKeyboardEvent(input: infer Input): boolean;
|
|
18
|
-
} ? Input : Connection extends {
|
|
19
|
-
handleBeforeInput(input: infer Input): boolean;
|
|
20
|
-
} ? Input : never;
|
|
21
|
-
type UpdateInput<Connection> = Connection extends {
|
|
22
|
-
syncControlledValues(input: infer Input): unknown;
|
|
23
|
-
} ? Input : Connection extends {
|
|
24
|
-
syncControlledValue(input: infer Input): unknown;
|
|
25
|
-
} ? Input : Connection extends {
|
|
26
|
-
syncWindow(input: infer Input): unknown;
|
|
27
|
-
} ? Input : never;
|
|
28
|
-
type UpdateResult<Connection> = Connection extends {
|
|
29
|
-
syncControlledValues(input: infer _Input): infer Output;
|
|
30
|
-
} ? Output : Connection extends {
|
|
31
|
-
syncControlledValue(input: infer _Input): infer Output;
|
|
32
|
-
} ? Output : Connection extends {
|
|
33
|
-
syncWindow(input: infer _Input): infer Output;
|
|
34
|
-
} ? Output : never;
|
|
35
|
-
export type FacadeConnection<Connection extends SnapshotConnection> = Connection & {
|
|
36
|
-
readonly state: StateOf<Connection>;
|
|
37
|
-
send(input: SendInput<Connection>): boolean;
|
|
38
|
-
update(input: UpdateInput<Connection>): UpdateResult<Connection>;
|
|
39
|
-
subscribe(listener: (snapshot: SnapshotOf<Connection>) => void): () => void;
|
|
40
|
-
destroy(): void;
|
|
41
|
-
};
|
|
42
|
-
export declare function createFacadeConnection<Options extends FacadeOptions, Connection extends SnapshotConnection>(options: Options, construct: (options: Options) => Result<Connection>): Result<FacadeConnection<Connection>>;
|
|
43
|
-
export {};
|
|
44
|
-
//# sourceMappingURL=facade.d.ts.map
|