@flowgram.ai/form-materials 0.4.4 → 0.4.6

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 (47) hide show
  1. package/dist/esm/chunk-6OZSB6PD.js +10 -0
  2. package/dist/esm/chunk-6OZSB6PD.js.map +1 -0
  3. package/dist/esm/chunk-G4HQ7OSI.js +440 -0
  4. package/dist/esm/chunk-G4HQ7OSI.js.map +1 -0
  5. package/dist/esm/chunk-QIJ4QVB2.js +271 -0
  6. package/dist/esm/chunk-QIJ4QVB2.js.map +1 -0
  7. package/dist/esm/editor-6UMULJYB.js +180 -0
  8. package/dist/esm/editor-6UMULJYB.js.map +1 -0
  9. package/dist/esm/editor-E2BQTPCD.js +388 -0
  10. package/dist/esm/editor-E2BQTPCD.js.map +1 -0
  11. package/dist/esm/editor-H2R7JJLO.js +282 -0
  12. package/dist/esm/editor-H2R7JJLO.js.map +1 -0
  13. package/dist/esm/editor-JX42GFAZ.js +249 -0
  14. package/dist/esm/editor-JX42GFAZ.js.map +1 -0
  15. package/dist/esm/editor-YMNCDGUR.js +167 -0
  16. package/dist/esm/editor-YMNCDGUR.js.map +1 -0
  17. package/dist/esm/index.js +1388 -3029
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/index.d.mts +144 -51
  20. package/dist/index.d.ts +144 -51
  21. package/dist/index.js +3511 -2759
  22. package/dist/index.js.map +1 -1
  23. package/package.json +6 -6
  24. package/src/components/code-editor/editor.tsx +96 -0
  25. package/src/components/code-editor/index.tsx +5 -89
  26. package/src/components/code-editor/theme/dark.ts +49 -30
  27. package/src/components/code-editor/theme/light.ts +56 -32
  28. package/src/components/code-editor-mini/index.tsx +2 -2
  29. package/src/components/condition-row/index.tsx +4 -0
  30. package/src/components/db-condition-row/hooks/use-left.tsx +66 -0
  31. package/src/components/db-condition-row/hooks/use-op.tsx +59 -0
  32. package/src/components/db-condition-row/index.tsx +93 -0
  33. package/src/components/db-condition-row/styles.tsx +43 -0
  34. package/src/components/db-condition-row/types.ts +34 -0
  35. package/src/components/index.ts +1 -0
  36. package/src/components/json-editor-with-variables/editor.tsx +69 -0
  37. package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +4 -3
  38. package/src/components/json-editor-with-variables/index.tsx +5 -60
  39. package/src/components/prompt-editor/editor.tsx +81 -0
  40. package/src/components/prompt-editor/index.tsx +5 -69
  41. package/src/components/prompt-editor-with-inputs/editor.tsx +25 -0
  42. package/src/components/prompt-editor-with-inputs/index.tsx +5 -15
  43. package/src/components/prompt-editor-with-variables/editor.tsx +22 -0
  44. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +10 -18
  45. package/src/components/prompt-editor-with-variables/index.tsx +5 -13
  46. package/src/shared/index.ts +1 -0
  47. package/src/shared/polyfill-create-root/index.tsx +33 -0
@@ -3,18 +3,10 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import React from 'react';
6
+ import { lazy } from 'react';
7
7
 
8
- import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
8
+ export const PromptEditorWithVariables = lazy(() =>
9
+ import('./editor').then((module) => ({ default: module.PromptEditorWithVariables }))
10
+ );
9
11
 
10
- import { VariableTree } from './extensions/variable-tree';
11
- import { VariableTagInject } from './extensions/variable-tag';
12
-
13
- export function PromptEditorWithVariables(props: PromptEditorPropsType) {
14
- return (
15
- <PromptEditor {...props}>
16
- <VariableTree />
17
- <VariableTagInject />
18
- </PromptEditor>
19
- );
20
- }
12
+ export type { PromptEditorWithVariablesProps } from './editor';
@@ -6,3 +6,4 @@
6
6
  export * from './format-legacy-refs';
7
7
  export * from './inject-material';
8
8
  export * from './flow-value';
9
+ export * from './polyfill-create-root';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import * as ReactDOM from 'react-dom';
7
+
8
+ export interface IPolyfillRoot {
9
+ render(children: React.ReactNode): void;
10
+ unmount(): void;
11
+ }
12
+
13
+ /**
14
+ * React 18 polyfill
15
+ * @param dom
16
+ * @returns
17
+ */
18
+ let unstableCreateRoot = (dom: HTMLElement): IPolyfillRoot => ({
19
+ render(children: JSX.Element) {
20
+ ReactDOM.render(children, dom);
21
+ },
22
+ unmount() {
23
+ ReactDOM.unmountComponentAtNode(dom);
24
+ },
25
+ });
26
+
27
+ export function polyfillCreateRoot(dom: HTMLElement): IPolyfillRoot {
28
+ return unstableCreateRoot(dom);
29
+ }
30
+
31
+ export function unstableSetCreateRoot(createRoot: (dom: HTMLElement) => IPolyfillRoot) {
32
+ unstableCreateRoot = createRoot;
33
+ }