@mistriwork/engine 0.0.0-stage → 1.0.0-rc.10
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 +21 -0
- package/README.md +17 -2
- package/dist/adapters/adapter.d.ts +693 -0
- package/dist/adapters/adapter.js +444 -0
- package/dist/adapters/cache/cacheStore.d.ts +75 -0
- package/dist/adapters/cache/cacheStore.js +160 -0
- package/dist/adapters/cache/resp.d.ts +52 -0
- package/dist/adapters/cache/resp.js +237 -0
- package/dist/adapters/commands/canonicalJson.d.ts +19 -0
- package/dist/adapters/commands/canonicalJson.js +154 -0
- package/dist/adapters/connect.d.ts +29 -0
- package/dist/adapters/connect.js +40 -0
- package/dist/adapters/connectionBudget.d.ts +101 -0
- package/dist/adapters/connectionBudget.js +128 -0
- package/dist/adapters/dbLatency.d.ts +35 -0
- package/dist/adapters/dbLatency.js +79 -0
- package/dist/adapters/epochCache.d.ts +50 -0
- package/dist/adapters/epochCache.js +85 -0
- package/dist/adapters/http/egress.d.ts +48 -0
- package/dist/adapters/http/egress.js +175 -0
- package/dist/adapters/http/httpAdapter.d.ts +71 -0
- package/dist/adapters/http/httpAdapter.js +512 -0
- package/dist/adapters/http/httpDescription.d.ts +32 -0
- package/dist/adapters/http/httpDescription.js +246 -0
- package/dist/adapters/http/openapi.d.ts +98 -0
- package/dist/adapters/http/openapi.js +487 -0
- package/dist/adapters/layoutRefusal.d.ts +24 -0
- package/dist/adapters/layoutRefusal.js +35 -0
- package/dist/adapters/net/networkPolicy.d.ts +44 -0
- package/dist/adapters/net/networkPolicy.js +123 -0
- package/dist/adapters/net/untrustedDatabase.d.ts +18 -0
- package/dist/adapters/net/untrustedDatabase.js +120 -0
- package/dist/adapters/poolAdmission.d.ts +43 -0
- package/dist/adapters/poolAdmission.js +184 -0
- package/dist/adapters/poolMetrics.d.ts +121 -0
- package/dist/adapters/poolMetrics.js +185 -0
- package/dist/adapters/postgres.d.ts +436 -0
- package/dist/adapters/postgres.js +1890 -0
- package/dist/adapters/postgresCatalog.d.ts +96 -0
- package/dist/adapters/postgresCatalog.js +387 -0
- package/dist/adapters/postgresCatalogDigest.d.ts +30 -0
- package/dist/adapters/postgresCatalogDigest.js +87 -0
- package/dist/adapters/postgresCatalogRows.d.ts +62 -0
- package/dist/adapters/postgresCatalogRows.js +37 -0
- package/dist/adapters/postgresDates.d.ts +1 -0
- package/dist/adapters/postgresDates.js +39 -0
- package/dist/adapters/postgresMaintenance.d.ts +33 -0
- package/dist/adapters/postgresMaintenance.js +179 -0
- package/dist/adapters/postgresPool.d.ts +255 -0
- package/dist/adapters/postgresPool.js +838 -0
- package/dist/adapters/postgresPooler.d.ts +28 -0
- package/dist/adapters/postgresPooler.js +267 -0
- package/dist/adapters/postgresReadCatalog.d.ts +31 -0
- package/dist/adapters/postgresReadCatalog.js +226 -0
- package/dist/adapters/postgresReadSnapshot.d.ts +46 -0
- package/dist/adapters/postgresReadSnapshot.js +133 -0
- package/dist/adapters/postgresSchemaEpoch.d.ts +24 -0
- package/dist/adapters/postgresSchemaEpoch.js +149 -0
- package/dist/adapters/postgresTransactionHandle.d.ts +173 -0
- package/dist/adapters/postgresTransactionHandle.js +524 -0
- package/dist/adapters/postgresValues.d.ts +30 -0
- package/dist/adapters/postgresValues.js +75 -0
- package/dist/adapters/replicas.d.ts +70 -0
- package/dist/adapters/replicas.js +208 -0
- package/dist/adapters/reservedSql.d.ts +38 -0
- package/dist/adapters/reservedSql.js +264 -0
- package/dist/adapters/rolePrivileges.d.ts +17 -0
- package/dist/adapters/rolePrivileges.js +22 -0
- package/dist/adapters/scoped/keyRows.d.ts +65 -0
- package/dist/adapters/scoped/keyRows.js +173 -0
- package/dist/adapters/scoped/postgresScopeCatalog.d.ts +16 -0
- package/dist/adapters/scoped/postgresScopeCatalog.js +117 -0
- package/dist/adapters/scoped/scopedCommandOperations.d.ts +5 -0
- package/dist/adapters/scoped/scopedCommandOperations.js +48 -0
- package/dist/adapters/scoped/scopedReads.d.ts +20 -0
- package/dist/adapters/scoped/scopedReads.js +174 -0
- package/dist/adapters/scoped/scopedTransaction.d.ts +89 -0
- package/dist/adapters/scoped/scopedTransaction.js +303 -0
- package/dist/adapters/scoped/sqliteScopeCatalog.d.ts +16 -0
- package/dist/adapters/scoped/sqliteScopeCatalog.js +241 -0
- package/dist/adapters/scoped/updateGuard.d.ts +3 -0
- package/dist/adapters/scoped/updateGuard.js +40 -0
- package/dist/adapters/serverSettings.d.ts +45 -0
- package/dist/adapters/serverSettings.js +46 -0
- package/dist/adapters/sqlite.d.ts +262 -0
- package/dist/adapters/sqlite.js +1434 -0
- package/dist/adapters/sqliteCostlyReads.d.ts +33 -0
- package/dist/adapters/sqliteCostlyReads.js +49 -0
- package/dist/adapters/sqliteDecimals.d.ts +22 -0
- package/dist/adapters/sqliteDecimals.js +57 -0
- package/dist/adapters/sqliteHandles.d.ts +43 -0
- package/dist/adapters/sqliteHandles.js +143 -0
- package/dist/adapters/sqliteStatementProcess.d.ts +29 -0
- package/dist/adapters/sqliteStatementProcess.js +131 -0
- package/dist/adapters/statementControl.d.ts +34 -0
- package/dist/adapters/statementControl.js +90 -0
- package/dist/adapters/storeHost.d.ts +130 -0
- package/dist/adapters/storeHost.js +13 -0
- package/dist/adapters/telemetry/drivers.d.ts +21 -0
- package/dist/adapters/telemetry/drivers.js +321 -0
- package/dist/adapters/telemetry/metrics.d.ts +63 -0
- package/dist/adapters/telemetry/metrics.js +122 -0
- package/dist/adapters/telemetry/otlp.d.ts +12 -0
- package/dist/adapters/telemetry/otlp.js +320 -0
- package/dist/adapters/telemetry/otlpEncode.d.ts +48 -0
- package/dist/adapters/telemetry/otlpEncode.js +366 -0
- package/dist/adapters/telemetry/otlpEnv.d.ts +1 -0
- package/dist/adapters/telemetry/otlpEnv.js +12 -0
- package/dist/adapters/telemetry/serverTiming.d.ts +83 -0
- package/dist/adapters/telemetry/serverTiming.js +503 -0
- package/dist/adapters/telemetry/start.d.ts +10 -0
- package/dist/adapters/telemetry/start.js +25 -0
- package/dist/adapters/telemetry/statement.d.ts +16 -0
- package/dist/adapters/telemetry/statement.js +134 -0
- package/dist/adapters/telemetry/trace.d.ts +127 -0
- package/dist/adapters/telemetry/trace.js +295 -0
- package/dist/adapters/writeAhead.d.ts +27 -0
- package/dist/adapters/writeAhead.js +46 -0
- package/dist/adapters/writeAttribution.d.ts +18 -0
- package/dist/adapters/writeAttribution.js +23 -0
- package/dist/adapters/writeCapture.d.ts +73 -0
- package/dist/adapters/writeCapture.js +20 -0
- package/dist/adapters/writeLanes.d.ts +94 -0
- package/dist/adapters/writeLanes.js +232 -0
- package/dist/engine.d.ts +15 -0
- package/dist/engine.js +13 -0
- package/dist/server/auth/credentials.d.ts +61 -0
- package/dist/server/auth/credentials.js +260 -0
- package/dist/server/cacheService.d.ts +50 -0
- package/dist/server/cacheService.js +110 -0
- package/dist/server/cli/args.d.ts +176 -0
- package/dist/server/cli/args.js +342 -0
- package/dist/server/cli/bin.d.ts +5 -0
- package/dist/server/cli/bin.js +66 -0
- package/dist/server/cli/browser.d.ts +15 -0
- package/dist/server/cli/browser.js +37 -0
- package/dist/server/cli/config.d.ts +50 -0
- package/dist/server/cli/config.js +206 -0
- package/dist/server/cli/startup.d.ts +36 -0
- package/dist/server/cli/startup.js +128 -0
- package/dist/server/cli/startupOptions.d.ts +63 -0
- package/dist/server/cli/startupOptions.js +143 -0
- package/dist/server/cli/subcommand.d.ts +28 -0
- package/dist/server/cli/subcommand.js +32 -0
- package/dist/server/cli/usage.d.ts +13 -0
- package/dist/server/cli/usage.js +31 -0
- package/dist/server/clientHttp.d.ts +184 -0
- package/dist/server/clientHttp.js +700 -0
- package/dist/server/clientSurface.d.ts +128 -0
- package/dist/server/clientSurface.js +182 -0
- package/dist/server/columnGrants.d.ts +103 -0
- package/dist/server/columnGrants.js +730 -0
- package/dist/server/compileCache.d.ts +1 -0
- package/dist/server/compileCache.js +30 -0
- package/dist/server/config/locations.d.ts +1 -0
- package/dist/server/config/locations.js +15 -0
- package/dist/server/configPaths.d.ts +7 -0
- package/dist/server/configPaths.js +34 -0
- package/dist/server/configSections.d.ts +64 -0
- package/dist/server/configSections.js +72 -0
- package/dist/server/connectionRedaction.d.ts +30 -0
- package/dist/server/connectionRedaction.js +77 -0
- package/dist/server/connections.d.ts +353 -0
- package/dist/server/connections.js +978 -0
- package/dist/server/constraints.d.ts +82 -0
- package/dist/server/constraints.js +169 -0
- package/dist/server/demo.d.ts +9 -0
- package/dist/server/demo.js +554 -0
- package/dist/server/devclient.d.ts +108 -0
- package/dist/server/devclient.js +361 -0
- package/dist/server/evidence.d.ts +55 -0
- package/dist/server/evidence.js +323 -0
- package/dist/server/hiddenColumns.d.ts +32 -0
- package/dist/server/hiddenColumns.js +238 -0
- package/dist/server/http/baselineHeaders.d.ts +24 -0
- package/dist/server/http/baselineHeaders.js +12 -0
- package/dist/server/http/captured.d.ts +35 -0
- package/dist/server/http/captured.js +73 -0
- package/dist/server/http/clock.d.ts +1 -0
- package/dist/server/http/clock.js +14 -0
- package/dist/server/http/connectionSource.d.ts +4 -0
- package/dist/server/http/connectionSource.js +48 -0
- package/dist/server/http/context.d.ts +189 -0
- package/dist/server/http/context.js +11 -0
- package/dist/server/http/crawlerText.d.ts +15 -0
- package/dist/server/http/crawlerText.js +32 -0
- package/dist/server/http/dataRoutes.d.ts +88 -0
- package/dist/server/http/dataRoutes.js +137 -0
- package/dist/server/http/door.d.ts +57 -0
- package/dist/server/http/door.js +39 -0
- package/dist/server/http/exportRoute.d.ts +15 -0
- package/dist/server/http/exportRoute.js +320 -0
- package/dist/server/http/firstPaint.d.ts +108 -0
- package/dist/server/http/firstPaint.js +262 -0
- package/dist/server/http/httpOperationRoutes.d.ts +11 -0
- package/dist/server/http/httpOperationRoutes.js +50 -0
- package/dist/server/http/pageReads.d.ts +20 -0
- package/dist/server/http/pageReads.js +205 -0
- package/dist/server/http/pageRoutes.d.ts +39 -0
- package/dist/server/http/pageRoutes.js +291 -0
- package/dist/server/http/probes.d.ts +22 -0
- package/dist/server/http/probes.js +27 -0
- package/dist/server/http/rateLimit.d.ts +131 -0
- package/dist/server/http/rateLimit.js +351 -0
- package/dist/server/http/readRoutes.d.ts +9 -0
- package/dist/server/http/readRoutes.js +131 -0
- package/dist/server/http/readRouting.d.ts +20 -0
- package/dist/server/http/readRouting.js +80 -0
- package/dist/server/http/recordCompose.d.ts +67 -0
- package/dist/server/http/recordCompose.js +167 -0
- package/dist/server/http/recordWrites.d.ts +89 -0
- package/dist/server/http/recordWrites.js +298 -0
- package/dist/server/http/refusalReport.d.ts +38 -0
- package/dist/server/http/refusalReport.js +63 -0
- package/dist/server/http/reply.d.ts +130 -0
- package/dist/server/http/reply.js +394 -0
- package/dist/server/http/requestOrigin.d.ts +11 -0
- package/dist/server/http/requestOrigin.js +8 -0
- package/dist/server/http/router.d.ts +45 -0
- package/dist/server/http/router.js +22 -0
- package/dist/server/http/serverCore.d.ts +68 -0
- package/dist/server/http/serverCore.js +177 -0
- package/dist/server/http/traceRequest.d.ts +30 -0
- package/dist/server/http/traceRequest.js +224 -0
- package/dist/server/http/trust.d.ts +261 -0
- package/dist/server/http/trust.js +472 -0
- package/dist/server/http/writeRefusal.d.ts +33 -0
- package/dist/server/http/writeRefusal.js +24 -0
- package/dist/server/httpConnection.d.ts +49 -0
- package/dist/server/httpConnection.js +170 -0
- package/dist/server/impact.d.ts +55 -0
- package/dist/server/impact.js +47 -0
- package/dist/server/journal.d.ts +134 -0
- package/dist/server/journal.js +398 -0
- package/dist/server/keysetReadHttp.d.ts +52 -0
- package/dist/server/keysetReadHttp.js +85 -0
- package/dist/server/layouts.d.ts +49 -0
- package/dist/server/layouts.js +192 -0
- package/dist/server/migrate/cli.d.ts +55 -0
- package/dist/server/migrate/cli.js +517 -0
- package/dist/server/migrate/database.d.ts +37 -0
- package/dist/server/migrate/database.js +247 -0
- package/dist/server/migrate/desired.d.ts +76 -0
- package/dist/server/migrate/desired.js +292 -0
- package/dist/server/migrate/files.d.ts +34 -0
- package/dist/server/migrate/files.js +141 -0
- package/dist/server/migrate/flyway.d.ts +7 -0
- package/dist/server/migrate/flyway.js +69 -0
- package/dist/server/migrate/history.d.ts +70 -0
- package/dist/server/migrate/history.js +211 -0
- package/dist/server/migrate/runner.d.ts +100 -0
- package/dist/server/migrate/runner.js +409 -0
- package/dist/server/migrate/snapshot.d.ts +30 -0
- package/dist/server/migrate/snapshot.js +239 -0
- package/dist/server/migrate/target.d.ts +33 -0
- package/dist/server/migrate/target.js +82 -0
- package/dist/server/openapiDraft.d.ts +25 -0
- package/dist/server/openapiDraft.js +171 -0
- package/dist/server/operations/diagnostics.d.ts +101 -0
- package/dist/server/operations/diagnostics.js +284 -0
- package/dist/server/operations/requestMetrics.d.ts +33 -0
- package/dist/server/operations/requestMetrics.js +94 -0
- package/dist/server/packageVersion.d.ts +1 -0
- package/dist/server/packageVersion.js +11 -0
- package/dist/server/poolConfig.d.ts +34 -0
- package/dist/server/poolConfig.js +114 -0
- package/dist/server/product.d.ts +20 -0
- package/dist/server/product.js +12 -0
- package/dist/server/recordHistoryOperations.d.ts +39 -0
- package/dist/server/recordHistoryOperations.js +43 -0
- package/dist/server/recordWriteOperations.d.ts +111 -0
- package/dist/server/recordWriteOperations.js +329 -0
- package/dist/server/resourceReadHttp.d.ts +81 -0
- package/dist/server/resourceReadHttp.js +606 -0
- package/dist/server/resourceReadOperations.d.ts +147 -0
- package/dist/server/resourceReadOperations.js +452 -0
- package/dist/server/scaffoldMachine.d.ts +54 -0
- package/dist/server/scaffoldMachine.js +184 -0
- package/dist/server/seed/cli.d.ts +20 -0
- package/dist/server/seed/cli.js +164 -0
- package/dist/server/seed/lexicon.d.ts +26 -0
- package/dist/server/seed/lexicon.js +585 -0
- package/dist/server/seed/seed.d.ts +70 -0
- package/dist/server/seed/seed.js +779 -0
- package/dist/server/seed/words.d.ts +21 -0
- package/dist/server/seed/words.js +164 -0
- package/dist/server/serverRequests.d.ts +6 -0
- package/dist/server/serverRequests.js +33 -0
- package/dist/server/serverTimeouts.d.ts +33 -0
- package/dist/server/serverTimeouts.js +32 -0
- package/dist/server/shapeonly.d.ts +32 -0
- package/dist/server/shapeonly.js +110 -0
- package/dist/server/startupWarnings.d.ts +32 -0
- package/dist/server/startupWarnings.js +92 -0
- package/dist/shared/addressParams.d.ts +28 -0
- package/dist/shared/addressParams.js +47 -0
- package/dist/shared/appCards.d.ts +123 -0
- package/dist/shared/appCards.js +385 -0
- package/dist/shared/appComponents.d.ts +177 -0
- package/dist/shared/appComponents.js +422 -0
- package/dist/shared/appDocuments.d.ts +43 -0
- package/dist/shared/appDocuments.js +131 -0
- package/dist/shared/appEmbeds.d.ts +21 -0
- package/dist/shared/appEmbeds.js +24 -0
- package/dist/shared/appIcons.d.ts +28 -0
- package/dist/shared/appIcons.js +223 -0
- package/dist/shared/appLinks.d.ts +17 -0
- package/dist/shared/appLinks.js +124 -0
- package/dist/shared/appListColumns.d.ts +3 -0
- package/dist/shared/appListColumns.js +66 -0
- package/dist/shared/appLocale.d.ts +36 -0
- package/dist/shared/appLocale.js +86 -0
- package/dist/shared/appMessages.d.ts +44 -0
- package/dist/shared/appMessages.js +78 -0
- package/dist/shared/appNoun.d.ts +21 -0
- package/dist/shared/appNoun.js +32 -0
- package/dist/shared/autoBucket.d.ts +98 -0
- package/dist/shared/autoBucket.js +305 -0
- package/dist/shared/autoValues.d.ts +25 -0
- package/dist/shared/autoValues.js +25 -0
- package/dist/shared/breakdown.d.ts +228 -0
- package/dist/shared/breakdown.js +557 -0
- package/dist/shared/breakdowntext.d.ts +41 -0
- package/dist/shared/breakdowntext.js +400 -0
- package/dist/shared/builtInThemes.d.ts +2 -0
- package/dist/shared/builtInThemes.js +771 -0
- package/dist/shared/chartSeparation.d.ts +11 -0
- package/dist/shared/chartSeparation.js +58 -0
- package/dist/shared/clauses.d.ts +22 -0
- package/dist/shared/clauses.js +97 -0
- package/dist/shared/columnCaption.d.ts +16 -0
- package/dist/shared/columnCaption.js +90 -0
- package/dist/shared/commandFieldPath.d.ts +2 -0
- package/dist/shared/commandFieldPath.js +7 -0
- package/dist/shared/commandWire.d.ts +26 -0
- package/dist/shared/commandWire.js +41 -0
- package/dist/shared/computed.d.ts +161 -0
- package/dist/shared/computed.js +378 -0
- package/dist/shared/computedParse.d.ts +13 -0
- package/dist/shared/computedParse.js +278 -0
- package/dist/shared/computedValue.d.ts +47 -0
- package/dist/shared/computedValue.js +191 -0
- package/dist/shared/connection.d.ts +30 -0
- package/dist/shared/connection.js +1 -0
- package/dist/shared/csv.d.ts +20 -0
- package/dist/shared/csv.js +63 -0
- package/dist/shared/dashLayout.d.ts +30 -0
- package/dist/shared/dashLayout.js +132 -0
- package/dist/shared/dashboardAsks.d.ts +93 -0
- package/dist/shared/dashboardAsks.js +129 -0
- package/dist/shared/dashboardTrend.d.ts +20 -0
- package/dist/shared/dashboardTrend.js +50 -0
- package/dist/shared/declaredReferences.d.ts +50 -0
- package/dist/shared/declaredReferences.js +202 -0
- package/dist/shared/definedFields.d.ts +63 -0
- package/dist/shared/definedFields.js +103 -0
- package/dist/shared/definedValues.d.ts +63 -0
- package/dist/shared/definedValues.js +184 -0
- package/dist/shared/displayDefaults.d.ts +135 -0
- package/dist/shared/displayDefaults.js +529 -0
- package/dist/shared/dueDate.d.ts +6 -0
- package/dist/shared/dueDate.js +6 -0
- package/dist/shared/duration.d.ts +4 -0
- package/dist/shared/duration.js +23 -0
- package/dist/shared/fileBounds.d.ts +9 -0
- package/dist/shared/fileBounds.js +9 -0
- package/dist/shared/filter.d.ts +217 -0
- package/dist/shared/filter.js +305 -0
- package/dist/shared/firstPaint.d.ts +24 -0
- package/dist/shared/firstPaint.js +33 -0
- package/dist/shared/form.d.ts +21 -0
- package/dist/shared/form.js +25 -0
- package/dist/shared/formValues.d.ts +104 -0
- package/dist/shared/formValues.js +352 -0
- package/dist/shared/funnel.d.ts +45 -0
- package/dist/shared/funnel.js +108 -0
- package/dist/shared/httpOperations.d.ts +48 -0
- package/dist/shared/httpOperations.js +9 -0
- package/dist/shared/iconGlyphs.d.ts +4 -0
- package/dist/shared/iconGlyphs.js +151 -0
- package/dist/shared/iconWeights.d.ts +3 -0
- package/dist/shared/iconWeights.js +162 -0
- package/dist/shared/imageWidths.d.ts +32 -0
- package/dist/shared/imageWidths.js +38 -0
- package/dist/shared/keysetPage.d.ts +64 -0
- package/dist/shared/keysetPage.js +161 -0
- package/dist/shared/like.d.ts +20 -0
- package/dist/shared/like.js +29 -0
- package/dist/shared/listEmpty.d.ts +12 -0
- package/dist/shared/listEmpty.js +36 -0
- package/dist/shared/listFilters.d.ts +28 -0
- package/dist/shared/listFilters.js +84 -0
- package/dist/shared/listPresentations.d.ts +199 -0
- package/dist/shared/listPresentations.js +7 -0
- package/dist/shared/listQuestion.d.ts +52 -0
- package/dist/shared/listQuestion.js +137 -0
- package/dist/shared/lookPalettes.d.ts +62 -0
- package/dist/shared/lookPalettes.js +306 -0
- package/dist/shared/maskQuoted.d.ts +24 -0
- package/dist/shared/maskQuoted.js +48 -0
- package/dist/shared/mentionLabel.d.ts +19 -0
- package/dist/shared/mentionLabel.js +38 -0
- package/dist/shared/mentionLookup.d.ts +17 -0
- package/dist/shared/mentionLookup.js +64 -0
- package/dist/shared/menuCounts.d.ts +16 -0
- package/dist/shared/menuCounts.js +74 -0
- package/dist/shared/model.d.ts +79 -0
- package/dist/shared/model.js +153 -0
- package/dist/shared/money.d.ts +44 -0
- package/dist/shared/money.js +81 -0
- package/dist/shared/moneyEntry.d.ts +7 -0
- package/dist/shared/moneyEntry.js +27 -0
- package/dist/shared/mount.d.ts +118 -0
- package/dist/shared/mount.js +248 -0
- package/dist/shared/niceTicks.d.ts +26 -0
- package/dist/shared/niceTicks.js +50 -0
- package/dist/shared/order.d.ts +59 -0
- package/dist/shared/order.js +133 -0
- package/dist/shared/page.d.ts +135 -0
- package/dist/shared/page.js +1187 -0
- package/dist/shared/pageAnatomy.d.ts +99 -0
- package/dist/shared/pageAnatomy.js +370 -0
- package/dist/shared/pageConfig.d.ts +25 -0
- package/dist/shared/pageConfig.js +1308 -0
- package/dist/shared/pageEmptyActions.d.ts +12 -0
- package/dist/shared/pageEmptyActions.js +20 -0
- package/dist/shared/pageLayouts.d.ts +72 -0
- package/dist/shared/pageLayouts.js +205 -0
- package/dist/shared/pageModel.d.ts +785 -0
- package/dist/shared/pageModel.js +121 -0
- package/dist/shared/pagePaths.d.ts +180 -0
- package/dist/shared/pagePaths.js +869 -0
- package/dist/shared/pagePlans.d.ts +52 -0
- package/dist/shared/pagePlans.js +108 -0
- package/dist/shared/pageRoutes.d.ts +9 -0
- package/dist/shared/pageRoutes.js +9 -0
- package/dist/shared/query.d.ts +166 -0
- package/dist/shared/query.js +1302 -0
- package/dist/shared/queryDates.d.ts +12 -0
- package/dist/shared/queryDates.js +101 -0
- package/dist/shared/queryOperands.d.ts +99 -0
- package/dist/shared/queryOperands.js +131 -0
- package/dist/shared/reads.d.ts +103 -0
- package/dist/shared/reads.js +154 -0
- package/dist/shared/recordLabel.d.ts +51 -0
- package/dist/shared/recordLabel.js +123 -0
- package/dist/shared/recordReadKeys.d.ts +30 -0
- package/dist/shared/recordReadKeys.js +51 -0
- package/dist/shared/recordReads.d.ts +268 -0
- package/dist/shared/recordReads.js +368 -0
- package/dist/shared/recordview.d.ts +198 -0
- package/dist/shared/recordview.js +356 -0
- package/dist/shared/referenceModel.d.ts +58 -0
- package/dist/shared/referenceModel.js +194 -0
- package/dist/shared/refusal.d.ts +64 -0
- package/dist/shared/refusal.js +144 -0
- package/dist/shared/relatedCreate.d.ts +30 -0
- package/dist/shared/relatedCreate.js +162 -0
- package/dist/shared/resourceHttp.d.ts +464 -0
- package/dist/shared/resourceHttp.js +1 -0
- package/dist/shared/richText.d.ts +85 -0
- package/dist/shared/richText.js +305 -0
- package/dist/shared/rollups.d.ts +143 -0
- package/dist/shared/rollups.js +64 -0
- package/dist/shared/rowScope.d.ts +72 -0
- package/dist/shared/rowScope.js +376 -0
- package/dist/shared/runtimeTables.d.ts +44 -0
- package/dist/shared/runtimeTables.js +79 -0
- package/dist/shared/schema.d.ts +523 -0
- package/dist/shared/schema.js +627 -0
- package/dist/shared/schematext.d.ts +38 -0
- package/dist/shared/schematext.js +101 -0
- package/dist/shared/scopeCatalog.d.ts +29 -0
- package/dist/shared/scopeCatalog.js +468 -0
- package/dist/shared/servedApp.d.ts +681 -0
- package/dist/shared/servedApp.js +45 -0
- package/dist/shared/sessionLease.d.ts +34 -0
- package/dist/shared/sessionLease.js +3 -0
- package/dist/shared/shape.d.ts +55 -0
- package/dist/shared/shape.js +168 -0
- package/dist/shared/slug.d.ts +1 -0
- package/dist/shared/slug.js +12 -0
- package/dist/shared/sortText.d.ts +14 -0
- package/dist/shared/sortText.js +26 -0
- package/dist/shared/sqlRelation.d.ts +4 -0
- package/dist/shared/sqlRelation.js +8 -0
- package/dist/shared/sqlsaved.d.ts +44 -0
- package/dist/shared/sqlsaved.js +63 -0
- package/dist/shared/stitchedPaths.d.ts +27 -0
- package/dist/shared/stitchedPaths.js +38 -0
- package/dist/shared/structuredFilter.d.ts +22 -0
- package/dist/shared/structuredFilter.js +1 -0
- package/dist/shared/subtitlePath.d.ts +20 -0
- package/dist/shared/subtitlePath.js +24 -0
- package/dist/shared/suggest.d.ts +18 -0
- package/dist/shared/suggest.js +59 -0
- package/dist/shared/tableSizing.d.ts +4 -0
- package/dist/shared/tableSizing.js +9 -0
- package/dist/shared/tagLists.d.ts +57 -0
- package/dist/shared/tagLists.js +34 -0
- package/dist/shared/textRules.d.ts +54 -0
- package/dist/shared/textRules.js +133 -0
- package/dist/shared/theme.d.ts +94 -0
- package/dist/shared/theme.js +800 -0
- package/dist/shared/themeColor.d.ts +34 -0
- package/dist/shared/themeColor.js +109 -0
- package/dist/shared/themeFaces.d.ts +30 -0
- package/dist/shared/themeFaces.js +42 -0
- package/dist/shared/themeInk.d.ts +20 -0
- package/dist/shared/themeInk.js +52 -0
- package/dist/shared/themeLooks.d.ts +9 -0
- package/dist/shared/themeLooks.js +572 -0
- package/dist/shared/themeParts.d.ts +26 -0
- package/dist/shared/themeParts.js +71 -0
- package/dist/shared/themePartsCheck.d.ts +21 -0
- package/dist/shared/themePartsCheck.js +91 -0
- package/dist/shared/themePresets.d.ts +85 -0
- package/dist/shared/themePresets.js +139 -0
- package/dist/shared/themeRecipeWords.d.ts +156 -0
- package/dist/shared/themeRecipeWords.js +156 -0
- package/dist/shared/themeRecipes.d.ts +213 -0
- package/dist/shared/themeRecipes.js +234 -0
- package/dist/shared/themeResolve.d.ts +55 -0
- package/dist/shared/themeResolve.js +52 -0
- package/dist/shared/themeTokens.d.ts +107 -0
- package/dist/shared/themeTokens.js +116 -0
- package/dist/shared/themeType.d.ts +38 -0
- package/dist/shared/themeType.js +205 -0
- package/dist/shared/unitWord.d.ts +4 -0
- package/dist/shared/unitWord.js +37 -0
- package/dist/shared/view.d.ts +195 -0
- package/dist/shared/view.js +987 -0
- package/dist/shared/viewLabels.d.ts +47 -0
- package/dist/shared/viewLabels.js +459 -0
- package/dist/shared/viewPaths.d.ts +248 -0
- package/dist/shared/viewPaths.js +294 -0
- package/dist/shared/viewtext.d.ts +57 -0
- package/dist/shared/viewtext.js +282 -0
- package/dist/shared/vocabulary.d.ts +71 -0
- package/dist/shared/vocabulary.js +249 -0
- package/dist/shared/weekStart.d.ts +7 -0
- package/dist/shared/weekStart.js +36 -0
- package/mark.svg +1 -0
- package/package.json +261 -4
- package/schema/model.d.ts +298 -0
- package/schema/theme.d.ts +587 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which theme a page wears: one function, read by the server where it
|
|
3
|
+
* projects an App for a principal (appViewRoles.ts) and guesses a first
|
|
4
|
+
* paint's sheets (clientSurface.ts), and by the browser where it applies the
|
|
5
|
+
* look (client visualTheme.ts), so the two never disagree about a page.
|
|
6
|
+
*
|
|
7
|
+
* The order (docs/theming.md, Precedence):
|
|
8
|
+
*
|
|
9
|
+
* 1. A public surface — a landing, the sign-in screen, a public form, or any
|
|
10
|
+
* page a signed-out visitor sees — wears `ui.theme.for.public` where the
|
|
11
|
+
* App names one, whatever a reader picked once: public pages are a
|
|
12
|
+
* storefront, the same for everyone, and so can be cached.
|
|
13
|
+
* 2. Otherwise the reader's own pick, where the App offers a picker.
|
|
14
|
+
* 3. Otherwise the first `for.roles` entry, in the order it is written, that
|
|
15
|
+
* the account holds: a portal's look is the App's design.
|
|
16
|
+
* 4. Otherwise the tenant's saved theme: its staff's default.
|
|
17
|
+
* 5. Otherwise the App's `ui.theme.preset`, and Workshop where it names none.
|
|
18
|
+
*
|
|
19
|
+
* Each id is taken only where the App offers it (a built-in look or one of
|
|
20
|
+
* its own), so a theme removed since a pick was saved falls through to the
|
|
21
|
+
* next rank instead of to nothing.
|
|
22
|
+
*/
|
|
23
|
+
/** The look in force when the App says nothing and nobody picked. */
|
|
24
|
+
const DEFAULT_THEME = 'workshop';
|
|
25
|
+
/** The theme a page wears, where it came from and, for a role's, which role. */
|
|
26
|
+
export function resolveTheme(ask) {
|
|
27
|
+
const offered = (id) => typeof id === 'string' && ask.offered(id);
|
|
28
|
+
if (ask.public && offered(ask.for?.public))
|
|
29
|
+
return { id: ask.for.public, source: 'public' };
|
|
30
|
+
if (offered(ask.pick))
|
|
31
|
+
return { id: ask.pick, source: 'reader' };
|
|
32
|
+
if (!ask.public && ask.roles?.length)
|
|
33
|
+
for (const [role, id] of Object.entries(ask.for?.roles ?? {}))
|
|
34
|
+
if (ask.roles.includes(role) && offered(id))
|
|
35
|
+
return { id, source: 'role', role };
|
|
36
|
+
if (offered(ask.tenant))
|
|
37
|
+
return { id: ask.tenant, source: 'tenant' };
|
|
38
|
+
if (offered(ask.preset))
|
|
39
|
+
return { id: ask.preset, source: 'app' };
|
|
40
|
+
return { id: DEFAULT_THEME, source: 'default' };
|
|
41
|
+
}
|
|
42
|
+
/** The role theme a principal holding `roles` wears, if `for.roles` maps one it holds: the first in written order. */
|
|
43
|
+
export function roleTheme(audiences, roles) {
|
|
44
|
+
for (const [role, id] of Object.entries(audiences?.roles ?? {}))
|
|
45
|
+
if (roles.includes(role))
|
|
46
|
+
return id;
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
/** Every theme a mapping can dress a page in: the public one, then each role's, once each. */
|
|
50
|
+
export function audienceThemes(audiences) {
|
|
51
|
+
return [...new Set([...(audiences?.public ? [audiences.public] : []), ...Object.values(audiences?.roles ?? {})])];
|
|
52
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export declare const THEME_BASES: readonly ['workshop', 'lumen', 'mono', 'sage', 'ledger'];
|
|
2
|
+
/** Each role as the custom property it is worn as: its spec path, hyphenated (`nav.ground` is `--nav-ground`, `chart[0]` is `--chart-1`). */
|
|
3
|
+
export declare const PALETTE_TOKENS: {
|
|
4
|
+
readonly ground: '--ground';
|
|
5
|
+
readonly surface: '--surface';
|
|
6
|
+
readonly field: '--field-fill';
|
|
7
|
+
readonly raised: '--raised';
|
|
8
|
+
readonly line: '--line';
|
|
9
|
+
readonly lineStrong: '--line-strong';
|
|
10
|
+
readonly lineControl: '--line-control';
|
|
11
|
+
readonly ink: '--ink';
|
|
12
|
+
readonly inkMuted: '--ink-muted';
|
|
13
|
+
readonly inkSubtle: '--ink-subtle';
|
|
14
|
+
readonly accent: '--accent';
|
|
15
|
+
readonly onAccent: '--on-accent';
|
|
16
|
+
readonly accentInk: '--accent-ink';
|
|
17
|
+
readonly primary: '--primary';
|
|
18
|
+
readonly onPrimary: '--on-primary';
|
|
19
|
+
readonly focus: '--focus';
|
|
20
|
+
readonly accentSoft: '--accent-soft';
|
|
21
|
+
readonly link: '--link';
|
|
22
|
+
readonly statusGood: '--status-good';
|
|
23
|
+
readonly statusWarning: '--status-warning';
|
|
24
|
+
readonly statusCritical: '--status-critical';
|
|
25
|
+
readonly statusInfo: '--status-info';
|
|
26
|
+
readonly navGround: '--nav-ground';
|
|
27
|
+
readonly navInk: '--nav-ink';
|
|
28
|
+
readonly navMuted: '--nav-muted';
|
|
29
|
+
readonly navLine: '--nav-line';
|
|
30
|
+
readonly navAccent: '--nav-accent';
|
|
31
|
+
readonly navCurrent: '--nav-current';
|
|
32
|
+
readonly navOnCurrent: '--nav-on-current';
|
|
33
|
+
readonly rulesSection: '--rules-section';
|
|
34
|
+
readonly rulesHead: '--rules-head';
|
|
35
|
+
readonly shadow: '--shadow-ink';
|
|
36
|
+
readonly band: '--band';
|
|
37
|
+
readonly rulesWeight: '--rules-weight';
|
|
38
|
+
readonly rulesControl: '--control-border-w';
|
|
39
|
+
readonly chart1: '--chart-1';
|
|
40
|
+
readonly chart2: '--chart-2';
|
|
41
|
+
readonly chart3: '--chart-3';
|
|
42
|
+
readonly chart4: '--chart-4';
|
|
43
|
+
readonly chart5: '--chart-5';
|
|
44
|
+
readonly chart6: '--chart-6';
|
|
45
|
+
readonly chart7: '--chart-7';
|
|
46
|
+
readonly chart8: '--chart-8';
|
|
47
|
+
};
|
|
48
|
+
export declare const FONT_TOKENS: {
|
|
49
|
+
readonly ui: '--sans';
|
|
50
|
+
readonly data: '--mono';
|
|
51
|
+
readonly heading: '--heading-font';
|
|
52
|
+
readonly code: '--code';
|
|
53
|
+
};
|
|
54
|
+
export declare const RADIUS_TOKENS: {
|
|
55
|
+
readonly control: '--radius';
|
|
56
|
+
readonly field: '--field-radius';
|
|
57
|
+
readonly pill: '--pill-radius';
|
|
58
|
+
readonly panel: '--panel-radius';
|
|
59
|
+
};
|
|
60
|
+
/** A panel's edge and the focus ring's width; a rule's and a control's ride in each mode's palette (`--rules-weight`). */
|
|
61
|
+
declare const BORDER_TOKENS: {
|
|
62
|
+
readonly panel: '--panel-border-width';
|
|
63
|
+
readonly focus: '--focus-ring-width';
|
|
64
|
+
};
|
|
65
|
+
/** Each corner's ceiling in pixels: a control may also be a pill (`round`), and so may a pill's tag. */
|
|
66
|
+
export declare const RADIUS_MAX: {
|
|
67
|
+
readonly control: 16;
|
|
68
|
+
readonly field: 12;
|
|
69
|
+
readonly pill: 12;
|
|
70
|
+
readonly panel: 20;
|
|
71
|
+
};
|
|
72
|
+
export declare const ROUND_CORNERS: ReadonlySet<string>;
|
|
73
|
+
/** `round`, compiled: a length past any box's, so a control or a tag draws as a pill whatever its height. */
|
|
74
|
+
export declare const ROUND = "999px";
|
|
75
|
+
/** The corner every other box that follows a control's takes when the controls are round: a card is not a pill. */
|
|
76
|
+
export declare const ROUND_BOX = "8px";
|
|
77
|
+
/** The widths each edge may take: a rule's, a control's, a panel's (0px draws none) and the focus ring's. */
|
|
78
|
+
export declare const BORDER_MENU: {
|
|
79
|
+
readonly rule: readonly ['1px', '2px', '3px'];
|
|
80
|
+
readonly control: readonly ['0px', '1px', '2px'];
|
|
81
|
+
readonly panel: readonly ['0px', '1px', '2px'];
|
|
82
|
+
readonly focus: readonly ['2px', '3px'];
|
|
83
|
+
};
|
|
84
|
+
/** A control's height, in whole pixels (`shape.height.control`): a field, a select and a button stand level at it. */
|
|
85
|
+
export declare const CONTROL_HEIGHT: {
|
|
86
|
+
readonly min: 32;
|
|
87
|
+
readonly max: 56;
|
|
88
|
+
};
|
|
89
|
+
export declare function controlHeightFits(length: unknown): boolean;
|
|
90
|
+
/** A corner in pixels up to `max`: `6px`, `7.5px`. */
|
|
91
|
+
export declare function cornerFits(length: unknown, max: number): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* A theme's corners and widths as the custom properties the sheets read. A round control is `--control-radius`,
|
|
94
|
+
* which only a control's own rule reads (customThemes.css), and `--radius` — every other box that follows a
|
|
95
|
+
* control's corner, a card's, a menu's — stays at ROUND_BOX.
|
|
96
|
+
*/
|
|
97
|
+
export declare function shapeTokens(theme: {
|
|
98
|
+
radius?: Partial<Record<keyof typeof RADIUS_TOKENS, string>>;
|
|
99
|
+
border?: Partial<Record<keyof typeof BORDER_TOKENS, string>>;
|
|
100
|
+
height?: {
|
|
101
|
+
control?: string;
|
|
102
|
+
};
|
|
103
|
+
}): Record<string, string>;
|
|
104
|
+
/** A role by its name in the spec, for any message an author reads: `statusCritical` is `status.critical`, `chart3`
|
|
105
|
+
is `chart[2]`. The roles are the spec's paths in camel case, so this is the whole map. */
|
|
106
|
+
export declare function rolePath(role: string): string;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export const THEME_BASES = ['workshop', 'lumen', 'mono', 'sage', 'ledger'];
|
|
2
|
+
/** Each role as the custom property it is worn as: its spec path, hyphenated (`nav.ground` is `--nav-ground`, `chart[0]` is `--chart-1`). */
|
|
3
|
+
export const PALETTE_TOKENS = {
|
|
4
|
+
ground: '--ground',
|
|
5
|
+
surface: '--surface',
|
|
6
|
+
field: '--field-fill',
|
|
7
|
+
raised: '--raised',
|
|
8
|
+
line: '--line',
|
|
9
|
+
lineStrong: '--line-strong',
|
|
10
|
+
lineControl: '--line-control',
|
|
11
|
+
ink: '--ink',
|
|
12
|
+
inkMuted: '--ink-muted',
|
|
13
|
+
inkSubtle: '--ink-subtle',
|
|
14
|
+
accent: '--accent',
|
|
15
|
+
onAccent: '--on-accent',
|
|
16
|
+
accentInk: '--accent-ink',
|
|
17
|
+
primary: '--primary',
|
|
18
|
+
onPrimary: '--on-primary',
|
|
19
|
+
focus: '--focus',
|
|
20
|
+
accentSoft: '--accent-soft',
|
|
21
|
+
link: '--link',
|
|
22
|
+
statusGood: '--status-good',
|
|
23
|
+
statusWarning: '--status-warning',
|
|
24
|
+
statusCritical: '--status-critical',
|
|
25
|
+
statusInfo: '--status-info',
|
|
26
|
+
navGround: '--nav-ground',
|
|
27
|
+
navInk: '--nav-ink',
|
|
28
|
+
navMuted: '--nav-muted',
|
|
29
|
+
navLine: '--nav-line',
|
|
30
|
+
navAccent: '--nav-accent',
|
|
31
|
+
navCurrent: '--nav-current',
|
|
32
|
+
navOnCurrent: '--nav-on-current',
|
|
33
|
+
rulesSection: '--rules-section',
|
|
34
|
+
rulesHead: '--rules-head',
|
|
35
|
+
shadow: '--shadow-ink',
|
|
36
|
+
band: '--band',
|
|
37
|
+
rulesWeight: '--rules-weight',
|
|
38
|
+
rulesControl: '--control-border-w',
|
|
39
|
+
chart1: '--chart-1',
|
|
40
|
+
chart2: '--chart-2',
|
|
41
|
+
chart3: '--chart-3',
|
|
42
|
+
chart4: '--chart-4',
|
|
43
|
+
chart5: '--chart-5',
|
|
44
|
+
chart6: '--chart-6',
|
|
45
|
+
chart7: '--chart-7',
|
|
46
|
+
chart8: '--chart-8',
|
|
47
|
+
};
|
|
48
|
+
export const FONT_TOKENS = { ui: '--sans', data: '--mono', heading: '--heading-font', code: '--code' };
|
|
49
|
+
export const RADIUS_TOKENS = { control: '--radius', field: '--field-radius', pill: '--pill-radius', panel: '--panel-radius' };
|
|
50
|
+
/** A panel's edge and the focus ring's width; a rule's and a control's ride in each mode's palette (`--rules-weight`). */
|
|
51
|
+
const BORDER_TOKENS = { panel: '--panel-border-width', focus: '--focus-ring-width' };
|
|
52
|
+
/** Each corner's ceiling in pixels: a control may also be a pill (`round`), and so may a pill's tag. */
|
|
53
|
+
export const RADIUS_MAX = { control: 16, field: 12, pill: 12, panel: 20 };
|
|
54
|
+
export const ROUND_CORNERS = new Set(['control', 'pill']);
|
|
55
|
+
/** `round`, compiled: a length past any box's, so a control or a tag draws as a pill whatever its height. */
|
|
56
|
+
export const ROUND = '999px';
|
|
57
|
+
/** The corner every other box that follows a control's takes when the controls are round: a card is not a pill. */
|
|
58
|
+
export const ROUND_BOX = '8px';
|
|
59
|
+
/** The widths each edge may take: a rule's, a control's, a panel's (0px draws none) and the focus ring's. */
|
|
60
|
+
export const BORDER_MENU = {
|
|
61
|
+
rule: ['1px', '2px', '3px'],
|
|
62
|
+
control: ['0px', '1px', '2px'],
|
|
63
|
+
panel: ['0px', '1px', '2px'],
|
|
64
|
+
focus: ['2px', '3px'],
|
|
65
|
+
};
|
|
66
|
+
/** A control's height, in whole pixels (`shape.height.control`): a field, a select and a button stand level at it. */
|
|
67
|
+
export const CONTROL_HEIGHT = { min: 32, max: 56 };
|
|
68
|
+
export function controlHeightFits(length) {
|
|
69
|
+
if (typeof length !== 'string')
|
|
70
|
+
return false;
|
|
71
|
+
const match = /^(\d{2})px$/.exec(length);
|
|
72
|
+
return Boolean(match) && Number(match[1]) >= CONTROL_HEIGHT.min && Number(match[1]) <= CONTROL_HEIGHT.max;
|
|
73
|
+
}
|
|
74
|
+
/** A corner in pixels up to `max`: `6px`, `7.5px`. */
|
|
75
|
+
export function cornerFits(length, max) {
|
|
76
|
+
if (typeof length !== 'string')
|
|
77
|
+
return false;
|
|
78
|
+
const match = /^(\d{1,2}(?:\.\d+)?)px$/.exec(length);
|
|
79
|
+
return Boolean(match) && Number(match[1]) <= max;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A theme's corners and widths as the custom properties the sheets read. A round control is `--control-radius`,
|
|
83
|
+
* which only a control's own rule reads (customThemes.css), and `--radius` — every other box that follows a
|
|
84
|
+
* control's corner, a card's, a menu's — stays at ROUND_BOX.
|
|
85
|
+
*/
|
|
86
|
+
export function shapeTokens(theme) {
|
|
87
|
+
const out = {};
|
|
88
|
+
for (const [key, token] of Object.entries(RADIUS_TOKENS)) {
|
|
89
|
+
const value = theme.radius?.[key];
|
|
90
|
+
if (value === undefined)
|
|
91
|
+
continue;
|
|
92
|
+
if (key === 'control' && value === ROUND) {
|
|
93
|
+
out['--radius'] = ROUND_BOX;
|
|
94
|
+
out['--control-radius'] = ROUND;
|
|
95
|
+
}
|
|
96
|
+
else
|
|
97
|
+
out[token] = value;
|
|
98
|
+
}
|
|
99
|
+
for (const [key, token] of Object.entries(BORDER_TOKENS)) {
|
|
100
|
+
const value = theme.border?.[key];
|
|
101
|
+
if (value !== undefined)
|
|
102
|
+
out[token] = value;
|
|
103
|
+
}
|
|
104
|
+
if (theme.height?.control !== undefined)
|
|
105
|
+
out['--control-h'] = theme.height.control;
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
/** A role by its name in the spec, for any message an author reads: `statusCritical` is `status.critical`, `chart3`
|
|
109
|
+
is `chart[2]`. The roles are the spec's paths in camel case, so this is the whole map. */
|
|
110
|
+
export function rolePath(role) {
|
|
111
|
+
const series = /^chart(\d)$/.exec(role);
|
|
112
|
+
if (series)
|
|
113
|
+
return `chart[${Number(series[1]) - 1}]`;
|
|
114
|
+
const group = /^(status|nav|rules)([A-Z])(\w*)$/.exec(role);
|
|
115
|
+
return group ? `${group[1]}.${group[2].toLowerCase()}${group[3]}` : role;
|
|
116
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A theme's type: the base size its text is drawn at and the nine roles, each
|
|
3
|
+
* kind of text by what it is for (docs/theming.md, Type). Checked here,
|
|
4
|
+
* merged over a base look's, and worn as two things the browser needs at
|
|
5
|
+
* first paint: custom properties (`--type-k`, `--type-<role>-<property>`) and
|
|
6
|
+
* one `data-type-<role>` attribute per role naming what that role says, which
|
|
7
|
+
* the rules in themeFamilies.css answer (the attributes are themeRecipes.ts's,
|
|
8
|
+
* with the rest of what a first paint sets on the root). A role that says nothing sets no
|
|
9
|
+
* attribute, so every rule it would draw is off and the look draws as before.
|
|
10
|
+
*/
|
|
11
|
+
import type { ThemeTypeBase, ThemeTypeDefinition, ThemeTypeFace, ThemeTypeRole, ThemeTypeRoleDefinition } from '../../schema/theme.js';
|
|
12
|
+
type Property = keyof ThemeTypeRoleDefinition;
|
|
13
|
+
interface RoleRule {
|
|
14
|
+
/** The properties a role takes. */
|
|
15
|
+
takes: readonly Property[];
|
|
16
|
+
/** Its size's range in pixels, at the 13px base. */
|
|
17
|
+
size?: readonly [number, number];
|
|
18
|
+
/** Its leading's range. */
|
|
19
|
+
leading?: readonly [number, number];
|
|
20
|
+
/** The weights it may be drawn at. */
|
|
21
|
+
weights?: readonly number[];
|
|
22
|
+
}
|
|
23
|
+
/** Each role, what it takes and the ranges it is held to: no text smaller than the look draws it, no menu that
|
|
24
|
+
competes with a heading, no body that is not the base. */
|
|
25
|
+
export declare const TYPE_ROLES: Record<ThemeTypeRole, RoleRule>;
|
|
26
|
+
export declare const TYPE_BASES: readonly ThemeTypeBase[];
|
|
27
|
+
/** Each face as the stack it reads: the theme's own, `code` its monospace (`fonts.code`, else the platform's). */
|
|
28
|
+
export declare const TYPE_FACES: Record<ThemeTypeFace, string>;
|
|
29
|
+
/** The spellings type roles replaced, each with where it went (a clean break: the old key is refused). */
|
|
30
|
+
export declare const TYPE_MOVED: Record<string, string>;
|
|
31
|
+
/** `type.base` and `type.roles` checked; anything else in `type` is the caller's. */
|
|
32
|
+
export declare function typeOf(base: unknown, roles: unknown, where: string): ThemeTypeDefinition;
|
|
33
|
+
/** A theme's type over its base look's: the theme's base, and each role's properties over the look's own. */
|
|
34
|
+
export declare function mergeType(under: ThemeTypeDefinition | undefined, over: ThemeTypeDefinition | undefined): ThemeTypeDefinition | undefined;
|
|
35
|
+
/** The custom properties a theme's type is worn as. A title's weight is not here: it is `--heading-weight`, which
|
|
36
|
+
every heading reads (headingWeight). */
|
|
37
|
+
export declare function typeTokens(type: ThemeTypeDefinition | undefined): Record<string, string>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
const WEIGHTS = [400, 500, 600, 700, 800, 900];
|
|
2
|
+
const LEADING = [1.1, 1.8];
|
|
3
|
+
/** A title and a display line may be set as tight as 0.85: a short line of large type wants the lines closer than a
|
|
4
|
+
heading's. Under 1.0 a wrapped line sets its descenders into the next, which `check` warns of (theme-type). */
|
|
5
|
+
const TIGHT_LEADING = [0.85, 1.8];
|
|
6
|
+
/** Each role, what it takes and the ranges it is held to: no text smaller than the look draws it, no menu that
|
|
7
|
+
competes with a heading, no body that is not the base. */
|
|
8
|
+
export const TYPE_ROLES = {
|
|
9
|
+
display: {
|
|
10
|
+
takes: ['face', 'size', 'leading', 'tracking', 'weight', 'features'],
|
|
11
|
+
size: [28, 56],
|
|
12
|
+
leading: TIGHT_LEADING,
|
|
13
|
+
weights: WEIGHTS,
|
|
14
|
+
},
|
|
15
|
+
title: {
|
|
16
|
+
takes: ['face', 'size', 'leading', 'tracking', 'weight', 'case', 'features'],
|
|
17
|
+
size: [20, 36],
|
|
18
|
+
leading: TIGHT_LEADING,
|
|
19
|
+
weights: WEIGHTS,
|
|
20
|
+
},
|
|
21
|
+
heading: {
|
|
22
|
+
takes: ['face', 'size', 'leading', 'tracking', 'weight', 'case', 'features'],
|
|
23
|
+
size: [16, 28],
|
|
24
|
+
leading: LEADING,
|
|
25
|
+
weights: WEIGHTS,
|
|
26
|
+
},
|
|
27
|
+
section: { takes: ['face', 'size', 'tracking', 'weight', 'case', 'features'], size: [12, 20], weights: WEIGHTS },
|
|
28
|
+
body: { takes: ['leading', 'features'], leading: [1.35, 1.8] },
|
|
29
|
+
label: { takes: ['face', 'tracking', 'weight', 'case', 'features'], weights: [400, 500, 600, 700] },
|
|
30
|
+
data: { takes: ['features', 'reach'] },
|
|
31
|
+
figure: { takes: ['face', 'size', 'tracking', 'weight', 'features'], size: [18, 40], weights: WEIGHTS },
|
|
32
|
+
nav: { takes: ['face', 'tracking', 'weight', 'case'], weights: [400, 500, 600] },
|
|
33
|
+
};
|
|
34
|
+
const TYPE_ROLE_NAMES = Object.keys(TYPE_ROLES);
|
|
35
|
+
export const TYPE_BASES = ['13px', '14px', '15px', '16px'];
|
|
36
|
+
/** Each face as the stack it reads: the theme's own, `code` its monospace (`fonts.code`, else the platform's). */
|
|
37
|
+
export const TYPE_FACES = {
|
|
38
|
+
ui: 'var(--sans)',
|
|
39
|
+
heading: 'var(--heading-font, var(--sans))',
|
|
40
|
+
data: 'var(--mono)',
|
|
41
|
+
code: 'var(--code)',
|
|
42
|
+
};
|
|
43
|
+
const CASES = ['none', 'upper', 'small-caps'];
|
|
44
|
+
/** What the data face may set: every value, or only the figures, keys and dates. */
|
|
45
|
+
const TYPE_REACHES = ['values', 'figures'];
|
|
46
|
+
/** The features `font-variant-numeric` says; the rest are `font-feature-settings`. */
|
|
47
|
+
const NUMERIC = { lnum: 'lining-nums', onum: 'oldstyle-nums', tnum: 'tabular-nums', zero: 'slashed-zero' };
|
|
48
|
+
const FEATURE = /^(?:tnum|lnum|onum|zero|case|ss(?:0[1-9]|1\d|20)|cv(?:0[1-9]|[1-9]\d))$/;
|
|
49
|
+
const TRACKING = /^(-?)(0|0?\.\d{1,3})em$/;
|
|
50
|
+
/** The size tokens the sheets already read: the title's, the display step's. */
|
|
51
|
+
const SIZE_TOKENS = { title: '--type-record-title', display: '--type-display' };
|
|
52
|
+
/** The spellings type roles replaced, each with where it went (a clean break: the old key is refused). */
|
|
53
|
+
export const TYPE_MOVED = {
|
|
54
|
+
'type.scale': "type.roles.title.size: '22px', '26px', '28px' or '30px' (compact, default, large, roomy)",
|
|
55
|
+
'type.headingWeight': "type.roles.title.weight (a list's heading takes it too, unless type.roles.heading.weight says its own)",
|
|
56
|
+
'recipes.labels': "type.roles.label: { face: 'code', case: 'upper' } for mono-caps, { case: 'small-caps' } for small-caps",
|
|
57
|
+
'recipes.headings': "type.roles.section: { case: 'upper', size: '12px' } for caps, { case: 'small-caps' } for small-caps",
|
|
58
|
+
'recipes.figures': "type.roles.figure: { face: 'code', weight: 700 } for mono, { face: 'heading', weight: 600, features: ['lnum'] } for book",
|
|
59
|
+
};
|
|
60
|
+
const record = (raw, where) => {
|
|
61
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
62
|
+
throw new Error(`${where} must be an object.`);
|
|
63
|
+
return raw;
|
|
64
|
+
};
|
|
65
|
+
const px = (value) => {
|
|
66
|
+
const match = typeof value === 'string' ? /^(\d{1,2}(?:\.\d)?)px$/.exec(value) : null;
|
|
67
|
+
return match ? Number(match[1]) : undefined;
|
|
68
|
+
};
|
|
69
|
+
/** `type.base` and `type.roles` checked; anything else in `type` is the caller's. */
|
|
70
|
+
export function typeOf(base, roles, where) {
|
|
71
|
+
const out = {};
|
|
72
|
+
if (base !== undefined) {
|
|
73
|
+
if (!TYPE_BASES.includes(base))
|
|
74
|
+
throw new Error(`${where}.base must be one of ${TYPE_BASES.join(', ')}.`);
|
|
75
|
+
out.base = base;
|
|
76
|
+
}
|
|
77
|
+
if (roles === undefined)
|
|
78
|
+
return out;
|
|
79
|
+
const value = record(roles, `${where}.roles`);
|
|
80
|
+
out.roles = {};
|
|
81
|
+
for (const [name, raw] of Object.entries(value)) {
|
|
82
|
+
const rule = TYPE_ROLES[name];
|
|
83
|
+
if (!Object.hasOwn(TYPE_ROLES, name) || !rule)
|
|
84
|
+
throw new Error(`${where}.roles has no "${name}". The roles are: ${TYPE_ROLE_NAMES.join(', ')}.`);
|
|
85
|
+
out.roles[name] = roleOf(raw, rule, `${where}.roles.${name}`);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
function roleOf(raw, rule, where) {
|
|
90
|
+
const value = record(raw, where);
|
|
91
|
+
for (const key of Object.keys(value))
|
|
92
|
+
if (!rule.takes.includes(key))
|
|
93
|
+
throw new Error(`${where} has no "${key}". It takes: ${rule.takes.join(', ')}.` +
|
|
94
|
+
(key === 'size' ? ' Its size is the base (type.base), so it grows with every other size.' : ''));
|
|
95
|
+
const out = {};
|
|
96
|
+
if (value.face !== undefined) {
|
|
97
|
+
/* Renamed before 1.0: the monospace face is `code`, the word a display rule and `fonts.code` say. */
|
|
98
|
+
if (value.face === 'mono')
|
|
99
|
+
throw new Error(`${where}.face "mono" is now "code": the theme's monospace (fonts.code).`);
|
|
100
|
+
if (!Object.hasOwn(TYPE_FACES, value.face))
|
|
101
|
+
throw new Error(`${where}.face must be one of ${Object.keys(TYPE_FACES).join(', ')}.`);
|
|
102
|
+
out.face = value.face;
|
|
103
|
+
}
|
|
104
|
+
if (value.size !== undefined) {
|
|
105
|
+
const size = px(value.size), [low, high] = rule.size;
|
|
106
|
+
if (size === undefined || size < low || size > high)
|
|
107
|
+
throw new Error(`${where}.size must be a length from ${low}px to ${high}px.`);
|
|
108
|
+
out.size = value.size;
|
|
109
|
+
}
|
|
110
|
+
if (value.leading !== undefined) {
|
|
111
|
+
const [low, high] = rule.leading;
|
|
112
|
+
if (typeof value.leading !== 'number' || !(value.leading >= low && value.leading <= high))
|
|
113
|
+
throw new Error(`${where}.leading must be a number from ${low} to ${high}.`);
|
|
114
|
+
out.leading = value.leading;
|
|
115
|
+
}
|
|
116
|
+
if (value.tracking !== undefined) {
|
|
117
|
+
const match = typeof value.tracking === 'string' ? TRACKING.exec(value.tracking) : null;
|
|
118
|
+
const amount = match ? Number(match[2]) * (match[1] ? -1 : 1) : NaN;
|
|
119
|
+
if (!(amount >= -0.03 && amount <= 0.15))
|
|
120
|
+
throw new Error(`${where}.tracking must be a length from -0.03em to 0.15em.`);
|
|
121
|
+
out.tracking = value.tracking;
|
|
122
|
+
}
|
|
123
|
+
if (value.weight !== undefined) {
|
|
124
|
+
if (!rule.weights.includes(value.weight))
|
|
125
|
+
throw new Error(`${where}.weight must be one of ${rule.weights.join(', ')}.`);
|
|
126
|
+
out.weight = value.weight;
|
|
127
|
+
}
|
|
128
|
+
if (value.case !== undefined) {
|
|
129
|
+
if (!CASES.includes(value.case))
|
|
130
|
+
throw new Error(`${where}.case must be one of ${CASES.join(', ')}.`);
|
|
131
|
+
out.case = value.case;
|
|
132
|
+
}
|
|
133
|
+
if (value.reach !== undefined) {
|
|
134
|
+
if (!TYPE_REACHES.includes(value.reach))
|
|
135
|
+
throw new Error(`${where}.reach must be values (every value in the data face) or figures (only figures, keys and dates).`);
|
|
136
|
+
out.reach = value.reach;
|
|
137
|
+
}
|
|
138
|
+
if (value.features !== undefined) {
|
|
139
|
+
const features = value.features;
|
|
140
|
+
if (!Array.isArray(features) || features.length > 8 || new Set(features).size !== features.length)
|
|
141
|
+
throw new Error(`${where}.features must be at most eight different features.`);
|
|
142
|
+
for (const feature of features)
|
|
143
|
+
if (typeof feature !== 'string' || !FEATURE.test(feature))
|
|
144
|
+
throw new Error(`${where}.features takes tnum, lnum, onum, zero, case, ss01 to ss20 and cv01 to cv99; "${String(feature)}" is not one.`);
|
|
145
|
+
out.features = [...features];
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
/** A theme's type over its base look's: the theme's base, and each role's properties over the look's own. */
|
|
150
|
+
export function mergeType(under, over) {
|
|
151
|
+
if (!under && !over)
|
|
152
|
+
return undefined;
|
|
153
|
+
const roles = {};
|
|
154
|
+
for (const name of TYPE_ROLE_NAMES) {
|
|
155
|
+
const role = { ...under?.roles?.[name], ...over?.roles?.[name] };
|
|
156
|
+
if (Object.keys(role).length)
|
|
157
|
+
roles[name] = role;
|
|
158
|
+
}
|
|
159
|
+
const base = over?.base ?? under?.base;
|
|
160
|
+
return { ...(base ? { base } : {}), ...(Object.keys(roles).length ? { roles } : {}) };
|
|
161
|
+
}
|
|
162
|
+
const sized = (length) => `calc(${length} * var(--type-k))`;
|
|
163
|
+
/** The custom properties a theme's type is worn as. A title's weight is not here: it is `--heading-weight`, which
|
|
164
|
+
every heading reads (headingWeight). */
|
|
165
|
+
export function typeTokens(type) {
|
|
166
|
+
const out = {};
|
|
167
|
+
if (type?.base && type.base !== '13px')
|
|
168
|
+
out['--type-k'] = `calc(${parseFloat(type.base)} / 13)`;
|
|
169
|
+
for (const name of TYPE_ROLE_NAMES) {
|
|
170
|
+
const role = type?.roles?.[name];
|
|
171
|
+
if (!role)
|
|
172
|
+
continue;
|
|
173
|
+
const token = (property) => `--type-${name}-${property}`;
|
|
174
|
+
if (role.face)
|
|
175
|
+
out[token('font')] = TYPE_FACES[role.face];
|
|
176
|
+
if (role.size)
|
|
177
|
+
out[SIZE_TOKENS[name] ?? token('size')] = sized(role.size);
|
|
178
|
+
if (role.leading !== undefined)
|
|
179
|
+
out[token('leading')] = String(role.leading);
|
|
180
|
+
if (role.tracking)
|
|
181
|
+
out[token('tracking')] = role.tracking;
|
|
182
|
+
if (role.weight !== undefined && name !== 'title')
|
|
183
|
+
out[token('weight')] = String(role.weight);
|
|
184
|
+
const numeric = numericOf(name, role.features);
|
|
185
|
+
if (numeric)
|
|
186
|
+
out[token('numeric')] = numeric;
|
|
187
|
+
const settings = (role.features ?? []).filter((feature) => !NUMERIC[feature]);
|
|
188
|
+
if (settings.length)
|
|
189
|
+
out[token('features')] = settings.map((feature) => `"${feature}"`).join(', ');
|
|
190
|
+
}
|
|
191
|
+
return out;
|
|
192
|
+
}
|
|
193
|
+
/** A role's figures as `font-variant-numeric`, tabular kept where the role's figures line up in columns. */
|
|
194
|
+
function numericOf(role, features) {
|
|
195
|
+
const named = (features ?? []).filter((feature) => NUMERIC[feature]);
|
|
196
|
+
if (!named.length)
|
|
197
|
+
return undefined;
|
|
198
|
+
if ((role === 'data' || role === 'figure') && !named.includes('tnum'))
|
|
199
|
+
named.push('tnum');
|
|
200
|
+
/* In the order the property's own value is written, so what the page computes is what is said. */
|
|
201
|
+
return ['lnum', 'onum', 'tnum', 'zero']
|
|
202
|
+
.filter((feature) => named.includes(feature))
|
|
203
|
+
.map((feature) => NUMERIC[feature])
|
|
204
|
+
.join(' ');
|
|
205
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The singular of a word written in the plural ("days", "tickets"), or undefined where the word is not a plural
|
|
2
|
+
the rule can read: an abbreviation, a word whose own "s" ends it, a word already singular. */
|
|
3
|
+
export declare function singularOf(word: string): string | undefined;
|
|
4
|
+
export declare function unitWord(figure: string, unit: string): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A display unit as it is said beside a figure. An App writes a unit plural
|
|
3
|
+
* (`{ unit: 'days' }`, `{ unit: 'bikes' }`), and one of them is said
|
|
4
|
+
* singular: "1 day" and "1 bike", never "1 days" or "1 bikes". Shared, so a
|
|
5
|
+
* public page the server draws says what the client says
|
|
6
|
+
* (http/publicPage.ts, components/valueModel.ts).
|
|
7
|
+
*
|
|
8
|
+
* An abbreviation keeps its spelling ("1 lbs", "1 pcs", "1 hrs"): it has no
|
|
9
|
+
* vowel, or is too short to be a word. A unit that is not one plain word
|
|
10
|
+
* ("kWh", "m²", "per day") is said as written.
|
|
11
|
+
*/
|
|
12
|
+
const ONE = /^[-−]?1$/;
|
|
13
|
+
const TIME_PLURAL = /^(second|minute|hour|day|night|week|month|year)s$/i;
|
|
14
|
+
/* A plain plural: four letters or more, a vowel before its ending, and an "s" that is not a word's own ("glass", "bus", "basis"). */
|
|
15
|
+
const PLURAL = /^(?=[a-z]*[aeiouy][a-z]*s$)[a-z]{3,}s$/i;
|
|
16
|
+
/** The singular of a regular English plural: batteries → battery, boxes → box, bikes → bike. */
|
|
17
|
+
function singular(unit) {
|
|
18
|
+
if (/[^aeiou]ies$/i.test(unit))
|
|
19
|
+
return `${unit.slice(0, -3)}${unit.at(-3) === 'I' ? 'Y' : 'y'}`;
|
|
20
|
+
if (/(x|ch|sh|ss|z)es$/i.test(unit))
|
|
21
|
+
return unit.slice(0, -2);
|
|
22
|
+
return unit.slice(0, -1);
|
|
23
|
+
}
|
|
24
|
+
/** The singular of a word written in the plural ("days", "tickets"), or undefined where the word is not a plural
|
|
25
|
+
the rule can read: an abbreviation, a word whose own "s" ends it, a word already singular. */
|
|
26
|
+
export function singularOf(word) {
|
|
27
|
+
if (TIME_PLURAL.test(word))
|
|
28
|
+
return word.slice(0, -1);
|
|
29
|
+
if (PLURAL.test(word) && !/(ss|us|is)$/i.test(word) && /[aeiouy]/i.test(word.slice(0, -1)))
|
|
30
|
+
return singular(word);
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
export function unitWord(figure, unit) {
|
|
34
|
+
if (!ONE.test(figure))
|
|
35
|
+
return unit;
|
|
36
|
+
return singularOf(unit) ?? unit;
|
|
37
|
+
}
|