@brftech/filex-core 0.42.2 → 0.43.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 +14 -2
- package/dist/ArchiveViewer-BqU761Wk.js +149 -0
- package/dist/ArchiveViewer-BqU761Wk.js.map +1 -0
- package/dist/CsvViewer-ByHVK5ga.js +172 -0
- package/dist/CsvViewer-ByHVK5ga.js.map +1 -0
- package/dist/{DrawioViewer-CC6rJXeP.js → DrawioViewer-Bgrj8-zG.js} +45 -44
- package/dist/DrawioViewer-Bgrj8-zG.js.map +1 -0
- package/dist/{EpubViewer-CAoTSXTO.js → EpubViewer-DJwUKlHW.js} +50 -50
- package/dist/EpubViewer-DJwUKlHW.js.map +1 -0
- package/dist/IpynbViewer-Bz0eJ4NS.js +184 -0
- package/dist/IpynbViewer-Bz0eJ4NS.js.map +1 -0
- package/dist/MermaidViewer-CEDTD_pp.js +136 -0
- package/dist/MermaidViewer-CEDTD_pp.js.map +1 -0
- package/dist/PsdViewer-CZcxUpZO.js +121 -0
- package/dist/PsdViewer-CZcxUpZO.js.map +1 -0
- package/dist/TiffViewer-BwI62CbQ.js +141 -0
- package/dist/TiffViewer-BwI62CbQ.js.map +1 -0
- package/dist/{Viewer3D-CdZeK4j4.js → Viewer3D-DoeZcuMm.js} +16 -16
- package/dist/Viewer3D-DoeZcuMm.js.map +1 -0
- package/dist/filex-core.js +475 -219
- package/dist/filex-core.umd.cjs +165 -108
- package/dist/filex-core.umd.cjs.map +1 -1
- package/dist/fonts/caveat-latin-ext.woff2 +0 -0
- package/dist/fonts/caveat-latin.woff2 +0 -0
- package/dist/fonts/dancing-script-latin-ext.woff2 +0 -0
- package/dist/fonts/dancing-script-latin.woff2 +0 -0
- package/dist/fonts/homemade-apple-latin.woff2 +0 -0
- package/dist/fonts/source-serif-4-latin-ext.woff2 +0 -0
- package/dist/fonts/source-serif-4-latin.woff2 +0 -0
- package/dist/index-DuWnGuv5.js +35901 -0
- package/dist/index-DuWnGuv5.js.map +1 -0
- package/dist/index.d.ts +5227 -553
- package/dist/pdf-CaPYsOUo.js +21302 -0
- package/dist/pdf-CaPYsOUo.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/FileExplorer.vue +1055 -253
- package/src/assets/fonts/LICENSE-Apache-2.0.txt +202 -0
- package/src/assets/fonts/LICENSE-OFL-1.1.txt +93 -0
- package/src/assets/fonts/README.md +58 -0
- package/src/assets/fonts/caveat-latin-ext.woff2 +0 -0
- package/src/assets/fonts/caveat-latin.woff2 +0 -0
- package/src/assets/fonts/dancing-script-latin-ext.woff2 +0 -0
- package/src/assets/fonts/dancing-script-latin.woff2 +0 -0
- package/src/assets/fonts/homemade-apple-latin.woff2 +0 -0
- package/src/assets/fonts/source-serif-4-latin-ext.woff2 +0 -0
- package/src/assets/fonts/source-serif-4-latin.woff2 +0 -0
- package/src/components/AdvancedSearch.vue +49 -0
- package/src/components/Breadcrumb.vue +5 -5
- package/src/components/ChoiceButtons.vue +152 -0
- package/src/components/CommandPalette.vue +5 -5
- package/src/components/ConnectionGuideView.vue +1 -1
- package/src/components/ConnectionNotice.vue +59 -0
- package/src/components/ConnectionsPanel.vue +30 -568
- package/src/components/ContextMenu.vue +31 -5
- package/src/components/DataTable.vue +1331 -0
- package/src/components/FilePane.vue +3 -0
- package/src/components/FilterBar.vue +12 -5
- package/src/components/GalleryView.vue +50 -2
- package/src/components/GridView.vue +51 -3
- package/src/components/HomeView.vue +18 -6
- package/src/components/InspectorPanel.vue +134 -17
- package/src/components/ListView.vue +366 -900
- package/src/components/LogoMark.vue +57 -0
- package/src/components/NFSExportsPanel.vue +76 -28
- package/src/components/OnboardingTour.vue +19 -7
- package/src/components/OperationsCenter.vue +77 -1
- package/src/components/PendingOpsTray.vue +59 -5
- package/src/components/PresenceBar.vue +7 -7
- package/src/components/ProductVersion.vue +31 -0
- package/src/components/QuickLook.vue +10 -14
- package/src/components/RecentlyOpened.vue +31 -15
- package/src/components/RecoveryKeyModal.vue +1 -1
- package/src/components/RowActions.vue +134 -0
- package/src/components/S3KeysPanel.vue +98 -62
- package/src/components/SSHKeysPanel.vue +79 -30
- package/src/components/SideNav.vue +260 -96
- package/src/components/StarButton.vue +1 -0
- package/src/components/StorageFields.vue +74 -6
- package/src/components/StorageTags.vue +62 -0
- package/src/components/TabBar.vue +1 -1
- package/src/components/TagKindIcon.vue +56 -0
- package/src/components/TagPicker.vue +226 -40
- package/src/components/ThemePalette.vue +4 -4
- package/src/components/TimeZonePicker.vue +29 -10
- package/src/components/TokensPanel.vue +82 -31
- package/src/components/Toolbar.vue +28 -6
- package/src/components/plugin/PluginConfirmModal.vue +54 -0
- package/src/components/plugin/PluginInspectorSection.vue +149 -0
- package/src/components/plugin/PluginPageView.vue +339 -0
- package/src/components/plugin/PluginViewModal.vue +159 -0
- package/src/components/plugin/SurfaceConversation.vue +76 -0
- package/src/components/plugin/SurfaceFooterButtons.vue +73 -0
- package/src/components/plugin/SurfaceRenderer.vue +299 -0
- package/src/components/plugin/SurfaceSections.vue +91 -0
- package/src/components/plugin/nodes/PdfFieldEditor.vue +509 -0
- package/src/components/plugin/nodes/SurfaceFileChooser.vue +94 -0
- package/src/components/plugin/nodes/SurfaceForm.vue +82 -0
- package/src/components/plugin/nodes/SurfaceList.vue +127 -0
- package/src/components/plugin/nodes/SurfacePdfFields.vue +1285 -0
- package/src/components/plugin/nodes/SurfacePeoplePicker.vue +213 -0
- package/src/components/plugin/nodes/SurfacePinInput.vue +57 -0
- package/src/components/plugin/nodes/SurfacePreview.vue +119 -0
- package/src/components/plugin/nodes/SurfaceProgress.vue +48 -0
- package/src/components/plugin/nodes/SurfaceSignaturePad.vue +472 -0
- package/src/components/plugin/nodes/SurfaceSteps.vue +53 -0
- package/src/components/public/PublicLanguagePicker.vue +58 -0
- package/src/components/public/PublicLinkPage.vue +286 -0
- package/src/components/public/PublicLinkPreview.vue +85 -0
- package/src/components/public/PublicPinGate.vue +108 -0
- package/src/components/public/PublicRequestBody.vue +204 -0
- package/src/components/public/PublicShareBody.vue +188 -0
- package/src/components/public/PublicShell.vue +332 -0
- package/src/composables/useConnections.ts +8 -2
- package/src/composables/useFileApi.ts +183 -44
- package/src/composables/useLocale.ts +277 -41
- package/src/composables/useNFSExports.ts +8 -10
- package/src/composables/useOperations.ts +44 -3
- package/src/composables/usePendingOps.ts +59 -8
- package/src/composables/usePluginActions.ts +121 -0
- package/src/composables/usePluginSurface.ts +223 -0
- package/src/composables/usePublicBranding.ts +172 -0
- package/src/composables/usePublicLink.ts +573 -0
- package/src/composables/usePublicPage.ts +61 -0
- package/src/composables/useS3Keys.ts +17 -12
- package/src/composables/useSSHKeys.ts +8 -10
- package/src/composables/useTokens.ts +8 -12
- package/src/composables/useUploadChunked.ts +18 -8
- package/src/composables/useViewerFetch.ts +6 -3
- package/src/index.ts +404 -8
- package/src/lib/actionIcons.ts +46 -1
- package/src/lib/advSearch.ts +14 -7
- package/src/lib/appLock.ts +130 -0
- package/src/lib/connection.ts +110 -0
- package/src/lib/destinationTree.ts +19 -3
- package/src/lib/direction.ts +353 -0
- package/src/lib/dragGhost.ts +6 -0
- package/src/lib/dropLimits.ts +69 -0
- package/src/lib/errorWords.ts +394 -0
- package/src/lib/externalReach.ts +5 -1
- package/src/lib/fileFilters.ts +7 -2
- package/src/lib/fileIcons.ts +4 -0
- package/src/lib/internalPaths.ts +77 -0
- package/src/lib/listInput.ts +64 -0
- package/src/lib/listing.ts +58 -23
- package/src/lib/modalStack.ts +26 -0
- package/src/lib/nodeRow.ts +18 -3
- package/src/lib/pdfFieldRules.ts +126 -0
- package/src/lib/pdfFields.ts +589 -0
- package/src/lib/pdfFieldsGeom.ts +203 -0
- package/src/lib/pdfjsLoader.ts +51 -0
- package/src/lib/personName.ts +47 -0
- package/src/lib/pluginApplies.ts +123 -0
- package/src/lib/pluginLabel.ts +72 -0
- package/src/lib/pluginMenu.ts +253 -0
- package/src/lib/pluginPage.ts +58 -0
- package/src/lib/plural.ts +181 -0
- package/src/lib/popupLayer.ts +103 -0
- package/src/lib/prefs.ts +563 -0
- package/src/lib/productVersion.ts +35 -0
- package/src/lib/publicLayout.ts +39 -0
- package/src/lib/serviceGate.ts +104 -0
- package/src/lib/shareTtl.ts +25 -11
- package/src/lib/signFonts.ts +85 -0
- package/src/lib/signaturePad.ts +111 -0
- package/src/lib/sortOrder.ts +100 -38
- package/src/lib/star.ts +7 -1
- package/src/lib/surfaceCell.ts +41 -0
- package/src/lib/surfaceConditions.ts +156 -0
- package/src/lib/surfaceOpen.ts +106 -0
- package/src/lib/surfaceSteps.ts +68 -0
- package/src/lib/surfaceValues.ts +191 -0
- package/src/lib/symlink.ts +150 -0
- package/src/lib/tableColumns.ts +493 -0
- package/src/lib/tableEnv.ts +34 -0
- package/src/lib/tablePrefs.ts +84 -0
- package/src/lib/tags.ts +121 -12
- package/src/lib/themes.ts +286 -18
- package/src/lib/tour.ts +152 -0
- package/src/lib/trashEmpty.ts +111 -0
- package/src/lib/trashTimeLeft.ts +23 -0
- package/src/lib/uiLocales.ts +460 -0
- package/src/lib/viewPrefs.ts +696 -660
- package/src/lib/viewPrefsHttp.ts +78 -0
- package/src/locales/en.ts +515 -117
- package/src/locales/resolve.ts +17 -8
- package/src/locales/tr.ts +536 -152
- package/src/modals/ConvertModal.vue +62 -11
- package/src/modals/DestinationPickerModal.vue +59 -16
- package/src/modals/Modal.vue +113 -23
- package/src/modals/NewDocumentModal.vue +16 -6
- package/src/modals/NewFolderModal.vue +8 -0
- package/src/modals/PermissionsModal.vue +272 -163
- package/src/modals/PreviewModal.vue +119 -20
- package/src/modals/RenameModal.vue +37 -1
- package/src/styles/base.css +2890 -260
- package/src/styles/sign-fonts.css +118 -0
- package/src/styles/variables.css +60 -0
- package/src/types/Connections.ts +17 -0
- package/src/types/ExplorerConfig.ts +117 -1
- package/src/types/FileNode.ts +50 -0
- package/src/types/Plugins.ts +494 -0
- package/src/types/Public.ts +212 -0
- package/src/viewers/ArchiveViewer.vue +93 -48
- package/src/viewers/CsvViewer.vue +99 -53
- package/src/viewers/DrawioViewer.vue +35 -9
- package/src/viewers/EpubViewer.vue +7 -8
- package/src/viewers/IpynbViewer.vue +3 -1
- package/src/viewers/MermaidViewer.vue +4 -5
- package/src/viewers/PdfViewer.vue +8 -17
- package/src/viewers/PsdViewer.vue +2 -4
- package/src/viewers/TiffViewer.vue +4 -5
- package/src/viewers/Viewer3D.vue +1 -1
- package/LICENSE +0 -21
- package/dist/ArchiveViewer-BUQWLhwX.js +0 -124
- package/dist/ArchiveViewer-BUQWLhwX.js.map +0 -1
- package/dist/CsvViewer-Bg2_aqzc.js +0 -141
- package/dist/CsvViewer-Bg2_aqzc.js.map +0 -1
- package/dist/DrawioViewer-CC6rJXeP.js.map +0 -1
- package/dist/EpubViewer-CAoTSXTO.js.map +0 -1
- package/dist/IpynbViewer-D0GwGpnE.js +0 -184
- package/dist/IpynbViewer-D0GwGpnE.js.map +0 -1
- package/dist/MermaidViewer-DGwAvRZg.js +0 -137
- package/dist/MermaidViewer-DGwAvRZg.js.map +0 -1
- package/dist/PsdViewer-DhGweA0m.js +0 -122
- package/dist/PsdViewer-DhGweA0m.js.map +0 -1
- package/dist/TiffViewer-D0AurvAh.js +0 -142
- package/dist/TiffViewer-D0AurvAh.js.map +0 -1
- package/dist/Viewer3D-CdZeK4j4.js.map +0 -1
- package/dist/index-BArI-B1M.js +0 -26911
- package/dist/index-BArI-B1M.js.map +0 -1
- package/dist/useViewerFetch-czqbd2Lj.js +0 -25
- package/dist/useViewerFetch-czqbd2Lj.js.map +0 -1
- package/src/composables/useScrolledX.ts +0 -21
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-plugin wire shapes — the TypeScript mirror of
|
|
3
|
+
* `backend/pkg/pluginkit/wire/wire.go` for the parts a browser sees.
|
|
4
|
+
*
|
|
5
|
+
* ⚠ Mirror, not a second design. A field lives here because it lives in
|
|
6
|
+
* wire.go under the same JSON name; when the Go side grows one, add it here
|
|
7
|
+
* with the same spelling. The HTTP surface around these is described in
|
|
8
|
+
* docs/APP-PLUGINS-API.md.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** A label in one or more languages. `en` is required; others fall back to it. */
|
|
12
|
+
export type PluginText = Record<string, string>;
|
|
13
|
+
|
|
14
|
+
/** Which selections an action or view is offered for (wire.Applies). */
|
|
15
|
+
export interface PluginApplies {
|
|
16
|
+
/** file | dir | any — the server treats an absent kind as `file`. */
|
|
17
|
+
kind?: 'file' | 'dir' | 'any' | string;
|
|
18
|
+
/** Lower-case, no dot. */
|
|
19
|
+
ext?: string[];
|
|
20
|
+
/** Exact, or a prefix glob such as `image/*`. */
|
|
21
|
+
mime?: string[];
|
|
22
|
+
multi?: boolean;
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
/**
|
|
26
|
+
* v2 — state-aware rows. `state` narrows the offer to files on which THIS
|
|
27
|
+
* action's plugin keeps at least one of the named keys, `no_state` to
|
|
28
|
+
* files that carry none of them. Listings expose the keys as
|
|
29
|
+
* `app_state: ["<plugin>:<key>"]`, so a client matching this rule strips
|
|
30
|
+
* the ROW'S OWN plugin prefix first (lib/pluginApplies). A signing app
|
|
31
|
+
* offers "Sign" only where `pending` is set and "Request signatures" only
|
|
32
|
+
* where it is not — both in the same menu.
|
|
33
|
+
*/
|
|
34
|
+
state?: string[];
|
|
35
|
+
no_state?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* The flow the action starts ends in writing the file, although its own
|
|
38
|
+
* output is `none` ("Request signatures"): filex does not offer it where
|
|
39
|
+
* the file cannot be written (a read-only storage), exactly as it does not
|
|
40
|
+
* offer an action whose output writes.
|
|
41
|
+
*/
|
|
42
|
+
writable?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* v2 — an app plugin holds a file read-only (`files:lock`,
|
|
47
|
+
* docs/APP-PLUGINS-API.md → "File locks"). The row's `perm` arrives capped
|
|
48
|
+
* at `viewer` for EVERYONE, administrators included, so nothing else has to
|
|
49
|
+
* know about locks to behave; this is what the badge says out loud.
|
|
50
|
+
*/
|
|
51
|
+
export interface AppLock {
|
|
52
|
+
/** The app holding it — its manifest `name`, which is what ADDRESSES it. */
|
|
53
|
+
plugin: string;
|
|
54
|
+
/**
|
|
55
|
+
* The same app as a person should read it ({"en": "e-Signature"}), in every
|
|
56
|
+
* language its manifest wrote it in.
|
|
57
|
+
*
|
|
58
|
+
* ⚠ Absent where the server cannot resolve the name (the app was removed,
|
|
59
|
+
* or there is no app runtime), and then `plugin` is what is shown — which
|
|
60
|
+
* is what every surface did before this field existed, and read as "sign
|
|
61
|
+
* locked this file" where the rest of the product says "e-Signature"
|
|
62
|
+
* (v0.43.0).
|
|
63
|
+
*/
|
|
64
|
+
plugin_label?: PluginText;
|
|
65
|
+
reason?: string;
|
|
66
|
+
/** The reason in every language the app wrote it in (a manifest message);
|
|
67
|
+
* the reader's own is shown, `reason` is the plain fallback. */
|
|
68
|
+
reason_text?: PluginText;
|
|
69
|
+
/** RFC 3339; absent means "until the app lifts it". */
|
|
70
|
+
until?: string | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** One entry of `GET /api/files/plugins/actions` → `actions[]`. */
|
|
74
|
+
export interface PluginActionRow {
|
|
75
|
+
plugin: string;
|
|
76
|
+
id: string;
|
|
77
|
+
/** `plugin:<plugin>/<action>` — the menu row's key. */
|
|
78
|
+
key?: string;
|
|
79
|
+
label: PluginText;
|
|
80
|
+
icon?: string;
|
|
81
|
+
applies: PluginApplies;
|
|
82
|
+
/** A view id: running the action opens this surface first. */
|
|
83
|
+
view?: string;
|
|
84
|
+
/**
|
|
85
|
+
* v2 — how `view` opens: `modal` (a dialog over the explorer) or `page`
|
|
86
|
+
* (a full page in a NEW TAB, `{base}apps/{plugin}/{view}?path=…`). A
|
|
87
|
+
* `page` action is not run through `…/run` at all: the tab opens on the
|
|
88
|
+
* view and the job is queued from the surface's own submit.
|
|
89
|
+
*/
|
|
90
|
+
view_placement?: 'modal' | 'page' | string;
|
|
91
|
+
confirm?: PluginText | null;
|
|
92
|
+
min_role?: 'viewer' | 'editor' | 'owner' | string;
|
|
93
|
+
danger?: boolean;
|
|
94
|
+
output_mode?: 'sibling' | 'version' | 'none' | string;
|
|
95
|
+
/** The result may go into a folder the person chooses (manifest
|
|
96
|
+
* `output.elsewhere`): the action is offered on a read-only storage too,
|
|
97
|
+
* and its screen asks where the result should go. */
|
|
98
|
+
output_elsewhere?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* What the action would ALSO be offered on once a requirement the server
|
|
101
|
+
* lacks is met — sent to administrators only. The menu draws each as a
|
|
102
|
+
* greyed row that says what is missing (lib/pluginMenu).
|
|
103
|
+
*/
|
|
104
|
+
gated?: PluginGatedRule[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** One "offered once X is there" part of an action's rule. */
|
|
108
|
+
export interface PluginGatedRule {
|
|
109
|
+
ext?: string[];
|
|
110
|
+
needs: { kind: 'engine' | string; id: string; name: string };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** One entry of `GET /api/files/plugins/actions` → `views[]`. */
|
|
114
|
+
export interface PluginViewRow {
|
|
115
|
+
plugin: string;
|
|
116
|
+
id: string;
|
|
117
|
+
placement: 'modal' | 'inspector' | 'home' | string;
|
|
118
|
+
label: PluginText;
|
|
119
|
+
applies?: PluginApplies;
|
|
120
|
+
icon?: string;
|
|
121
|
+
size?: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface PluginActionsResponse {
|
|
125
|
+
actions: PluginActionRow[];
|
|
126
|
+
views: PluginViewRow[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** One component of a surface (wire.Node). */
|
|
130
|
+
export interface SurfaceNode {
|
|
131
|
+
id?: string;
|
|
132
|
+
type: string;
|
|
133
|
+
props?: Record<string, unknown>;
|
|
134
|
+
children?: SurfaceNode[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ── Node props (M2) — docs/APP-PLUGINS-API.md → "Node props (M2)" ──────
|
|
138
|
+
* `SurfaceNode.props` stays `Record<string, unknown>` on the wire (the host
|
|
139
|
+
* validates against the catalogue, the browser never trusts it); each
|
|
140
|
+
* component narrows its own node's props through these. */
|
|
141
|
+
|
|
142
|
+
export type SurfaceTone = 'muted' | 'danger' | 'info';
|
|
143
|
+
|
|
144
|
+
export interface TextNodeProps {
|
|
145
|
+
text?: PluginText | string;
|
|
146
|
+
/** Accepted alias of `text` (M1). */
|
|
147
|
+
value?: PluginText | string;
|
|
148
|
+
tone?: SurfaceTone | string;
|
|
149
|
+
heading?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* v3 — "that other field holds one of these values" (wire.Condition).
|
|
154
|
+
*
|
|
155
|
+
* Carried by `show_when` (the field is not drawn until the condition holds)
|
|
156
|
+
* and `required_when` (the field is required only then). An empty `equals`
|
|
157
|
+
* means "holds anything at all", which is how a field is made to depend on
|
|
158
|
+
* another one merely having been answered.
|
|
159
|
+
*/
|
|
160
|
+
export interface PluginCondition {
|
|
161
|
+
key: string;
|
|
162
|
+
equals?: string[];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* A form field — the storage descriptor field (`types/Connections.StorageField`)
|
|
167
|
+
* as a plugin declares it: `label` / `help` may be Text, `i18n_key` is absent.
|
|
168
|
+
*
|
|
169
|
+
* ⚠ v3 removed `advanced`. A surface has no collapsed section any more: a
|
|
170
|
+
* field that matters is on the step, and one that does not is not in the
|
|
171
|
+
* manifest. An older plugin's `advanced` is ignored, not obeyed.
|
|
172
|
+
*/
|
|
173
|
+
export interface PluginField {
|
|
174
|
+
key: string;
|
|
175
|
+
type?: 'string' | 'int' | 'bool' | 'password' | 'select' | string;
|
|
176
|
+
label?: PluginText | string;
|
|
177
|
+
help?: PluginText | string;
|
|
178
|
+
required?: boolean;
|
|
179
|
+
secret?: boolean;
|
|
180
|
+
default?: unknown;
|
|
181
|
+
placeholder?: PluginText | string;
|
|
182
|
+
options?: Array<{ value: string; label?: PluginText | string }>;
|
|
183
|
+
min?: number;
|
|
184
|
+
max?: number;
|
|
185
|
+
multiline?: boolean;
|
|
186
|
+
monospace?: boolean;
|
|
187
|
+
/** v3 — a `select` that takes several of its options; the value is then a list. */
|
|
188
|
+
multi?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* v3 — how a `bool` is drawn (wire.Field.Style): `choice` for a decision
|
|
191
|
+
* the person must READ before answering (two buttons, Yes / No), `switch`
|
|
192
|
+
* for an on/off setting they flip in passing (a checkbox).
|
|
193
|
+
*
|
|
194
|
+
* ⚠ Empty is not `switch`: it leaves the answer to the guess in
|
|
195
|
+
* `lib/surfaceValues.boolIsDecision`, which is exactly why the contract
|
|
196
|
+
* says to state it when the answer matters. A `select` ignores `style`
|
|
197
|
+
* entirely — a surface has no dropdown for it to fall back to.
|
|
198
|
+
*/
|
|
199
|
+
style?: 'switch' | 'choice' | string;
|
|
200
|
+
/** v3 — hide the field until the condition holds; a hidden value is never sent. */
|
|
201
|
+
show_when?: PluginCondition | null;
|
|
202
|
+
/** v3 — require the field only while the condition holds. */
|
|
203
|
+
required_when?: PluginCondition | null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface FormNodeProps {
|
|
207
|
+
fields: PluginField[];
|
|
208
|
+
/** Initial values, keyed by field key. Field values are FLAT in `data.values`. */
|
|
209
|
+
values?: Record<string, unknown>;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export type StepState = 'done' | 'active' | 'todo';
|
|
213
|
+
|
|
214
|
+
export interface StepsNodeProps {
|
|
215
|
+
items: Array<{ id: string; label: PluginText | string; state?: StepState | string }>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface ListRowAction {
|
|
219
|
+
id: string;
|
|
220
|
+
label: PluginText | string;
|
|
221
|
+
danger?: boolean;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* A `list` node — drawn by the product's one table (DataTable).
|
|
226
|
+
*
|
|
227
|
+
* ⚠ Everything past `key`/`label`/`id`/`cells` is OPTIONAL and additive
|
|
228
|
+
* (docs/APP-PLUGINS-API.md → `list`): a plugin written against the first
|
|
229
|
+
* contract draws the same rows, now resizable, sortable and with columns a
|
|
230
|
+
* person can hide and move.
|
|
231
|
+
*/
|
|
232
|
+
export interface ListNodeProps {
|
|
233
|
+
columns: Array<{
|
|
234
|
+
key: string;
|
|
235
|
+
label: PluginText | string;
|
|
236
|
+
/** Opening width in px (60–900). */
|
|
237
|
+
width?: number;
|
|
238
|
+
/** Default true — the node carries every row, so sorting is honest. */
|
|
239
|
+
sortable?: boolean;
|
|
240
|
+
align?: 'left' | 'right' | 'center';
|
|
241
|
+
/** What the cells are: `date` (`YYYY-MM-DD`) or `datetime` (RFC 3339). The
|
|
242
|
+
* host prints them in the reader's language and clock and sorts by the
|
|
243
|
+
* value as sent (lib/surfaceCell). */
|
|
244
|
+
format?: 'date' | 'datetime';
|
|
245
|
+
}>;
|
|
246
|
+
rows: Array<{
|
|
247
|
+
id: string;
|
|
248
|
+
cells: Record<string, PluginText | string>;
|
|
249
|
+
actions?: ListRowAction[];
|
|
250
|
+
/** Raw values to sort by, keyed like `cells`, where the cell is formatted
|
|
251
|
+
* for people (a localised date, "1.2 MB"). */
|
|
252
|
+
sort?: Record<string, string | number>;
|
|
253
|
+
}>;
|
|
254
|
+
empty?: PluginText | string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface ProgressNodeProps {
|
|
258
|
+
/** 0..100, or null for indeterminate. */
|
|
259
|
+
value: number | null;
|
|
260
|
+
label?: PluginText | string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** One person in a `people-picker` value — and one row of the users lookup. */
|
|
264
|
+
export interface PluginPerson {
|
|
265
|
+
email: string;
|
|
266
|
+
user_id?: number;
|
|
267
|
+
name?: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface PeoplePickerNodeProps {
|
|
271
|
+
value?: PluginPerson[];
|
|
272
|
+
multi?: boolean;
|
|
273
|
+
allow_external?: boolean;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export interface PinInputNodeProps {
|
|
277
|
+
/** 4..8, default 6. */
|
|
278
|
+
length?: number;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface FileChooserNodeProps {
|
|
282
|
+
kind?: 'file' | 'dir' | string;
|
|
283
|
+
/** Adapter-qualified path. */
|
|
284
|
+
value?: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface PreviewNodeProps {
|
|
288
|
+
/** Adapter-qualified path of a storage file. */
|
|
289
|
+
path?: string;
|
|
290
|
+
/** An exposed copy on a public page (`pub:N`), resolved through the host's `fileUrl`. */
|
|
291
|
+
ref?: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* ── Node props (M3, sign track) — docs "Frontend needs (M3)" ─────────── */
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* How a surface node reaches a file the page exposes (`files[].ref`):
|
|
298
|
+
* the host resolves the ref to a URL the browser may load directly (the
|
|
299
|
+
* PIN cookie rides along on the same origin). Absent outside public pages.
|
|
300
|
+
*/
|
|
301
|
+
export type FileRefResolver = (ref: string) => { url: string; name?: string; mime?: string } | null;
|
|
302
|
+
|
|
303
|
+
export interface SignaturePadNodeProps {
|
|
304
|
+
/** Subset of `draw | type | upload`; all three when absent. */
|
|
305
|
+
modes?: string[];
|
|
306
|
+
width?: number;
|
|
307
|
+
height?: number;
|
|
308
|
+
/** The face a typed signature starts in (a `lib/signFonts` key). */
|
|
309
|
+
font?: string;
|
|
310
|
+
/** The faces a typed signature may use; one means no picker. All five when absent. */
|
|
311
|
+
fonts?: string[];
|
|
312
|
+
/**
|
|
313
|
+
* The pad's label — the box's name — drawn like a form field's, so a
|
|
314
|
+
* required signature wears the same `*` a required field does.
|
|
315
|
+
*/
|
|
316
|
+
label?: PluginText | string;
|
|
317
|
+
required?: boolean;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** Where a `pdf-fields` node's document comes from — exactly one of the three. */
|
|
321
|
+
export interface PdfFieldsSource {
|
|
322
|
+
/** An exposed copy on a public page. */
|
|
323
|
+
ref?: string;
|
|
324
|
+
/** Adapter-qualified path of a storage file (the explorer's authenticated preview fetch). */
|
|
325
|
+
path?: string;
|
|
326
|
+
/** Any URL the browser may fetch. */
|
|
327
|
+
url?: string;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export interface PdfFieldsNodeProps {
|
|
331
|
+
src: PdfFieldsSource;
|
|
332
|
+
/**
|
|
333
|
+
* `define` names the boxes (cards, no document), `place` puts them on the
|
|
334
|
+
* page (document, and the boxes that still need a place), `edit` is the
|
|
335
|
+
* one-screen form of both, `fill` is the signer's.
|
|
336
|
+
*/
|
|
337
|
+
mode?: 'define' | 'place' | 'edit' | 'fill' | string;
|
|
338
|
+
/** `lib/pdfFields.PdfField[]` on the wire; `placed: false` = defined, not yet on a page. */
|
|
339
|
+
fields?: unknown[];
|
|
340
|
+
signers?: unknown[];
|
|
341
|
+
/** Fill mode: the signer this visitor is. */
|
|
342
|
+
signer?: string;
|
|
343
|
+
/** `define` / `edit`: the palette, a subset of the five types. */
|
|
344
|
+
types?: string[];
|
|
345
|
+
/**
|
|
346
|
+
* `define` / `edit`: the date layouts a `date` box may be written in
|
|
347
|
+
* (`[{id, label, example}]`). The chosen id travels back as the field's
|
|
348
|
+
* `format`; with no catalogue there is no control and the plugin's own
|
|
349
|
+
* default stands.
|
|
350
|
+
*/
|
|
351
|
+
formats?: unknown[];
|
|
352
|
+
/**
|
|
353
|
+
* `define` / `edit`: the three captions the date control needs — the two
|
|
354
|
+
* questions (`order`, `separator`) and the word over the live example
|
|
355
|
+
* (`example`), each a `Text`. They ride with the node so they are the
|
|
356
|
+
* PLUGIN's words in the plugin's own languages. Absent: this package's
|
|
357
|
+
* own catalogue says them.
|
|
358
|
+
*/
|
|
359
|
+
date_labels?: unknown;
|
|
360
|
+
/**
|
|
361
|
+
* `define` / `edit`: the lines this plugin can print under a signature
|
|
362
|
+
* (`[{id, label, examples?: {<signer id>|'*': Text}, default?}]`,
|
|
363
|
+
* `lib/pdfFields.PdfStampLine`). Each signature/initials box then chooses
|
|
364
|
+
* its own `lines`. Absent: no choice is offered.
|
|
365
|
+
*/
|
|
366
|
+
stamp_lines?: unknown[];
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** What `GET /api/p/{token}` answered before v3. `/api/p/*` is retired (it
|
|
370
|
+
* 301s to `/api/public/s/{token}`); kept for the deprecated `usePublicPage`
|
|
371
|
+
* exports — new code reads `PublicShareInfo` through `usePublicShare`. */
|
|
372
|
+
export interface PublicPageInfo {
|
|
373
|
+
plugin: string;
|
|
374
|
+
page: string;
|
|
375
|
+
title: PluginText;
|
|
376
|
+
subject?: string;
|
|
377
|
+
requires_pin: boolean;
|
|
378
|
+
unlocked: boolean;
|
|
379
|
+
expires_at?: string | null;
|
|
380
|
+
files: PublicPageFile[];
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface PublicPageFile {
|
|
384
|
+
ref: string;
|
|
385
|
+
name: string;
|
|
386
|
+
size?: number;
|
|
387
|
+
mime?: string;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** `GET /api/files/plugins/users?plugin=<name>&q=` — docs "Frontend needs (M2)". */
|
|
391
|
+
export interface PluginUsersResponse {
|
|
392
|
+
users: PluginPerson[];
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* v3 §3.0 — `wire.OpenRequest`: "go to this file, and start this there".
|
|
397
|
+
* `action` or `view`, never both; neither just opens the file.
|
|
398
|
+
*/
|
|
399
|
+
export interface SurfaceOpenRequest {
|
|
400
|
+
/** Adapter-qualified (`docs://reports/nda.pdf`). */
|
|
401
|
+
path: string;
|
|
402
|
+
action?: string;
|
|
403
|
+
view?: string;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** A footer button (wire.SurfaceAction). */
|
|
407
|
+
export interface SurfaceAction {
|
|
408
|
+
id: string;
|
|
409
|
+
label: PluginText;
|
|
410
|
+
primary?: boolean;
|
|
411
|
+
danger?: boolean;
|
|
412
|
+
disabled?: boolean;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** wire.JobRequest — the surface asks the host to enqueue an action. */
|
|
416
|
+
export interface SurfaceJobRequest {
|
|
417
|
+
action_id: string;
|
|
418
|
+
params?: Record<string, unknown>;
|
|
419
|
+
/**
|
|
420
|
+
* v2 — this one job's output, replacing the action's manifest output
|
|
421
|
+
* ("same file as a new version" / "a new file beside it" / a name). The
|
|
422
|
+
* server re-checks the ACL against the EFFECTIVE mode, so a surface
|
|
423
|
+
* cannot turn a read-only action into a write.
|
|
424
|
+
*/
|
|
425
|
+
output?: { mode: 'sibling' | 'version' | 'none' | string; name?: string };
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** A declarative screen (wire.Surface). Drawn only by filex's own components. */
|
|
429
|
+
export interface PluginSurface {
|
|
430
|
+
title?: PluginText;
|
|
431
|
+
size?: string;
|
|
432
|
+
state?: Record<string, unknown>;
|
|
433
|
+
nodes: SurfaceNode[];
|
|
434
|
+
actions?: SurfaceAction[];
|
|
435
|
+
toast?: PluginText;
|
|
436
|
+
done?: boolean;
|
|
437
|
+
job?: SurfaceJobRequest | null;
|
|
438
|
+
errors?: Record<string, PluginText>;
|
|
439
|
+
/**
|
|
440
|
+
* v3 §3.0 — send the person to a FILE, and start a screen on it.
|
|
441
|
+
*
|
|
442
|
+
* A surface runs on the file it was opened on, so an app's home screen
|
|
443
|
+
* could list documents and then do nothing when a row was clicked. The
|
|
444
|
+
* client navigates (`lib/surfaceOpen`); with `done: true` the screen is
|
|
445
|
+
* closed first and then the navigation happens.
|
|
446
|
+
*/
|
|
447
|
+
open?: SurfaceOpenRequest | null;
|
|
448
|
+
/**
|
|
449
|
+
* A home page's MENU: one entry per section, drawn by the frame
|
|
450
|
+
* (`SurfaceSections`), and `section` — which one this surface is.
|
|
451
|
+
*
|
|
452
|
+
* ⚠ The frame and not a node, because only the frame owns the address
|
|
453
|
+
* bar: it keeps the open section in its URL (`?section=`), so the
|
|
454
|
+
* browser's Back walks the sections and a link — a notification's —
|
|
455
|
+
* lands on the right one (the owner, 2026-09-21).
|
|
456
|
+
*/
|
|
457
|
+
sections?: SurfaceSection[];
|
|
458
|
+
section?: string;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** One entry of a home page's menu. */
|
|
462
|
+
export interface SurfaceSection {
|
|
463
|
+
id: string;
|
|
464
|
+
label: PluginText;
|
|
465
|
+
/** Drawn beside the label (rows waiting there); absent draws none. */
|
|
466
|
+
count?: number;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* What `POST …/run` (and a view event that enqueued a job) answers with. The
|
|
471
|
+
* ops row is the raw server shape; `usePendingOps.register` normalises it.
|
|
472
|
+
*/
|
|
473
|
+
export type PluginRunResult =
|
|
474
|
+
| { op: Record<string, unknown>; job_id?: string; surface?: undefined }
|
|
475
|
+
| { surface: PluginSurface; op?: undefined };
|
|
476
|
+
|
|
477
|
+
/** Body of `POST …/run` and `POST …/views/{plugin}/{view}/event`. */
|
|
478
|
+
export interface PluginViewEventBody {
|
|
479
|
+
/** Adapter-qualified wire path of the row the view was opened on. */
|
|
480
|
+
path?: string;
|
|
481
|
+
storage_id?: number;
|
|
482
|
+
state?: Record<string, unknown>;
|
|
483
|
+
event: 'open' | 'change' | 'submit' | 'action';
|
|
484
|
+
action_id?: string;
|
|
485
|
+
data?: PluginViewEventData;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/** `data` of a view event: every node with an id contributes `values[id]`. */
|
|
489
|
+
export interface PluginViewEventData {
|
|
490
|
+
values?: Record<string, unknown>;
|
|
491
|
+
/** `list` row actions only. */
|
|
492
|
+
row_id?: string;
|
|
493
|
+
[k: string]: unknown;
|
|
494
|
+
}
|