@ember-lattice/state 1.0.0 → 1.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/CHANGELOG.md +30 -0
- package/declarations/persist.d.ts +13 -1
- package/declarations/persist.d.ts.map +1 -1
- package/dist/index.js +38 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @ember-lattice/state
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f931851: Configure a grid in its template (ADR 0028). `LatticeGrid` takes the rows as `@data` and makes the
|
|
8
|
+
table from the declarations in its block: `g.Column`, `g.ColumnGroup`, `g.SelectionColumn` and
|
|
9
|
+
`g.RowNumberColumn`. A column takes `<:cell>`, `<:header>`, `<:headerEnd>` and `<:editor>` blocks.
|
|
10
|
+
The grid also takes `@features`, `@initialState`, `@state`, `@onStateChange` and `@tableOptions`.
|
|
11
|
+
|
|
12
|
+
- `<:toolbar>`, `<:statusBar>` and `<:sideBar>` get the table and the grid root.
|
|
13
|
+
- `@rowModel` takes a function that makes the model from the table of the grid:
|
|
14
|
+
`ServerRowModel.forGrid({ source })`. The pivot columns of the server row model go after the
|
|
15
|
+
declared columns.
|
|
16
|
+
- `persistGridState` takes the `@stateHost` handle and waits for the table of the grid.
|
|
17
|
+
- The chrome blocks and the `@stateHost` handle give the table as `GridEngineTable`, the engine
|
|
18
|
+
table type. The components of `@ember-lattice/ui` and `persistGridState` take it.
|
|
19
|
+
- `GridRowModel<T>` has the row type, and `forGrid` of each row model keeps the row type of its
|
|
20
|
+
source. The grid gets its row type from `@rowModel`, as it does from `@data`.
|
|
21
|
+
- The grid disconnects a row model that it made from a `@rowModel` function: when the grid goes,
|
|
22
|
+
or when a new function replaces the model.
|
|
23
|
+
- `g.SelectionColumn` and `g.RowNumberColumn` take `@pinned` and `@hidden`.
|
|
24
|
+
- The editing args (`@editor`, `@editable`, `@schema`, `@parse`, `@options`) and the filter arg
|
|
25
|
+
(`@filter`) are args of `g.Column`.
|
|
26
|
+
|
|
27
|
+
`@table` and `constructTable` stay. Nothing is removed or deprecated.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- @ember-lattice/core@1.1.0
|
|
32
|
+
|
|
3
33
|
## 1.0.0
|
|
4
34
|
|
|
5
35
|
### Major Changes
|
|
@@ -34,11 +34,23 @@ export interface Persistence {
|
|
|
34
34
|
/** Stops all saves and subscriptions. Call it when the grid goes away. */
|
|
35
35
|
stop(): void;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* A state host that gets its table later: the `@stateHost` handle of a grid in the template
|
|
39
|
+
* form (ADR 0028). The grid makes its table in its first render, and gives it to the handle.
|
|
40
|
+
*/
|
|
41
|
+
export interface TableHost extends GridStateHost {
|
|
42
|
+
/** Calls `listener` with the table when the grid has it. Returns a function that stops it. */
|
|
43
|
+
onTable(listener: (table: TableLike) => void): () => void;
|
|
44
|
+
}
|
|
37
45
|
/**
|
|
38
46
|
* Loads the state of `table` from the first store that has one, and saves each change to all
|
|
39
47
|
* stores after a debounce. Call it before the grid renders: a sync store (URL, localStorage)
|
|
40
48
|
* then applies before the first read of the table, and an async store applies when it
|
|
41
49
|
* resolves. No save runs during a render, because each save waits for a timer.
|
|
50
|
+
*
|
|
51
|
+
* In the template form, give the `@stateHost` handle in place of the table. The handle gets the
|
|
52
|
+
* table when the grid makes it, after its first render and before the first paint; a sync store
|
|
53
|
+
* applies then. The handle is also the host of the scroll and the active cell.
|
|
42
54
|
*/
|
|
43
|
-
export declare function persistGridState(
|
|
55
|
+
export declare function persistGridState(target: TableLike | TableHost, options: PersistOptions): Persistence;
|
|
44
56
|
//# sourceMappingURL=persist.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources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B,WAAW,CAqBb"}
|
package/dist/index.js
CHANGED
|
@@ -355,13 +355,50 @@ function withoutDefaults(state, defaults) {
|
|
|
355
355
|
const record = defaults;
|
|
356
356
|
return Object.fromEntries(Object.entries(state).filter(([key, value]) => key === 'v' || !(key in record) || !sameJson(value, record[key])));
|
|
357
357
|
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* A state host that gets its table later: the `@stateHost` handle of a grid in the template
|
|
361
|
+
* form (ADR 0028). The grid makes its table in its first render, and gives it to the handle.
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
const isTableHost = target => is.function(target.onTable);
|
|
365
|
+
|
|
358
366
|
/**
|
|
359
367
|
* Loads the state of `table` from the first store that has one, and saves each change to all
|
|
360
368
|
* stores after a debounce. Call it before the grid renders: a sync store (URL, localStorage)
|
|
361
369
|
* then applies before the first read of the table, and an async store applies when it
|
|
362
370
|
* resolves. No save runs during a render, because each save waits for a timer.
|
|
371
|
+
*
|
|
372
|
+
* In the template form, give the `@stateHost` handle in place of the table. The handle gets the
|
|
373
|
+
* table when the grid makes it, after its first render and before the first paint; a sync store
|
|
374
|
+
* applies then. The handle is also the host of the scroll and the active cell.
|
|
363
375
|
*/
|
|
364
|
-
function persistGridState(
|
|
376
|
+
function persistGridState(target, options) {
|
|
377
|
+
if (!isTableHost(target)) return persistTable(target, options);
|
|
378
|
+
let inner;
|
|
379
|
+
let stopped = false;
|
|
380
|
+
let done = () => {};
|
|
381
|
+
const ready = new Promise(resolve => done = resolve);
|
|
382
|
+
const stopWaiting = target.onTable(table => {
|
|
383
|
+
if (stopped || inner) return;
|
|
384
|
+
inner = persistTable(table, {
|
|
385
|
+
...options,
|
|
386
|
+
host: options.host ?? target
|
|
387
|
+
});
|
|
388
|
+
void inner.ready.then(done);
|
|
389
|
+
});
|
|
390
|
+
return {
|
|
391
|
+
ready,
|
|
392
|
+
flush: () => inner?.flush() ?? Promise.resolve(),
|
|
393
|
+
stop() {
|
|
394
|
+
stopped = true;
|
|
395
|
+
stopWaiting();
|
|
396
|
+
inner?.stop();
|
|
397
|
+
done();
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function persistTable(table, options) {
|
|
365
402
|
const {
|
|
366
403
|
key,
|
|
367
404
|
stores,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/grid-state.ts","../src/migrate.ts","../src/internal.ts","../src/stores.ts","../src/persist.ts"],"sourcesContent":["import is from '@sindresorhus/is'\nimport type {\n ColumnFiltersState,\n ColumnPinningState,\n ColumnSizingState,\n ColumnVisibilityState,\n ExpandedState,\n GroupingState,\n PaginationState,\n RowSelectionState,\n SortingState,\n} from '@ember-lattice/core'\n\n/** The schema version of a `GridState`. Add a migration when you change the shape. */\nexport const SCHEMA_VERSION = 1\n\nexport interface ScrollOffset {\n top: number\n left: number\n}\n\nexport interface CellRef {\n rowId: string\n columnId: string\n}\n\n/** The state keys that the Grid owns, not the table. */\nexport interface HostState {\n scroll?: ScrollOffset\n activeCell?: CellRef | null\n}\n\n/**\n * The Grid implements this to persist its own keys (scroll offset and active cell).\n * `subscribe` is optional: without it, a change to these keys saves with the next table change.\n */\nexport interface GridStateHost {\n read(): HostState\n apply(state: HostState): void\n subscribe?(listener: () => void): () => void\n}\n\n/** The persistable grid state as JSON. Each key is optional: a missing key keeps its default. */\nexport interface GridState extends HostState {\n v: number\n columnOrder?: string[]\n columnPinning?: ColumnPinningState\n columnSizing?: ColumnSizingState\n columnVisibility?: ColumnVisibilityState\n sorting?: SortingState\n columnFilters?: ColumnFiltersState\n globalFilter?: unknown\n grouping?: GroupingState\n expanded?: ExpandedState\n rowSelection?: RowSelectionState\n pagination?: PaginationState\n}\n\n/** The table slices in a `GridState`. The table has a slice only when its feature is registered. */\nexport const TABLE_KEYS = [\n 'columnOrder',\n 'columnPinning',\n 'columnSizing',\n 'columnVisibility',\n 'sorting',\n 'columnFilters',\n 'globalFilter',\n 'grouping',\n 'expanded',\n 'rowSelection',\n 'pagination',\n] as const\n\nexport const HOST_KEYS = ['scroll', 'activeCell'] as const\n\n/**\n * The part of a Lattice table that this package uses. Any table from `constructTable` has it.\n * The feature setters (`setSorting` and the others) are found by name at run time.\n */\nexport interface TableLike {\n readonly store: {\n readonly state: object\n subscribe(listener: () => void): { unsubscribe: () => void }\n }\n readonly atoms: object\n}\n\n// `columnOrder` → `setColumnOrder`: each feature setter goes through the slice owner.\nconst setterOf = (key: string) => `set${key[0]!.toUpperCase()}${key.slice(1)}`\n\n/** Reads the persistable state of `table` (and of `host`, when given) as JSON. */\nexport function gridState(table: TableLike, host?: GridStateHost): GridState {\n const slices = table.store.state as Record<string, unknown>\n const state: Record<string, unknown> = { v: SCHEMA_VERSION }\n for (const key of TABLE_KEYS) {\n if (key in table.atoms && slices[key] !== undefined) state[key] = slices[key]\n }\n return { ...(state as unknown as GridState), ...host?.read() }\n}\n\n/** Sets each key of `state` on `table` (and on `host`). A key the table has no feature for stays unused. */\nexport function applyGridState(table: TableLike, state: GridState, host?: GridStateHost): void {\n const api = table as unknown as Record<string, unknown>\n for (const key of TABLE_KEYS) {\n if (!(key in state) || !(key in table.atoms)) continue\n const set = api[setterOf(key)]\n if (is.function(set)) set.call(table, state[key])\n }\n const own: HostState = {}\n for (const key of HOST_KEYS) if (key in state) Object.assign(own, { [key]: state[key] })\n if (host && Object.keys(own).length > 0) host.apply(own)\n}\n","import is from '@sindresorhus/is'\nimport { SCHEMA_VERSION } from './grid-state.ts'\nimport type { GridState } from './grid-state.ts'\n\ntype Raw = Record<string, unknown>\n\n/** `migrations[v]` upgrades a state from version `v` to version `v + 1`. */\nexport type Migrations = Record<number, (state: Raw) => Raw>\n\n/** The migrations of this release. Version 1 is the first schema, so there is none yet. */\nexport const migrations: Migrations = {}\n\nexport interface MigrateOptions {\n migrations?: Migrations\n version?: number\n /** Gets each dev warning. The default is `console.warn`. */\n warn?: (message: string) => void\n}\n\nconst strings = (x: unknown) => is.array(x) && x.every(is.string)\nconst record = (x: unknown, value: (v: unknown) => boolean) =>\n is.plainObject(x) && Object.values(x).every(value)\nconst finite = (x: unknown): x is number => is.number(x) && Number.isFinite(x)\nconst intAtLeast = (min: number) => (x: unknown) => is.integer(x) && x >= min\nconst optional = (check: (x: unknown) => boolean) => (x: unknown) => x === undefined || check(x)\nconst json = (x: unknown): boolean =>\n is.string(x) ||\n is.boolean(x) ||\n is.null(x) ||\n finite(x) ||\n (is.array(x) && x.every(json)) ||\n record(x, json)\n\n// One check for each known key. A key that is not here is unknown, also `__proto__`.\nconst VALID: Record<string, (x: unknown) => boolean> = {\n columnOrder: strings,\n columnPinning: x =>\n is.plainObject(x) &&\n Object.keys(x).every(k => k === 'start' || k === 'end') &&\n optional(strings)(x['start']) &&\n optional(strings)(x['end']),\n columnSizing: x => record(x, finite),\n columnVisibility: x => record(x, is.boolean),\n sorting: x =>\n is.array(x) && x.every(s => is.plainObject(s) && is.string(s['id']) && is.boolean(s['desc'])),\n columnFilters: x =>\n is.array(x) &&\n x.every(\n f => is.plainObject(f) && is.string(f['id']) && f['value'] !== undefined && json(f['value']),\n ),\n globalFilter: json,\n grouping: strings,\n expanded: x => x === true || record(x, is.boolean),\n rowSelection: x => record(x, v => v === true),\n pagination: x =>\n is.plainObject(x) && intAtLeast(0)(x['pageIndex']) && intAtLeast(1)(x['pageSize']),\n scroll: x => is.plainObject(x) && finite(x['top']) && finite(x['left']),\n activeCell: x =>\n x === null || (is.plainObject(x) && is.string(x['rowId']) && is.string(x['columnId'])),\n}\n\n/**\n * Upgrades `input` to the current schema, one version at a time, then checks each key.\n * An unknown key or a key with a bad value drops only that key, with a dev warning. A value\n * that is not a state at all gives `undefined`. It never throws: the input can come from a URL.\n */\nexport function migrate(input: unknown, options: MigrateOptions = {}): GridState | undefined {\n const {\n migrations: steps = migrations,\n version = SCHEMA_VERSION,\n warn = (message: string) => console.warn(message),\n } = options\n if (!is.plainObject(input) || !is.integer(input['v']) || input['v'] < 1) return undefined\n let state: Raw = input\n try {\n for (let v = input['v']; v < version; v++) {\n const step = steps[v]\n if (step) state = step(state)\n else warn(`Lattice state: no migration from version ${v}; the keys are checked as they are.`)\n }\n } catch (error) {\n warn(`Lattice state: a migration failed, so the state is not used. ${String(error)}`)\n return undefined\n }\n const out: Raw = { v: version }\n for (const [key, value] of Object.entries(state)) {\n if (key === 'v') continue\n const check = VALID[key]\n if (!check) warn(`Lattice state: unknown key \"${key}\" is dropped.`)\n else if (!check(value)) warn(`Lattice state: key \"${key}\" has a bad value and is dropped.`)\n else out[key] = value\n }\n return out as unknown as GridState\n}\n","import is from '@sindresorhus/is'\n\n// JSON with sorted object keys, so the same state always gives the same string.\nexport function canonical(value: unknown): unknown {\n if (is.array(value)) return value.map(canonical)\n if (!is.plainObject(value)) return value\n return Object.fromEntries(\n Object.keys(value)\n .sort()\n .map(key => [key, canonical(value[key])]),\n )\n}\n\nexport const sameJson = (a: unknown, b: unknown) =>\n JSON.stringify(canonical(a)) === JSON.stringify(canonical(b))\n\nexport const consoleWarn = (message: string) => console.warn(message)\n","import is from '@sindresorhus/is'\nimport { canonical, consoleWarn } from './internal.ts'\nimport { migrate } from './migrate.ts'\nimport type { GridState } from './grid-state.ts'\n\n/** One place that keeps grid state. `load` can be sync (URL, localStorage) or async (server). */\nexport interface StateStore {\n load(key: string): GridState | undefined | Promise<GridState | undefined>\n save(key: string, state: GridState): void | Promise<void>\n /** Calls `listener` when the state changes outside the grid (the back button, for example). */\n subscribe?(key: string, listener: (state: GridState | undefined) => void): () => void\n}\n\ninterface WarnOption {\n /** Gets each dev warning. The default is `console.warn`. */\n warn?: (message: string) => void\n}\n\n// One-letter names for the top-level keys in the URL. Never change a name: old links use it.\nconst SHORT: Record<string, string> = {\n columnOrder: 'o',\n columnPinning: 'p',\n columnSizing: 'w',\n columnVisibility: 'h',\n sorting: 's',\n columnFilters: 'f',\n globalFilter: 'q',\n grouping: 'g',\n expanded: 'e',\n rowSelection: 'r',\n pagination: 'n',\n scroll: 'y',\n activeCell: 'a',\n}\nconst LONG = Object.fromEntries(Object.entries(SHORT).map(([long, short]) => [short, long]))\nconst rename = (state: object, names: Record<string, string>) =>\n Object.fromEntries(Object.entries(state).map(([key, value]) => [names[key] ?? key, value]))\n\n/**\n * A short and stable string for `state`: JSON with one-letter top-level keys and sorted keys,\n * as base64url with no padding.\n */\nexport function encodeState(state: GridState): string {\n const bytes = new TextEncoder().encode(JSON.stringify(canonical(rename(state, SHORT))))\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '')\n}\n\n/** The state in `text`, or `undefined` when the text is not a valid state. It never throws. */\nexport function decodeState(text: string, options: WarnOption = {}): GridState | undefined {\n try {\n const binary = atob(text.replace(/-/g, '+').replace(/_/g, '/'))\n const bytes = Uint8Array.from(binary, char => char.charCodeAt(0))\n const json = new TextDecoder('utf-8', { fatal: true }).decode(bytes)\n const parsed: unknown = JSON.parse(json)\n return migrate(is.plainObject(parsed) ? rename(parsed, LONG) : parsed, options)\n } catch {\n return undefined\n }\n}\n\n/** True when `state` has no key other than the version. */\nexport const isEmptyState = (state: GridState) => Object.keys(state).every(key => key === 'v')\n\n/** The part of the Ember router service that `urlStore` uses. */\nexport interface RouterLike {\n currentRoute?: { queryParams: Record<string, unknown> } | null\n replaceWith(options: { queryParams: Record<string, string | null> }): unknown\n on?(event: 'routeDidChange', listener: () => void): unknown\n off?(event: 'routeDidChange', listener: () => void): unknown\n}\n\n/** The part of `window` that `urlStore` uses when there is no router. */\nexport interface WindowLike {\n location: { href: string }\n history: { state: unknown; replaceState(state: unknown, unused: string, url: string): void }\n addEventListener(type: 'popstate', listener: () => void): void\n removeEventListener(type: 'popstate', listener: () => void): void\n}\n\nexport interface UrlStoreOptions extends WarnOption {\n /**\n * The Ember router service. The route must declare the query param (the `key`), because\n * Ember drops a query param that no controller declares.\n */\n router?: RouterLike\n /** The window to use when there is no router. The default is the global `window`. */\n window?: WindowLike\n}\n\n/**\n * Keeps the state in one query param, named by the store key. The param holds the encoded\n * state (see `encodeState`); a state with no key removes the param.\n */\nexport function urlStore(options: UrlStoreOptions = {}): StateStore {\n const { router, warn = consoleWarn } = options\n const win = () => options.window ?? (globalThis as unknown as { window: WindowLike }).window\n const read = (key: string): string | undefined => {\n const value = router\n ? router.currentRoute?.queryParams[key]\n : new URL(win().location.href).searchParams.get(key)\n return is.string(value) && value !== '' ? value : undefined\n }\n const load = (key: string) => {\n const text = read(key)\n return text === undefined ? undefined : decodeState(text, { warn })\n }\n return {\n load,\n save(key, state) {\n const text = isEmptyState(state) ? null : encodeState(state)\n if ((read(key) ?? null) === text) return\n if (router) {\n router.replaceWith({ queryParams: { [key]: text } })\n return\n }\n const url = new URL(win().location.href)\n if (text === null) url.searchParams.delete(key)\n else url.searchParams.set(key, text)\n win().history.replaceState(win().history.state, '', url.href)\n },\n subscribe(key, listener) {\n let last = read(key)\n const changed = () => {\n const text = read(key)\n if (text === last) return\n last = text\n listener(load(key))\n }\n if (router) {\n router.on?.('routeDidChange', changed)\n return () => void router.off?.('routeDidChange', changed)\n }\n win().addEventListener('popstate', changed)\n return () => win().removeEventListener('popstate', changed)\n },\n }\n}\n\n/** The part of `Storage` that `localStore` uses. */\nexport type StorageLike = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>\n\nexport interface LocalStoreOptions extends WarnOption {\n /** The default is `globalThis.localStorage`. A function is called on each use. */\n storage?: StorageLike | (() => StorageLike)\n /** The prefix of each storage key. The default is `lattice:`. */\n prefix?: string\n}\n\n/**\n * Keeps the state in localStorage. It never throws: when storage is not there (private mode),\n * is full (quota) or holds bad JSON, `load` gives `undefined` and `save` does nothing.\n */\nexport function localStore(options: LocalStoreOptions = {}): StateStore {\n const { prefix = 'lattice:', warn = consoleWarn } = options\n // Even a read of `localStorage` can throw (a sandboxed frame), so it is inside the try.\n const storage = (): StorageLike =>\n is.function(options.storage) ? options.storage() : (options.storage ?? globalThis.localStorage)\n return {\n load(key) {\n try {\n const text = storage().getItem(prefix + key)\n return text === null ? undefined : migrate(JSON.parse(text), { warn })\n } catch {\n return undefined\n }\n },\n save(key, state) {\n try {\n if (isEmptyState(state)) storage().removeItem(prefix + key)\n else storage().setItem(prefix + key, JSON.stringify(state))\n } catch (error) {\n warn(`Lattice state: localStorage did not save \"${key}\". ${String(error)}`)\n }\n },\n }\n}\n\nexport type ViewScope = 'personal' | 'shared'\n\n/** A saved view. A shared view is for everyone; a locked view changes only by an explicit call. */\nexport interface SavedView {\n id: string\n /** The grid that the view is for: the store key. */\n key: string\n name: string\n scope: ViewScope\n locked?: boolean\n state: GridState\n}\n\n/** The async views API of a data source. The server decides who can see a personal view. */\nexport interface ViewSource {\n listViews(): Promise<SavedView[]>\n saveView(view: Omit<SavedView, 'id'> & { id?: string }): Promise<SavedView>\n deleteView(id: string): Promise<void>\n}\n\nexport interface ViewInput {\n name: string\n scope: ViewScope\n locked?: boolean\n state: GridState\n}\n\nexport interface ServerStore extends StateStore {\n load(key: string): Promise<GridState | undefined>\n save(key: string, state: GridState): Promise<void>\n /** The personal and the shared view with the current view name. */\n loadLayers(key: string): Promise<{ personal?: GridState; shared?: GridState }>\n listViews(key: string): Promise<SavedView[]>\n /** Saves a view. A `shared` scope is \"save for everyone\": only this call writes one. */\n saveView(key: string, view: ViewInput): Promise<SavedView>\n deleteView(id: string): Promise<void>\n}\n\nexport interface ServerStoreOptions extends WarnOption {\n /** The name of the view that the grid shows and that `save` writes. The default is `Default`. */\n view?: string\n}\n\n/**\n * Saved views through a data source. `save` (the automatic save) writes only the personal\n * view, and never over a locked view. `load` gives the personal view, then the shared view.\n */\nexport function serverStore(source: ViewSource, options: ServerStoreOptions = {}): ServerStore {\n const { view: name = 'Default', warn = consoleWarn } = options\n const listViews = async (key: string) =>\n (await source.listViews())\n .filter(view => view.key === key)\n .map(view => ({ ...view, state: migrate(view.state, { warn }) ?? { v: view.state.v } }))\n const find = (views: SavedView[], viewName: string, scope: ViewScope) =>\n views.find(view => view.name === viewName && view.scope === scope)\n\n const store: ServerStore = {\n listViews,\n deleteView: id => source.deleteView(id),\n async loadLayers(key) {\n const views = await listViews(key)\n return {\n personal: find(views, name, 'personal')?.state,\n shared: find(views, name, 'shared')?.state,\n }\n },\n async load(key) {\n const { personal, shared } = await store.loadLayers(key)\n return personal ?? shared\n },\n async saveView(key, input) {\n const old = find(\n await source.listViews().then(all => all.filter(v => v.key === key)),\n input.name,\n input.scope,\n )\n if (old?.locked && input.locked === undefined) {\n throw new Error(`Lattice state: the view \"${input.name}\" is locked.`)\n }\n return source.saveView({ locked: old?.locked, ...input, id: old?.id, key })\n },\n async save(key, state) {\n try {\n await store.saveView(key, { name, scope: 'personal', state })\n } catch (error) {\n warn(`Lattice state: the personal view did not save. ${String(error)}`)\n }\n },\n }\n return store\n}\n","import is from '@sindresorhus/is'\nimport { applyGridState, gridState } from './grid-state.ts'\nimport type { GridState, GridStateHost, TableLike } from './grid-state.ts'\nimport { consoleWarn, sameJson } from './internal.ts'\nimport type { StateStore } from './stores.ts'\n\nexport interface StateLayers {\n url?: GridState\n personal?: GridState\n shared?: GridState\n /** The column defaults: the state of the grid before any store loads. */\n defaults: GridState\n}\n\n/**\n * The state to show. The first layer that is there wins as a whole: URL, then the personal\n * view, then the shared view. Its missing keys come from the defaults, never from a lower\n * layer, so a shared link shows the same grid to each person.\n */\nexport function resolveState({ url, personal, shared, defaults }: StateLayers): GridState {\n return { ...defaults, ...(url ?? personal ?? shared) }\n}\n\n/** The keys of `state` that differ from `defaults`. A store keeps only these. */\nexport function withoutDefaults(state: GridState, defaults: GridState): GridState {\n const record = defaults as unknown as Record<string, unknown>\n return Object.fromEntries(\n Object.entries(state).filter(\n ([key, value]) => key === 'v' || !(key in record) || !sameJson(value, record[key]),\n ),\n ) as unknown as GridState\n}\n\nexport interface PersistOptions {\n /** The name of this grid's state in each store (the query param, for the URL store). */\n key: string\n /** The stores, highest precedence first: for example URL, localStorage, server. */\n stores: StateStore[]\n /** The Grid, for its own keys (scroll offset and active cell). */\n host?: GridStateHost\n /** The milliseconds to wait after the last change before a save. The default is 300. */\n wait?: number\n warn?: (message: string) => void\n}\n\nexport interface Persistence {\n /** Resolves when the load is done, also when an async store gave the state. */\n ready: Promise<void>\n /** Saves a pending change now. */\n flush(): Promise<void>\n /** Stops all saves and subscriptions. Call it when the grid goes away. */\n stop(): void\n}\n\ntype Loaded = GridState | undefined\n\n/**\n * Loads the state of `table` from the first store that has one, and saves each change to all\n * stores after a debounce. Call it before the grid renders: a sync store (URL, localStorage)\n * then applies before the first read of the table, and an async store applies when it\n * resolves. No save runs during a render, because each save waits for a timer.\n */\nexport function persistGridState(table: TableLike, options: PersistOptions): Persistence {\n const { key, stores, host, wait = 300, warn = consoleWarn } = options\n const defaults = gridState(table, host)\n const current = () => withoutDefaults(gridState(table, host), defaults)\n let last = current()\n let timer: ReturnType<typeof setTimeout> | undefined\n let stopped = false\n\n const apply = (state: Loaded) => {\n if (stopped) return\n applyGridState(table, resolveState({ url: state, defaults }), host)\n last = current()\n }\n\n const loadFrom = (index: number): Loaded | Promise<Loaded> => {\n const store = stores[index]\n if (!store) return undefined\n let result: Loaded | Promise<Loaded>\n try {\n result = store.load(key)\n } catch (error) {\n warn(`Lattice state: a store did not load \"${key}\". ${String(error)}`)\n return loadFrom(index + 1)\n }\n if (!is.promise(result)) return result ?? loadFrom(index + 1)\n return result.then(\n state => state ?? loadFrom(index + 1),\n (error: unknown) => {\n warn(`Lattice state: a store did not load \"${key}\". ${String(error)}`)\n return loadFrom(index + 1)\n },\n )\n }\n\n const save = async () => {\n timer = undefined\n const state = current()\n if (stopped || sameJson(state, last)) return\n last = state\n await Promise.all(\n stores.map(store =>\n Promise.resolve()\n .then(() => store.save(key, state))\n .catch((error: unknown) => {\n warn(`Lattice state: a store did not save \"${key}\". ${String(error)}`)\n }),\n ),\n )\n }\n\n const schedule = () => {\n if (stopped) return\n clearTimeout(timer)\n timer = setTimeout(() => void save(), wait)\n }\n\n const loaded = loadFrom(0)\n let ready: Promise<void>\n if (is.promise(loaded)) {\n const before = current()\n ready = loaded.then(state => {\n // A change by the user while the store loaded wins over the stored state.\n if (state && sameJson(current(), before)) apply(state)\n })\n } else {\n if (loaded) apply(loaded)\n ready = Promise.resolve()\n }\n\n const subscriptions = [\n table.store.subscribe(schedule).unsubscribe,\n host?.subscribe?.(schedule),\n // A store also tells about its own save (the router fires `routeDidChange` later). That\n // echo is skipped, so it cannot undo a change that the user made after the save.\n ...stores.map(store =>\n store.subscribe?.(key, state => {\n if (!sameJson(withoutDefaults(resolveState({ url: state, defaults }), defaults), last)) {\n apply(state)\n }\n }),\n ),\n ]\n\n return {\n ready,\n flush() {\n clearTimeout(timer)\n return save()\n },\n stop() {\n stopped = true\n clearTimeout(timer)\n for (const unsubscribe of subscriptions) unsubscribe?.()\n },\n }\n}\n"],"names":["SCHEMA_VERSION","TABLE_KEYS","HOST_KEYS","setterOf","key","toUpperCase","slice","gridState","table","host","slices","store","state","v","atoms","undefined","read","applyGridState","api","set","is","function","call","own","Object","assign","keys","length","apply","migrations","strings","x","array","every","string","record","value","plainObject","values","finite","number","Number","isFinite","intAtLeast","min","integer","optional","check","json","boolean","null","VALID","columnOrder","columnPinning","k","columnSizing","columnVisibility","sorting","s","columnFilters","f","globalFilter","grouping","expanded","rowSelection","pagination","scroll","activeCell","migrate","input","options","steps","version","warn","message","console","step","error","String","out","entries","canonical","map","fromEntries","sort","sameJson","a","b","JSON","stringify","consoleWarn","SHORT","LONG","long","short","rename","names","encodeState","bytes","TextEncoder","encode","binary","byte","fromCharCode","btoa","replace","decodeState","text","atob","Uint8Array","from","char","charCodeAt","TextDecoder","fatal","decode","parsed","parse","isEmptyState","urlStore","router","win","window","globalThis","currentRoute","queryParams","URL","location","href","searchParams","get","load","save","replaceWith","url","delete","history","replaceState","subscribe","listener","last","changed","on","off","addEventListener","removeEventListener","localStore","prefix","storage","localStorage","getItem","removeItem","setItem","serverStore","source","view","name","listViews","filter","find","views","viewName","scope","deleteView","id","loadLayers","personal","shared","saveView","old","then","all","locked","Error","resolveState","defaults","withoutDefaults","persistGridState","stores","wait","current","timer","stopped","loadFrom","index","result","promise","Promise","resolve","catch","schedule","clearTimeout","setTimeout","loaded","ready","before","subscriptions","unsubscribe","flush","stop"],"mappings":";;AAaA;AACO,MAAMA,cAAc,GAAG;;AAY9B;;AAMA;AACA;AACA;AACA;;AAOA;;AAgBA;AACO,MAAMC,UAAU,GAAG,CACxB,aAAa,EACb,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,cAAc,EACd,UAAU,EACV,UAAU,EACV,cAAc,EACd,YAAY;MAGDC,SAAS,GAAG,CAAC,QAAQ,EAAE,YAAY;;AAEhD;AACA;AACA;AACA;;AASA;AACA,MAAMC,QAAQ,GAAIC,GAAW,IAAK,MAAMA,GAAG,CAAC,CAAC,CAAC,CAAEC,WAAW,EAAE,GAAGD,GAAG,CAACE,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE;;AAE9E;AACO,SAASC,SAASA,CAACC,KAAgB,EAAEC,IAAoB,EAAa;AAC3E,EAAA,MAAMC,MAAM,GAAGF,KAAK,CAACG,KAAK,CAACC,KAAgC;AAC3D,EAAA,MAAMA,KAA8B,GAAG;AAAEC,IAAAA,CAAC,EAAEb;GAAgB;AAC5D,EAAA,KAAK,MAAMI,GAAG,IAAIH,UAAU,EAAE;IAC5B,IAAIG,GAAG,IAAII,KAAK,CAACM,KAAK,IAAIJ,MAAM,CAACN,GAAG,CAAC,KAAKW,SAAS,EAAEH,KAAK,CAACR,GAAG,CAAC,GAAGM,MAAM,CAACN,GAAG,CAAC;AAC/E,EAAA;EACA,OAAO;AAAE,IAAA,GAAIQ,KAA8B;IAAE,GAAGH,IAAI,EAAEO,IAAI;GAAI;AAChE;;AAEA;AACO,SAASC,cAAcA,CAACT,KAAgB,EAAEI,KAAgB,EAAEH,IAAoB,EAAQ;EAC7F,MAAMS,GAAG,GAAGV,K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AAG,CACpB5L,KAAK,CAACG,KAAK,CAAC+H,SAAS,CAACoD,QAAQ,CAAC,CAACO,WAAW,EAC3C5L,IAAI,EAAEiI,SAAS,GAAGoD,QAAQ,CAAC;AAC3B;AACA;AACA,EAAA,GAAGZ,MAAM,CAAChG,GAAG,CAACvE,KAAK,IACjBA,KAAK,CAAC+H,SAAS,GAAGtI,GAAG,EAAEQ,KAAK,IAAI;AAC9B,IAAA,IAAI,CAACyE,QAAQ,CAAC2F,eAAe,CAACF,YAAY,CAAC;AAAExC,MAAAA,GAAG,EAAE1H,KAAK;AAAEmK,MAAAA;AAAS,KAAC,CAAC,EAAEA,QAAQ,CAAC,EAAEnC,IAAI,CAAC,EAAE;MACtFhH,KAAK,CAAChB,KAAK,CAAC;AACd,IAAA;EACF,CAAC,CACH,CAAC,CACF;EAED,OAAO;IACLsL,KAAK;AACLI,IAAAA,KAAKA,GAAG;MACNP,YAAY,CAACV,KAAK,CAAC;MACnB,OAAOjD,IAAI,EAAE;IACf,CAAC;AACDmE,IAAAA,IAAIA,GAAG;AACLjB,MAAAA,OAAO,GAAG,IAAI;MACdS,YAAY,CAACV,KAAK,CAAC;AACnB,MAAA,KAAK,MAAMgB,WAAW,IAAID,aAAa,EAAEC,WAAW,IAAI;AAC1D,IAAA;GACD;AACH;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/grid-state.ts","../src/migrate.ts","../src/internal.ts","../src/stores.ts","../src/persist.ts"],"sourcesContent":["import is from '@sindresorhus/is'\nimport type {\n ColumnFiltersState,\n ColumnPinningState,\n ColumnSizingState,\n ColumnVisibilityState,\n ExpandedState,\n GroupingState,\n PaginationState,\n RowSelectionState,\n SortingState,\n} from '@ember-lattice/core'\n\n/** The schema version of a `GridState`. Add a migration when you change the shape. */\nexport const SCHEMA_VERSION = 1\n\nexport interface ScrollOffset {\n top: number\n left: number\n}\n\nexport interface CellRef {\n rowId: string\n columnId: string\n}\n\n/** The state keys that the Grid owns, not the table. */\nexport interface HostState {\n scroll?: ScrollOffset\n activeCell?: CellRef | null\n}\n\n/**\n * The Grid implements this to persist its own keys (scroll offset and active cell).\n * `subscribe` is optional: without it, a change to these keys saves with the next table change.\n */\nexport interface GridStateHost {\n read(): HostState\n apply(state: HostState): void\n subscribe?(listener: () => void): () => void\n}\n\n/** The persistable grid state as JSON. Each key is optional: a missing key keeps its default. */\nexport interface GridState extends HostState {\n v: number\n columnOrder?: string[]\n columnPinning?: ColumnPinningState\n columnSizing?: ColumnSizingState\n columnVisibility?: ColumnVisibilityState\n sorting?: SortingState\n columnFilters?: ColumnFiltersState\n globalFilter?: unknown\n grouping?: GroupingState\n expanded?: ExpandedState\n rowSelection?: RowSelectionState\n pagination?: PaginationState\n}\n\n/** The table slices in a `GridState`. The table has a slice only when its feature is registered. */\nexport const TABLE_KEYS = [\n 'columnOrder',\n 'columnPinning',\n 'columnSizing',\n 'columnVisibility',\n 'sorting',\n 'columnFilters',\n 'globalFilter',\n 'grouping',\n 'expanded',\n 'rowSelection',\n 'pagination',\n] as const\n\nexport const HOST_KEYS = ['scroll', 'activeCell'] as const\n\n/**\n * The part of a Lattice table that this package uses. Any table from `constructTable` has it.\n * The feature setters (`setSorting` and the others) are found by name at run time.\n */\nexport interface TableLike {\n readonly store: {\n readonly state: object\n subscribe(listener: () => void): { unsubscribe: () => void }\n }\n readonly atoms: object\n}\n\n// `columnOrder` → `setColumnOrder`: each feature setter goes through the slice owner.\nconst setterOf = (key: string) => `set${key[0]!.toUpperCase()}${key.slice(1)}`\n\n/** Reads the persistable state of `table` (and of `host`, when given) as JSON. */\nexport function gridState(table: TableLike, host?: GridStateHost): GridState {\n const slices = table.store.state as Record<string, unknown>\n const state: Record<string, unknown> = { v: SCHEMA_VERSION }\n for (const key of TABLE_KEYS) {\n if (key in table.atoms && slices[key] !== undefined) state[key] = slices[key]\n }\n return { ...(state as unknown as GridState), ...host?.read() }\n}\n\n/** Sets each key of `state` on `table` (and on `host`). A key the table has no feature for stays unused. */\nexport function applyGridState(table: TableLike, state: GridState, host?: GridStateHost): void {\n const api = table as unknown as Record<string, unknown>\n for (const key of TABLE_KEYS) {\n if (!(key in state) || !(key in table.atoms)) continue\n const set = api[setterOf(key)]\n if (is.function(set)) set.call(table, state[key])\n }\n const own: HostState = {}\n for (const key of HOST_KEYS) if (key in state) Object.assign(own, { [key]: state[key] })\n if (host && Object.keys(own).length > 0) host.apply(own)\n}\n","import is from '@sindresorhus/is'\nimport { SCHEMA_VERSION } from './grid-state.ts'\nimport type { GridState } from './grid-state.ts'\n\ntype Raw = Record<string, unknown>\n\n/** `migrations[v]` upgrades a state from version `v` to version `v + 1`. */\nexport type Migrations = Record<number, (state: Raw) => Raw>\n\n/** The migrations of this release. Version 1 is the first schema, so there is none yet. */\nexport const migrations: Migrations = {}\n\nexport interface MigrateOptions {\n migrations?: Migrations\n version?: number\n /** Gets each dev warning. The default is `console.warn`. */\n warn?: (message: string) => void\n}\n\nconst strings = (x: unknown) => is.array(x) && x.every(is.string)\nconst record = (x: unknown, value: (v: unknown) => boolean) =>\n is.plainObject(x) && Object.values(x).every(value)\nconst finite = (x: unknown): x is number => is.number(x) && Number.isFinite(x)\nconst intAtLeast = (min: number) => (x: unknown) => is.integer(x) && x >= min\nconst optional = (check: (x: unknown) => boolean) => (x: unknown) => x === undefined || check(x)\nconst json = (x: unknown): boolean =>\n is.string(x) ||\n is.boolean(x) ||\n is.null(x) ||\n finite(x) ||\n (is.array(x) && x.every(json)) ||\n record(x, json)\n\n// One check for each known key. A key that is not here is unknown, also `__proto__`.\nconst VALID: Record<string, (x: unknown) => boolean> = {\n columnOrder: strings,\n columnPinning: x =>\n is.plainObject(x) &&\n Object.keys(x).every(k => k === 'start' || k === 'end') &&\n optional(strings)(x['start']) &&\n optional(strings)(x['end']),\n columnSizing: x => record(x, finite),\n columnVisibility: x => record(x, is.boolean),\n sorting: x =>\n is.array(x) && x.every(s => is.plainObject(s) && is.string(s['id']) && is.boolean(s['desc'])),\n columnFilters: x =>\n is.array(x) &&\n x.every(\n f => is.plainObject(f) && is.string(f['id']) && f['value'] !== undefined && json(f['value']),\n ),\n globalFilter: json,\n grouping: strings,\n expanded: x => x === true || record(x, is.boolean),\n rowSelection: x => record(x, v => v === true),\n pagination: x =>\n is.plainObject(x) && intAtLeast(0)(x['pageIndex']) && intAtLeast(1)(x['pageSize']),\n scroll: x => is.plainObject(x) && finite(x['top']) && finite(x['left']),\n activeCell: x =>\n x === null || (is.plainObject(x) && is.string(x['rowId']) && is.string(x['columnId'])),\n}\n\n/**\n * Upgrades `input` to the current schema, one version at a time, then checks each key.\n * An unknown key or a key with a bad value drops only that key, with a dev warning. A value\n * that is not a state at all gives `undefined`. It never throws: the input can come from a URL.\n */\nexport function migrate(input: unknown, options: MigrateOptions = {}): GridState | undefined {\n const {\n migrations: steps = migrations,\n version = SCHEMA_VERSION,\n warn = (message: string) => console.warn(message),\n } = options\n if (!is.plainObject(input) || !is.integer(input['v']) || input['v'] < 1) return undefined\n let state: Raw = input\n try {\n for (let v = input['v']; v < version; v++) {\n const step = steps[v]\n if (step) state = step(state)\n else warn(`Lattice state: no migration from version ${v}; the keys are checked as they are.`)\n }\n } catch (error) {\n warn(`Lattice state: a migration failed, so the state is not used. ${String(error)}`)\n return undefined\n }\n const out: Raw = { v: version }\n for (const [key, value] of Object.entries(state)) {\n if (key === 'v') continue\n const check = VALID[key]\n if (!check) warn(`Lattice state: unknown key \"${key}\" is dropped.`)\n else if (!check(value)) warn(`Lattice state: key \"${key}\" has a bad value and is dropped.`)\n else out[key] = value\n }\n return out as unknown as GridState\n}\n","import is from '@sindresorhus/is'\n\n// JSON with sorted object keys, so the same state always gives the same string.\nexport function canonical(value: unknown): unknown {\n if (is.array(value)) return value.map(canonical)\n if (!is.plainObject(value)) return value\n return Object.fromEntries(\n Object.keys(value)\n .sort()\n .map(key => [key, canonical(value[key])]),\n )\n}\n\nexport const sameJson = (a: unknown, b: unknown) =>\n JSON.stringify(canonical(a)) === JSON.stringify(canonical(b))\n\nexport const consoleWarn = (message: string) => console.warn(message)\n","import is from '@sindresorhus/is'\nimport { canonical, consoleWarn } from './internal.ts'\nimport { migrate } from './migrate.ts'\nimport type { GridState } from './grid-state.ts'\n\n/** One place that keeps grid state. `load` can be sync (URL, localStorage) or async (server). */\nexport interface StateStore {\n load(key: string): GridState | undefined | Promise<GridState | undefined>\n save(key: string, state: GridState): void | Promise<void>\n /** Calls `listener` when the state changes outside the grid (the back button, for example). */\n subscribe?(key: string, listener: (state: GridState | undefined) => void): () => void\n}\n\ninterface WarnOption {\n /** Gets each dev warning. The default is `console.warn`. */\n warn?: (message: string) => void\n}\n\n// One-letter names for the top-level keys in the URL. Never change a name: old links use it.\nconst SHORT: Record<string, string> = {\n columnOrder: 'o',\n columnPinning: 'p',\n columnSizing: 'w',\n columnVisibility: 'h',\n sorting: 's',\n columnFilters: 'f',\n globalFilter: 'q',\n grouping: 'g',\n expanded: 'e',\n rowSelection: 'r',\n pagination: 'n',\n scroll: 'y',\n activeCell: 'a',\n}\nconst LONG = Object.fromEntries(Object.entries(SHORT).map(([long, short]) => [short, long]))\nconst rename = (state: object, names: Record<string, string>) =>\n Object.fromEntries(Object.entries(state).map(([key, value]) => [names[key] ?? key, value]))\n\n/**\n * A short and stable string for `state`: JSON with one-letter top-level keys and sorted keys,\n * as base64url with no padding.\n */\nexport function encodeState(state: GridState): string {\n const bytes = new TextEncoder().encode(JSON.stringify(canonical(rename(state, SHORT))))\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '')\n}\n\n/** The state in `text`, or `undefined` when the text is not a valid state. It never throws. */\nexport function decodeState(text: string, options: WarnOption = {}): GridState | undefined {\n try {\n const binary = atob(text.replace(/-/g, '+').replace(/_/g, '/'))\n const bytes = Uint8Array.from(binary, char => char.charCodeAt(0))\n const json = new TextDecoder('utf-8', { fatal: true }).decode(bytes)\n const parsed: unknown = JSON.parse(json)\n return migrate(is.plainObject(parsed) ? rename(parsed, LONG) : parsed, options)\n } catch {\n return undefined\n }\n}\n\n/** True when `state` has no key other than the version. */\nexport const isEmptyState = (state: GridState) => Object.keys(state).every(key => key === 'v')\n\n/** The part of the Ember router service that `urlStore` uses. */\nexport interface RouterLike {\n currentRoute?: { queryParams: Record<string, unknown> } | null\n replaceWith(options: { queryParams: Record<string, string | null> }): unknown\n on?(event: 'routeDidChange', listener: () => void): unknown\n off?(event: 'routeDidChange', listener: () => void): unknown\n}\n\n/** The part of `window` that `urlStore` uses when there is no router. */\nexport interface WindowLike {\n location: { href: string }\n history: { state: unknown; replaceState(state: unknown, unused: string, url: string): void }\n addEventListener(type: 'popstate', listener: () => void): void\n removeEventListener(type: 'popstate', listener: () => void): void\n}\n\nexport interface UrlStoreOptions extends WarnOption {\n /**\n * The Ember router service. The route must declare the query param (the `key`), because\n * Ember drops a query param that no controller declares.\n */\n router?: RouterLike\n /** The window to use when there is no router. The default is the global `window`. */\n window?: WindowLike\n}\n\n/**\n * Keeps the state in one query param, named by the store key. The param holds the encoded\n * state (see `encodeState`); a state with no key removes the param.\n */\nexport function urlStore(options: UrlStoreOptions = {}): StateStore {\n const { router, warn = consoleWarn } = options\n const win = () => options.window ?? (globalThis as unknown as { window: WindowLike }).window\n const read = (key: string): string | undefined => {\n const value = router\n ? router.currentRoute?.queryParams[key]\n : new URL(win().location.href).searchParams.get(key)\n return is.string(value) && value !== '' ? value : undefined\n }\n const load = (key: string) => {\n const text = read(key)\n return text === undefined ? undefined : decodeState(text, { warn })\n }\n return {\n load,\n save(key, state) {\n const text = isEmptyState(state) ? null : encodeState(state)\n if ((read(key) ?? null) === text) return\n if (router) {\n router.replaceWith({ queryParams: { [key]: text } })\n return\n }\n const url = new URL(win().location.href)\n if (text === null) url.searchParams.delete(key)\n else url.searchParams.set(key, text)\n win().history.replaceState(win().history.state, '', url.href)\n },\n subscribe(key, listener) {\n let last = read(key)\n const changed = () => {\n const text = read(key)\n if (text === last) return\n last = text\n listener(load(key))\n }\n if (router) {\n router.on?.('routeDidChange', changed)\n return () => void router.off?.('routeDidChange', changed)\n }\n win().addEventListener('popstate', changed)\n return () => win().removeEventListener('popstate', changed)\n },\n }\n}\n\n/** The part of `Storage` that `localStore` uses. */\nexport type StorageLike = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>\n\nexport interface LocalStoreOptions extends WarnOption {\n /** The default is `globalThis.localStorage`. A function is called on each use. */\n storage?: StorageLike | (() => StorageLike)\n /** The prefix of each storage key. The default is `lattice:`. */\n prefix?: string\n}\n\n/**\n * Keeps the state in localStorage. It never throws: when storage is not there (private mode),\n * is full (quota) or holds bad JSON, `load` gives `undefined` and `save` does nothing.\n */\nexport function localStore(options: LocalStoreOptions = {}): StateStore {\n const { prefix = 'lattice:', warn = consoleWarn } = options\n // Even a read of `localStorage` can throw (a sandboxed frame), so it is inside the try.\n const storage = (): StorageLike =>\n is.function(options.storage) ? options.storage() : (options.storage ?? globalThis.localStorage)\n return {\n load(key) {\n try {\n const text = storage().getItem(prefix + key)\n return text === null ? undefined : migrate(JSON.parse(text), { warn })\n } catch {\n return undefined\n }\n },\n save(key, state) {\n try {\n if (isEmptyState(state)) storage().removeItem(prefix + key)\n else storage().setItem(prefix + key, JSON.stringify(state))\n } catch (error) {\n warn(`Lattice state: localStorage did not save \"${key}\". ${String(error)}`)\n }\n },\n }\n}\n\nexport type ViewScope = 'personal' | 'shared'\n\n/** A saved view. A shared view is for everyone; a locked view changes only by an explicit call. */\nexport interface SavedView {\n id: string\n /** The grid that the view is for: the store key. */\n key: string\n name: string\n scope: ViewScope\n locked?: boolean\n state: GridState\n}\n\n/** The async views API of a data source. The server decides who can see a personal view. */\nexport interface ViewSource {\n listViews(): Promise<SavedView[]>\n saveView(view: Omit<SavedView, 'id'> & { id?: string }): Promise<SavedView>\n deleteView(id: string): Promise<void>\n}\n\nexport interface ViewInput {\n name: string\n scope: ViewScope\n locked?: boolean\n state: GridState\n}\n\nexport interface ServerStore extends StateStore {\n load(key: string): Promise<GridState | undefined>\n save(key: string, state: GridState): Promise<void>\n /** The personal and the shared view with the current view name. */\n loadLayers(key: string): Promise<{ personal?: GridState; shared?: GridState }>\n listViews(key: string): Promise<SavedView[]>\n /** Saves a view. A `shared` scope is \"save for everyone\": only this call writes one. */\n saveView(key: string, view: ViewInput): Promise<SavedView>\n deleteView(id: string): Promise<void>\n}\n\nexport interface ServerStoreOptions extends WarnOption {\n /** The name of the view that the grid shows and that `save` writes. The default is `Default`. */\n view?: string\n}\n\n/**\n * Saved views through a data source. `save` (the automatic save) writes only the personal\n * view, and never over a locked view. `load` gives the personal view, then the shared view.\n */\nexport function serverStore(source: ViewSource, options: ServerStoreOptions = {}): ServerStore {\n const { view: name = 'Default', warn = consoleWarn } = options\n const listViews = async (key: string) =>\n (await source.listViews())\n .filter(view => view.key === key)\n .map(view => ({ ...view, state: migrate(view.state, { warn }) ?? { v: view.state.v } }))\n const find = (views: SavedView[], viewName: string, scope: ViewScope) =>\n views.find(view => view.name === viewName && view.scope === scope)\n\n const store: ServerStore = {\n listViews,\n deleteView: id => source.deleteView(id),\n async loadLayers(key) {\n const views = await listViews(key)\n return {\n personal: find(views, name, 'personal')?.state,\n shared: find(views, name, 'shared')?.state,\n }\n },\n async load(key) {\n const { personal, shared } = await store.loadLayers(key)\n return personal ?? shared\n },\n async saveView(key, input) {\n const old = find(\n await source.listViews().then(all => all.filter(v => v.key === key)),\n input.name,\n input.scope,\n )\n if (old?.locked && input.locked === undefined) {\n throw new Error(`Lattice state: the view \"${input.name}\" is locked.`)\n }\n return source.saveView({ locked: old?.locked, ...input, id: old?.id, key })\n },\n async save(key, state) {\n try {\n await store.saveView(key, { name, scope: 'personal', state })\n } catch (error) {\n warn(`Lattice state: the personal view did not save. ${String(error)}`)\n }\n },\n }\n return store\n}\n","import is from '@sindresorhus/is'\nimport { applyGridState, gridState } from './grid-state.ts'\nimport type { GridState, GridStateHost, TableLike } from './grid-state.ts'\nimport { consoleWarn, sameJson } from './internal.ts'\nimport type { StateStore } from './stores.ts'\n\nexport interface StateLayers {\n url?: GridState\n personal?: GridState\n shared?: GridState\n /** The column defaults: the state of the grid before any store loads. */\n defaults: GridState\n}\n\n/**\n * The state to show. The first layer that is there wins as a whole: URL, then the personal\n * view, then the shared view. Its missing keys come from the defaults, never from a lower\n * layer, so a shared link shows the same grid to each person.\n */\nexport function resolveState({ url, personal, shared, defaults }: StateLayers): GridState {\n return { ...defaults, ...(url ?? personal ?? shared) }\n}\n\n/** The keys of `state` that differ from `defaults`. A store keeps only these. */\nexport function withoutDefaults(state: GridState, defaults: GridState): GridState {\n const record = defaults as unknown as Record<string, unknown>\n return Object.fromEntries(\n Object.entries(state).filter(\n ([key, value]) => key === 'v' || !(key in record) || !sameJson(value, record[key]),\n ),\n ) as unknown as GridState\n}\n\nexport interface PersistOptions {\n /** The name of this grid's state in each store (the query param, for the URL store). */\n key: string\n /** The stores, highest precedence first: for example URL, localStorage, server. */\n stores: StateStore[]\n /** The Grid, for its own keys (scroll offset and active cell). */\n host?: GridStateHost\n /** The milliseconds to wait after the last change before a save. The default is 300. */\n wait?: number\n warn?: (message: string) => void\n}\n\nexport interface Persistence {\n /** Resolves when the load is done, also when an async store gave the state. */\n ready: Promise<void>\n /** Saves a pending change now. */\n flush(): Promise<void>\n /** Stops all saves and subscriptions. Call it when the grid goes away. */\n stop(): void\n}\n\ntype Loaded = GridState | undefined\n\n/**\n * A state host that gets its table later: the `@stateHost` handle of a grid in the template\n * form (ADR 0028). The grid makes its table in its first render, and gives it to the handle.\n */\nexport interface TableHost extends GridStateHost {\n /** Calls `listener` with the table when the grid has it. Returns a function that stops it. */\n onTable(listener: (table: TableLike) => void): () => void\n}\n\nconst isTableHost = (target: TableLike | TableHost): target is TableHost =>\n is.function((target as Partial<TableHost>).onTable)\n\n/**\n * Loads the state of `table` from the first store that has one, and saves each change to all\n * stores after a debounce. Call it before the grid renders: a sync store (URL, localStorage)\n * then applies before the first read of the table, and an async store applies when it\n * resolves. No save runs during a render, because each save waits for a timer.\n *\n * In the template form, give the `@stateHost` handle in place of the table. The handle gets the\n * table when the grid makes it, after its first render and before the first paint; a sync store\n * applies then. The handle is also the host of the scroll and the active cell.\n */\nexport function persistGridState(\n target: TableLike | TableHost,\n options: PersistOptions,\n): Persistence {\n if (!isTableHost(target)) return persistTable(target, options)\n let inner: Persistence | undefined\n let stopped = false\n let done: () => void = () => {}\n const ready = new Promise<void>(resolve => (done = resolve))\n const stopWaiting = target.onTable(table => {\n if (stopped || inner) return\n inner = persistTable(table, { ...options, host: options.host ?? target })\n void inner.ready.then(done)\n })\n return {\n ready,\n flush: () => inner?.flush() ?? Promise.resolve(),\n stop() {\n stopped = true\n stopWaiting()\n inner?.stop()\n done()\n },\n }\n}\n\nfunction persistTable(table: TableLike, options: PersistOptions): Persistence {\n const { key, stores, host, wait = 300, warn = consoleWarn } = options\n const defaults = gridState(table, host)\n const current = () => withoutDefaults(gridState(table, host), defaults)\n let last = current()\n let timer: ReturnType<typeof setTimeout> | undefined\n let stopped = false\n\n const apply = (state: Loaded) => {\n if (stopped) return\n applyGridState(table, resolveState({ url: state, defaults }), host)\n last = current()\n }\n\n const loadFrom = (index: number): Loaded | Promise<Loaded> => {\n const store = stores[index]\n if (!store) return undefined\n let result: Loaded | Promise<Loaded>\n try {\n result = store.load(key)\n } catch (error) {\n warn(`Lattice state: a store did not load \"${key}\". ${String(error)}`)\n return loadFrom(index + 1)\n }\n if (!is.promise(result)) return result ?? loadFrom(index + 1)\n return result.then(\n state => state ?? loadFrom(index + 1),\n (error: unknown) => {\n warn(`Lattice state: a store did not load \"${key}\". ${String(error)}`)\n return loadFrom(index + 1)\n },\n )\n }\n\n const save = async () => {\n timer = undefined\n const state = current()\n if (stopped || sameJson(state, last)) return\n last = state\n await Promise.all(\n stores.map(store =>\n Promise.resolve()\n .then(() => store.save(key, state))\n .catch((error: unknown) => {\n warn(`Lattice state: a store did not save \"${key}\". ${String(error)}`)\n }),\n ),\n )\n }\n\n const schedule = () => {\n if (stopped) return\n clearTimeout(timer)\n timer = setTimeout(() => void save(), wait)\n }\n\n const loaded = loadFrom(0)\n let ready: Promise<void>\n if (is.promise(loaded)) {\n const before = current()\n ready = loaded.then(state => {\n // A change by the user while the store loaded wins over the stored state.\n if (state && sameJson(current(), before)) apply(state)\n })\n } else {\n if (loaded) apply(loaded)\n ready = Promise.resolve()\n }\n\n const subscriptions = [\n table.store.subscribe(schedule).unsubscribe,\n host?.subscribe?.(schedule),\n // A store also tells about its own save (the router fires `routeDidChange` later). That\n // echo is skipped, so it cannot undo a change that the user made after the save.\n ...stores.map(store =>\n store.subscribe?.(key, state => {\n if (!sameJson(withoutDefaults(resolveState({ url: state, defaults }), defaults), last)) {\n apply(state)\n }\n }),\n ),\n ]\n\n return {\n ready,\n flush() {\n clearTimeout(timer)\n return save()\n },\n stop() {\n stopped = true\n clearTimeout(timer)\n for (const unsubscribe of subscriptions) unsubscribe?.()\n },\n }\n}\n"],"names":["SCHEMA_VERSION","TABLE_KEYS","HOST_KEYS","setterOf","key","toUpperCase","slice","gridState","table","host","slices","store","state","v","atoms","undefined","read","applyGridState","api","set","is","function","call","own","Object","assign","keys","length","apply","migrations","strings","x","array","every","string","record","value","plainObject","values","finite","number","Number","isFinite","intAtLeast","min","integer","optional","check","json","boolean","null","VALID","columnOrder","columnPinning","k","columnSizing","columnVisibility","sorting","s","columnFilters","f","globalFilter","grouping","expanded","rowSelection","pagination","scroll","activeCell","migrate","input","options","steps","version","warn","message","console","step","error","String","out","entries","canonical","map","fromEntries","sort","sameJson","a","b","JSON","stringify","consoleWarn","SHORT","LONG","long","short","rename","names","encodeState","bytes","TextEncoder","encode","binary","byte","fromCharCode","btoa","replace","decodeState","text","atob","Uint8Array","from","char","charCodeAt","TextDecoder","fatal","decode","parsed","parse","isEmptyState","urlStore","router","win","window","globalThis","currentRoute","queryParams","URL","location","href","searchParams","get","load","save","replaceWith","url","delete","history","replaceState","subscribe","listener","last","changed","on","off","addEventListener","removeEventListener","localStore","prefix","storage","localStorage","getItem","removeItem","setItem","serverStore","source","view","name","listViews","filter","find","views","viewName","scope","deleteView","id","loadLayers","personal","shared","saveView","old","then","all","locked","Error","resolveState","defaults","withoutDefaults","isTableHost","target","onTable","persistGridState","persistTable","inner","stopped","done","ready","Promise","resolve","stopWaiting","flush","stop","stores","wait","current","timer","loadFrom","index","result","promise","catch","schedule","clearTimeout","setTimeout","loaded","before","subscriptions","unsubscribe"],"mappings":";;AAaA;AACO,MAAMA,cAAc,GAAG;;AAY9B;;AAMA;AACA;AACA;AACA;;AAOA;;AAgBA;AACO,MAAMC,UAAU,GAAG,CACxB,aAAa,EACb,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,cAAc,EACd,UAAU,EACV,UAAU,EACV,cAAc,EACd,YAAY;MAGDC,SAAS,GAAG,CAAC,QAAQ,EAAE,YAAY;;AAEhD;AACA;AACA;AACA;;AASA;AACA,MAAMC,QAAQ,GAAIC,GAAW,IAAK,MAAMA,GAAG,CAAC,CAAC,CAAC,CAAEC,WAAW,EAAE,GAAGD,GAAG,CAACE,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE;;AAE9E;AACO,SAASC,SAASA,CAACC,KAAgB,EAAEC,IAAoB,EAAa;AAC3E,EAAA,MAAMC,MAAM,GAAGF,KAAK,CAACG,KAAK,CAACC,KAAgC;AAC3D,EAAA,MAAMA,KAA8B,GAAG;AAAEC,IAAAA,CAAC,EAAEb;GAAgB;AAC5D,EAAA,KAAK,MAAMI,GAAG,IAAIH,UAAU,EAAE;IAC5B,IAAIG,GAAG,IAAII,KAAK,CAACM,KAAK,IAAIJ,MAAM,CAACN,GAAG,CAAC,KAAKW,SAAS,EAAEH,KAAK,CAACR,GAAG,CAAC,GAAGM,MAAM,CAACN,GAAG,CAAC;AAC/E,EAAA;EACA,OAAO;AAAE,IAAA,GAAIQ,KAA8B;IAAE,GAAGH,IAAI,EAAEO,IAAI;GAAI;AAChE;;AAEA;AACO,SAASC,cAAcA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pBrM,KAAK,CAACG,KAAK,CAAC+H,SAAS,CAAC8D,QAAQ,CAAC,CAACM,WAAW,EAC3CrM,IAAI,EAAEiI,SAAS,GAAG8D,QAAQ,CAAC;AAC3B;AACA;AACA,EAAA,GAAGT,MAAM,CAAC7G,GAAG,CAACvE,KAAK,IACjBA,KAAK,CAAC+H,SAAS,GAAGtI,GAAG,EAAEQ,KAAK,IAAI;AAC9B,IAAA,IAAI,CAACyE,QAAQ,CAAC2F,eAAe,CAACF,YAAY,CAAC;AAAExC,MAAAA,GAAG,EAAE1H,KAAK;AAAEmK,MAAAA;AAAS,KAAC,CAAC,EAAEA,QAAQ,CAAC,EAAEnC,IAAI,CAAC,EAAE;MACtFhH,KAAK,CAAChB,KAAK,CAAC;AACd,IAAA;EACF,CAAC,CACH,CAAC,CACF;EAED,OAAO;IACL6K,KAAK;AACLI,IAAAA,KAAKA,GAAG;MACNY,YAAY,CAACP,KAAK,CAAC;MACnB,OAAO9D,IAAI,EAAE;IACf,CAAC;AACD0D,IAAAA,IAAIA,GAAG;AACLP,MAAAA,OAAO,GAAG,IAAI;MACdkB,YAAY,CAACP,KAAK,CAAC;AACnB,MAAA,KAAK,MAAMY,WAAW,IAAID,aAAa,EAAEC,WAAW,IAAI;AAC1D,IAAA;GACD;AACH;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-lattice/state",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Grid state that lasts: a StateStore interface with URL, localStorage and server adapters, saved views and state migrations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"NOTICE"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ember-lattice/core": "1.
|
|
45
|
+
"@ember-lattice/core": "1.1.0",
|
|
46
46
|
"@embroider/addon-shim": "^1.10.3",
|
|
47
47
|
"@sindresorhus/is": "^7.2.0",
|
|
48
48
|
"decorator-transforms": "^2.4.0"
|