@yimoka/designable-playground 0.0.0-stage → 0.1.1

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 (262) hide show
  1. package/README.md +8 -2
  2. package/dist/demo/components/Alert/index.d.ts +4 -0
  3. package/dist/demo/components/Alert/index.js +41 -0
  4. package/dist/demo/components/ArrayCards/index.d.ts +17 -0
  5. package/dist/demo/components/ArrayCards/index.js +62 -0
  6. package/dist/demo/components/ArrayList/index.d.ts +25 -0
  7. package/dist/demo/components/ArrayList/index.js +143 -0
  8. package/dist/demo/components/ArrayTable/index.d.ts +39 -0
  9. package/dist/demo/components/ArrayTable/index.js +247 -0
  10. package/dist/demo/components/AutoComplete/index.d.ts +4 -0
  11. package/dist/demo/components/AutoComplete/index.js +52 -0
  12. package/dist/demo/components/Avatar/index.d.ts +4 -0
  13. package/dist/demo/components/Avatar/index.js +34 -0
  14. package/dist/demo/components/Badge/index.d.ts +4 -0
  15. package/dist/demo/components/Badge/index.js +35 -0
  16. package/dist/demo/components/Button/index.d.ts +4 -0
  17. package/dist/demo/components/Button/index.js +86 -0
  18. package/dist/demo/components/Card/index.d.ts +4 -0
  19. package/dist/demo/components/Card/index.js +72 -0
  20. package/dist/demo/components/Carousel/index.d.ts +4 -0
  21. package/dist/demo/components/Carousel/index.js +33 -0
  22. package/dist/demo/components/Cascader/index.d.ts +4 -0
  23. package/dist/demo/components/Cascader/index.js +60 -0
  24. package/dist/demo/components/Checkbox/index.d.ts +8 -0
  25. package/dist/demo/components/Checkbox/index.js +55 -0
  26. package/dist/demo/components/ColorPicker/index.d.ts +4 -0
  27. package/dist/demo/components/ColorPicker/index.js +38 -0
  28. package/dist/demo/components/DatePicker/index.d.ts +4 -0
  29. package/dist/demo/components/DatePicker/index.js +61 -0
  30. package/dist/demo/components/DateRangePicker/index.d.ts +4 -0
  31. package/dist/demo/components/DateRangePicker/index.js +58 -0
  32. package/dist/demo/components/Divider/index.d.ts +4 -0
  33. package/dist/demo/components/Divider/index.js +39 -0
  34. package/dist/demo/components/Empty/index.d.ts +4 -0
  35. package/dist/demo/components/Empty/index.js +29 -0
  36. package/dist/demo/components/Flex/index.d.ts +4 -0
  37. package/dist/demo/components/Flex/index.js +51 -0
  38. package/dist/demo/components/Form/index.d.ts +21 -0
  39. package/dist/demo/components/Form/index.js +116 -0
  40. package/dist/demo/components/FormCollapse/index.d.ts +28 -0
  41. package/dist/demo/components/FormCollapse/index.js +164 -0
  42. package/dist/demo/components/FormGrid/index.d.ts +22 -0
  43. package/dist/demo/components/FormGrid/index.js +134 -0
  44. package/dist/demo/components/FormItem/index.d.ts +14 -0
  45. package/dist/demo/components/FormItem/index.js +33 -0
  46. package/dist/demo/components/FormLayout/index.d.ts +26 -0
  47. package/dist/demo/components/FormLayout/index.js +260 -0
  48. package/dist/demo/components/FormTab/index.d.ts +15 -0
  49. package/dist/demo/components/FormTab/index.js +186 -0
  50. package/dist/demo/components/GridCol/index.d.ts +4 -0
  51. package/dist/demo/components/GridCol/index.js +53 -0
  52. package/dist/demo/components/GridRow/index.d.ts +4 -0
  53. package/dist/demo/components/GridRow/index.js +70 -0
  54. package/dist/demo/components/HTMLContent/index.d.ts +4 -0
  55. package/dist/demo/components/HTMLContent/index.js +34 -0
  56. package/dist/demo/components/I18nEditor/index.d.ts +8 -0
  57. package/dist/demo/components/I18nEditor/index.js +64 -0
  58. package/dist/demo/components/Image/index.d.ts +4 -0
  59. package/dist/demo/components/Image/index.js +36 -0
  60. package/dist/demo/components/Input/index.d.ts +4 -0
  61. package/dist/demo/components/Input/index.js +36 -0
  62. package/dist/demo/components/InputSearch/index.d.ts +4 -0
  63. package/dist/demo/components/InputSearch/index.js +40 -0
  64. package/dist/demo/components/Link/index.d.ts +4 -0
  65. package/dist/demo/components/Link/index.js +37 -0
  66. package/dist/demo/components/Mentions/index.d.ts +4 -0
  67. package/dist/demo/components/Mentions/index.js +41 -0
  68. package/dist/demo/components/NumberPicker/index.d.ts +6 -0
  69. package/dist/demo/components/NumberPicker/index.js +63 -0
  70. package/dist/demo/components/ObjectContainer/index.d.ts +14 -0
  71. package/dist/demo/components/ObjectContainer/index.js +46 -0
  72. package/dist/demo/components/Password/index.d.ts +6 -0
  73. package/dist/demo/components/Password/index.js +44 -0
  74. package/dist/demo/components/QRCode/index.d.ts +4 -0
  75. package/dist/demo/components/QRCode/index.js +34 -0
  76. package/dist/demo/components/Radio/index.d.ts +6 -0
  77. package/dist/demo/components/Radio/index.js +49 -0
  78. package/dist/demo/components/Rate/index.d.ts +6 -0
  79. package/dist/demo/components/Rate/index.js +43 -0
  80. package/dist/demo/components/Search/index.d.ts +4 -0
  81. package/dist/demo/components/Search/index.js +42 -0
  82. package/dist/demo/components/SearchSelect/index.d.ts +4 -0
  83. package/dist/demo/components/SearchSelect/index.js +53 -0
  84. package/dist/demo/components/Select/index.d.ts +4 -0
  85. package/dist/demo/components/Select/index.js +59 -0
  86. package/dist/demo/components/Slider/index.d.ts +6 -0
  87. package/dist/demo/components/Slider/index.js +61 -0
  88. package/dist/demo/components/Space/index.d.ts +9 -0
  89. package/dist/demo/components/Space/index.js +61 -0
  90. package/dist/demo/components/Statistic/index.d.ts +4 -0
  91. package/dist/demo/components/Statistic/index.js +33 -0
  92. package/dist/demo/components/Switch/index.d.ts +4 -0
  93. package/dist/demo/components/Switch/index.js +49 -0
  94. package/dist/demo/components/Tabs/index.d.ts +10 -0
  95. package/dist/demo/components/Tabs/index.js +181 -0
  96. package/dist/demo/components/Tag/index.d.ts +4 -0
  97. package/dist/demo/components/Tag/index.js +33 -0
  98. package/dist/demo/components/Text/index.d.ts +11 -0
  99. package/dist/demo/components/Text/index.js +64 -0
  100. package/dist/demo/components/TextArea/index.d.ts +6 -0
  101. package/dist/demo/components/TextArea/index.js +43 -0
  102. package/dist/demo/components/TimePicker/index.d.ts +4 -0
  103. package/dist/demo/components/TimePicker/index.js +69 -0
  104. package/dist/demo/components/TimeRangePicker/index.d.ts +4 -0
  105. package/dist/demo/components/TimeRangePicker/index.js +68 -0
  106. package/dist/demo/components/Transfer/index.d.ts +6 -0
  107. package/dist/demo/components/Transfer/index.js +59 -0
  108. package/dist/demo/components/TreeSelect/index.d.ts +4 -0
  109. package/dist/demo/components/TreeSelect/index.js +63 -0
  110. package/dist/demo/components/Upload/index.d.ts +8 -0
  111. package/dist/demo/components/Upload/index.js +64 -0
  112. package/dist/demo/components/index.d.ts +55 -0
  113. package/dist/demo/components/index.js +55 -0
  114. package/dist/demo/components/shared.d.ts +143 -0
  115. package/dist/demo/components/shared.js +315 -0
  116. package/dist/src/Playground.d.ts +3 -0
  117. package/dist/src/Playground.js +304 -0
  118. package/dist/src/antd/AntdPlayground.d.ts +16 -0
  119. package/dist/src/antd/AntdPlayground.js +136 -0
  120. package/dist/src/antd/index.d.ts +1 -0
  121. package/dist/src/antd/index.js +1 -0
  122. package/dist/src/context.d.ts +4 -0
  123. package/dist/src/context.js +13 -0
  124. package/dist/src/examples/index.d.ts +267 -0
  125. package/dist/src/examples/index.js +824 -0
  126. package/dist/src/hooks/index.d.ts +4 -0
  127. package/dist/src/hooks/index.js +4 -0
  128. package/dist/src/hooks/remoteSchemaAdapter.d.ts +53 -0
  129. package/dist/src/hooks/remoteSchemaAdapter.js +262 -0
  130. package/dist/src/hooks/usePlayground.d.ts +38 -0
  131. package/dist/src/hooks/usePlayground.js +642 -0
  132. package/dist/src/hooks/usePlaygroundRemotePersistence.d.ts +135 -0
  133. package/dist/src/hooks/usePlaygroundRemotePersistence.js +736 -0
  134. package/dist/src/hooks/useSchemaEditorDraft.d.ts +4 -0
  135. package/dist/src/hooks/useSchemaEditorDraft.js +44 -0
  136. package/dist/src/index.d.ts +14 -0
  137. package/dist/src/index.js +14 -0
  138. package/dist/src/layouts/PlaygroundLayout/ErrorBoundaries.d.ts +59 -0
  139. package/dist/src/layouts/PlaygroundLayout/ErrorBoundaries.js +161 -0
  140. package/dist/src/layouts/PlaygroundLayout/index.d.ts +7 -0
  141. package/dist/src/layouts/PlaygroundLayout/index.js +443 -0
  142. package/dist/src/layouts/index.d.ts +1 -0
  143. package/dist/src/layouts/index.js +1 -0
  144. package/dist/src/panels/CompositePanel/index.d.ts +6 -0
  145. package/dist/src/panels/CompositePanel/index.js +139 -0
  146. package/dist/src/panels/ToolbarPanel/index.d.ts +3 -0
  147. package/dist/src/panels/ToolbarPanel/index.js +24 -0
  148. package/dist/src/panels/index.d.ts +2 -0
  149. package/dist/src/panels/index.js +2 -0
  150. package/dist/src/presets/antd.d.ts +19 -0
  151. package/dist/src/presets/antd.js +112 -0
  152. package/dist/src/presets/index.d.ts +4 -0
  153. package/dist/src/presets/index.js +3 -0
  154. package/dist/src/presets/runtime-array-helpers.d.ts +8 -0
  155. package/dist/src/presets/runtime-array-helpers.js +147 -0
  156. package/dist/src/presets/runtime-component-props.d.ts +3 -0
  157. package/dist/src/presets/runtime-component-props.js +5 -0
  158. package/dist/src/presets/runtime-components.d.ts +5 -0
  159. package/dist/src/presets/runtime-components.js +419 -0
  160. package/dist/src/presets/runtime-form-components.d.ts +9 -0
  161. package/dist/src/presets/runtime-form-components.js +94 -0
  162. package/dist/src/presets/scenario-catalog.d.ts +6 -0
  163. package/dist/src/presets/scenario-catalog.js +128 -0
  164. package/dist/src/presets/scenarios.d.ts +52 -0
  165. package/dist/src/presets/scenarios.js +603 -0
  166. package/dist/src/runtime/actions.d.ts +19 -0
  167. package/dist/src/runtime/actions.js +307 -0
  168. package/dist/src/runtime/contracts.d.ts +149 -0
  169. package/dist/src/runtime/contracts.js +1 -0
  170. package/dist/src/runtime/document-bindings.d.ts +3 -0
  171. package/dist/src/runtime/document-bindings.js +101 -0
  172. package/dist/src/runtime/document-core.d.ts +57 -0
  173. package/dist/src/runtime/document-core.js +379 -0
  174. package/dist/src/runtime/document-entity.d.ts +12 -0
  175. package/dist/src/runtime/document-entity.js +351 -0
  176. package/dist/src/runtime/document-expressions.d.ts +35 -0
  177. package/dist/src/runtime/document-expressions.js +346 -0
  178. package/dist/src/runtime/document-security.d.ts +34 -0
  179. package/dist/src/runtime/document-security.js +538 -0
  180. package/dist/src/runtime/document.d.ts +16 -0
  181. package/dist/src/runtime/document.js +212 -0
  182. package/dist/src/runtime/environment.d.ts +16 -0
  183. package/dist/src/runtime/environment.js +76 -0
  184. package/dist/src/runtime/i18n-schema.d.ts +36 -0
  185. package/dist/src/runtime/i18n-schema.js +338 -0
  186. package/dist/src/runtime/i18n.d.ts +25 -0
  187. package/dist/src/runtime/i18n.js +447 -0
  188. package/dist/src/runtime/index.d.ts +8 -0
  189. package/dist/src/runtime/index.js +8 -0
  190. package/dist/src/runtime/navigation.d.ts +5 -0
  191. package/dist/src/runtime/navigation.js +43 -0
  192. package/dist/src/runtime/playground.d.ts +30 -0
  193. package/dist/src/runtime/playground.js +243 -0
  194. package/dist/src/runtime/preview-boundaries.d.ts +13 -0
  195. package/dist/src/runtime/preview-boundaries.js +43 -0
  196. package/dist/src/runtime/preview.d.ts +44 -0
  197. package/dist/src/runtime/preview.js +574 -0
  198. package/dist/src/runtime/settings/RuntimeJsonEditor.d.ts +10 -0
  199. package/dist/src/runtime/settings/RuntimeJsonEditor.js +21 -0
  200. package/dist/src/runtime/settings/RuntimeStoreEntitySettings.d.ts +15 -0
  201. package/dist/src/runtime/settings/RuntimeStoreEntitySettings.js +65 -0
  202. package/dist/src/runtime/templates.d.ts +1560 -0
  203. package/dist/src/runtime/templates.js +508 -0
  204. package/dist/src/runtime/website-contact-template.d.ts +1 -0
  205. package/dist/src/runtime/website-contact-template.js +66 -0
  206. package/dist/src/runtime/website-template-shared.d.ts +14 -0
  207. package/dist/src/runtime/website-template-shared.js +210 -0
  208. package/dist/src/runtime/website-templates.d.ts +5 -0
  209. package/dist/src/runtime/website-templates.js +976 -0
  210. package/dist/src/shared/clipboard.d.ts +4 -0
  211. package/dist/src/shared/clipboard.js +56 -0
  212. package/dist/src/shared/componentRegistry.d.ts +133 -0
  213. package/dist/src/shared/componentRegistry.js +381 -0
  214. package/dist/src/shared/formilyCompatibility.d.ts +8 -0
  215. package/dist/src/shared/formilyCompatibility.js +40 -0
  216. package/dist/src/shared/index.d.ts +6 -0
  217. package/dist/src/shared/index.js +6 -0
  218. package/dist/src/shared/productionAcceptance.d.ts +63 -0
  219. package/dist/src/shared/productionAcceptance.js +201 -0
  220. package/dist/src/shared/schema-options.d.ts +16 -0
  221. package/dist/src/shared/schema-options.js +138 -0
  222. package/dist/src/shared/schema.d.ts +63 -0
  223. package/dist/src/shared/schema.js +627 -0
  224. package/dist/src/shared/styleSecurity.d.ts +2 -0
  225. package/dist/src/shared/styleSecurity.js +35 -0
  226. package/dist/src/transformers/formily.d.ts +34 -0
  227. package/dist/src/transformers/formily.js +943 -0
  228. package/dist/src/transformers/index.d.ts +1 -0
  229. package/dist/src/transformers/index.js +1 -0
  230. package/dist/src/types.d.ts +186 -0
  231. package/dist/src/types.js +1 -0
  232. package/dist/src/widgets/ActionsWidget/index.d.ts +3 -0
  233. package/dist/src/widgets/ActionsWidget/index.js +10 -0
  234. package/dist/src/widgets/ComponentTreeWidget/index.d.ts +3 -0
  235. package/dist/src/widgets/ComponentTreeWidget/index.js +333 -0
  236. package/dist/src/widgets/NodeActionsWidget/index.d.ts +2 -0
  237. package/dist/src/widgets/NodeActionsWidget/index.js +125 -0
  238. package/dist/src/widgets/OutlineTreeWidget/index.d.ts +3 -0
  239. package/dist/src/widgets/OutlineTreeWidget/index.js +432 -0
  240. package/dist/src/widgets/OutlineTreeWidget/shared.d.ts +32 -0
  241. package/dist/src/widgets/OutlineTreeWidget/shared.js +79 -0
  242. package/dist/src/widgets/PreviewWidget/index.d.ts +2 -0
  243. package/dist/src/widgets/PreviewWidget/index.js +1566 -0
  244. package/dist/src/widgets/ProductionReadinessWidget/index.d.ts +18 -0
  245. package/dist/src/widgets/ProductionReadinessWidget/index.js +356 -0
  246. package/dist/src/widgets/RemotePersistenceStatusWidget/index.d.ts +18 -0
  247. package/dist/src/widgets/RemotePersistenceStatusWidget/index.js +438 -0
  248. package/dist/src/widgets/RemoteVersionHistoryWidget/index.d.ts +39 -0
  249. package/dist/src/widgets/RemoteVersionHistoryWidget/index.js +475 -0
  250. package/dist/src/widgets/ResourceWidget/index.d.ts +3 -0
  251. package/dist/src/widgets/ResourceWidget/index.js +491 -0
  252. package/dist/src/widgets/SchemaCodeView/index.d.ts +7 -0
  253. package/dist/src/widgets/SchemaCodeView/index.js +225 -0
  254. package/dist/src/widgets/SchemaEditorWidget/index.d.ts +10 -0
  255. package/dist/src/widgets/SchemaEditorWidget/index.js +484 -0
  256. package/dist/src/widgets/SettingsPanelWidget/index.d.ts +3 -0
  257. package/dist/src/widgets/SettingsPanelWidget/index.js +190 -0
  258. package/dist/src/widgets/StorageActionsWidget/index.d.ts +2 -0
  259. package/dist/src/widgets/StorageActionsWidget/index.js +284 -0
  260. package/dist/src/widgets/index.d.ts +13 -0
  261. package/dist/src/widgets/index.js +13 -0
  262. package/package.json +100 -4
