Jelajahi Sumber

docs(materials): explain WIP in materials (#938)

* docs: scope chain docs

* docs: explain WIP for materials
Yiwei Mao 2 bulan lalu
induk
melakukan
6dd24973a0
66 mengubah file dengan 759 tambahan dan 44 penghapusan
  1. 64 0
      apps/docs/components/form-materials/components/db-condition-row.tsx
  2. 55 0
      apps/docs/components/form-materials/components/display-schema-tag.tsx
  3. 55 0
      apps/docs/components/form-materials/components/display-schema-tree.tsx
  4. 53 0
      apps/docs/components/form-materials/components/inputs-values-tree.tsx
  5. 42 0
      apps/docs/components/form-materials/components/prompt-editor.tsx
  6. 2 1
      apps/docs/src/en/guide/variable/_meta.json
  7. 58 0
      apps/docs/src/en/guide/variable/custom-scope-chain.mdx
  8. 4 0
      apps/docs/src/en/materials/common/disable-declaration-plugin.mdx
  9. 5 1
      apps/docs/src/en/materials/common/inject-material.mdx
  10. 4 0
      apps/docs/src/en/materials/common/json-schema-preset.mdx
  11. 4 0
      apps/docs/src/en/materials/components/assign-row.mdx
  12. 4 0
      apps/docs/src/en/materials/components/assign-rows.mdx
  13. 4 0
      apps/docs/src/en/materials/components/batch-outputs.mdx
  14. 4 0
      apps/docs/src/en/materials/components/batch-variable-selector.mdx
  15. 4 0
      apps/docs/src/en/materials/components/blur-input.mdx
  16. 4 0
      apps/docs/src/en/materials/components/condition-context.mdx
  17. 4 0
      apps/docs/src/en/materials/components/constant-input.mdx
  18. 4 0
      apps/docs/src/en/materials/components/coze-editor-extensions.mdx
  19. 4 0
      apps/docs/src/en/materials/components/db-condition-row.mdx
  20. 4 0
      apps/docs/src/en/materials/components/display-flow-value.mdx
  21. 4 0
      apps/docs/src/en/materials/components/display-inputs-values.mdx
  22. 4 0
      apps/docs/src/en/materials/components/display-outputs.mdx
  23. 4 0
      apps/docs/src/en/materials/components/display-schema-tag.mdx
  24. 4 0
      apps/docs/src/en/materials/components/display-schema-tree.mdx
  25. 56 1
      apps/docs/src/en/materials/components/inputs-values-tree.mdx
  26. 21 1
      apps/docs/src/en/materials/components/prompt-editor.mdx
  27. 4 0
      apps/docs/src/en/materials/effects/provide-batch-input.mdx
  28. 4 0
      apps/docs/src/en/materials/effects/provide-json-schema-outputs.mdx
  29. 4 0
      apps/docs/src/en/materials/effects/sync-variable-title.mdx
  30. 4 0
      apps/docs/src/en/materials/effects/validate-when-variable-sync.mdx
  31. 4 0
      apps/docs/src/en/materials/form-plugins/batch-outputs-plugin.mdx
  32. 4 0
      apps/docs/src/en/materials/form-plugins/infer-assign-plugin.mdx
  33. 4 0
      apps/docs/src/en/materials/form-plugins/infer-inputs-plugin.mdx
  34. 4 0
      apps/docs/src/en/materials/validate/validate-flow-value.mdx
  35. 2 1
      apps/docs/src/zh/guide/variable/_meta.json
  36. 48 5
      apps/docs/src/zh/guide/variable/custom-scope-chain.mdx
  37. 4 0
      apps/docs/src/zh/materials/common/disable-declaration-plugin.mdx
  38. 4 0
      apps/docs/src/zh/materials/common/inject-material.mdx
  39. 4 0
      apps/docs/src/zh/materials/common/json-schema-preset.mdx
  40. 8 9
      apps/docs/src/zh/materials/components/_meta.json
  41. 5 1
      apps/docs/src/zh/materials/components/assign-row.mdx
  42. 5 1
      apps/docs/src/zh/materials/components/assign-rows.mdx
  43. 5 1
      apps/docs/src/zh/materials/components/batch-outputs.mdx
  44. 5 1
      apps/docs/src/zh/materials/components/batch-variable-selector.mdx
  45. 5 1
      apps/docs/src/zh/materials/components/blur-input.mdx
  46. 0 7
      apps/docs/src/zh/materials/components/code-editor-mini.mdx
  47. 5 1
      apps/docs/src/zh/materials/components/condition-context.mdx
  48. 5 1
      apps/docs/src/zh/materials/components/constant-input.mdx
  49. 5 1
      apps/docs/src/zh/materials/components/coze-editor-extensions.mdx
  50. 5 1
      apps/docs/src/zh/materials/components/db-condition-row.mdx
  51. 5 1
      apps/docs/src/zh/materials/components/display-flow-value.mdx
  52. 5 1
      apps/docs/src/zh/materials/components/display-inputs-values.mdx
  53. 5 1
      apps/docs/src/zh/materials/components/display-outputs.mdx
  54. 4 0
      apps/docs/src/zh/materials/components/display-schema-tag.mdx
  55. 5 1
      apps/docs/src/zh/materials/components/display-schema-tree.mdx
  56. 59 1
      apps/docs/src/zh/materials/components/inputs-values-tree.mdx
  57. 20 1
      apps/docs/src/zh/materials/components/prompt-editor.mdx
  58. 4 0
      apps/docs/src/zh/materials/effects/provide-batch-input.mdx
  59. 4 0
      apps/docs/src/zh/materials/effects/provide-json-schema-outputs.mdx
  60. 4 0
      apps/docs/src/zh/materials/effects/sync-variable-title.mdx
  61. 4 0
      apps/docs/src/zh/materials/effects/validate-when-variable-sync.mdx
  62. 4 0
      apps/docs/src/zh/materials/form-plugins/batch-outputs-plugin.mdx
  63. 4 0
      apps/docs/src/zh/materials/form-plugins/infer-assign-plugin.mdx
  64. 5 1
      apps/docs/src/zh/materials/form-plugins/infer-inputs-plugin.mdx
  65. 0 1
      apps/docs/src/zh/materials/introduction.mdx
  66. 5 1
      apps/docs/src/zh/materials/validate/validate-flow-value.mdx

+ 64 - 0
apps/docs/components/form-materials/components/db-condition-row.tsx

@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+import React from 'react';
+
+import { Field } from '@flowgram.ai/fixed-layout-editor';
+
+import { FreeFormMetaStoryBuilder, FormHeader } from '../../free-form-meta-story-builder';
+
+const DBConditionRow = React.lazy(() =>
+  import('@flowgram.ai/form-materials').then((module) => ({
+    default: module.DBConditionRow,
+  }))
+);
+
+export const BasicStory = () => (
+  <FreeFormMetaStoryBuilder
+    filterEndNode
+    formMeta={{
+      render: () => (
+        <>
+          <FormHeader />
+          <Field<any | undefined> name="db_condition_row">
+            {({ field }) => (
+              <DBConditionRow
+                options={[
+                  {
+                    label: 'TransactionID',
+                    value: 'transaction_id',
+                    schema: { type: 'integer' },
+                  },
+                  {
+                    label: 'Amount',
+                    value: 'amount',
+                    schema: { type: 'number' },
+                  },
+                  {
+                    label: 'Description',
+                    value: 'description',
+                    schema: { type: 'string' },
+                  },
+                  {
+                    label: 'Archived',
+                    value: 'archived',
+                    schema: { type: 'boolean' },
+                  },
+                  {
+                    label: 'CreateTime',
+                    value: 'create_time',
+                    schema: { type: 'date-time' },
+                  },
+                ]}
+                value={field.value}
+                onChange={(value) => field.onChange(value)}
+              />
+            )}
+          </Field>
+        </>
+      ),
+    }}
+  />
+);

+ 55 - 0
apps/docs/components/form-materials/components/display-schema-tag.tsx

@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+import React from 'react';
+
+import { FreeFormMetaStoryBuilder, FormHeader } from '../../free-form-meta-story-builder';
+
+const DisplaySchemaTag = React.lazy(() =>
+  import('@flowgram.ai/form-materials').then((module) => ({
+    default: module.DisplaySchemaTag,
+  }))
+);
+
+export const BasicStory = () => (
+  <FreeFormMetaStoryBuilder
+    filterEndNode
+    formMeta={{
+      render: () => (
+        <>
+          <FormHeader />
+          <DisplaySchemaTag
+            value={{
+              type: 'object',
+              properties: {
+                transaction_id: { type: 'integer' },
+                amount: { type: 'number' },
+                description: { type: 'string' },
+                archived: { type: 'boolean' },
+                owner: {
+                  type: 'object',
+                  properties: {
+                    id: { type: 'integer' },
+                    username: { type: 'string' },
+                    friends: {
+                      type: 'array',
+                      items: {
+                        type: 'object',
+                        properties: {
+                          id: { type: 'integer' },
+                          username: { type: 'string' },
+                        },
+                      },
+                    },
+                  },
+                },
+              },
+            }}
+          />
+        </>
+      ),
+    }}
+  />
+);

+ 55 - 0
apps/docs/components/form-materials/components/display-schema-tree.tsx

@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+import React from 'react';
+
+import { FreeFormMetaStoryBuilder, FormHeader } from '../../free-form-meta-story-builder';
+
+const DisplaySchemaTree = React.lazy(() =>
+  import('@flowgram.ai/form-materials').then((module) => ({
+    default: module.DisplaySchemaTree,
+  }))
+);
+
+export const BasicStory = () => (
+  <FreeFormMetaStoryBuilder
+    filterEndNode
+    formMeta={{
+      render: () => (
+        <>
+          <FormHeader />
+          <DisplaySchemaTree
+            value={{
+              type: 'object',
+              properties: {
+                transaction_id: { type: 'integer' },
+                amount: { type: 'number' },
+                description: { type: 'string' },
+                archived: { type: 'boolean' },
+                owner: {
+                  type: 'object',
+                  properties: {
+                    id: { type: 'integer' },
+                    username: { type: 'string' },
+                    friends: {
+                      type: 'array',
+                      items: {
+                        type: 'object',
+                        properties: {
+                          id: { type: 'integer' },
+                          username: { type: 'string' },
+                        },
+                      },
+                    },
+                  },
+                },
+              },
+            }}
+          />
+        </>
+      ),
+    }}
+  />
+);

+ 53 - 0
apps/docs/components/form-materials/components/inputs-values-tree.tsx

@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+import React from 'react';
+
+import { Field } from '@flowgram.ai/fixed-layout-editor';
+
+import { FreeFormMetaStoryBuilder, FormHeader } from '../../free-form-meta-story-builder';
+
+const InputsValuesTree = React.lazy(() =>
+  import('@flowgram.ai/form-materials').then((module) => ({
+    default: module.InputsValuesTree,
+  }))
+);
+
+export const BasicStory = () => (
+  <FreeFormMetaStoryBuilder
+    filterEndNode
+    formMeta={{
+      render: () => (
+        <>
+          <FormHeader />
+          <Field<Record<string, any> | undefined>
+            name="inputs_values"
+            defaultValue={{
+              a: {
+                b: {
+                  type: 'ref',
+                  content: ['start_0', 'str'],
+                },
+                c: {
+                  type: 'constant',
+                  content: 'hello',
+                },
+              },
+              d: {
+                type: 'constant',
+                content: '{ "a": "b"}',
+                schema: { type: 'object' },
+              },
+            }}
+          >
+            {({ field }) => (
+              <InputsValuesTree value={field.value} onChange={(value) => field.onChange(value)} />
+            )}
+          </Field>
+        </>
+      ),
+    }}
+  />
+);

+ 42 - 0
apps/docs/components/form-materials/components/prompt-editor.tsx

@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+import React from 'react';
+
+import { Field } from '@flowgram.ai/fixed-layout-editor';
+
+import { FreeFormMetaStoryBuilder, FormHeader } from '../../free-form-meta-story-builder';
+
+const PromptEditor = React.lazy(() =>
+  import('@flowgram.ai/form-materials').then((module) => ({
+    default: module.PromptEditor,
+  }))
+);
+
+export const BasicStory = () => (
+  <FreeFormMetaStoryBuilder
+    filterEndNode
+    formMeta={{
+      render: () => (
+        <>
+          <FormHeader />
+          <Field<any | undefined>
+            name="prompt_editor"
+            defaultValue={{
+              type: 'template',
+              content: `# Role
+You are a helpful assistant
+`,
+            }}
+          >
+            {({ field }) => (
+              <PromptEditor value={field.value} onChange={(value) => field.onChange(value)} />
+            )}
+          </Field>
+        </>
+      ),
+    }}
+  />
+);

+ 2 - 1
apps/docs/src/en/guide/variable/_meta.json

@@ -2,5 +2,6 @@
   "basic",
   "concept",
   "variable-output",
-  "variable-consume"
+  "variable-consume",
+  "custom-scope-chain"
 ]

