@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.
- package/dist/esm/chunk-6OZSB6PD.js +10 -0
- package/dist/esm/chunk-6OZSB6PD.js.map +1 -0
- package/dist/esm/chunk-G4HQ7OSI.js +440 -0
- package/dist/esm/chunk-G4HQ7OSI.js.map +1 -0
- package/dist/esm/chunk-QIJ4QVB2.js +271 -0
- package/dist/esm/chunk-QIJ4QVB2.js.map +1 -0
- package/dist/esm/editor-6UMULJYB.js +180 -0
- package/dist/esm/editor-6UMULJYB.js.map +1 -0
- package/dist/esm/editor-E2BQTPCD.js +388 -0
- package/dist/esm/editor-E2BQTPCD.js.map +1 -0
- package/dist/esm/editor-H2R7JJLO.js +282 -0
- package/dist/esm/editor-H2R7JJLO.js.map +1 -0
- package/dist/esm/editor-JX42GFAZ.js +249 -0
- package/dist/esm/editor-JX42GFAZ.js.map +1 -0
- package/dist/esm/editor-YMNCDGUR.js +167 -0
- package/dist/esm/editor-YMNCDGUR.js.map +1 -0
- package/dist/esm/index.js +1388 -3029
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +144 -51
- package/dist/index.d.ts +144 -51
- package/dist/index.js +3511 -2759
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/code-editor/editor.tsx +96 -0
- package/src/components/code-editor/index.tsx +5 -89
- package/src/components/code-editor/theme/dark.ts +49 -30
- package/src/components/code-editor/theme/light.ts +56 -32
- package/src/components/code-editor-mini/index.tsx +2 -2
- package/src/components/condition-row/index.tsx +4 -0
- package/src/components/db-condition-row/hooks/use-left.tsx +66 -0
- package/src/components/db-condition-row/hooks/use-op.tsx +59 -0
- package/src/components/db-condition-row/index.tsx +93 -0
- package/src/components/db-condition-row/styles.tsx +43 -0
- package/src/components/db-condition-row/types.ts +34 -0
- package/src/components/index.ts +1 -0
- package/src/components/json-editor-with-variables/editor.tsx +69 -0
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +4 -3
- package/src/components/json-editor-with-variables/index.tsx +5 -60
- package/src/components/prompt-editor/editor.tsx +81 -0
- package/src/components/prompt-editor/index.tsx +5 -69
- package/src/components/prompt-editor-with-inputs/editor.tsx +25 -0
- package/src/components/prompt-editor-with-inputs/index.tsx +5 -15
- package/src/components/prompt-editor-with-variables/editor.tsx +22 -0
- package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +10 -18
- package/src/components/prompt-editor-with-variables/index.tsx +5 -13
- package/src/shared/index.ts +1 -0
- 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
|
|
6
|
+
import { lazy } from 'react';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export const PromptEditorWithVariables = lazy(() =>
|
|
9
|
+
import('./editor').then((module) => ({ default: module.PromptEditorWithVariables }))
|
|
10
|
+
);
|
|
9
11
|
|
|
10
|
-
|
|
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';
|
package/src/shared/index.ts
CHANGED
|
@@ -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
|
+
}
|