@ahoo-wang/wow-view-engine 10.0.0-beta.2 → 10.0.0-beta.4
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/dist/{actions-CThpS7Yj.js → actions-G0GVzYhc.js} +2 -2
- package/dist/actions-G0GVzYhc.js.map +1 -0
- package/dist/cartesianBrush-bgRuE6Ks.js.map +1 -1
- package/dist/echarts-rjTKpBsf.js.map +1 -1
- package/dist/echartsGeo-qZv2ZF9e.js.map +1 -1
- package/dist/echartsHierarchy-DHNP9W4v.js.map +1 -1
- package/dist/echartsStatistics-DCDWqvde.js.map +1 -1
- package/dist/echartsTime-DIRSRMnr.js.map +1 -1
- package/dist/{export-D6bnNjrA.js → export-CEOFAImT.js} +2 -2
- package/dist/export-CEOFAImT.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/{react-0RrtrG7t.js → react-BlzB-Chr.js} +1173 -1173
- package/dist/react-BlzB-Chr.js.map +1 -0
- package/dist/react-router.js.map +1 -1
- package/dist/react.js +1 -1
- package/dist/routes-CMXKbAo2.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/ui.js +143 -143
- package/dist/ui.js.map +1 -1
- package/dist/{viewEngine-DL-S0OAZ.js → viewEngine-lAwpy3jk.js} +4 -4
- package/dist/viewEngine-lAwpy3jk.js.map +1 -0
- package/package.json +14 -14
- package/dist/actions-CThpS7Yj.js.map +0 -1
- package/dist/export-D6bnNjrA.js.map +0 -1
- package/dist/react-0RrtrG7t.js.map +0 -1
- package/dist/viewEngine-DL-S0OAZ.js.map +0 -1
package/dist/react-router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-router.js","names":["
|
|
1
|
+
{"version":3,"file":"react-router.js","names":["useLocation","useNavigate","useReactRouter","$","_c","pathname","search","state","navigate","t0","t1","path","options","replace","t2","location","go","useReactRouter","$","c","useLocation","navigate","useNavigate","t0","pathname","search","state","t1","path","options","t2"],"sources":["../src/react-router/index.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * `@ahoo-wang/wow-view-engine/react-router`: the router port's adapter for\n * React Router (host-integration.md 4.2), the one the package ships —\n * React Router is an optional peer only this entry loads. A host on\n * another router writes the port's two members itself (`ViewRouter`).\n */\n\nimport { useMemo } from 'react';\nimport { useLocation, useNavigate } from 'react-router';\nimport type { ViewRouter } from '../runtime/routes.js';\n\nexport type { ViewLocation, ViewRouter } from '../runtime/routes.js';\n\n/**\n * React Router as `ViewHost`'s `router`, inside its `RouterProvider` (or\n * any router component): where it is, and a way to go — paths relative to\n * its `basename`, as its own links are.\n *\n * ```tsx\n * <ViewHost engine={engine} router={useReactRouter()} bindings={bindings}>\n * ```\n */\nexport function useReactRouter(): ViewRouter {\n const { pathname, search, state } = useLocation();\n const navigate = useNavigate();\n return useMemo(\n () => ({\n location: { pathname, search, state },\n go: (path, options) => {\n void navigate(path, {\n state: options?.state,\n replace: options?.replace,\n });\n },\n }),\n [pathname, search, state, navigate],\n );\n}\n"],"mappings":";;;AAmCA,SAAOE,IAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACL,EAAAC,aAAAC,WAAAC,aAAoCP,EAAY,GAChDQ,IAAiBP,EAAY,GAAEQ;CAAA,AAAAN,EAAA,OAAAE,KAAAF,EAAA,OAAAG,KAAAH,EAAA,OAAAI,KAGjBE,IAAA;EAAAJ;EAAAC;EAAAC;CAA0B,GAACJ,EAAA,KAAAE,GAAAF,EAAA,KAAAG,GAAAH,EAAA,KAAAI,GAAAJ,EAAA,KAAAM,KAAAA,IAAAN,EAAA;CAAA,IAAAO;CAAA,AAAAP,EAAA,OAAAK,IAMpCE,IAAAP,EAAA,MALGO,KAAAC,GAAAC,MAAA;EACGJ,EAASG,GAAM;GAAAJ,OACXK,GAAOL;GAAOM,SACZD,GAAOC;EAClB,CAAC;CAAC,GACHV,EAAA,KAAAK,GAAAL,EAAA,KAAAO;CAAA,IAAAI;CACF,OADEX,EAAA,OAAAM,KAAAN,EAAA,OAAAO,KAPII,IAAA;EAAAC,UACKN;EAA2BO,IACjCN;CAMN,GAACP,EAAA,KAAAM,GAAAN,EAAA,KAAAO,GAAAP,EAAA,KAAAW,KAAAA,IAAAX,EAAA,IARMW;AAQN"}
|
package/dist/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { H as browserRuntimeEnvironment, U as documentVisibility, B as useAnalysisEditor, z as useAnalysisResult, L as useAutoRefresh, m as useCreateViewEngine, j as useDashboard, A as useDatasets, g as useEngine, T as useFilterEditor, n as useHandOver, r as useHandedConditions, i as useHandedRemoval, s as useInstanceSync, o as useLeaveGuard, p as useOpenView, k as usePanelFollowUps, F as useRecordActions, w as useRecordDetail, C as useRecordExport, S as useRecordKanban, b as useRecordTable, N as useReferenceLabels, R as useRefreshCountdown, a as useReleaseDeleted, v as useSaveCommands, P as useSearchBox, M as useUnavailable, _ as useValueCandidates, d as useViewList, l as useViewManager, V as useViewRuntime, t as useWorkbench } from "./react-
|
|
1
|
+
export { H as browserRuntimeEnvironment, U as documentVisibility, B as useAnalysisEditor, z as useAnalysisResult, L as useAutoRefresh, m as useCreateViewEngine, j as useDashboard, A as useDatasets, g as useEngine, T as useFilterEditor, n as useHandOver, r as useHandedConditions, i as useHandedRemoval, s as useInstanceSync, o as useLeaveGuard, p as useOpenView, k as usePanelFollowUps, F as useRecordActions, w as useRecordDetail, C as useRecordExport, S as useRecordKanban, b as useRecordTable, N as useReferenceLabels, R as useRefreshCountdown, a as useReleaseDeleted, v as useSaveCommands, P as useSearchBox, M as useUnavailable, _ as useValueCandidates, d as useViewList, l as useViewManager, V as useViewRuntime, t as useWorkbench } from "./react-BlzB-Chr.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-CMXKbAo2.js","names":["
|
|
1
|
+
{"version":3,"file":"routes-CMXKbAo2.js","names":["handOver","filters","tab","kind","path","state","target","instanceId","resolveNavigation","to","bindingOf","definitionId","route","undefined","resolveNavigation","to","route","bindingOf"],"sources":["../src/runtime/routes.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A way off a board or a view resolved to the host's address\n * (host-integration.md 4): the route a host bound to the definition it\n * leads to, the path and what the page there is handed. Headless — the\n * bindings that hold the routes are React's (`/ui`'s `bind`).\n */\n\nimport type { DashboardFilters } from '../model/index.js';\nimport type {\n DashboardTarget,\n SavedViewTarget,\n UnsavedViewTarget,\n ViewHandOver,\n ViewNavigation,\n} from './navigation.js';\n\n/** A way off a board or a view that leads to one of the host's resources. */\nexport type RoutedTarget =\n SavedViewTarget | UnsavedViewTarget | DashboardTarget;\n\n/** What the page a route opens is handed with it, as history state. */\nexport interface ViewRouteState {\n /** A view to open as it came (`DataWorkbench`'s `handOver`). */\n handOver?: ViewHandOver;\n /** A board's filters (`DashboardWorkbench`'s `initialFilters`). */\n filters?: DashboardFilters;\n /** The tab a board opens on (`initialTab`); absent, where it was last read. */\n tab?: string | null;\n /**\n * What each board on the page left its filters and tab at, by the board\n * (`/ui`'s `ViewHost` writes it as the reader changes them): several\n * boards on one page each find their own again. A board that wrote\n * nothing here yet reads `filters` and `tab` above.\n */\n boards?: Record<string, { filters?: DashboardFilters; tab?: string | null }>;\n}\n\n/**\n * A way off a board or a view, resolved through its definition's `route`:\n * the host's path, and what the page there is handed.\n */\nexport interface ViewRoute {\n kind: 'route';\n path: string;\n state: ViewRouteState;\n /** What was asked for, for a host that wants more of it. */\n target: RoutedTarget;\n}\n\n/**\n * What the host's `navigate` is handed: a route, where the target's\n * definition has one; otherwise the target as it came — a URL, or a\n * definition the host bound no route for.\n */\nexport type ViewDestination = ViewRoute | ViewNavigation;\n\n/**\n * Where a view or a board of a definition lives in the host's address.\n * `target` is the way off it was asked for; it is absent where the engine\n * asks for a link rather than a way off — a resource's or a system view's\n * place in the host's navigation (`useViewNavigation`).\n */\nexport type ViewRouteOf = (\n instanceId: string | null,\n target?: RoutedTarget,\n) => string;\n\n/**\n * Where the host's router is (host-integration.md 4.2): what the engine\n * reads the open view (`?view=`), the open record (`?id=`) and what a page\n * was handed (`ViewRouteState`, the history entry's state) from.\n */\nexport interface ViewLocation {\n /** The path, without its search: `/orders`. */\n pathname: string;\n /** The search, with its `?`, or empty. */\n search: string;\n /** The state of the history entry, as the router keeps it. */\n state: unknown;\n}\n\n/**\n * The router port (host-integration.md 4.2): the host's router as the\n * engine reads and moves it — the one bridge to it, whichever library it\n * is. `/react-router`'s `useReactRouter` is one; a host on another router\n * writes these two members over it.\n *\n * The contract is the object's identity: **a new `ViewRouter` object\n * whenever `location` changes, and the same object while it does not.**\n * `ViewHost` hands it down through context, and everything that reads the\n * address — the open view, the open record, a board's filters and tab —\n * re-reads it when, and only when, the object is new. A router mutated in\n * place is never seen to move; one rebuilt on every render reads the\n * address anew on every render. Build it with `useMemo` over the\n * location's parts, as `useReactRouter` does. `go` is read at the moment\n * it is called, so it may be a new function each time.\n */\nexport interface ViewRouter {\n /** Where the router is now: a new object, in a new router, as it moves. */\n readonly location: ViewLocation;\n /**\n * Goes to `path` — the host's path, its search included — handing the\n * page there `state` as the history entry's; `replace` replaces the\n * entry rather than adding one.\n */\n go(path: string, options?: { state?: unknown; replace?: boolean }): void;\n}\n\n/**\n * `to` through the route of the definition it leads to, where it has one\n * (`bind`'s `route`, looked up by `bindingOf`): what the host's `navigate`\n * is handed. Pure, and in `/testing` too, so a host's tests of its\n * bindings run the engine's own resolution.\n */\nexport function resolveNavigation(\n to: ViewNavigation,\n bindingOf: (definitionId: string) => { route?: ViewRouteOf } | undefined,\n): ViewDestination {\n if (to.kind === 'url') return to;\n const route = bindingOf(to.definitionId)?.route;\n if (!route) return to;\n if (to.kind === 'dashboard')\n return {\n kind: 'route',\n path: route(to.instanceId, to),\n state: {\n filters: to.filters,\n ...(to.tab !== undefined ? { tab: to.tab } : {}),\n },\n target: to,\n };\n return {\n kind: 'route',\n path: route(to.kind === 'view' ? to.instanceId : null, to),\n state: { handOver: to },\n target: to,\n };\n}\n"],"mappings":";AA+HA,SAAgBQ,EACdC,GACAC,GACiB;CACjB,IAAID,EAAGN,SAAS,OAAO,OAAOM;CAC9B,IAAMG,IAAQF,EAAUD,EAAGE,YAAY,CAAC,EAAEC;CAY1C,OAXKA,IACDH,EAAGN,SAAS,cACP;EACLA,MAAM;EACNC,MAAMQ,EAAMH,EAAGF,YAAYE,CAAE;EAC7BJ,OAAO;GACLJ,SAASQ,EAAGR;GACZ,GAAIQ,EAAGP,QAAQW,KAAAA,IAA8B,CAAC,IAAnB,EAAEX,KAAKO,EAAGP,IAAI;EAC3C;EACAI,QAAQG;CACV,IACK;EACLN,MAAM;EACNC,MAAMQ,EAAMH,EAAGN,SAAS,SAASM,EAAGF,aAAa,MAAME,CAAE;EACzDJ,OAAO,EAAEL,UAAUS,EAAG;EACtBH,QAAQG;CACV,IAhBmBA;AAiBrB"}
|