nucleus-core-ts 0.10.147 → 0.10.151
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/LICENSE +48 -48
- package/dist/.build-ok +1 -1
- package/dist/fe/components/AuthorizationPage/labels.js +13 -13
- package/dist/fe/components/Captcha/labels.js +17 -17
- package/dist/fe/components/ChatPanel/helpers.js +17 -17
- package/dist/fe/components/ChatPanel/labels.js +16 -16
- package/dist/fe/components/DataTable/labels.js +16 -16
- package/dist/fe/components/DevicesPage/components/DeviceCard.js +15 -15
- package/dist/fe/components/DevicesPage/components/DevicesPage.js +9 -9
- package/dist/fe/components/DevicesPage/labels.js +12 -12
- package/dist/fe/components/ForgotPasswordPage/labels.js +8 -8
- package/dist/fe/components/FormBuilder/components/FormField.js +5 -5
- package/dist/fe/components/FormBuilder/utils/fieldMapping.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/ConnectionAuthFields.js +8 -8
- package/dist/fe/components/IntegrationsPage/components/ConnectionBasicFields.js +3 -3
- package/dist/fe/components/IntegrationsPage/components/ConnectionExport.js +23 -23
- package/dist/fe/components/IntegrationsPage/components/ConnectionForm.js +22 -22
- package/dist/fe/components/IntegrationsPage/components/ConnectionList.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/ConnectionOauthFields.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/ConnectionSettingsTab.js +24 -24
- package/dist/fe/components/IntegrationsPage/components/ConnectionSwitcher.js +19 -19
- package/dist/fe/components/IntegrationsPage/components/ConnectionTabs.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/ConnectionTest.js +21 -21
- package/dist/fe/components/IntegrationsPage/components/ConnectionTransfer.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/CredentialFields.js +19 -19
- package/dist/fe/components/IntegrationsPage/components/CredentialSlotRow.js +8 -8
- package/dist/fe/components/IntegrationsPage/components/EndpointForm.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/EndpointFormFields.js +12 -12
- package/dist/fe/components/IntegrationsPage/components/EndpointList.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/EndpointSample.js +36 -36
- package/dist/fe/components/IntegrationsPage/components/EndpointsTab.js +29 -29
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRow.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.js +60 -60
- package/dist/fe/components/IntegrationsPage/components/MappingAccountFields.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/MappingList.js +23 -23
- package/dist/fe/components/IntegrationsPage/components/MappingPasswordField.js +12 -12
- package/dist/fe/components/IntegrationsPage/components/MappingScheduleFields.js +23 -23
- package/dist/fe/components/IntegrationsPage/components/MappingWriteModeFields.js +31 -31
- package/dist/fe/components/IntegrationsPage/components/MappingsTab.js +56 -56
- package/dist/fe/components/IntegrationsPage/components/PaginationFields.js +11 -11
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRows.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/Primitives.js +28 -28
- package/dist/fe/components/IntegrationsPage/components/ReferenceCheckRows.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/RunConfirmStep.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunHistory.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunHistoryRow.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/RunPanel.js +40 -40
- package/dist/fe/components/IntegrationsPage/components/RunPasswordField.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/RunPlanIssues.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunPlanReferences.js +12 -12
- package/dist/fe/components/IntegrationsPage/components/RunPlanSuggestions.js +11 -11
- package/dist/fe/components/IntegrationsPage/components/RunPlanSummary.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunProgressBar.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunRevertConflicts.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/Skeletons.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/authOptions.js +4 -4
- package/dist/fe/components/IntegrationsPage/components/connectionDraft.js +27 -27
- package/dist/fe/components/IntegrationsPage/components/credentialSlots.js +25 -25
- package/dist/fe/components/IntegrationsPage/components/deleteIsConfirmed.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/fieldMappingOptions.js +4 -4
- package/dist/fe/components/IntegrationsPage/components/formSupport.js +34 -34
- package/dist/fe/components/IntegrationsPage/components/jsonArray.js +14 -14
- package/dist/fe/components/IntegrationsPage/components/jsonObjectField.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/mappingDraft.js +10 -10
- package/dist/fe/components/IntegrationsPage/components/mappingStaleness.js +22 -22
- package/dist/fe/components/IntegrationsPage/components/nextRuns.js +8 -8
- package/dist/fe/components/IntegrationsPage/components/passwordIsNeeded.js +13 -13
- package/dist/fe/components/IntegrationsPage/components/pathParams.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/runFormat.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/settleOwnership.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/useInfiniteList.js +8 -8
- package/dist/fe/components/IntegrationsPage/store/index.js +20 -20
- package/dist/fe/components/IntegrationsPage/store/upsertInto.js +12 -12
- package/dist/fe/components/IntegrationsPage/text/context.js +6 -6
- package/dist/fe/components/IntegrationsPage/text/index.js +18 -18
- package/dist/fe/components/IntegrationsPage/theme/index.js +29 -29
- package/dist/fe/components/IntegrationsPage/types/records.js +10 -10
- package/dist/fe/components/IntegrationsPage/types/results.js +3 -3
- package/dist/fe/components/NotificationCenter/labels.js +17 -17
- package/dist/fe/components/ProfilePage/labels.js +10 -10
- package/dist/fe/components/ResetPasswordPage/labels.js +4 -4
- package/dist/fe/components/SetPasswordPage/labels.js +11 -11
- package/dist/fe/components/UsersPage/labels.js +14 -14
- package/dist/fe/utils/columnUtils.js +24 -24
- package/dist/fe/utils/searchFold.js +36 -36
- package/dist/index.js +6 -6
- package/dist/server.js +6 -6
- package/dist/src/Client/Proxy/authz.js +4 -4
- package/dist/src/Client/Proxy/httpProxy.js +136 -136
- package/dist/src/Client/Proxy/largeBody.js +29 -29
- package/dist/src/Client/Proxy/utils.js +32 -32
- package/dist/src/Client/Proxy/wsProxy.js +59 -59
- package/dist/src/Managers/Redis/index.d.ts +14 -0
- package/dist/src/Nucleus/routes/auth/admin/impersonationStore.d.ts +3 -4
- package/dist/src/Nucleus/routes/auth/refresh/issuedPair.d.ts +67 -0
- package/dist/src/Nucleus/routes/auth/refresh/recordIssued.d.ts +15 -6
- package/dist/src/Nucleus/routes/auth/refresh/refreshChain.d.ts +56 -0
- package/dist/src/Services/Auth/SessionStore/utils.d.ts +2 -0
- package/dist/src/Shared/cron.js +71 -71
- package/dist/src/Shared/redactSecrets.js +156 -156
- package/dist/src/Shared/redaction/bare.js +61 -61
- package/dist/src/Shared/redaction/floor.js +48 -48
- package/dist/src/Shared/redaction/freeText.js +70 -70
- package/dist/src/Shared/redaction/json.js +30 -30
- package/dist/src/Shared/redaction/lists.js +23 -23
- package/dist/src/Shared/redaction/markers.js +28 -28
- package/dist/src/Shared/redaction/names.js +49 -49
- package/dist/src/Shared/redaction/pairs.js +54 -54
- package/dist/src/Shared/redaction/secretString.js +29 -29
- package/dist/src/Shared/redaction/structured.js +52 -52
- package/dist/src/Shared/redaction/walk.js +25 -25
- package/infra/scripts/generate-project.ts +766 -766
- package/infra/templates/README.md +57 -57
- package/infra/templates/backend/.dockerignore +9 -9
- package/infra/templates/backend/.env.example +15 -15
- package/infra/templates/backend/README.md +28 -28
- package/infra/templates/backend/azure-pipelines.yml +135 -135
- package/infra/templates/backend/k8s/Dockerfile +31 -31
- package/infra/templates/backend/k8s/configmap.yaml +26 -26
- package/infra/templates/backend/k8s/deployment.yaml +85 -85
- package/infra/templates/backend/k8s/pvc.yaml +12 -12
- package/infra/templates/backend/k8s/service.yaml +13 -13
- package/infra/templates/backend/tsconfig.json +22 -22
- package/infra/templates/frontend/.dockerignore +10 -10
- package/infra/templates/frontend/.env.example +8 -8
- package/infra/templates/frontend/.env.local.example +10 -10
- package/infra/templates/frontend/README.md +69 -69
- package/infra/templates/frontend/app/[tablename]/page.tsx +37 -37
- package/infra/templates/frontend/app/_components/AuthWrapper/index.tsx +63 -63
- package/infra/templates/frontend/app/authorization/page.tsx +43 -43
- package/infra/templates/frontend/app/change-password/page.tsx +23 -23
- package/infra/templates/frontend/app/devices/page.tsx +127 -127
- package/infra/templates/frontend/app/forgot-password/page.tsx +20 -20
- package/infra/templates/frontend/app/globals.css +28 -28
- package/infra/templates/frontend/app/layout.tsx +35 -35
- package/infra/templates/frontend/app/login/page.tsx +33 -33
- package/infra/templates/frontend/app/page.tsx +565 -565
- package/infra/templates/frontend/app/profile/page.tsx +92 -92
- package/infra/templates/frontend/app/register/page.tsx +27 -27
- package/infra/templates/frontend/app/reset-password/page.tsx +60 -60
- package/infra/templates/frontend/app/set-password/page.tsx +43 -43
- package/infra/templates/frontend/app/ui-docs/page.tsx +52 -52
- package/infra/templates/frontend/app/users/page.tsx +52 -52
- package/infra/templates/frontend/app/verify-email/page.tsx +41 -41
- package/infra/templates/frontend/app/verify-magic-link/page.tsx +46 -46
- package/infra/templates/frontend/azure-pipelines.yml +137 -137
- package/infra/templates/frontend/code-and-design-principles.md +438 -438
- package/infra/templates/frontend/k8s/Dockerfile +50 -50
- package/infra/templates/frontend/k8s/configmap.yaml +18 -18
- package/infra/templates/frontend/k8s/deployment.yaml +72 -72
- package/infra/templates/frontend/k8s/ingress.yaml +36 -36
- package/infra/templates/frontend/k8s/service.yaml +14 -14
- package/infra/templates/frontend/lib/api/endpoints.ts +37 -37
- package/infra/templates/frontend/lib/api/factory.ts +44 -44
- package/infra/templates/frontend/lib/api/hook.ts +10 -10
- package/infra/templates/frontend/next.config.ts +19 -19
- package/infra/templates/frontend/package.json +34 -34
- package/infra/templates/frontend/postcss.config.mjs +5 -5
- package/infra/templates/frontend/server.ts +114 -114
- package/infra/templates/frontend/tsconfig.json +23 -23
- package/package.json +1 -1
- package/public/components/CTA.tsx +25 -25
- package/public/components/Capabilities.tsx +67 -67
- package/public/components/Features.tsx +107 -107
- package/public/components/Footer.tsx +58 -58
- package/public/components/Hero.tsx +51 -51
- package/public/components/Managers.tsx +55 -55
- package/public/components/Nav.tsx +91 -91
- package/public/components/Stack.tsx +36 -36
- package/public/components/docs/Docs.tsx +60 -60
- package/public/components/docs/DocsContent.tsx +176 -176
- package/public/components/docs/DocsRightSidebar.tsx +53 -53
- package/public/components/docs/DocsSidebar.tsx +54 -54
- package/public/components/docs/content/authentication.ts +836 -836
- package/public/components/docs/content/authorization.ts +268 -268
- package/public/components/docs/content/backupRestore.ts +173 -173
- package/public/components/docs/content/clientModule.ts +287 -287
- package/public/components/docs/content/entityCrud.ts +682 -682
- package/public/components/docs/content/monitoring.ts +313 -313
- package/public/components/docs/content/multiTenant.ts +269 -269
- package/public/components/docs/content/oauthApiKeys.ts +325 -325
- package/public/components/docs/content/pubsub.ts +131 -131
- package/public/components/docs/content/storageCdn.ts +171 -171
- package/public/components/docs/content/verification.ts +289 -289
- package/public/components/docs/docsData.ts +113 -113
- package/public/components/docs/index.ts +6 -6
- package/public/components/index.ts +9 -9
- package/public/docs.css +629 -629
- package/public/index.html +81 -81
- package/public/index.tsx +42 -42
- package/public/store.ts +76 -76
- package/public/styles.css +858 -858
- package/schemas/config.nucleus.json +2651 -2651
- package/scripts/audit-purge-noise.ts +120 -120
- package/scripts/build.ts +582 -582
- package/scripts/generate-system-tables-types.ts +18 -18
- package/scripts/generate-types-schema.test.ts +73 -73
- package/scripts/generate-types-schema.ts +1284 -1284
- package/scripts/packagedScripts.test.ts +87 -87
- package/scripts/publish.ts +276 -276
- package/scripts/skillCitations.test.ts +107 -107
- package/scripts/verify-publishable.ts +40 -40
|
@@ -93,17 +93,17 @@ export const { useStore: useIntegrationsStore } = createStore(initial, {
|
|
|
93
93
|
store.endpointsTotal = Math.max(0, store.endpointsTotal - 1);
|
|
94
94
|
store.endpoints = kept;
|
|
95
95
|
}
|
|
96
|
-
/**
|
|
97
|
-
* A mapping cannot outlive the call it reads from.
|
|
98
|
-
*
|
|
99
|
-
* The server deletes them — the foreign key cascades — and this list did
|
|
100
|
-
* not, so the step strip went on counting mappings that no longer existed
|
|
101
|
-
* and the IMPORT step stayed unlocked by them. Pressing it landed on an
|
|
102
|
-
* import whose mapping the server had already removed.
|
|
103
|
-
*
|
|
104
|
-
* Filtered here rather than at the call site because the store is what
|
|
105
|
-
* every one of those readings comes from; a caller that forgot would put
|
|
106
|
-
* the same ghost back.
|
|
96
|
+
/**
|
|
97
|
+
* A mapping cannot outlive the call it reads from.
|
|
98
|
+
*
|
|
99
|
+
* The server deletes them — the foreign key cascades — and this list did
|
|
100
|
+
* not, so the step strip went on counting mappings that no longer existed
|
|
101
|
+
* and the IMPORT step stayed unlocked by them. Pressing it landed on an
|
|
102
|
+
* import whose mapping the server had already removed.
|
|
103
|
+
*
|
|
104
|
+
* Filtered here rather than at the call site because the store is what
|
|
105
|
+
* every one of those readings comes from; a caller that forgot would put
|
|
106
|
+
* the same ghost back.
|
|
107
107
|
*/ const survivors = store.mappings.filter((mapping)=>mapping.endpointId !== id);
|
|
108
108
|
if (survivors.length !== store.mappings.length) {
|
|
109
109
|
store.mappingsTotal = Math.max(0, store.mappingsTotal - (store.mappings.length - survivors.length));
|
|
@@ -163,15 +163,15 @@ export const { useStore: useIntegrationsStore } = createStore(initial, {
|
|
|
163
163
|
store.mappingsLoading = loading;
|
|
164
164
|
},
|
|
165
165
|
selectMapping: (store)=>(id)=>batch(()=>{
|
|
166
|
-
/*
|
|
167
|
-
* Choosing the mapping you are already on changes nothing.
|
|
168
|
-
*
|
|
169
|
-
* Everything below discards what belongs to the PREVIOUS mapping — its
|
|
170
|
-
* plan, its running import, its progress. Selecting the same one again
|
|
171
|
-
* therefore threw away the tracking of an import that was still going:
|
|
172
|
-
* clicking its row in the list while it ran, or arriving at the step from
|
|
173
|
-
* a link that re-selected it, left the progress bar gone and the run
|
|
174
|
-
* apparently finished. It was still writing.
|
|
166
|
+
/*
|
|
167
|
+
* Choosing the mapping you are already on changes nothing.
|
|
168
|
+
*
|
|
169
|
+
* Everything below discards what belongs to the PREVIOUS mapping — its
|
|
170
|
+
* plan, its running import, its progress. Selecting the same one again
|
|
171
|
+
* therefore threw away the tracking of an import that was still going:
|
|
172
|
+
* clicking its row in the list while it ran, or arriving at the step from
|
|
173
|
+
* a link that re-selected it, left the progress bar gone and the run
|
|
174
|
+
* apparently finished. It was still writing.
|
|
175
175
|
*/ if (store.selectedMappingId === id) return;
|
|
176
176
|
store.selectedMappingId = id;
|
|
177
177
|
// A plan belongs to the mapping it was computed for. Showing it against a
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where a saved record goes in a list that may or may not already hold it.
|
|
3
|
-
*
|
|
4
|
-
* Kept as a function so the rule can be tested apart from the store: the panel
|
|
5
|
-
* unmounts the connection rail the moment a connection is chosen, so a newly
|
|
6
|
-
* created connection is selected into a list that never fetched it. Putting the
|
|
7
|
-
* returned record in by hand is what stops the detail below from waiting for a
|
|
8
|
-
* fetch that no mounted component will make.
|
|
9
|
-
*
|
|
10
|
-
* A new record goes to the FRONT — it is the one just made, and the operator is
|
|
11
|
-
* about to be switched to it; an existing one is replaced where it already sits,
|
|
12
|
-
* so an edit never reorders a list somebody is reading.
|
|
1
|
+
/**
|
|
2
|
+
* Where a saved record goes in a list that may or may not already hold it.
|
|
3
|
+
*
|
|
4
|
+
* Kept as a function so the rule can be tested apart from the store: the panel
|
|
5
|
+
* unmounts the connection rail the moment a connection is chosen, so a newly
|
|
6
|
+
* created connection is selected into a list that never fetched it. Putting the
|
|
7
|
+
* returned record in by hand is what stops the detail below from waiting for a
|
|
8
|
+
* fetch that no mounted component will make.
|
|
9
|
+
*
|
|
10
|
+
* A new record goes to the FRONT — it is the one just made, and the operator is
|
|
11
|
+
* about to be switched to it; an existing one is replaced where it already sits,
|
|
12
|
+
* so an edit never reorders a list somebody is reading.
|
|
13
13
|
*/ export function upsertInto(items, record) {
|
|
14
14
|
return items.some((candidate)=>candidate.id === record.id) ? items.map((candidate)=>candidate.id === record.id ? record : candidate) : [
|
|
15
15
|
record,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from 'react';
|
|
4
4
|
import { defaultIntegrationsLabels } from './index';
|
|
5
|
-
/**
|
|
6
|
-
* The panel's words, reachable from any depth without prop-drilling.
|
|
7
|
-
*
|
|
8
|
-
* A context rather than a prop because the strings are needed by controls four
|
|
9
|
-
* levels down — a field row, a badge, a stat cell — and threading them through
|
|
10
|
-
* would put a `labels` prop on components that otherwise take none.
|
|
5
|
+
/**
|
|
6
|
+
* The panel's words, reachable from any depth without prop-drilling.
|
|
7
|
+
*
|
|
8
|
+
* A context rather than a prop because the strings are needed by controls four
|
|
9
|
+
* levels down — a field row, a badge, a stat cell — and threading them through
|
|
10
|
+
* would put a `labels` prop on components that otherwise take none.
|
|
11
11
|
*/ const LabelsContext = /*#__PURE__*/ createContext(defaultIntegrationsLabels);
|
|
12
12
|
export function IntegrationsLabelsProvider({ labels, children }) {
|
|
13
13
|
return /*#__PURE__*/ _jsx(LabelsContext.Provider, {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every word the panel says, in one place — and overridable by the app.
|
|
3
|
-
*
|
|
4
|
-
* The theme could already be replaced slice by slice; the text could not, so a
|
|
5
|
-
* Turkish intranet rendered a Turkish page header above an entirely English
|
|
6
|
-
* panel. From the operator's side that does not read as "in another language",
|
|
7
|
-
* it reads as no explanation at all: `upsert`, `Deduplication column`,
|
|
8
|
-
* `missing rows: ignore` mean nothing to the person whose job this screen is.
|
|
9
|
-
*
|
|
10
|
-
* English stays the default so an app that says nothing still gets sentences,
|
|
11
|
-
* and every group is overridable on its own — an app translating the steps does
|
|
12
|
-
* not have to restate the buttons.
|
|
1
|
+
/**
|
|
2
|
+
* Every word the panel says, in one place — and overridable by the app.
|
|
3
|
+
*
|
|
4
|
+
* The theme could already be replaced slice by slice; the text could not, so a
|
|
5
|
+
* Turkish intranet rendered a Turkish page header above an entirely English
|
|
6
|
+
* panel. From the operator's side that does not read as "in another language",
|
|
7
|
+
* it reads as no explanation at all: `upsert`, `Deduplication column`,
|
|
8
|
+
* `missing rows: ignore` mean nothing to the person whose job this screen is.
|
|
9
|
+
*
|
|
10
|
+
* English stays the default so an app that says nothing still gets sentences,
|
|
11
|
+
* and every group is overridable on its own — an app translating the steps does
|
|
12
|
+
* not have to restate the buttons.
|
|
13
13
|
*/ /** What every app gets before it says otherwise. */ export const defaultIntegrationsLabels = {
|
|
14
14
|
journey: {
|
|
15
15
|
heading: 'How an import works',
|
|
@@ -600,12 +600,12 @@
|
|
|
600
600
|
runPlanAccountsSharePassword: 'Each new record gets an account in the same import — one password for all of them, which people change themselves afterwards. Anyone whose value already has an account is linked to it instead.'
|
|
601
601
|
}
|
|
602
602
|
};
|
|
603
|
-
/**
|
|
604
|
-
* Fills the gaps in an app's labels from the defaults.
|
|
605
|
-
*
|
|
606
|
-
* Two levels deep is everything this shape has, so a group is merged rather
|
|
607
|
-
* than replaced — an app naming the four steps does not lose the sentences that
|
|
608
|
-
* explain them.
|
|
603
|
+
/**
|
|
604
|
+
* Fills the gaps in an app's labels from the defaults.
|
|
605
|
+
*
|
|
606
|
+
* Two levels deep is everything this shape has, so a group is merged rather
|
|
607
|
+
* than replaced — an app naming the four steps does not lose the sentences that
|
|
608
|
+
* explain them.
|
|
609
609
|
*/ export function resolveIntegrationsLabels(overrides) {
|
|
610
610
|
if (!overrides) return defaultIntegrationsLabels;
|
|
611
611
|
const merged = {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every class the panel paints with, in one place.
|
|
3
|
-
*
|
|
4
|
-
* Light is the base and `dark:` is the override, so nothing renders unstyled in
|
|
5
|
-
* either theme. Sizing is mobile-first: the base classes are what a 320px phone
|
|
6
|
-
* gets, and each breakpoint adds room rather than repairing damage.
|
|
7
|
-
*
|
|
8
|
-
* An app can replace any slice of this with {@link extendIntegrationsTheme}
|
|
9
|
-
* without forking the components.
|
|
1
|
+
/**
|
|
2
|
+
* Every class the panel paints with, in one place.
|
|
3
|
+
*
|
|
4
|
+
* Light is the base and `dark:` is the override, so nothing renders unstyled in
|
|
5
|
+
* either theme. Sizing is mobile-first: the base classes are what a 320px phone
|
|
6
|
+
* gets, and each breakpoint adds room rather than repairing damage.
|
|
7
|
+
*
|
|
8
|
+
* An app can replace any slice of this with {@link extendIntegrationsTheme}
|
|
9
|
+
* without forking the components.
|
|
10
10
|
*/ /** Shared so a control and its skeleton cannot drift apart in height. */ const CONTROL = 'h-11 rounded-lg text-sm sm:h-10';
|
|
11
|
-
/**
|
|
12
|
-
* Micro-caps for field labels.
|
|
13
|
-
*
|
|
14
|
-
* A form of twenty identical `text-sm` labels reads as a wall. Making the label
|
|
15
|
-
* smaller and wider-tracked than its value gives every row an obvious top and
|
|
16
|
-
* bottom, which is what lets an eye skip the ones it does not need.
|
|
11
|
+
/**
|
|
12
|
+
* Micro-caps for field labels.
|
|
13
|
+
*
|
|
14
|
+
* A form of twenty identical `text-sm` labels reads as a wall. Making the label
|
|
15
|
+
* smaller and wider-tracked than its value gives every row an obvious top and
|
|
16
|
+
* bottom, which is what lets an eye skip the ones it does not need.
|
|
17
17
|
*/ const LABEL = 'font-semibold text-[11px] uppercase tracking-wider';
|
|
18
18
|
export const integrationsPageTheme = {
|
|
19
19
|
container: 'flex flex-col gap-5 text-slate-900 sm:gap-6 dark:text-slate-100',
|
|
@@ -76,14 +76,14 @@ export const integrationsPageTheme = {
|
|
|
76
76
|
purpose: 'mt-1 text-slate-600 text-xs leading-relaxed dark:text-slate-400',
|
|
77
77
|
evidence: 'mt-1.5 font-semibold text-[11px] text-emerald-700 dark:text-emerald-400'
|
|
78
78
|
},
|
|
79
|
-
/**
|
|
80
|
-
* A form of twenty controls is not a form, it is a wall.
|
|
81
|
-
*
|
|
82
|
-
* The mapping screen asks five separate questions — what this reads, where it
|
|
83
|
-
* lands, what must already exist, whether it opens a login, when it runs — and
|
|
84
|
-
* they were one unbroken column of inputs and paragraphs. Sectioned, each
|
|
85
|
-
* question is a block with a name, and the eye can skip the ones it does not
|
|
86
|
-
* need.
|
|
79
|
+
/**
|
|
80
|
+
* A form of twenty controls is not a form, it is a wall.
|
|
81
|
+
*
|
|
82
|
+
* The mapping screen asks five separate questions — what this reads, where it
|
|
83
|
+
* lands, what must already exist, whether it opens a login, when it runs — and
|
|
84
|
+
* they were one unbroken column of inputs and paragraphs. Sectioned, each
|
|
85
|
+
* question is a block with a name, and the eye can skip the ones it does not
|
|
86
|
+
* need.
|
|
87
87
|
*/ section: {
|
|
88
88
|
wrapper: 'rounded-2xl border border-slate-200/70 bg-slate-50/50 p-4 sm:p-5 dark:border-slate-800 dark:bg-slate-950/30',
|
|
89
89
|
header: 'mb-3 flex flex-col gap-0.5',
|
|
@@ -138,12 +138,12 @@ export const integrationsPageTheme = {
|
|
|
138
138
|
label: 'font-medium text-slate-600 text-xs tabular-nums dark:text-slate-400'
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
/**
|
|
142
|
-
* Overrides a slice of the theme, leaving the rest intact.
|
|
143
|
-
*
|
|
144
|
-
* One level of nesting is all the theme has, so a shallow merge per group is
|
|
145
|
-
* exactly right — and it means an app overriding one badge colour does not have
|
|
146
|
-
* to restate the other five.
|
|
141
|
+
/**
|
|
142
|
+
* Overrides a slice of the theme, leaving the rest intact.
|
|
143
|
+
*
|
|
144
|
+
* One level of nesting is all the theme has, so a shallow merge per group is
|
|
145
|
+
* exactly right — and it means an app overriding one badge colour does not have
|
|
146
|
+
* to restate the other five.
|
|
147
147
|
*/ export function extendIntegrationsTheme(overrides) {
|
|
148
148
|
const base = integrationsPageTheme;
|
|
149
149
|
const merged = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The panel's contract with whatever app mounts it.
|
|
3
|
-
*
|
|
4
|
-
* Every call is an injected action, exactly like the other pages in this kit —
|
|
5
|
-
* the component knows the SHAPE of an integration but nothing about how this
|
|
6
|
-
* particular app talks to its server.
|
|
7
|
-
*
|
|
8
|
-
* The record types below deliberately mirror the system tables rather than
|
|
9
|
-
* re-modelling them, so a column added to the framework does not need a second
|
|
10
|
-
* definition here to become visible.
|
|
1
|
+
/**
|
|
2
|
+
* The panel's contract with whatever app mounts it.
|
|
3
|
+
*
|
|
4
|
+
* Every call is an injected action, exactly like the other pages in this kit —
|
|
5
|
+
* the component knows the SHAPE of an integration but nothing about how this
|
|
6
|
+
* particular app talks to its server.
|
|
7
|
+
*
|
|
8
|
+
* The record types below deliberately mirror the system tables rather than
|
|
9
|
+
* re-modelling them, so a column added to the framework does not need a second
|
|
10
|
+
* definition here to become visible.
|
|
11
11
|
*/ export { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shapes the panel RENDERS rather than stores: what a call reported, what a
|
|
3
|
-
* run would do, and how far a running one has got.
|
|
1
|
+
/**
|
|
2
|
+
* Shapes the panel RENDERS rather than stores: what a call reported, what a
|
|
3
|
+
* run would do, and how far a running one has got.
|
|
4
4
|
*/ /** How far a running import has got, as the server reports it. */ export { };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every word the notification centre says, so a portal can say them in its own
|
|
3
|
-
* language.
|
|
4
|
-
*
|
|
5
|
-
* One label was already a prop — `title` — which is the tell: an intranet in
|
|
6
|
-
* Turkish set the heading to "Bildirimler" and everything under it still said
|
|
7
|
-
* "Mark all as read", "No notifications yet", "Loading notifications..." and
|
|
8
|
-
* "3d ago". This is the panel an employee opens to find out what happened
|
|
9
|
-
* while they were away, so it is read more often than any form in the product.
|
|
10
|
-
*
|
|
11
|
-
* Defaults stay English, so an installation that passes no labels is
|
|
12
|
-
* completely unaffected.
|
|
13
|
-
*
|
|
14
|
-
* Anything that interpolates a value is a FUNCTION of that value, never a
|
|
15
|
-
* translated fragment glued to an untranslated one: "3d ago" is "3 gün önce"
|
|
16
|
-
* in Turkish, and the bell's accessible name puts the count in a different
|
|
17
|
-
* place again — a concatenation would produce a sentence in neither language.
|
|
1
|
+
/**
|
|
2
|
+
* Every word the notification centre says, so a portal can say them in its own
|
|
3
|
+
* language.
|
|
4
|
+
*
|
|
5
|
+
* One label was already a prop — `title` — which is the tell: an intranet in
|
|
6
|
+
* Turkish set the heading to "Bildirimler" and everything under it still said
|
|
7
|
+
* "Mark all as read", "No notifications yet", "Loading notifications..." and
|
|
8
|
+
* "3d ago". This is the panel an employee opens to find out what happened
|
|
9
|
+
* while they were away, so it is read more often than any form in the product.
|
|
10
|
+
*
|
|
11
|
+
* Defaults stay English, so an installation that passes no labels is
|
|
12
|
+
* completely unaffected.
|
|
13
|
+
*
|
|
14
|
+
* Anything that interpolates a value is a FUNCTION of that value, never a
|
|
15
|
+
* translated fragment glued to an untranslated one: "3d ago" is "3 gün önce"
|
|
16
|
+
* in Turkish, and the bell's accessible name puts the count in a different
|
|
17
|
+
* place again — a concatenation would produce a sentence in neither language.
|
|
18
18
|
*/ export const DEFAULT_NOTIFICATION_CENTER_LABELS = {
|
|
19
19
|
title: 'Notifications',
|
|
20
20
|
markAllAsSeen: 'Mark all as read',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
-
*
|
|
4
|
-
* The profile page had no contract at all: forty-odd sentences were welded into
|
|
5
|
-
* the components — the section headings, both modals, every placeholder, the
|
|
6
|
-
* empty states, the icon titles a screen reader announces, and the two lines of
|
|
7
|
-
* account settings. A Turkish intranet could translate the shell around this
|
|
8
|
-
* page and still hand its employees "No phone numbers added yet".
|
|
9
|
-
*
|
|
10
|
-
* Defaults stay English, so an installation that passes no labels is unaffected.
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* The profile page had no contract at all: forty-odd sentences were welded into
|
|
5
|
+
* the components — the section headings, both modals, every placeholder, the
|
|
6
|
+
* empty states, the icon titles a screen reader announces, and the two lines of
|
|
7
|
+
* account settings. A Turkish intranet could translate the shell around this
|
|
8
|
+
* page and still hand its employees "No phone numbers added yet".
|
|
9
|
+
*
|
|
10
|
+
* Defaults stay English, so an installation that passes no labels is unaffected.
|
|
11
11
|
*/ const ADDRESS_TYPE_NAMES = {
|
|
12
12
|
home: 'Home',
|
|
13
13
|
residential: 'Residential',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
-
*
|
|
4
|
-
* Defaults stay English, so nothing that does not pass labels changes.
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* Defaults stay English, so nothing that does not pass labels changes.
|
|
5
5
|
*/ export const DEFAULT_RESET_PASSWORD_LABELS = {
|
|
6
6
|
title: 'Reset Password',
|
|
7
7
|
subtitle: 'Enter your new password below.',
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
-
*
|
|
4
|
-
* Two of them were already props — `inviteTitle` and `inviteSubtitle` — which
|
|
5
|
-
* is the tell: a Turkish intranet passed those, and the page underneath still
|
|
6
|
-
* said "Verifying Invitation", "Enter your new password" and "Need help?
|
|
7
|
-
* Contact your system administrator." This is the screen every employee meets
|
|
8
|
-
* once, when they activate the account somebody made for them, and it is the
|
|
9
|
-
* first thing the product says to them.
|
|
10
|
-
*
|
|
11
|
-
* Defaults stay English, so nothing that does not pass labels changes.
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* Two of them were already props — `inviteTitle` and `inviteSubtitle` — which
|
|
5
|
+
* is the tell: a Turkish intranet passed those, and the page underneath still
|
|
6
|
+
* said "Verifying Invitation", "Enter your new password" and "Need help?
|
|
7
|
+
* Contact your system administrator." This is the screen every employee meets
|
|
8
|
+
* once, when they activate the account somebody made for them, and it is the
|
|
9
|
+
* first thing the product says to them.
|
|
10
|
+
*
|
|
11
|
+
* Defaults stay English, so nothing that does not pass labels changes.
|
|
12
12
|
*/ export const DEFAULT_SET_PASSWORD_LABELS = {
|
|
13
13
|
verifying: 'Verifying Invitation',
|
|
14
14
|
verifyingSubtitle: 'Please wait while we verify your invitation link...',
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every word the user-management screen says, so a portal can say them in its
|
|
3
|
-
* own language.
|
|
4
|
-
*
|
|
5
|
-
* The screen had a `title` prop and nothing else: an installation could rename
|
|
6
|
-
* the heading and then the whole page under it still said "Invite User",
|
|
7
|
-
* "No users found", "Never logged in", "Lock Account" and "Send Invitation".
|
|
8
|
-
* This is the screen an administrator lives on — it lists every colleague in
|
|
9
|
-
* the company and every button on it changes somebody's access — so a Turkish
|
|
10
|
-
* portal reading a Turkish heading over an English page is the worst place for
|
|
11
|
-
* the seam to show.
|
|
12
|
-
*
|
|
13
|
-
* Defaults stay English, so an installation that passes no labels is
|
|
14
|
-
* completely unaffected.
|
|
1
|
+
/**
|
|
2
|
+
* Every word the user-management screen says, so a portal can say them in its
|
|
3
|
+
* own language.
|
|
4
|
+
*
|
|
5
|
+
* The screen had a `title` prop and nothing else: an installation could rename
|
|
6
|
+
* the heading and then the whole page under it still said "Invite User",
|
|
7
|
+
* "No users found", "Never logged in", "Lock Account" and "Send Invitation".
|
|
8
|
+
* This is the screen an administrator lives on — it lists every colleague in
|
|
9
|
+
* the company and every button on it changes somebody's access — so a Turkish
|
|
10
|
+
* portal reading a Turkish heading over an English page is the worst place for
|
|
11
|
+
* the seam to show.
|
|
12
|
+
*
|
|
13
|
+
* Defaults stay English, so an installation that passes no labels is
|
|
14
|
+
* completely unaffected.
|
|
15
15
|
*/ export const DEFAULT_USERS_PAGE_LABELS = {
|
|
16
16
|
pageTitle: 'User Management',
|
|
17
17
|
inviteUser: 'Invite User',
|
|
@@ -115,37 +115,37 @@ const DATE_COLUMN_TYPES = [
|
|
|
115
115
|
'timestamp',
|
|
116
116
|
'timestamptz'
|
|
117
117
|
];
|
|
118
|
-
/**
|
|
119
|
-
* Check if column is searchable (text-based)
|
|
118
|
+
/**
|
|
119
|
+
* Check if column is searchable (text-based)
|
|
120
120
|
*/ export function isSearchableColumn(column) {
|
|
121
121
|
return TEXT_COLUMN_TYPES.includes(column.type);
|
|
122
122
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Check if column has enum values (for SelectBox filter)
|
|
125
|
-
* Handles both enumValues array and enum.values from customType columns
|
|
123
|
+
/**
|
|
124
|
+
* Check if column has enum values (for SelectBox filter)
|
|
125
|
+
* Handles both enumValues array and enum.values from customType columns
|
|
126
126
|
*/ export function isEnumColumn(column) {
|
|
127
127
|
if ((column.enumValues?.length ?? 0) > 0) return true;
|
|
128
128
|
if ((column.enum?.values?.length ?? 0) > 0) return true;
|
|
129
129
|
if (column.type === 'customType' && column.enum) return true;
|
|
130
130
|
return false;
|
|
131
131
|
}
|
|
132
|
-
/**
|
|
133
|
-
* Check if column is boolean (for SelectBox filter with Yes/No)
|
|
132
|
+
/**
|
|
133
|
+
* Check if column is boolean (for SelectBox filter with Yes/No)
|
|
134
134
|
*/ export function isBooleanColumn(column) {
|
|
135
135
|
return column.type === 'boolean';
|
|
136
136
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Check if column is numeric (for RangePicker filter)
|
|
137
|
+
/**
|
|
138
|
+
* Check if column is numeric (for RangePicker filter)
|
|
139
139
|
*/ export function isNumericColumn(column) {
|
|
140
140
|
return NUMERIC_COLUMN_TYPES.includes(column.type);
|
|
141
141
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Check if column is date/time (for DatePicker filter)
|
|
142
|
+
/**
|
|
143
|
+
* Check if column is date/time (for DatePicker filter)
|
|
144
144
|
*/ export function isDateColumn(column) {
|
|
145
145
|
return DATE_COLUMN_TYPES.includes(column.type);
|
|
146
146
|
}
|
|
147
|
-
/**
|
|
148
|
-
* Check if column is a decimal type (for formatting)
|
|
147
|
+
/**
|
|
148
|
+
* Check if column is a decimal type (for formatting)
|
|
149
149
|
*/ export function isDecimalColumn(column) {
|
|
150
150
|
return [
|
|
151
151
|
'numeric',
|
|
@@ -155,8 +155,8 @@ const DATE_COLUMN_TYPES = [
|
|
|
155
155
|
'money'
|
|
156
156
|
].includes(column.type);
|
|
157
157
|
}
|
|
158
|
-
/**
|
|
159
|
-
* Get enum values from column
|
|
158
|
+
/**
|
|
159
|
+
* Get enum values from column
|
|
160
160
|
*/ export function getEnumValues(column) {
|
|
161
161
|
if (column.enumValues?.length) {
|
|
162
162
|
return column.enumValues;
|
|
@@ -166,24 +166,24 @@ const DATE_COLUMN_TYPES = [
|
|
|
166
166
|
}
|
|
167
167
|
return [];
|
|
168
168
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Filter columns that can be searched (text-type columns)
|
|
169
|
+
/**
|
|
170
|
+
* Filter columns that can be searched (text-type columns)
|
|
171
171
|
*/ export function getSearchableColumns(columns) {
|
|
172
172
|
return columns.filter(isSearchableColumn);
|
|
173
173
|
}
|
|
174
|
-
/**
|
|
175
|
-
* Filter columns that can be filtered with enum/boolean SelectBox
|
|
174
|
+
/**
|
|
175
|
+
* Filter columns that can be filtered with enum/boolean SelectBox
|
|
176
176
|
*/ export function getEnumFilterColumns(columns) {
|
|
177
177
|
return columns.filter((col)=>isEnumColumn(col) || isBooleanColumn(col));
|
|
178
178
|
}
|
|
179
|
-
/**
|
|
180
|
-
* Filter columns that can be filtered with RangePicker (numeric)
|
|
179
|
+
/**
|
|
180
|
+
* Filter columns that can be filtered with RangePicker (numeric)
|
|
181
181
|
*/ export function getNumericFilterColumns(columns) {
|
|
182
182
|
return columns.filter((col)=>isNumericColumn(col) && !col.primaryKey);
|
|
183
183
|
}
|
|
184
|
-
/**
|
|
185
|
-
* Filter columns that can be filtered with DatePicker
|
|
186
|
-
* Includes base date columns (created_at, updated_at)
|
|
184
|
+
/**
|
|
185
|
+
* Filter columns that can be filtered with DatePicker
|
|
186
|
+
* Includes base date columns (created_at, updated_at)
|
|
187
187
|
*/ export function getDateFilterColumns(columns) {
|
|
188
188
|
return columns.filter((col)=>isDateColumn(col));
|
|
189
189
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Folding a string down to what a person typing into a search box meant.
|
|
3
|
-
*
|
|
4
|
-
* A search box that compares `toLowerCase()` to `toLowerCase()` only works for
|
|
5
|
-
* the alphabet it was written in. Everywhere else it fails in two directions at
|
|
6
|
-
* once, and the dotted i is the clearest case: `İSMAİL`.toLowerCase() is not
|
|
7
|
-
* `ismail` but `i̇smai̇l` — an `i` followed by a combining dot, which is a
|
|
8
|
-
* character nobody's keyboard produces. Type `ismail` into a directory of eight
|
|
9
|
-
* hundred people exported in capitals and it finds none of them. The same box
|
|
10
|
-
* cannot find `Şafak` from `safak`, or `Café` from `cafe`, which is how people
|
|
11
|
-
* search when the marks are a keystroke away rather than a key.
|
|
12
|
-
*
|
|
13
|
-
* The fold is three passes and no per-language table:
|
|
14
|
-
*
|
|
15
|
-
* 1. Lower-case with the INVARIANT rules. Turkish's own casing would send `I`
|
|
16
|
-
* to `ı`, which is right for writing and wrong here — a search box wants
|
|
17
|
-
* `I`, `İ`, `ı` and `i` to end up as the same letter, and they do once the
|
|
18
|
-
* marks come off.
|
|
19
|
-
* 2. Decompose (NFD) and drop the combining marks. This is what turns the
|
|
20
|
-
* stray dot above into nothing, and `é`, `ş`, `ğ`, `ü`, `ö`, `ç` into their
|
|
21
|
-
* plain letters, for every script that composes that way.
|
|
22
|
-
* 3. Map the few letters that are their own character rather than a letter
|
|
23
|
-
* plus a mark, so NFD has nothing to strip: the dotless `ı`, and `ø`, `ł`,
|
|
24
|
-
* `đ`, `ß`, `æ`, `œ`.
|
|
25
|
-
*
|
|
26
|
-
* Language-neutral by construction, which is the point: the kit ships to
|
|
27
|
-
* whoever installs it.
|
|
1
|
+
/**
|
|
2
|
+
* Folding a string down to what a person typing into a search box meant.
|
|
3
|
+
*
|
|
4
|
+
* A search box that compares `toLowerCase()` to `toLowerCase()` only works for
|
|
5
|
+
* the alphabet it was written in. Everywhere else it fails in two directions at
|
|
6
|
+
* once, and the dotted i is the clearest case: `İSMAİL`.toLowerCase() is not
|
|
7
|
+
* `ismail` but `i̇smai̇l` — an `i` followed by a combining dot, which is a
|
|
8
|
+
* character nobody's keyboard produces. Type `ismail` into a directory of eight
|
|
9
|
+
* hundred people exported in capitals and it finds none of them. The same box
|
|
10
|
+
* cannot find `Şafak` from `safak`, or `Café` from `cafe`, which is how people
|
|
11
|
+
* search when the marks are a keystroke away rather than a key.
|
|
12
|
+
*
|
|
13
|
+
* The fold is three passes and no per-language table:
|
|
14
|
+
*
|
|
15
|
+
* 1. Lower-case with the INVARIANT rules. Turkish's own casing would send `I`
|
|
16
|
+
* to `ı`, which is right for writing and wrong here — a search box wants
|
|
17
|
+
* `I`, `İ`, `ı` and `i` to end up as the same letter, and they do once the
|
|
18
|
+
* marks come off.
|
|
19
|
+
* 2. Decompose (NFD) and drop the combining marks. This is what turns the
|
|
20
|
+
* stray dot above into nothing, and `é`, `ş`, `ğ`, `ü`, `ö`, `ç` into their
|
|
21
|
+
* plain letters, for every script that composes that way.
|
|
22
|
+
* 3. Map the few letters that are their own character rather than a letter
|
|
23
|
+
* plus a mark, so NFD has nothing to strip: the dotless `ı`, and `ø`, `ł`,
|
|
24
|
+
* `đ`, `ß`, `æ`, `œ`.
|
|
25
|
+
*
|
|
26
|
+
* Language-neutral by construction, which is the point: the kit ships to
|
|
27
|
+
* whoever installs it.
|
|
28
28
|
*/ /** Letters with no decomposition, so step 2 cannot reach them. */ const STANDALONE = {
|
|
29
29
|
ı: 'i',
|
|
30
30
|
ø: 'o',
|
|
@@ -43,15 +43,15 @@ export function foldForSearch(value) {
|
|
|
43
43
|
for (const char of lowered)out += STANDALONE[char] ?? char;
|
|
44
44
|
return out;
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
47
|
-
* True when every word typed appears somewhere in the given fields.
|
|
48
|
-
*
|
|
49
|
-
* Word by word rather than as one string, because the reader should not have to
|
|
50
|
-
* guess the order a row prints its parts in: `yalgi genel` finds the general
|
|
51
|
-
* manager whether the list renders the name before the post or after it.
|
|
52
|
-
*
|
|
53
|
-
* An empty query matches everything, so a caller can hand the raw input over
|
|
54
|
-
* without checking it first.
|
|
46
|
+
/**
|
|
47
|
+
* True when every word typed appears somewhere in the given fields.
|
|
48
|
+
*
|
|
49
|
+
* Word by word rather than as one string, because the reader should not have to
|
|
50
|
+
* guess the order a row prints its parts in: `yalgi genel` finds the general
|
|
51
|
+
* manager whether the list renders the name before the post or after it.
|
|
52
|
+
*
|
|
53
|
+
* An empty query matches everything, so a caller can hand the raw input over
|
|
54
|
+
* without checking it first.
|
|
55
55
|
*/ export function matchesQuery(query, fields) {
|
|
56
56
|
const words = foldForSearch(query).split(/\s+/).filter(Boolean);
|
|
57
57
|
if (words.length === 0) return true;
|