@nocobase/client-v2 2.2.0-alpha.3 → 2.2.0-alpha.5

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.
Files changed (81) hide show
  1. package/es/BaseApplication.d.ts +2 -0
  2. package/es/RouteRepository.d.ts +8 -0
  3. package/es/RouterManager.d.ts +15 -0
  4. package/es/authRedirect.d.ts +1 -0
  5. package/es/components/form/TypedVariableInput.d.ts +9 -1
  6. package/es/components/form/filter/CollectionFilter.d.ts +2 -0
  7. package/es/components/form/filter/CollectionFilterPanel.d.ts +2 -0
  8. package/es/components/form/filter/useFilterActionProps.d.ts +2 -0
  9. package/es/entry-actions/EntryActionManager.d.ts +24 -0
  10. package/es/entry-actions/index.d.ts +9 -0
  11. package/es/flow/admin-shell/BaseLayoutModel.d.ts +6 -0
  12. package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +7 -0
  13. package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +2 -1
  14. package/es/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.d.ts +24 -0
  15. package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
  16. package/es/flow/admin-shell/admin-layout/useApplications.d.ts +7 -2
  17. package/es/flow/models/base/ActionModelCore.d.ts +2 -0
  18. package/es/flow/routeTransientInputArgs.d.ts +14 -0
  19. package/es/index.d.ts +6 -0
  20. package/es/index.mjs +229 -143
  21. package/es/utils/getRouteRuntimeVersion.d.ts +23 -0
  22. package/es/utils/index.d.ts +1 -0
  23. package/es/utils/markdownSanitize.d.ts +11 -0
  24. package/lib/index.js +219 -133
  25. package/package.json +7 -7
  26. package/src/BaseApplication.tsx +2 -0
  27. package/src/RouteRepository.ts +25 -0
  28. package/src/RouterManager.tsx +142 -1
  29. package/src/__tests__/RouteRepository.test.ts +23 -0
  30. package/src/__tests__/RouterManager.test.ts +125 -0
  31. package/src/__tests__/authRedirect.test.ts +17 -0
  32. package/src/__tests__/getRouteRuntimeVersion.test.ts +68 -0
  33. package/src/authRedirect.ts +38 -0
  34. package/src/components/form/JsonTextArea.tsx +4 -0
  35. package/src/components/form/TypedVariableInput.tsx +58 -34
  36. package/src/components/form/__tests__/TypedVariableInput.test.tsx +52 -0
  37. package/src/components/form/filter/CollectionFilter.tsx +4 -0
  38. package/src/components/form/filter/CollectionFilterPanel.tsx +4 -0
  39. package/src/components/form/filter/__tests__/useFilterActionProps.test.tsx +95 -0
  40. package/src/components/form/filter/useFilterActionProps.ts +37 -6
  41. package/src/entry-actions/EntryActionManager.ts +76 -0
  42. package/src/entry-actions/index.ts +10 -0
  43. package/src/flow/FlowPage.tsx +29 -2
  44. package/src/flow/__tests__/FlowPage.test.tsx +152 -25
  45. package/src/flow/__tests__/FlowRoute.test.tsx +547 -2
  46. package/src/flow/actions/__tests__/dataScopeFilter.test.ts +62 -0
  47. package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +80 -20
  48. package/src/flow/actions/dataScopeFilter.ts +10 -1
  49. package/src/flow/actions/dateTimeFormat.tsx +2 -2
  50. package/src/flow/actions/openView.tsx +21 -1
  51. package/src/flow/admin-shell/BaseLayoutModel.tsx +124 -0
  52. package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +184 -42
  53. package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +1016 -119
  54. package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +41 -4
  55. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +177 -1
  56. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +20 -0
  57. package/src/flow/admin-shell/admin-layout/AppListRender.tsx +13 -2
  58. package/src/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.tsx +289 -0
  59. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +436 -2
  60. package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +48 -0
  61. package/src/flow/admin-shell/admin-layout/index.ts +1 -0
  62. package/src/flow/admin-shell/admin-layout/useApplications.tsx +81 -12
  63. package/src/flow/common/Markdown/Display.tsx +14 -3
  64. package/src/flow/common/Markdown/Edit.tsx +19 -7
  65. package/src/flow/components/FlowRoute.tsx +128 -16
  66. package/src/flow/internal/components/Markdown/util.ts +2 -1
  67. package/src/flow/models/base/ActionModel.tsx +10 -8
  68. package/src/flow/models/base/ActionModelCore.tsx +5 -0
  69. package/src/flow/models/blocks/table/TableColumnModel.tsx +6 -2
  70. package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +51 -0
  71. package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +45 -13
  72. package/src/flow/models/fields/TextareaFieldModel.tsx +42 -19
  73. package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +32 -1
  74. package/src/flow/models/topbar/TopbarActionModel.tsx +78 -3
  75. package/src/flow/routeTransientInputArgs.ts +27 -0
  76. package/src/flow/utils/__tests__/dateTimeFormat.test.ts +42 -0
  77. package/src/index.ts +6 -0
  78. package/src/nocobase-buildin-plugin/index.tsx +7 -1
  79. package/src/utils/getRouteRuntimeVersion.ts +185 -0
  80. package/src/utils/index.tsx +1 -0
  81. package/src/utils/markdownSanitize.ts +88 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export type RouteRuntimeVersion = 'legacy' | 'modern';
10
+ declare global {
11
+ interface Window {
12
+ __nocobase_modern_client_prefix__?: string;
13
+ __nocobase_public_path__?: string;
14
+ }
15
+ }
16
+ /** Resolve which client shell currently owns the route.
17
+ *
18
+ * - returns `modern` when the current page is actually mounted under the modern
19
+ * client base path (`/v/`, `/nocobase/v/`, ...)
20
+ * - returns `legacy` when the route is still under the legacy shell, even if the
21
+ * modern prefix global has been injected into the page
22
+ */
23
+ export declare function getRouteRuntimeVersion(): RouteRuntimeVersion;
@@ -8,5 +8,6 @@
8
8
  */
9
9
  import React, { ComponentType } from 'react';
10
10
  export * from './appVersionHTML';
11
+ export * from './getRouteRuntimeVersion';
11
12
  export declare function normalizeContainer(container: Element | ShadowRoot | string): Element | null;
12
13
  export declare const compose: (...components: [ComponentType<any>, any][]) => (LastChild?: ComponentType<any>) => React.FC;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function stripMarkdownIframeTags(markdown: string): string;
10
+ export declare function stripMarkdownIframes(html: string): string;
11
+ export declare function removeMarkdownIframes(container?: ParentNode | null): void;