+ 58 - 0
apps/docs/src/en/guide/variable/custom-scope-chain.mdx

@@ -0,0 +1,58 @@
+---
+description: How to customize the scope chain
+---
+
+# Scope Chain
+
+## Default Scope Chain Logic
+
+For details, see: [Scope in Canvas](./concept#variables-in-canvas)
+
+
+## Customize in `editor-props`
+
+The customization logic for the scope is usually done in `editor-props` through `variableEngine.chainConfig`.
+
+```tsx pure title="use-editor-props.tsx" {6-8}
+// ...
+{
+  // ...
+  variableEngine: {
+    enable: true,
+    chainConfig: {
+      // Customize scope chain logic
+    }
+  }
+  // ...
+}
+// ...
+```
+
+
+### Whether child nodes can be depended on by subsequent nodes
+
+**By default, child nodes cannot be depended on by subsequent nodes of the parent node**.
+
+If you need to customize this logic, you need to configure it in `variableEngine.chainConfig.isNodeChildrenPrivate`.
+
+
+```tsx pure title="use-editor-props.tsx" {8-15}
+{
+  variableEngine: {
+    enable: true,
+    chainConfig: {
+      /**
+       * Customize: Whether child nodes can be depended on by subsequent nodes of the parent node
+       */
+      isNodeChildrenPrivate(node) {
+        // When a certain type of custom node is hit, allow its child nodes to be depended on by subsequent nodes
+        if (node.flowNodeType === 'Your_Custom_Type') {
+          return false;
+        }
+        // Otherwise: by default, child nodes are not allowed to be depended on by subsequent nodes
+        return true;
+      },
+    }
+  }
+}
+```

+ 4 - 0
apps/docs/src/en/materials/common/disable-declaration-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DisableDeclarationPlugin (WIP)
 
 <SourceCode

+ 5 - 1
apps/docs/src/en/materials/common/inject-material.mdx

@@ -1,6 +1,10 @@
 import { SourceCode } from '@theme';
 
-# InjectMaterial (WIP)
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
+# Material Dependency Injection (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/shared/inject-material"

+ 4 - 0
apps/docs/src/en/materials/common/json-schema-preset.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # JsonSchemaPreset (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/assign-row.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # AssignRow (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/assign-rows.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # AssignRows (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/batch-outputs.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # BatchOutputs (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/batch-variable-selector.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # BatchVariableSelector (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/blur-input.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # BlurInput (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/condition-context.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # ConditionContext (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/constant-input.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # ConstantInput (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/coze-editor-extensions.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # CozeEditorExtensions (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/db-condition-row.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DbConditionRow (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/display-flow-value.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DisplayFlowValue (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/display-inputs-values.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DisplayInputsValues (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/display-outputs.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DisplayOutputs (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/display-schema-tag.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DisplaySchemaTag (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/components/display-schema-tree.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # DisplaySchemaTree (WIP)
 
 <SourceCode

+ 56 - 1
apps/docs/src/en/materials/components/inputs-values-tree.mdx

@@ -1,7 +1,62 @@
 import { SourceCode } from '@theme';
+import { BasicStory } from 'components/form-materials/components/inputs-values-tree';
+
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
 
 # InputsValuesTree (WIP)
 
+## Demo
+
+### Basic Usage
+
+<BasicStory />
+
+```typescript
+import { InputsValuesTree } from '@flowgram.ai/form-materials';
+
+const formMeta = {
+  render: () => (
+    <>
+      <FormHeader />
+      <Field<Record<string, any> | undefined>
+        name="inputs_values"
+        defaultValue={{
+          a: {
+            b: {
+              type: 'ref',
+              content: ['start_0', 'str'],
+            },
+            c: {
+              type: 'constant',
+              content: 'hello',
+            },
+          },
+          d: {
+            type: 'constant',
+            content: '{ "a": "b"}',
+            schema: { type: 'object' },
+          },
+        }}
+      >
+        {({ field }) => (
+          <InputsValuesTree value={field.value} onChange={(value) => field.onChange(value)} />
+        )}
+      </Field>
+    </>
+  ),
+}
+```
+
+## Source Code Guide
+
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/inputs-values-tree"
-/>
+/>
+
+Use the CLI command to copy the source code locally:
+
+```bash
+npx @flowgram.ai/cli@latest materials components/inputs-values-tree
+```

+ 21 - 1
apps/docs/src/en/materials/components/prompt-editor.mdx

@@ -1,7 +1,27 @@
 import { SourceCode } from '@theme';
+import { BasicStory } from 'components/form-materials/components/prompt-editor';
+
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
 
 # PromptEditor (WIP)
 
+## Demo
+
+### Basic Usage
+
+<BasicStory />
+
+## Source Code Guide
+
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/prompt-editor"
-/>
+/>
+
+Use the CLI command to copy the source code locally:
+
+```bash
+npx @flowgram.ai/cli@latest materials components/prompt-editor
+```
+

+ 4 - 0
apps/docs/src/en/materials/effects/provide-batch-input.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # provideBatchInput (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/effects/provide-json-schema-outputs.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # provideJsonSchemaOutputs (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/effects/sync-variable-title.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # syncVariableTitle (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/effects/validate-when-variable-sync.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # validateWhenVariableSync (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/form-plugins/batch-outputs-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # batchOutputsPlugin (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/form-plugins/infer-assign-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # inferAssignPlugin (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/form-plugins/infer-inputs-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # inferInputsPlugin (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/en/materials/validate/validate-flow-value.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+The material has been developed and the documentation is still being improved. Contributions are welcome.
+:::
+
 # validateFlowValue (WIP)
 
 <SourceCode

+ 2 - 1
apps/docs/src/zh/guide/variable/_meta.json

@@ -2,5 +2,6 @@
   "basic",
   "concept",
   "variable-output",
-  "variable-consume"
+  "variable-consume",
+  "custom-scope-chain"
 ]