@@ -0,0 +1,4 @@
1
+ export declare const writeClipboardTextWithTimeout: (writeText: () => Promise<void>, timeout?: number) => Promise<void>;
2
+ export declare const readClipboardTextWithTimeout: (readText: () => Promise<string>, timeout?: number) => Promise<string>;
3
+ export declare const copyTextToClipboard: (text: string) => Promise<void>;
4
+ export declare const readTextFromClipboard: () => Promise<string>;
@@ -0,0 +1,56 @@
1
+ const CLIPBOARD_READ_TIMEOUT = 5000;
2
+ const CLIPBOARD_WRITE_TIMEOUT = 5000;
3
+ const copyTextFallback = (text) => {
4
+ if (typeof document.execCommand !== 'function')
5
+ return false;
6
+ const textarea = document.createElement('textarea');
7
+ textarea.value = text;
8
+ textarea.setAttribute('readonly', 'true');
9
+ textarea.style.position = 'fixed';
10
+ textarea.style.left = '-9999px';
11
+ textarea.style.top = '0';
12
+ try {
13
+ document.body.append(textarea);
14
+ textarea.select();
15
+ return document.execCommand('copy');
16
+ }
17
+ finally {
18
+ textarea.remove();
19
+ }
20
+ };
21
+ export const writeClipboardTextWithTimeout = (writeText, timeout = CLIPBOARD_WRITE_TIMEOUT) => new Promise((resolve, reject) => {
22
+ const timer = window.setTimeout(() => {
23
+ reject(new Error('写入剪贴板超时,请确认浏览器剪贴板权限'));
24
+ }, timeout);
25
+ writeText()
26
+ .then(resolve, reject)
27
+ .finally(() => {
28
+ window.clearTimeout(timer);
29
+ });
30
+ });
31
+ export const readClipboardTextWithTimeout = (readText, timeout = CLIPBOARD_READ_TIMEOUT) => new Promise((resolve, reject) => {
32
+ const timer = window.setTimeout(() => {
33
+ reject(new Error('读取剪贴板超时,请确认浏览器剪贴板权限'));
34
+ }, timeout);
35
+ readText()
36
+ .then(resolve, reject)
37
+ .finally(() => {
38
+ window.clearTimeout(timer);
39
+ });
40
+ });
41
+ export const copyTextToClipboard = async (text) => {
42
+ const clipboard = typeof navigator === 'undefined' ? undefined : navigator.clipboard;
43
+ if (!clipboard?.writeText) {
44
+ if (copyTextFallback(text))
45
+ return;
46
+ throw new Error('当前浏览器不支持剪贴板 API');
47
+ }
48
+ await writeClipboardTextWithTimeout(() => clipboard.writeText(text));
49
+ };
50
+ export const readTextFromClipboard = async () => {
51
+ const clipboard = typeof navigator === 'undefined' ? undefined : navigator.clipboard;
52
+ if (!clipboard?.readText) {
53
+ throw new Error('当前浏览器不支持读取剪贴板');
54
+ }
55
+ return readClipboardTextWithTimeout(() => clipboard.readText());
56
+ };
@@ -0,0 +1,133 @@
1
+ import { type ISettingsSchemaSectionAnalysis } from '@yimoka/designable-antd';
2
+ import type { DnComponentRegistryItem } from '@yimoka/designable-react';
3
+ import type { IComponentCategory } from "../types.js";
4
+ import { type ISchemaValidationResult } from "./schema.js";
5
+ export interface IComponentRegistryValidationOptions {
6
+ categories?: IComponentCategory[];
7
+ ignoredComponentNames?: string[];
8
+ schema?: unknown;
9
+ requiredSettingsPropPaths?: Record<string, string[]>;
10
+ warnCategorizedComponentWithoutResource?: boolean;
11
+ }
12
+ export interface IComponentRegistryAnalysisOptions {
13
+ categories?: IComponentCategory[];
14
+ }
15
+ export interface IPlaygroundComponentReadinessMatrixOptions {
16
+ ignoredComponentNames?: string[];
17
+ requiredSettingsPropPaths?: Record<string, string[]>;
18
+ }
19
+ export type PlaygroundComponentReadinessStatus = 'blocked' | 'ready' | 'warning';
20
+ export type PlaygroundProductionReadinessStatus = 'blocked' | 'ready' | 'warning';
21
+ export type PlaygroundProductionReadinessPhase = 'blocked' | 'gray' | 'production';
22
+ export interface IPlaygroundProductionReadinessDecisionOptions {
23
+ blockWarnings?: boolean;
24
+ maxMessages?: number;
25
+ }
26
+ export interface IComponentCapabilityInfo {
27
+ componentName: string;
28
+ categoryKeys: string[];
29
+ behaviorCount: number;
30
+ resourceCount: number;
31
+ hasBehavior: boolean;
32
+ hasResource: boolean;
33
+ hasPropsSchema: boolean;
34
+ propertyNames: string[];
35
+ propertyCount: number;
36
+ }
37
+ export interface IComponentRegistryAnalysisResult {
38
+ totalComponentCount: number;
39
+ editableComponentCount: number;
40
+ resourceComponentCount: number;
41
+ propsSchemaComponentCount: number;
42
+ totalEditablePropertyCount: number;
43
+ components: IComponentCapabilityInfo[];
44
+ }
45
+ export interface IComponentSettingsCapabilityInfo {
46
+ componentName: string;
47
+ hasStaticPropsSchema: boolean;
48
+ settingsEditablePropPaths: string[];
49
+ settingsEditablePropCount: number;
50
+ settingsStylePropertyCount: number;
51
+ settingsSections: ISettingsSchemaSectionAnalysis[];
52
+ }
53
+ export interface IPlaygroundProductionSettingsAnalysis {
54
+ totalComponentCount: number;
55
+ analyzableComponentCount: number;
56
+ styleCapableComponentCount: number;
57
+ totalSettingsEditablePropCount: number;
58
+ totalStylePropertyCount: number;
59
+ components: IComponentSettingsCapabilityInfo[];
60
+ }
61
+ export interface IPlaygroundComponentReadinessMatrixItem {
62
+ componentName: string;
63
+ categoryKeys: string[];
64
+ hasBehavior: boolean;
65
+ hasResource: boolean;
66
+ hasPropsSchema: boolean;
67
+ hasStyleSettings: boolean;
68
+ settingsEditablePropCount: number;
69
+ settingsStylePropertyCount: number;
70
+ missingRequiredSettingsPropPaths: string[];
71
+ status: PlaygroundComponentReadinessStatus;
72
+ reasons: string[];
73
+ }
74
+ export interface IPlaygroundComponentReadinessMatrix {
75
+ totalComponentCount: number;
76
+ readyComponentCount: number;
77
+ warningComponentCount: number;
78
+ blockedComponentCount: number;
79
+ components: IPlaygroundComponentReadinessMatrixItem[];
80
+ }
81
+ export interface IPlaygroundProductionReadinessReport {
82
+ valid: boolean;
83
+ validation: ISchemaValidationResult;
84
+ registry: IComponentRegistryAnalysisResult;
85
+ settings: IPlaygroundProductionSettingsAnalysis;
86
+ componentMatrix: IPlaygroundComponentReadinessMatrix;
87
+ }
88
+ export interface IAssertPlaygroundProductionReadyOptions {
89
+ blockWarnings?: boolean;
90
+ }
91
+ export interface IPlaygroundProductionReadinessDecision {
92
+ status: PlaygroundProductionReadinessStatus;
93
+ blockWarnings: boolean;
94
+ canPublish: boolean;
95
+ canGrayRelease: boolean;
96
+ issueCounts: {
97
+ errors: number;
98
+ warnings: number;
99
+ };
100
+ componentCounts: {
101
+ blocked: number;
102
+ ready: number;
103
+ total: number;
104
+ warning: number;
105
+ };
106
+ blockingMessages: string[];
107
+ warningMessages: string[];
108
+ summary: string;
109
+ }
110
+ export interface IPlaygroundProductionReadinessPhaseSummary {
111
+ phase: PlaygroundProductionReadinessPhase;
112
+ title: string;
113
+ description: string;
114
+ requiredActions: string[];
115
+ decision: IPlaygroundProductionReadinessDecision;
116
+ metrics: {
117
+ blockedComponentCount: number;
118
+ errorCount: number;
119
+ readyComponentCount: number;
120
+ totalComponentCount: number;
121
+ warningComponentCount: number;
122
+ warningCount: number;
123
+ };
124
+ }
125
+ export declare const getPlaygroundProductionReadinessStatus: (report: IPlaygroundProductionReadinessReport) => PlaygroundProductionReadinessStatus;
126
+ export declare const getEditableComponentNames: (components: Record<string, DnComponentRegistryItem>) => string[];
127
+ export declare const analyzeComponentRegistry: (components: Record<string, DnComponentRegistryItem>, options?: IComponentRegistryAnalysisOptions) => IComponentRegistryAnalysisResult;
128
+ export declare const analyzePlaygroundComponentReadinessMatrix: (registry: IComponentRegistryAnalysisResult, settings: IPlaygroundProductionSettingsAnalysis, options?: IPlaygroundComponentReadinessMatrixOptions) => IPlaygroundComponentReadinessMatrix;
129
+ export declare const analyzePlaygroundProductionReadiness: (components: Record<string, DnComponentRegistryItem>, options?: IComponentRegistryValidationOptions) => IPlaygroundProductionReadinessReport;
130
+ export declare const getPlaygroundProductionReadinessDecision: (report: IPlaygroundProductionReadinessReport, options?: IPlaygroundProductionReadinessDecisionOptions) => IPlaygroundProductionReadinessDecision;
131
+ export declare const getPlaygroundProductionReadinessPhaseSummary: (report: IPlaygroundProductionReadinessReport, options?: IPlaygroundProductionReadinessDecisionOptions) => IPlaygroundProductionReadinessPhaseSummary;
132
+ export declare const assertPlaygroundProductionReady: (report: IPlaygroundProductionReadinessReport, options?: IAssertPlaygroundProductionReadyOptions) => void;
133
+ export declare const validateComponentRegistry: (components: Record<string, DnComponentRegistryItem>, options?: IComponentRegistryValidationOptions) => ISchemaValidationResult;
@@ -0,0 +1,381 @@
1
+ import { analyzeSettingsSchema, } from '@yimoka/designable-antd';
2
+ import { validateSchemaSecurity, } from "./schema.js";
3
+ export const getPlaygroundProductionReadinessStatus = (report) => {
4
+ const hasValidationError = report.validation.issues.some(issue => issue.severity === 'error');
5
+ const hasValidationWarning = report.validation.issues.some(issue => issue.severity === 'warning');
6
+ if (hasValidationError || report.componentMatrix.blockedComponentCount > 0)
7
+ return 'blocked';
8
+ if (hasValidationWarning || report.componentMatrix.warningComponentCount > 0)
9
+ return 'warning';
10
+ return 'ready';
11
+ };
12
+ const hasBehavior = (component) => (Array.isArray(component?.Behavior) && component.Behavior.length > 0);
13
+ const hasResource = (component) => (Array.isArray(component?.Resource) && component.Resource.length > 0);
14
+ const isRecord = (value) => (typeof value === 'object' && value !== null && !Array.isArray(value));
15
+ const getComponentBehaviors = (component) => (Array.isArray(component?.Behavior) ? component.Behavior : []);
16
+ const getComponentResources = (component) => (Array.isArray(component?.Resource) ? component.Resource : []);
17
+ const getBehaviorPropsSchemas = (component) => (getComponentBehaviors(component)
18
+ .map((behavior) => {
19
+ const { designerProps } = behavior;
20
+ if (!isRecord(designerProps))
21
+ return undefined;
22
+ return designerProps.propsSchema;
23
+ })
24
+ .filter(isRecord));
25
+ const getFirstBehaviorPropsSchema = (component) => getBehaviorPropsSchemas(component)[0];
26
+ const collectSchemaPropertyPaths = (schema, prefix = '') => {
27
+ if (!isRecord(schema) || !isRecord(schema.properties))
28
+ return [];
29
+ return Object.entries(schema.properties).flatMap(([propertyName, propertySchema]) => {
30
+ const path = prefix ? `${prefix}.${propertyName}` : propertyName;
31
+ return [
32
+ path,
33
+ ...collectSchemaPropertyPaths(propertySchema, path),
34
+ ];
35
+ });
36
+ };
37
+ const createCategoryKeyMap = (categories) => {
38
+ const categoryKeyMap = new Map();
39
+ categories?.forEach((category) => {
40
+ category.components.forEach((componentName) => {
41
+ categoryKeyMap.set(componentName, [
42
+ ...(categoryKeyMap.get(componentName) ?? []),
43
+ category.key,
44
+ ]);
45
+ });
46
+ });
47
+ return categoryKeyMap;
48
+ };
49
+ const createCategorizedComponentNameSet = (categories) => (new Set(categories?.flatMap(category => category.components) ?? []));
50
+ const getUncategorizedComponentNames = (components, categories) => {
51
+ const categorizedComponentNameSet = createCategorizedComponentNameSet(categories);
52
+ return Object.keys(components).filter(componentName => !categorizedComponentNameSet.has(componentName));
53
+ };
54
+ const createComponentCapabilityInfo = (componentName, component, categoryKeyMap) => {
55
+ const behaviors = getComponentBehaviors(component);
56
+ const resources = getComponentResources(component);
57
+ const propertyNames = Array.from(new Set(getBehaviorPropsSchemas(component).flatMap(schema => collectSchemaPropertyPaths(schema)))).sort();
58
+ return {
59
+ behaviorCount: behaviors.length,
60
+ categoryKeys: categoryKeyMap.get(componentName) ?? [],
61
+ componentName,
62
+ hasBehavior: behaviors.length > 0,
63
+ hasPropsSchema: propertyNames.length > 0,
64
+ hasResource: resources.length > 0,
65
+ propertyCount: propertyNames.length,
66
+ propertyNames,
67
+ resourceCount: resources.length,
68
+ };
69
+ };
70
+ const createValidationResult = (issues) => ({
71
+ issues,
72
+ valid: !issues.some(issue => issue.severity === 'error'),
73
+ });
74
+ const pushIssue = (issues, issue) => {
75
+ issues.push(issue);
76
+ };
77
+ const validateRegisteredComponents = (components, issues, ignoredComponentNames) => {
78
+ const ignoredComponentNameSet = new Set(ignoredComponentNames);
79
+ Object.entries(components).forEach(([componentName, component]) => {
80
+ if (ignoredComponentNameSet.has(componentName))
81
+ return;
82
+ if (hasBehavior(component))
83
+ return;
84
+ pushIssue(issues, {
85
+ code: 'component_behavior_missing',
86
+ componentName,
87
+ message: `组件缺少 Behavior,无法在设计视图中编辑:${componentName}`,
88
+ path: `components.${componentName}.Behavior`,
89
+ severity: 'error',
90
+ });
91
+ });
92
+ };
93
+ const validateCategoryComponents = (components, categories, issues, warnCategorizedComponentWithoutResource) => {
94
+ categories?.forEach((category) => {
95
+ category.components.forEach((componentName) => {
96
+ const component = components[componentName];
97
+ if (!component) {
98
+ pushIssue(issues, {
99
+ code: 'category_component_missing',
100
+ componentName,
101
+ message: `组件分类引用了未注册组件:${componentName}`,
102
+ path: `categories.${category.key}.components.${componentName}`,
103
+ severity: 'error',
104
+ });
105
+ return;
106
+ }
107
+ if (warnCategorizedComponentWithoutResource && !hasResource(component)) {
108
+ pushIssue(issues, {
109
+ code: 'component_resource_missing',
110
+ componentName,
111
+ message: `组件缺少 Resource,无法从资源面板拖拽添加:${componentName}`,
112
+ path: `components.${componentName}.Resource`,
113
+ severity: 'warning',
114
+ });
115
+ }
116
+ });
117
+ });
118
+ };
119
+ export const getEditableComponentNames = (components) => (Object.entries(components)
120
+ .filter(([, component]) => hasBehavior(component))
121
+ .map(([componentName]) => componentName));
122
+ export const analyzeComponentRegistry = (components, options = {}) => {
123
+ const categoryKeyMap = createCategoryKeyMap(options.categories);
124
+ const componentInfos = Object.entries(components)
125
+ .map(([componentName, component]) => createComponentCapabilityInfo(componentName, component, categoryKeyMap))
126
+ .sort((current, next) => current.componentName.localeCompare(next.componentName));
127
+ return {
128
+ components: componentInfos,
129
+ editableComponentCount: componentInfos.filter(component => component.hasBehavior).length,
130
+ propsSchemaComponentCount: componentInfos.filter(component => component.hasPropsSchema).length,
131
+ resourceComponentCount: componentInfos.filter(component => component.hasResource).length,
132
+ totalComponentCount: componentInfos.length,
133
+ totalEditablePropertyCount: componentInfos.reduce((total, component) => total + component.propertyCount, 0),
134
+ };
135
+ };
136
+ const createComponentSettingsCapabilityInfo = (componentName, component) => {
137
+ const propsSchema = getFirstBehaviorPropsSchema(component);
138
+ if (!propsSchema) {
139
+ return {
140
+ componentName,
141
+ hasStaticPropsSchema: false,
142
+ settingsEditablePropCount: 0,
143
+ settingsEditablePropPaths: [],
144
+ settingsSections: [],
145
+ settingsStylePropertyCount: 0,
146
+ };
147
+ }
148
+ const report = analyzeSettingsSchema(propsSchema);
149
+ return {
150
+ componentName,
151
+ hasStaticPropsSchema: true,
152
+ settingsEditablePropCount: report.totalEditablePropCount,
153
+ settingsEditablePropPaths: report.editablePropPaths,
154
+ settingsSections: report.sectionReports,
155
+ settingsStylePropertyCount: report.stylePropertyCount,
156
+ };
157
+ };
158
+ const analyzePlaygroundSettingsCoverage = (components) => {
159
+ const componentInfos = Object.entries(components)
160
+ .map(([componentName, component]) => createComponentSettingsCapabilityInfo(componentName, component))
161
+ .sort((current, next) => current.componentName.localeCompare(next.componentName));
162
+ return {
163
+ analyzableComponentCount: componentInfos.filter(component => component.hasStaticPropsSchema).length,
164
+ components: componentInfos,
165
+ styleCapableComponentCount: componentInfos.filter(component => component.settingsStylePropertyCount > 0).length,
166
+ totalComponentCount: componentInfos.length,
167
+ totalSettingsEditablePropCount: componentInfos.reduce((total, component) => total + component.settingsEditablePropCount, 0),
168
+ totalStylePropertyCount: componentInfos.reduce((total, component) => total + component.settingsStylePropertyCount, 0),
169
+ };
170
+ };
171
+ const getReadinessReasons = (registryInfo, settingsInfo) => {
172
+ const reasons = [];
173
+ if (!registryInfo.hasBehavior) {
174
+ reasons.push('缺少 Behavior,无法在设计视图中编辑');
175
+ }
176
+ if (!registryInfo.hasResource) {
177
+ reasons.push('缺少 Resource,无法从资源面板拖拽添加');
178
+ }
179
+ if (!registryInfo.hasPropsSchema) {
180
+ reasons.push('缺少 propsSchema,属性面板无组件专属配置');
181
+ }
182
+ if (!settingsInfo?.settingsStylePropertyCount) {
183
+ reasons.push('缺少通用样式配置覆盖');
184
+ }
185
+ return reasons;
186
+ };
187
+ const getMissingRequiredSettingsPropPaths = (settingsInfo, requiredPropPaths) => {
188
+ if (!requiredPropPaths?.length)
189
+ return [];
190
+ const actualPathSet = new Set(settingsInfo?.settingsEditablePropPaths ?? []);
191
+ return requiredPropPaths.filter(propPath => !actualPathSet.has(propPath));
192
+ };
193
+ const getReadinessStatus = (registryInfo, reasons) => {
194
+ if (!registryInfo.hasBehavior)
195
+ return 'blocked';
196
+ if (reasons.length > 0)
197
+ return 'warning';
198
+ return 'ready';
199
+ };
200
+ export const analyzePlaygroundComponentReadinessMatrix = (registry, settings, options = {}) => {
201
+ const ignoredComponentNameSet = new Set(options.ignoredComponentNames ?? []);
202
+ const settingsMap = new Map(settings.components.map(component => [component.componentName, component]));
203
+ const components = registry.components
204
+ .filter(registryInfo => !ignoredComponentNameSet.has(registryInfo.componentName))
205
+ .map((registryInfo) => {
206
+ const settingsInfo = settingsMap.get(registryInfo.componentName);
207
+ const reasons = getReadinessReasons(registryInfo, settingsInfo);
208
+ const missingRequiredSettingsPropPaths = getMissingRequiredSettingsPropPaths(settingsInfo, options.requiredSettingsPropPaths?.[registryInfo.componentName]);
209
+ if (missingRequiredSettingsPropPaths.length) {
210
+ reasons.push(`缺少生产关键属性:${missingRequiredSettingsPropPaths.join('、')}`);
211
+ }
212
+ return {
213
+ categoryKeys: registryInfo.categoryKeys,
214
+ componentName: registryInfo.componentName,
215
+ hasBehavior: registryInfo.hasBehavior,
216
+ hasPropsSchema: registryInfo.hasPropsSchema,
217
+ hasResource: registryInfo.hasResource,
218
+ hasStyleSettings: Boolean(settingsInfo?.settingsStylePropertyCount),
219
+ missingRequiredSettingsPropPaths,
220
+ reasons,
221
+ settingsEditablePropCount: settingsInfo?.settingsEditablePropCount ?? 0,
222
+ settingsStylePropertyCount: settingsInfo?.settingsStylePropertyCount ?? 0,
223
+ status: getReadinessStatus(registryInfo, reasons),
224
+ };
225
+ });
226
+ return {
227
+ blockedComponentCount: components.filter(component => component.status === 'blocked').length,
228
+ components,
229
+ readyComponentCount: components.filter(component => component.status === 'ready').length,
230
+ totalComponentCount: components.length,
231
+ warningComponentCount: components.filter(component => component.status === 'warning').length,
232
+ };
233
+ };
234
+ export const analyzePlaygroundProductionReadiness = (components, options = {}) => {
235
+ const ignoredComponentNames = [
236
+ ...getUncategorizedComponentNames(components, options.categories),
237
+ ...(options.ignoredComponentNames ?? []),
238
+ ];
239
+ const validation = validateComponentRegistry(components, {
240
+ ...options,
241
+ ignoredComponentNames,
242
+ });
243
+ if (options.schema !== undefined) {
244
+ validation.issues.push(...validateSchemaSecurity(options.schema));
245
+ validation.valid = !validation.issues.some(issue => issue.severity === 'error');
246
+ }
247
+ const registry = analyzeComponentRegistry(components, {
248
+ categories: options.categories,
249
+ });
250
+ const settings = analyzePlaygroundSettingsCoverage(components);
251
+ return {
252
+ componentMatrix: analyzePlaygroundComponentReadinessMatrix(registry, settings, {
253
+ ignoredComponentNames,
254
+ requiredSettingsPropPaths: options.requiredSettingsPropPaths,
255
+ }),
256
+ registry,
257
+ settings,
258
+ valid: validation.valid,
259
+ validation,
260
+ };
261
+ };
262
+ const getProductionReadinessBlockingMessages = (report, options = {}) => {
263
+ const blockWarnings = options.blockWarnings ?? true;
264
+ const validationIssues = report.validation.issues.filter(issue => (issue.severity === 'error' || blockWarnings));
265
+ const blockedComponents = report.componentMatrix.components.filter(component => (component.status === 'blocked' || (blockWarnings && component.status === 'warning')));
266
+ return [
267
+ ...validationIssues.map(issue => issue.message),
268
+ ...blockedComponents.map(component => (`${component.componentName}: ${component.reasons.join(';') || '未通过生产准入'}`)),
269
+ ];
270
+ };
271
+ const getProductionReadinessWarningMessages = (report) => {
272
+ const validationWarnings = report.validation.issues
273
+ .filter(issue => issue.severity === 'warning')
274
+ .map(issue => issue.message);
275
+ const warningComponents = report.componentMatrix.components
276
+ .filter(component => component.status === 'warning')
277
+ .map(component => (`${component.componentName}: ${component.reasons.join(';') || '存在待补项'}`));
278
+ return [
279
+ ...validationWarnings,
280
+ ...warningComponents,
281
+ ];
282
+ };
283
+ const createReadinessDecisionSummary = (decision) => {
284
+ if (!decision.canGrayRelease) {
285
+ return `存在生产阻断:${decision.issueCounts.errors} 个错误,${decision.componentCounts.blocked} 个组件阻断`;
286
+ }
287
+ if (!decision.canPublish) {
288
+ return `可灰度发布:${decision.issueCounts.warnings} 个 warning,${decision.componentCounts.warning} 个组件待补`;
289
+ }
290
+ if (decision.status === 'warning') {
291
+ return `可发布但建议关注:${decision.issueCounts.warnings} 个 warning,${decision.componentCounts.warning} 个组件待补`;
292
+ }
293
+ return `可正式发布:${decision.componentCounts.ready}/${decision.componentCounts.total} 个组件通过准入`;
294
+ };
295
+ export const getPlaygroundProductionReadinessDecision = (report, options = {}) => {
296
+ const blockWarnings = options.blockWarnings ?? true;
297
+ const maxMessages = options.maxMessages ?? 5;
298
+ const status = getPlaygroundProductionReadinessStatus(report);
299
+ const blockingMessages = getProductionReadinessBlockingMessages(report, { blockWarnings });
300
+ const grayBlockingMessages = getProductionReadinessBlockingMessages(report, { blockWarnings: false });
301
+ const validationErrorCount = report.validation.issues.filter(issue => issue.severity === 'error').length;
302
+ const validationWarningCount = report.validation.issues.filter(issue => issue.severity === 'warning').length;
303
+ const decisionDraft = {
304
+ blockWarnings,
305
+ blockingMessages: blockingMessages.slice(0, maxMessages),
306
+ canGrayRelease: grayBlockingMessages.length === 0,
307
+ canPublish: blockingMessages.length === 0,
308
+ componentCounts: {
309
+ blocked: report.componentMatrix.blockedComponentCount,
310
+ ready: report.componentMatrix.readyComponentCount,
311
+ total: report.componentMatrix.totalComponentCount,
312
+ warning: report.componentMatrix.warningComponentCount,
313
+ },
314
+ issueCounts: {
315
+ errors: validationErrorCount,
316
+ warnings: validationWarningCount,
317
+ },
318
+ status,
319
+ warningMessages: getProductionReadinessWarningMessages(report).slice(0, maxMessages),
320
+ };
321
+ return {
322
+ ...decisionDraft,
323
+ summary: createReadinessDecisionSummary(decisionDraft),
324
+ };
325
+ };
326
+ export const getPlaygroundProductionReadinessPhaseSummary = (report, options = {}) => {
327
+ const decision = getPlaygroundProductionReadinessDecision(report, options);
328
+ const metrics = {
329
+ blockedComponentCount: decision.componentCounts.blocked,
330
+ errorCount: decision.issueCounts.errors,
331
+ readyComponentCount: decision.componentCounts.ready,
332
+ totalComponentCount: decision.componentCounts.total,
333
+ warningComponentCount: decision.componentCounts.warning,
334
+ warningCount: decision.issueCounts.warnings,
335
+ };
336
+ if (!decision.canGrayRelease) {
337
+ return {
338
+ decision,
339
+ description: '存在 error 或组件阻断,需修复后才能进入灰度或正式发布。',
340
+ metrics,
341
+ phase: 'blocked',
342
+ requiredActions: decision.blockingMessages,
343
+ title: '阻断',
344
+ };
345
+ }
346
+ if (!decision.canPublish || decision.status === 'warning') {
347
+ return {
348
+ decision,
349
+ description: decision.canPublish
350
+ ? '已满足发布条件,但仍建议先灰度观察并补齐 warning。'
351
+ : '可进入灰度验证,正式发布前仍需清理 warning 和待补组件。',
352
+ metrics,
353
+ phase: 'gray',
354
+ requiredActions: decision.warningMessages,
355
+ title: '灰度发布',
356
+ };
357
+ }
358
+ return {
359
+ decision,
360
+ description: '组件注册、属性覆盖和 Schema 安全检查均满足正式发布条件。',
361
+ metrics,
362
+ phase: 'production',
363
+ requiredActions: [],
364
+ title: '正式发布',
365
+ };
366
+ };
367
+ export const assertPlaygroundProductionReady = (report, options = {}) => {
368
+ const messages = getProductionReadinessBlockingMessages(report, options);
369
+ if (messages.length === 0)
370
+ return;
371
+ throw new Error([
372
+ `Playground 生产准入未通过:${messages.length} 个阻断项`,
373
+ ...messages.slice(0, 5).map(message => `- ${message}`),
374
+ ].join('\n'));
375
+ };
376
+ export const validateComponentRegistry = (components, options = {}) => {
377
+ const issues = [];
378
+ validateRegisteredComponents(components, issues, options.ignoredComponentNames ?? []);
379
+ validateCategoryComponents(components, options.categories, issues, options.warnCategorizedComponentWithoutResource ?? true);
380
+ return createValidationResult(issues);
381
+ };
@@ -0,0 +1,8 @@
1
+ import { TreeNode, type ITreeNode } from '@yimoka/designable-core';
2
+ import type { ISchemaTransformer } from "../types.js";
3
+ export declare const HISTORICAL_FIELD_COMPONENT_NAME = "Field";
4
+ export declare const DEFAULT_FORMILY_COMPONENT_NAME_ALIASES: Record<string, string>;
5
+ export declare const IGNORED_HISTORICAL_FORMILY_COMPONENT_NAMES: Set<string>;
6
+ export declare const HISTORICAL_FORMILY_TREE_COMPONENT_NAMES: Set<string>;
7
+ export declare const hasHistoricalFormilyTreeSchemaNode: (schema: ITreeNode) => boolean;
8
+ export declare const normalizeHistoricalFormilyTreeSchema: <S = unknown>(schema: ITreeNode, transformer?: ISchemaTransformer<S>) => ITreeNode | TreeNode;
@@ -0,0 +1,40 @@
1
+ import { TreeNode } from '@yimoka/designable-core';
2
+ export const HISTORICAL_FIELD_COMPONENT_NAME = 'Field';
3
+ export const DEFAULT_FORMILY_COMPONENT_NAME_ALIASES = {
4
+ 'ArrayTable.Column': 'ArrayTableColumn',
5
+ 'Checkbox.Group': 'Checkbox',
6
+ 'DatePicker.RangePicker': 'DateRangePicker',
7
+ 'FormCollapse.CollapsePanel': 'FormCollapsePanel',
8
+ 'FormGrid.GridColumn': 'FormGridColumn',
9
+ 'Input.TextArea': 'TextArea',
10
+ InputNumber: 'NumberPicker',
11
+ 'Radio.Group': 'Radio',
12
+ 'TimePicker.RangePicker': 'TimeRangePicker',
13
+ 'Upload.Dragger': 'Upload',
14
+ };
15
+ export const IGNORED_HISTORICAL_FORMILY_COMPONENT_NAMES = new Set([
16
+ 'ArrayCards.Addition',
17
+ 'ArrayCards.Index',
18
+ 'ArrayCards.MoveDown',
19
+ 'ArrayCards.MoveUp',
20
+ 'ArrayCards.Remove',
21
+ 'ArrayTable.Addition',
22
+ 'ArrayTable.Index',
23
+ 'ArrayTable.MoveDown',
24
+ 'ArrayTable.MoveUp',
25
+ 'ArrayTable.Remove',
26
+ 'ArrayTable.SortHandle',
27
+ ]);
28
+ export const HISTORICAL_FORMILY_TREE_COMPONENT_NAMES = new Set([
29
+ ...IGNORED_HISTORICAL_FORMILY_COMPONENT_NAMES,
30
+ ...Object.keys(DEFAULT_FORMILY_COMPONENT_NAME_ALIASES),
31
+ ]);
32
+ export const hasHistoricalFormilyTreeSchemaNode = (schema) => ((schema.componentName === HISTORICAL_FIELD_COMPONENT_NAME
33
+ && typeof schema.props?.['x-component'] === 'string')
34
+ || (typeof schema.componentName === 'string' && HISTORICAL_FORMILY_TREE_COMPONENT_NAMES.has(schema.componentName))
35
+ || Boolean(schema.children?.some(hasHistoricalFormilyTreeSchemaNode)));
36
+ export const normalizeHistoricalFormilyTreeSchema = (schema, transformer) => {
37
+ if (!transformer || !hasHistoricalFormilyTreeSchemaNode(schema))
38
+ return schema;
39
+ return transformer.toTreeNode(transformer.toSchema(new TreeNode(schema)));
40
+ };
@@ -0,0 +1,6 @@
1
+ export * from "./clipboard.js";
2
+ export * from "./componentRegistry.js";
3
+ export * from "./formilyCompatibility.js";
4
+ export * from "./productionAcceptance.js";
5
+ export * from "./schema.js";
6
+ export * from "./styleSecurity.js";
@@ -0,0 +1,6 @@
1
+ export * from "./clipboard.js";
2
+ export * from "./componentRegistry.js";
3
+ export * from "./formilyCompatibility.js";
4
+ export * from "./productionAcceptance.js";
5
+ export * from "./schema.js";
6
+ export * from "./styleSecurity.js";