docblocks-react-ui 0.29.1 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +6 -2
- package/dist/{Editor-Pe8EWlEk.mjs → Editor-y3dFOZE4.mjs} +609 -1080
- package/dist/{Maximize-BBHnCDWL.mjs → Maximize-BTsFyI81.mjs} +1 -2
- package/dist/{constants-D_3p65rk.mjs → constants-CBPODzZc.mjs} +11 -22
- package/dist/{index-DeOMnr7f.d.mts → index-BsP8XWdE.d.mts} +8 -10
- package/dist/{index-sSq0oOSl.d.mts → index-DxRfzb-L.d.mts} +1 -65
- package/dist/index.d.mts +19 -86
- package/dist/index.mjs +17 -30
- package/dist/mermaid/index.d.mts +1 -3
- package/dist/mermaid/index.mjs +13 -21
- package/dist/pdf/index.d.mts +15 -3
- package/dist/pdf/index.mjs +15 -25
- package/dist/styles.css +58 -58
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/shared/ui/icons/Maximize.tsx
|
|
3
3
|
function Maximize(props) {
|
|
4
4
|
return /* @__PURE__ */ jsxs("svg", {
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -20,5 +20,4 @@ function Maximize(props) {
|
|
|
20
20
|
]
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { Maximize as t };
|
|
@@ -2,12 +2,11 @@ import { clsx } from "clsx";
|
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { normalizeHrefInput } from "docblocks-core";
|
|
5
|
-
|
|
5
|
+
// src/shared/ui/cn.ts
|
|
6
6
|
function cn(...inputs) {
|
|
7
7
|
return twMerge(clsx(inputs));
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
//#region src/shared/errors.ts
|
|
9
|
+
// src/shared/errors.ts
|
|
11
10
|
/**
|
|
12
11
|
* Typed react-ui errors.
|
|
13
12
|
*
|
|
@@ -77,8 +76,7 @@ var HookMisuseError = class extends DocBlocksUiError {
|
|
|
77
76
|
this.name = "HookMisuseError";
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
|
-
|
|
81
|
-
//#region src/shared/ui/icons/ChevronLeft.tsx
|
|
79
|
+
// src/shared/ui/icons/ChevronLeft.tsx
|
|
82
80
|
function ChevronLeft(props) {
|
|
83
81
|
return /* @__PURE__ */ jsx("svg", {
|
|
84
82
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -94,8 +92,7 @@ function ChevronLeft(props) {
|
|
|
94
92
|
children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
|
|
95
93
|
});
|
|
96
94
|
}
|
|
97
|
-
|
|
98
|
-
//#region src/shared/ui/icons/ChevronRight.tsx
|
|
95
|
+
// src/shared/ui/icons/ChevronRight.tsx
|
|
99
96
|
function ChevronRight(props) {
|
|
100
97
|
return /* @__PURE__ */ jsx("svg", {
|
|
101
98
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -111,8 +108,7 @@ function ChevronRight(props) {
|
|
|
111
108
|
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
112
109
|
});
|
|
113
110
|
}
|
|
114
|
-
|
|
115
|
-
//#region src/shared/ui/icons/LoaderCircle.tsx
|
|
111
|
+
// src/shared/ui/icons/LoaderCircle.tsx
|
|
116
112
|
function LoaderCircle(props) {
|
|
117
113
|
return /* @__PURE__ */ jsx("svg", {
|
|
118
114
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -128,8 +124,7 @@ function LoaderCircle(props) {
|
|
|
128
124
|
children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
129
125
|
});
|
|
130
126
|
}
|
|
131
|
-
|
|
132
|
-
//#region src/shared/ui/icons/Minus.tsx
|
|
127
|
+
// src/shared/ui/icons/Minus.tsx
|
|
133
128
|
function Minus(props) {
|
|
134
129
|
return /* @__PURE__ */ jsx("svg", {
|
|
135
130
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -145,8 +140,7 @@ function Minus(props) {
|
|
|
145
140
|
children: /* @__PURE__ */ jsx("path", { d: "M5 12h14" })
|
|
146
141
|
});
|
|
147
142
|
}
|
|
148
|
-
|
|
149
|
-
//#region src/shared/ui/icons/Plus.tsx
|
|
143
|
+
// src/shared/ui/icons/Plus.tsx
|
|
150
144
|
function Plus(props) {
|
|
151
145
|
return /* @__PURE__ */ jsxs("svg", {
|
|
152
146
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -162,8 +156,7 @@ function Plus(props) {
|
|
|
162
156
|
children: [/* @__PURE__ */ jsx("path", { d: "M5 12h14" }), /* @__PURE__ */ jsx("path", { d: "M12 5v14" })]
|
|
163
157
|
});
|
|
164
158
|
}
|
|
165
|
-
|
|
166
|
-
//#region src/shared/ui/icons/TriangleAlert.tsx
|
|
159
|
+
// src/shared/ui/icons/TriangleAlert.tsx
|
|
167
160
|
function TriangleAlert(props) {
|
|
168
161
|
return /* @__PURE__ */ jsxs("svg", {
|
|
169
162
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -183,8 +176,7 @@ function TriangleAlert(props) {
|
|
|
183
176
|
]
|
|
184
177
|
});
|
|
185
178
|
}
|
|
186
|
-
|
|
187
|
-
//#region src/shared/ui/icons/X.tsx
|
|
179
|
+
// src/shared/ui/icons/X.tsx
|
|
188
180
|
function X(props) {
|
|
189
181
|
return /* @__PURE__ */ jsxs("svg", {
|
|
190
182
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -200,8 +192,7 @@ function X(props) {
|
|
|
200
192
|
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
201
193
|
});
|
|
202
194
|
}
|
|
203
|
-
|
|
204
|
-
//#region src/shared/utils.ts
|
|
195
|
+
// src/shared/utils.ts
|
|
205
196
|
/** Clamps a value into the inclusive [min, max] range. */
|
|
206
197
|
function clamp(value, min, max) {
|
|
207
198
|
return Math.min(max, Math.max(min, value));
|
|
@@ -239,8 +230,7 @@ function isSafeDownloadHref(url) {
|
|
|
239
230
|
function assertNever(value) {
|
|
240
231
|
throw new UnhandledValueError(`Unhandled value: ${String(value)}`);
|
|
241
232
|
}
|
|
242
|
-
|
|
243
|
-
//#region src/pdf/constants.ts
|
|
233
|
+
// src/pdf/constants.ts
|
|
244
234
|
/** The fullscreen zoom's bounds + the per-click step: the scale's units
|
|
245
235
|
* are the css px per pdf point (the device pixel ratio stands the backing
|
|
246
236
|
* store's scale, not this factor). */
|
|
@@ -257,5 +247,4 @@ function isEmbeddablePdfUrl(url) {
|
|
|
257
247
|
return false;
|
|
258
248
|
}
|
|
259
249
|
}
|
|
260
|
-
//#endregion
|
|
261
250
|
export { UnknownSlashCommandError as C, UnhandledValueError as S, CanvasPasteError as _, clamp as a, HookMisuseError as b, stopPropagation as c, Plus as d, Minus as f, BlobNotFoundError as g, ChevronLeft as h, assertNever as i, X as l, ChevronRight as m, ZOOM_STEP as n, isSafeDownloadHref as o, LoaderCircle as p, isEmbeddablePdfUrl as r, preventDefault as s, ZOOM_MIN as t, TriangleAlert as u, DocBlocksUiError as v, cn as w, PdfFetchError as x, EditorProviderError as y };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Block, BlockContent, BlockId, BlockType, CanvasTextAttrs, Change, ConnectorAttrs,
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Block, BlockContent, BlockId, BlockType, CanvasTextAttrs, Change, ConnectorAttrs, DocMeta, Geometry, PresenceSelection, PresenceState, Selection, ShapeAttrs } from "docblocks-core";
|
|
3
3
|
import { StoreApi } from "zustand/vanilla";
|
|
4
|
-
//#region src/canvas/clipboard/models.d.ts
|
|
5
4
|
/** The one copied canvas item (the deep data; the ids stand the originals). */
|
|
6
5
|
type ClipboardItem = {
|
|
7
6
|
type: "shape";
|
|
@@ -34,8 +33,6 @@ interface CanvasClipboard {
|
|
|
34
33
|
/** The top-level ids (the selection order) — the paste's selection stand. */
|
|
35
34
|
ids: BlockId[];
|
|
36
35
|
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/presence/models.d.ts
|
|
39
36
|
/** The local selection's sharing grant: no sharing, sharing over the whole
|
|
40
37
|
* room (plaintext), or a targeted user-id list (encrypted per target). */
|
|
41
38
|
type PresenceSharingMode = "off" | "everyone" | string[];
|
|
@@ -78,8 +75,6 @@ interface PresenceIdentity {
|
|
|
78
75
|
userId?: string;
|
|
79
76
|
name?: string;
|
|
80
77
|
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/state/models.d.ts
|
|
83
78
|
/**
|
|
84
79
|
* The slash File command's upload stand: the block the skeleton stands on
|
|
85
80
|
* + the phase. View state per editor (not doc data, no wire).
|
|
@@ -214,6 +209,12 @@ interface EditorState {
|
|
|
214
209
|
interface EditorActions {
|
|
215
210
|
/** Re-reads the blocks a doc change touched, keeping stable references for the unchanged ones. */
|
|
216
211
|
applyChange: (change: Change) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Re-reads the doc's whole snapshot into the store (the mount resync) —
|
|
214
|
+
* the changes committed before the doc subscription existed. An unmoved
|
|
215
|
+
* doc stands a no-op; every unchanged block keeps its reference.
|
|
216
|
+
*/
|
|
217
|
+
resync: () => void;
|
|
217
218
|
/** Replaces the presence slice. */
|
|
218
219
|
setPresence: (peers: PresenceState[]) => void;
|
|
219
220
|
/** Sets the local sharing grant. */
|
|
@@ -231,8 +232,6 @@ interface EditorActions {
|
|
|
231
232
|
}
|
|
232
233
|
/** The per-instance vanilla store created by `createEditorStore`. */
|
|
233
234
|
type EditorStore = StoreApi<EditorState & EditorActions>;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region src/blocks/renderers.d.ts
|
|
236
235
|
/** The props a block renderer receives: the block id and its plain snapshot. */
|
|
237
236
|
interface BlockRendererProps {
|
|
238
237
|
id: BlockId;
|
|
@@ -267,5 +266,4 @@ type BlockRenderer = (props: BlockRendererProps) => ReactNode;
|
|
|
267
266
|
* placeholder (future block types keep working).
|
|
268
267
|
*/
|
|
269
268
|
type BlockRendererMap = Partial<Record<BlockType, BlockRenderer>>;
|
|
270
|
-
//#endregion
|
|
271
269
|
export { PresenceCrypto as a, PresenceSharing as c, EditorStore as i, PresenceSharingMode as l, BlockRendererMap as n, PresenceIdentity as o, BlockRendererProps as r, PresencePeer as s, BlockRenderer as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as PresenceCrypto, i as EditorStore, n as BlockRendererMap } from "./index-DeOMnr7f.mjs";
|
|
2
1
|
import { ComponentType, ReactNode } from "react";
|
|
3
2
|
import { AttributeType, BlockId, DatabaseFilterPayload, DatabaseSortKey, Doc, DocAttributeValue, MentionKind, MentionMark, SelectionView, SyncEmbedRef, SyncProvider } from "docblocks-core";
|
|
4
|
-
|
|
3
|
+
import { a as PresenceCrypto, i as EditorStore, n as BlockRendererMap } from "./index-BsP8XWdE.mjs";
|
|
5
4
|
/** The props an attribute-value renderer receives (the `renderAttribute` provider prop). */
|
|
6
5
|
interface RenderAttributeProps {
|
|
7
6
|
/** The attribute's key (the preset key or the custom key). */
|
|
@@ -26,8 +25,6 @@ interface AttributeTypePickerProps {
|
|
|
26
25
|
}
|
|
27
26
|
/** The consumer's replacement of the default type picker (the `attributeTypePicker` provider prop): the custom-attribute's add popover's type selection. The built-in's enum (`ATTRIBUTE_TYPES`) is the shared vocabulary. */
|
|
28
27
|
type AttributeTypePicker = ComponentType<AttributeTypePickerProps>;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/blob-store.d.ts
|
|
31
28
|
/** The blob's authoritative display metadata. */
|
|
32
29
|
interface BlobMeta {
|
|
33
30
|
/** The current display and suggested download name. */
|
|
@@ -78,8 +75,6 @@ interface BlobStore {
|
|
|
78
75
|
}
|
|
79
76
|
/** The default in-memory store: blobs live for the JS session only. */
|
|
80
77
|
declare function createMemoryBlobStore(): BlobStore;
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/database/bridge/errors.d.ts
|
|
83
78
|
/**
|
|
84
79
|
* The bridge's structured error: the stable machine-readable code +
|
|
85
80
|
* the safe message (no stack trace, SQL or tenant details) + the optional
|
|
@@ -129,8 +124,6 @@ declare function isBridgeError(error: unknown): error is BridgeError;
|
|
|
129
124
|
* operation.
|
|
130
125
|
*/
|
|
131
126
|
declare function toBridgeError(error: unknown): BridgeError;
|
|
132
|
-
//#endregion
|
|
133
|
-
//#region src/database/bridge/wire-types.d.ts
|
|
134
127
|
/**
|
|
135
128
|
* The wire's data model's types (the opaque ids, the table / column's
|
|
136
129
|
* schema entries, the query's inputs — the filter / the sort / the page,
|
|
@@ -322,8 +315,6 @@ type PageSnapshot = RowPage & {
|
|
|
322
315
|
type TableSnapshot = TableDescription & {
|
|
323
316
|
page: PageSnapshot;
|
|
324
317
|
};
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/database/bridge/event-types.d.ts
|
|
327
318
|
/** The write's context: the client-issued idempotency key (a UUID, unique
|
|
328
319
|
* within the operation retention) + the issue time + the optional CAS
|
|
329
320
|
* revision (its absence selects the LWW default — the last committed
|
|
@@ -482,8 +473,6 @@ interface SubscriptionObserver {
|
|
|
482
473
|
interface SubscriptionHandle {
|
|
483
474
|
unsubscribe(): void;
|
|
484
475
|
}
|
|
485
|
-
//#endregion
|
|
486
|
-
//#region src/database/bridge/grid-types.d.ts
|
|
487
476
|
/**
|
|
488
477
|
* A bridge column (the grid's view over the wire's `Column` — the display
|
|
489
478
|
* attributes flattened, the reference relation's fields in the wire's
|
|
@@ -575,8 +564,6 @@ type CellValueParse = {
|
|
|
575
564
|
ok: false;
|
|
576
565
|
error: string;
|
|
577
566
|
};
|
|
578
|
-
//#endregion
|
|
579
|
-
//#region src/database/bridge/mutation-types.d.ts
|
|
580
567
|
/** A batch operation (the mixed batch's element; the ordered `ops[]`
|
|
581
568
|
* commit as one transaction — either the whole batch or none). */
|
|
582
569
|
type BatchOp = {
|
|
@@ -702,8 +689,6 @@ interface DatabaseBridge {
|
|
|
702
689
|
* rejection (an unknown id is never a new mutation). */
|
|
703
690
|
getOperationStatus(operationId: Id): Promise<OperationStatus>;
|
|
704
691
|
}
|
|
705
|
-
//#endregion
|
|
706
|
-
//#region src/database/grid/use-ref-tables.d.ts
|
|
707
692
|
/** The loaded ref-table data: the row ids in the row order + the row
|
|
708
693
|
* displays (rowId → the display text) + the option colors (rowId → the
|
|
709
694
|
* `color` column's hex — the absent value stands none). */
|
|
@@ -714,8 +699,6 @@ interface RefTableData {
|
|
|
714
699
|
}
|
|
715
700
|
/** The ref-table data keyed by the entry's key (`refEntryKey`). */
|
|
716
701
|
type RefTableDataMap = Record<string, RefTableData>;
|
|
717
|
-
//#endregion
|
|
718
|
-
//#region src/database/filter-builder/FilterBuilder.d.ts
|
|
719
702
|
interface FilterBuilderProps {
|
|
720
703
|
/** The payload being edited; null = the empty filter. */
|
|
721
704
|
value: DatabaseFilterPayload | null;
|
|
@@ -728,15 +711,11 @@ interface FilterBuilderProps {
|
|
|
728
711
|
refTableData?: RefTableDataMap;
|
|
729
712
|
}
|
|
730
713
|
declare function FilterBuilder({ value, columns, onChange, refTableData }: FilterBuilderProps): import("react").JSX.Element;
|
|
731
|
-
//#endregion
|
|
732
|
-
//#region src/database/filter-builder/utils.d.ts
|
|
733
714
|
/** The empty filter payload (the "no filter" shape the Clear writes). */
|
|
734
715
|
declare function emptyFilter(): DatabaseFilterPayload;
|
|
735
716
|
/** Whether the payload is applicable: every condition that needs a value
|
|
736
717
|
* has one (an empty value = the condition is inapplicable). */
|
|
737
718
|
declare function filterIsComplete(payload: DatabaseFilterPayload | null, columns: BridgeColumn[]): boolean;
|
|
738
|
-
//#endregion
|
|
739
|
-
//#region src/database/use-database-table/models.d.ts
|
|
740
719
|
/** One loaded row: the row id (the pk value) + the cells + the row's
|
|
741
720
|
* system instants (the `created` / `updated` system columns' values;
|
|
742
721
|
* absent = the column is empty). */
|
|
@@ -833,8 +812,6 @@ interface UseDatabaseTable {
|
|
|
833
812
|
sort?: DatabaseSortKey[];
|
|
834
813
|
};
|
|
835
814
|
}
|
|
836
|
-
//#endregion
|
|
837
|
-
//#region src/database/use-database-table/use-database-table.d.ts
|
|
838
815
|
/**
|
|
839
816
|
* The external-form data provider for one `tableId` (per block
|
|
840
817
|
* instance: each block has its own row store and its own undo stack, even
|
|
@@ -843,8 +820,6 @@ interface UseDatabaseTable {
|
|
|
843
820
|
* contract query's input shapes).
|
|
844
821
|
*/
|
|
845
822
|
declare function useDatabaseTable(bridge: DatabaseBridge, tableId: string, filter?: DatabaseFilterPayload, sort?: DatabaseSortKey[]): UseDatabaseTable;
|
|
846
|
-
//#endregion
|
|
847
|
-
//#region src/database/use-database-table/utils.d.ts
|
|
848
823
|
/** The cell-value equality (null / undefined stand as the empty cell).
|
|
849
824
|
* The composite value (the multi-select's array) stands the element-wise
|
|
850
825
|
* stand: the same content over a fresh array instance is NOT a change
|
|
@@ -857,8 +832,6 @@ declare function cellValueEqual(current: unknown, next: unknown): boolean;
|
|
|
857
832
|
* the consumer's stand over the bridge's `getOperationStatus`; the UI's
|
|
858
833
|
* convergence is the rebaseline (the next snapshot / the envelope). */
|
|
859
834
|
declare function newMutationContext(): MutationContext;
|
|
860
|
-
//#endregion
|
|
861
|
-
//#region src/database/table-section.d.ts
|
|
862
835
|
/** The consumer's per-table section settings: the values that belong to
|
|
863
836
|
* the table itself rather than to a document block. The consumer owns the
|
|
864
837
|
* storage (its own table registry); the package reads the values as the
|
|
@@ -877,8 +850,6 @@ interface DatabaseTableSection {
|
|
|
877
850
|
* subscription: the consumer re-renders when its count changes. */
|
|
878
851
|
getRowCount?: (tableId: string) => number | undefined;
|
|
879
852
|
}
|
|
880
|
-
//#endregion
|
|
881
|
-
//#region src/database/standalone/models.d.ts
|
|
882
853
|
/**
|
|
883
854
|
* The database table's view settings — the standalone's `DatabaseTable`
|
|
884
855
|
* stand over the block's view attrs: the `filter`, the `sort`, the
|
|
@@ -918,8 +889,6 @@ interface UseTableList {
|
|
|
918
889
|
/** The `renameTable`'s mutation (the fresh's `operationId` per op; rejects with the `BridgeError`). */
|
|
919
890
|
rename: (tableId: string, name: string) => Promise<void>;
|
|
920
891
|
}
|
|
921
|
-
//#endregion
|
|
922
|
-
//#region src/database/standalone/DatabaseTable.d.ts
|
|
923
892
|
interface DatabaseTableProps {
|
|
924
893
|
/** The consumer's bridge (the table's truth). */
|
|
925
894
|
bridge: DatabaseBridge;
|
|
@@ -957,8 +926,6 @@ interface DatabaseTableProps {
|
|
|
957
926
|
* content's height).
|
|
958
927
|
*/
|
|
959
928
|
declare function DatabaseTable({ bridge, tableId, readOnly, view, onViewChange, className, tableSection }: DatabaseTableProps): import("react").JSX.Element;
|
|
960
|
-
//#endregion
|
|
961
|
-
//#region src/database/standalone/use-table-list.d.ts
|
|
962
929
|
/**
|
|
963
930
|
* The table catalog's hook (the standalone's stand): the consumer's
|
|
964
931
|
* `DatabaseBridge`'s catalog read (`listTables` — the system tables stand
|
|
@@ -972,8 +939,6 @@ declare function DatabaseTable({ bridge, tableId, readOnly, view, onViewChange,
|
|
|
972
939
|
* `BridgeError` stand) — the `error` state is the catalog read's own.
|
|
973
940
|
*/
|
|
974
941
|
declare function useTableList(bridge: DatabaseBridge): UseTableList;
|
|
975
|
-
//#endregion
|
|
976
|
-
//#region src/editor-provider/models/mentions.d.ts
|
|
977
942
|
/** A mention search result: the stable target id + the display label. */
|
|
978
943
|
interface MentionEntry {
|
|
979
944
|
id: string;
|
|
@@ -1028,16 +993,12 @@ interface MentionInteractions {
|
|
|
1028
993
|
*/
|
|
1029
994
|
renderEmptyState?: (query: string) => ReactNode | null;
|
|
1030
995
|
}
|
|
1031
|
-
//#endregion
|
|
1032
|
-
//#region src/editor-provider/models/modes.d.ts
|
|
1033
996
|
/** The access stand: the consumer's user access level and the document
|
|
1034
997
|
* mode (consumer session state, never document data). */
|
|
1035
998
|
/** The consumer's user access level: the available document modes. "viewer" is locked to the published's view (the current state is never rendered); "editor" (the default) may edit and view. Session state — not document data, never on the wire. */
|
|
1036
999
|
type AccessLevel = "viewer" | "editor";
|
|
1037
1000
|
/** The document's mode (consumer-controlled view state, like the page/canvas `view`): "edit" (the default) is the live document editable; "view" is the live document read-only (the current state, still syncing) with its text selectable and copyable; "published" is the `publishedDoc`'s snapshot read-only (static) with no selection and no copy by default — the `publishedCopyable` provider prop lifts the block per reader (the `view` mode's payload). */
|
|
1038
1001
|
type EditorMode = "edit" | "view" | "published";
|
|
1039
|
-
//#endregion
|
|
1040
|
-
//#region src/editor-provider/models/panels.d.ts
|
|
1041
1002
|
/** The document-attributes panel's consumer-owned contracts: the tags,
|
|
1042
1003
|
* the description, and the cover preset gallery. */
|
|
1043
1004
|
/**
|
|
@@ -1130,8 +1091,6 @@ interface CoverPresetSets {
|
|
|
1130
1091
|
/** The centering mode's preset's file ids; `[]` / the absent stands no grid over the centering's stand. */
|
|
1131
1092
|
center?: readonly string[];
|
|
1132
1093
|
}
|
|
1133
|
-
//#endregion
|
|
1134
|
-
//#region src/editor-provider/models/pdf.d.ts
|
|
1135
1094
|
/** The props a PDF first-page preview renderer receives (the `pdfPreview` provider prop). */
|
|
1136
1095
|
interface PdfPreviewProps {
|
|
1137
1096
|
/** The block's id — the renderer stamps it on its root, like the other block renderers. */
|
|
@@ -1145,8 +1104,6 @@ interface PdfPreviewProps {
|
|
|
1145
1104
|
}
|
|
1146
1105
|
/** A PDF first-page preview renderer: a component over a resolved `pdf` blob. */
|
|
1147
1106
|
type PdfPreview = ComponentType<PdfPreviewProps>;
|
|
1148
|
-
//#endregion
|
|
1149
|
-
//#region src/editor-provider/models/presence.d.ts
|
|
1150
1107
|
/**
|
|
1151
1108
|
* The local user's presence identity and the selection-sharing cipher
|
|
1152
1109
|
* (consumer session state — never document data). Without `userId` the
|
|
@@ -1168,8 +1125,6 @@ interface PresenceConfig {
|
|
|
1168
1125
|
*/
|
|
1169
1126
|
crypto?: PresenceCrypto;
|
|
1170
1127
|
}
|
|
1171
|
-
//#endregion
|
|
1172
|
-
//#region src/editor-provider/models/props-base.d.ts
|
|
1173
1128
|
/** The blob loading policy: the viewport-gated lazy stand (the default) or
|
|
1174
1129
|
* the eager stand (every block resolves at mount). */
|
|
1175
1130
|
type BlobLoading = "eager" | "lazy";
|
|
@@ -1281,8 +1236,6 @@ interface EditorProviderBaseProps {
|
|
|
1281
1236
|
commandPalettePlaceholder?: string;
|
|
1282
1237
|
children: ReactNode;
|
|
1283
1238
|
}
|
|
1284
|
-
//#endregion
|
|
1285
|
-
//#region src/editor-provider/models/selection.d.ts
|
|
1286
1239
|
/** The per-instance selection view; null before the mount effect ran and after unmount. */
|
|
1287
1240
|
interface SelectionRef {
|
|
1288
1241
|
view: SelectionView | null;
|
|
@@ -1297,8 +1250,6 @@ interface SelectionRef {
|
|
|
1297
1250
|
current: number;
|
|
1298
1251
|
};
|
|
1299
1252
|
}
|
|
1300
|
-
//#endregion
|
|
1301
|
-
//#region src/editor-provider/models/sync-embed.d.ts
|
|
1302
1253
|
/**
|
|
1303
1254
|
* Resolves a sync-embed ref to the master doc the consumer holds; null when
|
|
1304
1255
|
* the master is unknown to the consumer (the block renders its broken state).
|
|
@@ -1307,8 +1258,6 @@ type SyncEmbedResolver = (ref: SyncEmbedRef) => Doc | null;
|
|
|
1307
1258
|
/** The embed sandbox policy: the iframe's `sandbox` value for a given embed
|
|
1308
1259
|
* src; `null` stands no sandbox (a fully trusted embed, the old behavior). */
|
|
1309
1260
|
type EmbedSandboxPolicy = (src: string) => string | null;
|
|
1310
|
-
//#endregion
|
|
1311
|
-
//#region src/editor-provider/models/context.d.ts
|
|
1312
1261
|
/** Per-instance editor context: the store, the doc, the selection handle, and the customization values. */
|
|
1313
1262
|
interface EditorContextValue {
|
|
1314
1263
|
store: EditorStore;
|
|
@@ -1374,8 +1323,6 @@ interface EditorContextValue {
|
|
|
1374
1323
|
/** The presence identity + cipher (the provider's `presence` prop); null when none was supplied (the legacy's anonymous stand). */
|
|
1375
1324
|
presence: PresenceConfig | null;
|
|
1376
1325
|
}
|
|
1377
|
-
//#endregion
|
|
1378
|
-
//#region src/editor-provider/models/props-access.d.ts
|
|
1379
1326
|
interface EditorProviderAccessProps {
|
|
1380
1327
|
/**
|
|
1381
1328
|
* Optional user access level: "viewer" locks the render to the
|
|
@@ -1432,8 +1379,6 @@ interface EditorProviderAccessProps {
|
|
|
1432
1379
|
*/
|
|
1433
1380
|
presence?: PresenceConfig;
|
|
1434
1381
|
}
|
|
1435
|
-
//#endregion
|
|
1436
|
-
//#region src/editor-provider/models/props-customization.d.ts
|
|
1437
1382
|
interface EditorProviderCustomizationProps {
|
|
1438
1383
|
/**
|
|
1439
1384
|
* Optional resolver of a sync-embed's ref to the master Doc (the consumer
|
|
@@ -1569,11 +1514,7 @@ interface EditorProviderCustomizationProps {
|
|
|
1569
1514
|
*/
|
|
1570
1515
|
embedSandbox?: EmbedSandboxPolicy;
|
|
1571
1516
|
}
|
|
1572
|
-
//#endregion
|
|
1573
|
-
//#region src/editor-provider/models/props.d.ts
|
|
1574
1517
|
interface EditorProviderProps extends EditorProviderBaseProps, EditorProviderCustomizationProps, EditorProviderAccessProps {}
|
|
1575
|
-
//#endregion
|
|
1576
|
-
//#region src/editor-provider/EditorProvider.d.ts
|
|
1577
1518
|
/**
|
|
1578
1519
|
* The provider's entry: resolves the viewer's top-level stand before the
|
|
1579
1520
|
* stand's hooks (the security stand — the reader's browser never holds the
|
|
@@ -1584,8 +1525,6 @@ interface EditorProviderProps extends EditorProviderBaseProps, EditorProviderCus
|
|
|
1584
1525
|
* stand).
|
|
1585
1526
|
*/
|
|
1586
1527
|
declare function EditorProvider(props: EditorProviderProps): import("react").JSX.Element;
|
|
1587
|
-
//#endregion
|
|
1588
|
-
//#region src/editor-provider/constants.d.ts
|
|
1589
1528
|
/**
|
|
1590
1529
|
* The embed sandbox (the default when no `embedSandbox` policy is supplied):
|
|
1591
1530
|
* the embedded content runs with its own origin's grants (`allow-same-origin`
|
|
@@ -1599,9 +1538,6 @@ declare function EditorProvider(props: EditorProviderProps): import("react").JSX
|
|
|
1599
1538
|
* opaque-origin stand — no `allow-same-origin` — for the untrusted embeds).
|
|
1600
1539
|
*/
|
|
1601
1540
|
declare const DEFAULT_EMBED_SANDBOX = "allow-scripts allow-same-origin allow-forms allow-popups";
|
|
1602
|
-
//#endregion
|
|
1603
|
-
//#region src/editor-provider/context.d.ts
|
|
1604
1541
|
/** Read the per-instance editor context; throws outside an EditorProvider. */
|
|
1605
1542
|
declare function useEditorContext(): EditorContextValue;
|
|
1606
|
-
//#endregion
|
|
1607
1543
|
export { SubscriptionStatus as $, useDatabaseTable as A, BlobRef as At, BridgeColumnAnnotation as B, DatabaseTable as C, BRIDGE_ERROR_CODES as Ct, DatabaseTableSection as D, isBridgeErrorCode as Dt, UseTableList as E, isBridgeError as Et, filterIsComplete as F, RenderAttribute as Ft, MutationContext as G, BridgeValueInput as H, FilterBuilder as I, RenderAttributeProps as It, ProtocolCapability as J, MutationReceipt as K, BatchOp as L, DatabaseTableRow as M, createMemoryBlobStore as Mt, UseDatabaseTable as N, AttributeTypePicker as Nt, cellValueEqual as O, toBridgeError as Ot, emptyFilter as P, AttributeTypePickerProps as Pt, SubscriptionObserver as Q, DatabaseBridge as R, useTableList as S, TableSnapshot as St, DatabaseTableView as T, BridgeErrorCode as Tt, CellValueParse as U, BridgeTableDescription as V, DomainEvent as W, ProtocolLimits as X, ProtocolDescriptor as Y, SubscriptionHandle as Z, AccessLevel as _, RowPage as _t, EditorContextValue as a, ColumnCreateReference as at, MentionInteractions as b, TableDescription as bt, SelectionRef as c, FilterConditionInput as ct, PdfPreview as d, IsoInstant as dt, TableEnvelopeBase as et, PdfPreviewProps as f, PageQuery as ft, DocTags as g, Revision as gt, DocTag as h, QuerySemantics as ht, EditorProviderProps as i, ColumnCreateInput as it, DatabaseTablePhase as j, BlobStore as jt, newMutationContext as k, BlobMeta as kt, BlobLoading as l, FilterInput as lt, DocDescription as m, QueryOperator as mt, DEFAULT_EMBED_SANDBOX as n, CellMap as nt, EmbedSandboxPolicy as o, ColumnSystem as ot, CoverPresetSets as p, PageSnapshot as pt, OperationStatus as q, EditorProvider as r, Column as rt, SyncEmbedResolver as s, EnumOptionInput as st, useEditorContext as t, TableEvent as tt, PresenceConfig as u, Id as ut, EditorMode as v, RowWire as vt, DatabaseTableProps as w, BridgeError as wt, MentionProvider as x, TableRef as xt, MentionEntry as y, SortInput as yt, BridgeColumn as z };
|