+ 48 - 5
apps/docs/src/zh/guide/variable/custom-scope-chain.mdx

@@ -2,15 +2,58 @@
 description: 介绍如何定制作用域链
 ---
 
-# 定制作用域链(WIP)
+# 作用域链
 
-## 常见场景
+## 默认作用域链逻辑
 
+详见:[画布中的作用域](./concept#画布中的变量)
 
-## 配置 variableEngine.chainConfig
 
-## 通过 ScopeChainTransformService
+## 在 `editor-props` 中定制
 
+作用域的定制逻辑,通常在 `editor-props` 中,通过 `variableEngine.chainConfig` 定制。
 
+```tsx pure title="use-editor-props.tsx" {6-8}
+// ...
+{
+  // ...
+  variableEngine: {
+    enable: true,
+    chainConfig: {
+      // 作用域链逻辑定制
+    }
+  }
+  // ...
+}
+// ...
+```
+
+
+### 子节点能否被后续节点依赖
+
+**默认情况下,子节点是不可以被父节点的后续节点依赖的**。
+
+如果需要定制这个逻辑,需要在 `variableEngine.chainConfig.isNodeChildrenPrivate` 中配置。
+
+
+```tsx pure title="use-editor-props.tsx" {8-15}
+{
+  variableEngine: {
+    enable: true,
+    chainConfig: {
+      /**
+       * 定制:子节点是否可以被父节点的后续节点依赖
+       */
+      isNodeChildrenPrivate(node) {
+        // 当命中用户某类自定义节点时,允许其子节点被后续节点依赖
+        if (node.flowNodeType === 'Your_Custom_Type') {
+          return false;
+        }
+        // 否则:默认不允许子节点被后续节点依赖
+        return true;
+      },
+    }
+  }
+}
+```
 
-## 通过插件定制作用域链

+ 4 - 0
apps/docs/src/zh/materials/common/disable-declaration-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DisableDeclarationPlugin (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/common/inject-material.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # 物料依赖注入 (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/common/json-schema-preset.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # JsonSchemaPreset (WIP)
 
 <SourceCode

+ 8 - 9
apps/docs/src/zh/materials/components/_meta.json

@@ -4,27 +4,26 @@
   "variable-selector",
   "dynamic-value-input",
   "condition-row",
+  "db-condition-row",
+  "condition-context",
   "inputs-values",
-  "code-editor",
-  "json-editor-with-variables",
+  "inputs-values-tree",
+  "prompt-editor",
   "prompt-editor-with-variables",
   "prompt-editor-with-inputs",
+  "code-editor",
+  "json-editor-with-variables",
   "sql-editor-with-variables",
+  "coze-editor-extensions",
   "assign-row",
   "assign-rows",
   "batch-outputs",
   "batch-variable-selector",
   "blur-input",
-  "code-editor-mini",
-  "condition-context",
   "constant-input",
-  "coze-editor-extensions",
-  "db-condition-row",
   "display-flow-value",
   "display-inputs-values",
   "display-outputs",
   "display-schema-tag",
-  "display-schema-tree",
-  "inputs-values-tree",
-  "prompt-editor"
+  "display-schema-tree"
 ]

+ 5 - 1
apps/docs/src/zh/materials/components/assign-row.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # AssignRow (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/assign-row"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/assign-rows.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # AssignRows (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/assign-rows"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/batch-outputs.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # BatchOutputs (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/batch-outputs"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/batch-variable-selector.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # BatchVariableSelector (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/batch-variable-selector"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/blur-input.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # BlurInput (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/blur-input"
-/>
+/>

+ 0 - 7
apps/docs/src/zh/materials/components/code-editor-mini.mdx

@@ -1,7 +0,0 @@
-import { SourceCode } from '@theme';
-
-# CodeEditorMini (WIP)
-
-<SourceCode
-  href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/code-editor-mini"
-/>

+ 5 - 1
apps/docs/src/zh/materials/components/condition-context.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # ConditionContext (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/condition-context"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/constant-input.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # ConstantInput (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/constant-input"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/coze-editor-extensions.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # CozeEditorExtensions (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/coze-editor-extensions"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/db-condition-row.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DbConditionRow (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/db-condition-row"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/display-flow-value.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DisplayFlowValue (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/display-flow-value"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/display-inputs-values.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DisplayInputsValues (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/display-inputs-values"
-/>
+/>

+ 5 - 1
apps/docs/src/zh/materials/components/display-outputs.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DisplayOutputs (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/display-outputs"
-/>
+/>

+ 4 - 0
apps/docs/src/zh/materials/components/display-schema-tag.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DisplaySchemaTag (WIP)
 
 <SourceCode

+ 5 - 1
apps/docs/src/zh/materials/components/display-schema-tree.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # DisplaySchemaTree (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/display-schema-tree"
-/>
+/>

+ 59 - 1
apps/docs/src/zh/materials/components/inputs-values-tree.mdx

@@ -1,7 +1,65 @@
 import { SourceCode } from '@theme';
+import { BasicStory } from 'components/form-materials/components/inputs-values-tree';
+
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
 
 # InputsValuesTree (WIP)
 
+## 案例演示
+
+### 基本使用
+
+<BasicStory />
+
+```typescript
+import { InputsValuesTree } from '@flowgram.ai/form-materials';
+
+const formMeta = {
+  render: () => (
+    <>
+      <FormHeader />
+      <Field<Record<string, any> | undefined>
+        name="inputs_values"
+        defaultValue={{
+          a: {
+            b: {
+              type: 'ref',
+              content: ['start_0', 'str'],
+            },
+            c: {
+              type: 'constant',
+              content: 'hello',
+            },
+          },
+          d: {
+            type: 'constant',
+            content: '{ "a": "b"}',
+            schema: { type: 'object' },
+          },
+        }}
+      >
+        {({ field }) => (
+          <InputsValuesTree value={field.value} onChange={(value) => field.onChange(value)} />
+        )}
+      </Field>
+    </>
+  ),
+}
+```
+
+
+
+## 源码导读
+
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/inputs-values-tree"
-/>
+/>
+
+
+使用 CLI 命令可以复制源代码到本地:
+
+```bash
+npx @flowgram.ai/cli@latest materials components/inputs-values-tree
+```

+ 20 - 1
apps/docs/src/zh/materials/components/prompt-editor.mdx

@@ -1,7 +1,26 @@
 import { SourceCode } from '@theme';
+import { BasicStory } from 'components/form-materials/components/prompt-editor';
+
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
 
 # PromptEditor (WIP)
 
+## 案例演示
+
+### 基本使用
+
+<BasicStory />
+
+## 源码导读
+
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/components/prompt-editor"
-/>
+/>
+
+使用 CLI 命令可以复制源代码到本地:
+
+```bash
+npx @flowgram.ai/cli@latest materials components/prompt-editor
+```

+ 4 - 0
apps/docs/src/zh/materials/effects/provide-batch-input.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # provideBatchInput (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/effects/provide-json-schema-outputs.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # provideJsonSchemaOutputs (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/effects/sync-variable-title.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # syncVariableTitle (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/effects/validate-when-variable-sync.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # validateWhenVariableSync (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/form-plugins/batch-outputs-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # batchOutputsPlugin (WIP)
 
 <SourceCode

+ 4 - 0
apps/docs/src/zh/materials/form-plugins/infer-assign-plugin.mdx

@@ -1,5 +1,9 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # inferAssignPlugin (WIP)
 
 <SourceCode

+ 5 - 1
apps/docs/src/zh/materials/form-plugins/infer-inputs-plugin.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # inferInputsPlugin (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/form-plugins/infer-inputs-plugin"
-/>
+/>

+ 0 - 1
apps/docs/src/zh/materials/introduction.mdx

@@ -48,4 +48,3 @@ CLI 运行成功后,相关物料会自动添加到当前项目下的 `src/form
 3. 一些物料会依赖另外一些官方物料,这些被依赖的物料源代码在 CLI 运行时会一起被添加到项目中去
 
 :::
-

+ 5 - 1
apps/docs/src/zh/materials/validate/validate-flow-value.mdx

@@ -1,7 +1,11 @@
 import { SourceCode } from '@theme';
 
+:::warning
+物料已完成开发,文档还在完善中,欢迎参与贡献
+:::
+
 # validateFlowValue (WIP)
 
 <SourceCode
   href="https://github.com/bytedance/flowgram.ai/tree/main/packages/materials/form-materials/src/validate/validate-flow-value"
-/>
+/>