@flowgram.ai/form-materials 0.2.24 → 0.2.26

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/index.d.mts CHANGED
@@ -268,6 +268,7 @@ type PropsType$1 = React$1.PropsWithChildren<{
268
268
  hasError?: boolean;
269
269
  placeholder?: string;
270
270
  activeLinePlaceholder?: string;
271
+ disableMarkdownHighlight?: boolean;
271
272
  style?: React$1.CSSProperties;
272
273
  }>;
273
274
 
package/dist/index.d.ts CHANGED
@@ -268,6 +268,7 @@ type PropsType$1 = React$1.PropsWithChildren<{
268
268
  hasError?: boolean;
269
269
  placeholder?: string;
270
270
  activeLinePlaceholder?: string;
271
+ disableMarkdownHighlight?: boolean;
271
272
  style?: React$1.CSSProperties;
272
273
  }>;
273
274
 
package/dist/index.js CHANGED
@@ -1003,6 +1003,7 @@ var ConstantInputWrapper = import_styled_components2.default.div`
1003
1003
 
1004
1004
  // src/components/json-schema-editor/hooks.tsx
1005
1005
  var import_react6 = require("react");
1006
+ var import_lodash2 = require("lodash");
1006
1007
  var _id = 0;
1007
1008
  function genId() {
1008
1009
  return _id++;
@@ -1075,7 +1076,7 @@ function usePropertiesEdit(value, onChange) {
1075
1076
  if (!_property.name) {
1076
1077
  continue;
1077
1078
  }
1078
- nextProperties[_property.name] = _property;
1079
+ nextProperties[_property.name] = (0, import_lodash2.omit)(_property, ["key", "name", "isPropertyRequired"]);
1079
1080
  if (_property.isPropertyRequired) {
1080
1081
  nextRequired.push(_property.name);
1081
1082
  }
@@ -1737,9 +1738,9 @@ var opConfigs = {
1737
1738
  };
1738
1739
 
1739
1740
  // src/utils/format-legacy-refs/index.ts
1740
- var import_lodash2 = require("lodash");
1741
+ var import_lodash3 = require("lodash");
1741
1742
  function formatLegacyRefOnSubmit(value) {
1742
- if ((0, import_lodash2.isObject)(value)) {
1743
+ if ((0, import_lodash3.isObject)(value)) {
1743
1744
  if (isLegacyFlowRefValueSchema(value)) {
1744
1745
  return formatLegacyRefToNewRef(value);
1745
1746
  }
@@ -1756,7 +1757,7 @@ function formatLegacyRefOnSubmit(value) {
1756
1757
  return value;
1757
1758
  }
1758
1759
  function formatLegacyRefOnInit(value) {
1759
- if ((0, import_lodash2.isObject)(value)) {
1760
+ if ((0, import_lodash3.isObject)(value)) {
1760
1761
  if (isNewFlowRefValueSchema(value)) {
1761
1762
  return formatNewRefToLegacyRef(value);
1762
1763
  }
@@ -1773,10 +1774,10 @@ function formatLegacyRefOnInit(value) {
1773
1774
  return value;
1774
1775
  }
1775
1776
  function isLegacyFlowRefValueSchema(value) {
1776
- return (0, import_lodash2.isObject)(value) && Object.keys(value).length === 2 && value.type === "ref" && typeof value.content === "string";
1777
+ return (0, import_lodash3.isObject)(value) && Object.keys(value).length === 2 && value.type === "ref" && typeof value.content === "string";
1777
1778
  }
1778
1779
  function isNewFlowRefValueSchema(value) {
1779
- return (0, import_lodash2.isObject)(value) && Object.keys(value).length === 2 && value.type === "ref" && Array.isArray(value.content);
1780
+ return (0, import_lodash3.isObject)(value) && Object.keys(value).length === 2 && value.type === "ref" && Array.isArray(value.content);
1780
1781
  }
1781
1782
  function formatLegacyRefToNewRef(value) {
1782
1783
  const keyPath = value.content.split(".");
@@ -1895,7 +1896,7 @@ var import_semi_icons8 = require("@douyinfe/semi-icons");
1895
1896
 
1896
1897
  // src/components/batch-outputs/use-list.ts
1897
1898
  var import_react16 = require("react");
1898
- var import_lodash3 = require("lodash");
1899
+ var import_lodash4 = require("lodash");
1899
1900
  var _id2 = 0;
1900
1901
  function genId2() {
1901
1902
  return _id2++;
@@ -1906,7 +1907,7 @@ function useList({ value, onChange }) {
1906
1907
  setList((_prevList) => {
1907
1908
  const newKeys = Object.keys(value || {});
1908
1909
  const oldKeys = _prevList.map((item) => item.key).filter(Boolean);
1909
- const addKeys = (0, import_lodash3.difference)(newKeys, oldKeys);
1910
+ const addKeys = (0, import_lodash4.difference)(newKeys, oldKeys);
1910
1911
  return _prevList.filter((item) => !item.key || newKeys.includes(item.key)).map((item) => ({
1911
1912
  id: item.id,
1912
1913
  key: item.key,
@@ -2152,7 +2153,8 @@ function PromptEditor(props) {
2152
2153
  activeLinePlaceholder,
2153
2154
  style,
2154
2155
  hasError,
2155
- children
2156
+ children,
2157
+ disableMarkdownHighlight
2156
2158
  } = props || {};
2157
2159
  const editorRef = (0, import_react24.useRef)(null);
2158
2160
  (0, import_react24.useEffect)(() => {
@@ -2177,7 +2179,7 @@ function PromptEditor(props) {
2177
2179
  onChange({ type: "template", content: e.value });
2178
2180
  }
2179
2181
  }
2180
- ), activeLinePlaceholder && /* @__PURE__ */ import_react24.default.createElement(import_react25.ActiveLinePlaceholder, null, activeLinePlaceholder), /* @__PURE__ */ import_react24.default.createElement(markdown_default, null), /* @__PURE__ */ import_react24.default.createElement(language_support_default, null), /* @__PURE__ */ import_react24.default.createElement(jinja_default, null), children));
2182
+ ), activeLinePlaceholder && /* @__PURE__ */ import_react24.default.createElement(import_react25.ActiveLinePlaceholder, null, activeLinePlaceholder), !disableMarkdownHighlight && /* @__PURE__ */ import_react24.default.createElement(markdown_default, null), /* @__PURE__ */ import_react24.default.createElement(language_support_default, null), /* @__PURE__ */ import_react24.default.createElement(jinja_default, null), children));
2181
2183
  }
2182
2184
 
2183
2185
  // src/components/prompt-editor-with-variables/index.tsx
@@ -2243,7 +2245,7 @@ function VariableTree() {
2243
2245
  // src/components/prompt-editor-with-variables/extensions/variable-tag.tsx
2244
2246
  var import_react_dom = __toESM(require("react-dom"));
2245
2247
  var import_react28 = __toESM(require("react"));
2246
- var import_lodash4 = require("lodash");
2248
+ var import_lodash5 = require("lodash");
2247
2249
  var import_editor7 = require("@flowgram.ai/editor");
2248
2250
  var import_semi_ui13 = require("@douyinfe/semi-ui");
2249
2251
  var import_semi_icons9 = require("@douyinfe/semi-icons");
@@ -2311,7 +2313,7 @@ var VariableTagWidget = class extends import_view3.WidgetType {
2311
2313
  );
2312
2314
  return;
2313
2315
  }
2314
- const rootField = (0, import_lodash4.last)(v.parentFields);
2316
+ const rootField = (0, import_lodash5.last)(v.parentFields);
2315
2317
  const rootTitle = /* @__PURE__ */ import_react28.default.createElement(UIRootTitle2, null, rootField?.meta.title ? `${rootField.meta.title} -` : "");
2316
2318
  const rootIcon = this.renderIcon(rootField?.meta.icon);
2317
2319
  this.renderReact(
@@ -2345,7 +2347,7 @@ var VariableTagWidget = class extends import_view3.WidgetType {
2345
2347
  return dom;
2346
2348
  }
2347
2349
  eq(other) {
2348
- return (0, import_lodash4.isEqual)(this.keyPath, other.keyPath);
2350
+ return (0, import_lodash5.isEqual)(this.keyPath, other.keyPath);
2349
2351
  }
2350
2352
  ignoreEvent() {
2351
2353
  return false;
@@ -2407,7 +2409,7 @@ var import_react33 = require("@coze-editor/editor/react");
2407
2409
 
2408
2410
  // src/components/prompt-editor-with-inputs/inputs-picker.tsx
2409
2411
  var import_react31 = __toESM(require("react"));
2410
- var import_lodash5 = require("lodash");
2412
+ var import_lodash6 = require("lodash");
2411
2413
  var import_editor8 = require("@flowgram.ai/editor");
2412
2414
  var import_semi_ui14 = require("@douyinfe/semi-ui");
2413
2415
  function InputsPicker({
@@ -2442,7 +2444,7 @@ function InputsPicker({
2442
2444
  const key = keyPath.map((_key, idx) => _key === "[0]" || idx === 0 ? _key : `.${_key}`).join("");
2443
2445
  return {
2444
2446
  key,
2445
- label: (0, import_lodash5.last)(keyPath),
2447
+ label: (0, import_lodash6.last)(keyPath),
2446
2448
  value: key,
2447
2449
  children
2448
2450
  };
@@ -2904,7 +2906,7 @@ function VariableTree2() {
2904
2906
  // src/components/json-editor-with-variables/extensions/variable-tag.tsx
2905
2907
  var import_react39 = __toESM(require("react"));
2906
2908
  var import_client = require("react-dom/client");
2907
- var import_lodash6 = require("lodash");
2909
+ var import_lodash7 = require("lodash");
2908
2910
  var import_editor10 = require("@flowgram.ai/editor");
2909
2911
  var import_semi_ui18 = require("@douyinfe/semi-ui");
2910
2912
  var import_semi_icons10 = require("@douyinfe/semi-icons");
@@ -2969,7 +2971,7 @@ var VariableTagWidget2 = class extends import_view5.WidgetType {
2969
2971
  );
2970
2972
  return;
2971
2973
  }
2972
- const rootField = (0, import_lodash6.last)(v.parentFields);
2974
+ const rootField = (0, import_lodash7.last)(v.parentFields);
2973
2975
  const rootTitle = /* @__PURE__ */ import_react39.default.createElement(UIRootTitle3, null, rootField?.meta.title ? `${rootField.meta.title} -` : "");
2974
2976
  const rootIcon = this.renderIcon(rootField?.meta.icon);
2975
2977
  this.root.render(
@@ -3003,7 +3005,7 @@ var VariableTagWidget2 = class extends import_view5.WidgetType {
3003
3005
  return dom;
3004
3006
  }
3005
3007
  eq(other) {
3006
- return (0, import_lodash6.isEqual)(this.keyPath, other.keyPath);
3008
+ return (0, import_lodash7.isEqual)(this.keyPath, other.keyPath);
3007
3009
  }
3008
3010
  ignoreEvent() {
3009
3011
  return false;
@@ -3154,7 +3156,7 @@ var provideBatchOutputsEffect = (0, import_editor12.createEffectFromVariableProv
3154
3156
  });
3155
3157
 
3156
3158
  // src/effects/auto-rename-ref/index.ts
3157
- var import_lodash7 = require("lodash");
3159
+ var import_lodash8 = require("lodash");
3158
3160
  var import_editor13 = require("@flowgram.ai/editor");
3159
3161
  var autoRenameRefEffect = [
3160
3162
  {
@@ -3191,7 +3193,7 @@ function isRef(value) {
3191
3193
  return value?.type === "ref" && Array.isArray(value?.content) && typeof value?.content[0] === "string";
3192
3194
  }
3193
3195
  function traverseRef(name, value, cb) {
3194
- if ((0, import_lodash7.isObject)(value)) {
3196
+ if ((0, import_lodash8.isObject)(value)) {
3195
3197
  if (isRef(value)) {
3196
3198
  cb(name, value);
3197
3199
  return;
@@ -3201,7 +3203,7 @@ function traverseRef(name, value, cb) {
3201
3203
  });
3202
3204
  return;
3203
3205
  }
3204
- if ((0, import_lodash7.isArray)(value)) {
3206
+ if ((0, import_lodash8.isArray)(value)) {
3205
3207
  value.forEach((_value, idx) => {
3206
3208
  traverseRef(`${name}[${idx}]`, _value, cb);
3207
3209
  });