tinacms 2.0.0 → 2.1.0

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.js CHANGED
@@ -3699,7 +3699,18 @@ var __publicField = (obj, key, value) => {
3699
3699
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
3700
3700
  "application/msword",
3701
3701
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
3702
- "image/*"
3702
+ "application/postscript",
3703
+ "model/fbx",
3704
+ "model/gltf+json",
3705
+ "model/ply",
3706
+ "model/u3d+mesh",
3707
+ "model/vnd.usdz+zip",
3708
+ "application/x-indesign",
3709
+ "application/vnd.apple.mpegurl",
3710
+ "application/dash+xml",
3711
+ "application/mxf",
3712
+ "image/*",
3713
+ "video/*"
3703
3714
  ];
3704
3715
  const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
3705
3716
  const dropzoneAcceptFromString = (str) => {
@@ -12770,6 +12781,7 @@ var __publicField = (obj, key, value) => {
12770
12781
  const EMBED_ICON_WIDTH = 85;
12771
12782
  function Toolbar({
12772
12783
  templates,
12784
+ toolbarOverride,
12773
12785
  tinaForm
12774
12786
  }) {
12775
12787
  const { setRawMode } = useEditorContext();
@@ -12785,8 +12797,8 @@ var __publicField = (obj, key, value) => {
12785
12797
  const codeBlockActive = helpers.isNodeActive(editor, plateHeadless.ELEMENT_CODE_BLOCK);
12786
12798
  const blockQuoteActive = helpers.isNodeActive(editor, plateHeadless.ELEMENT_BLOCKQUOTE);
12787
12799
  const isImgActive = helpers.isNodeActive(editor, ELEMENT_IMG);
12788
- const toolbarItems = [
12789
- {
12800
+ const toolbarItemLookup = {
12801
+ heading: {
12790
12802
  tinaForm,
12791
12803
  name: "heading",
12792
12804
  label: "Heading",
@@ -12807,19 +12819,19 @@ var __publicField = (obj, key, value) => {
12807
12819
  item.render
12808
12820
  ))
12809
12821
  },
12810
- {
12822
+ link: {
12811
12823
  tinaForm,
12812
12824
  name: "link",
12813
12825
  label: "Link",
12814
12826
  active: isLinkActive2
12815
12827
  },
12816
- {
12828
+ image: {
12817
12829
  tinaForm,
12818
12830
  name: "image",
12819
12831
  label: "Image",
12820
12832
  active: isImgActive
12821
12833
  },
12822
- {
12834
+ quote: {
12823
12835
  tinaForm,
12824
12836
  name: "quote",
12825
12837
  label: "Quote",
@@ -12830,7 +12842,7 @@ var __publicField = (obj, key, value) => {
12830
12842
  plateHeadless.toggleNodeType(editor, { activeType: plateHeadless.ELEMENT_BLOCKQUOTE });
12831
12843
  }
12832
12844
  },
12833
- {
12845
+ ul: {
12834
12846
  tinaForm,
12835
12847
  name: "ul",
12836
12848
  label: "Bullet List",
@@ -12841,7 +12853,7 @@ var __publicField = (obj, key, value) => {
12841
12853
  plateHeadless.toggleList(editor, { type: plateHeadless.ELEMENT_UL });
12842
12854
  }
12843
12855
  },
12844
- {
12856
+ ol: {
12845
12857
  tinaForm,
12846
12858
  name: "ol",
12847
12859
  label: "List",
@@ -12852,7 +12864,7 @@ var __publicField = (obj, key, value) => {
12852
12864
  plateHeadless.toggleList(editor, { type: plateHeadless.ELEMENT_OL });
12853
12865
  }
12854
12866
  },
12855
- {
12867
+ code: {
12856
12868
  tinaForm,
12857
12869
  name: "code",
12858
12870
  label: "Code",
@@ -12863,7 +12875,7 @@ var __publicField = (obj, key, value) => {
12863
12875
  plateHeadless.toggleMark(editor, { key: plateHeadless.MARK_CODE });
12864
12876
  }
12865
12877
  },
12866
- {
12878
+ codeBlock: {
12867
12879
  tinaForm,
12868
12880
  name: "codeBlock",
12869
12881
  label: "Code Block",
@@ -12874,7 +12886,7 @@ var __publicField = (obj, key, value) => {
12874
12886
  insertEmptyCodeBlock(editor);
12875
12887
  }
12876
12888
  },
12877
- {
12889
+ bold: {
12878
12890
  tinaForm,
12879
12891
  name: "bold",
12880
12892
  label: "Bold",
@@ -12885,7 +12897,7 @@ var __publicField = (obj, key, value) => {
12885
12897
  plateHeadless.toggleMark(editor, { key: plateHeadless.MARK_BOLD });
12886
12898
  }
12887
12899
  },
12888
- {
12900
+ italic: {
12889
12901
  tinaForm,
12890
12902
  name: "italic",
12891
12903
  label: "Italic",
@@ -12896,14 +12908,15 @@ var __publicField = (obj, key, value) => {
12896
12908
  plateHeadless.toggleMark(editor, { key: plateHeadless.MARK_ITALIC });
12897
12909
  }
12898
12910
  },
12899
- {
12911
+ raw: {
12900
12912
  tinaForm,
12901
12913
  name: "raw",
12902
12914
  label: "Raw",
12903
12915
  active: false,
12904
12916
  onMouseDown: () => setRawMode(true)
12905
12917
  }
12906
- ];
12918
+ };
12919
+ const toolbarItems = toolbarOverride === void 0 ? Object.values(toolbarItemLookup) : toolbarOverride.map((item) => toolbarItemLookup[item]).filter((item) => item !== void 0);
12907
12920
  const [itemsShown, setItemsShown] = React__namespace.useState(toolbarItems.length);
12908
12921
  useResize(toolbarRef, (entry) => {
12909
12922
  const width = entry.target.getBoundingClientRect().width;
@@ -13048,10 +13061,11 @@ var __publicField = (obj, key, value) => {
13048
13061
  ))));
13049
13062
  }
13050
13063
  const RichEditor = (props) => {
13064
+ var _a;
13051
13065
  const initialValue = React.useMemo(
13052
13066
  () => {
13053
- var _a, _b;
13054
- return ((_b = (_a = props.input.value) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? props.input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
13067
+ var _a2, _b;
13068
+ return ((_b = (_a2 = props.input.value) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) ? props.input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
13055
13069
  },
13056
13070
  []
13057
13071
  );
@@ -13079,8 +13093,8 @@ var __publicField = (obj, key, value) => {
13079
13093
  React.useEffect(() => {
13080
13094
  if (ref.current) {
13081
13095
  setTimeout(() => {
13082
- var _a;
13083
- const plateElement = (_a = ref.current) == null ? void 0 : _a.querySelector(
13096
+ var _a2;
13097
+ const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
13084
13098
  '[role="textbox"]'
13085
13099
  );
13086
13100
  if (props.field.experimental_focusIntent && plateElement) {
@@ -13106,6 +13120,7 @@ var __publicField = (obj, key, value) => {
13106
13120
  Toolbar,
13107
13121
  {
13108
13122
  tinaForm: props.tinaForm,
13123
+ toolbarOverride: (_a = props.field) == null ? void 0 : _a.toolbarOverride,
13109
13124
  templates: props.field.templates,
13110
13125
  inlineOnly: false
13111
13126
  }
@@ -13115,38 +13130,36 @@ var __publicField = (obj, key, value) => {
13115
13130
  };
13116
13131
  const MdxFieldPlugin = {
13117
13132
  name: "rich-text",
13118
- Component: wrapFieldsWithMeta(
13119
- (props) => {
13120
- const [rawMode, setRawMode] = React.useState(false);
13121
- const [key, setKey] = React.useState(0);
13122
- React.useMemo(() => {
13123
- const { reset } = props.form;
13124
- props.form.reset = (initialValues) => {
13125
- setKey((key2) => key2 + 1);
13126
- return reset(initialValues);
13127
- };
13128
- }, []);
13129
- return /* @__PURE__ */ React.createElement(
13130
- EditorContext.Provider,
13133
+ Component: wrapFieldsWithMeta((props) => {
13134
+ const [rawMode, setRawMode] = React.useState(false);
13135
+ const [key, setKey] = React.useState(0);
13136
+ React.useMemo(() => {
13137
+ const { reset } = props.form;
13138
+ props.form.reset = (initialValues) => {
13139
+ setKey((key2) => key2 + 1);
13140
+ return reset(initialValues);
13141
+ };
13142
+ }, []);
13143
+ return /* @__PURE__ */ React.createElement(
13144
+ EditorContext.Provider,
13145
+ {
13146
+ key,
13147
+ value: {
13148
+ fieldName: props.field.name,
13149
+ templates: props.field.templates,
13150
+ rawMode,
13151
+ setRawMode
13152
+ }
13153
+ },
13154
+ /* @__PURE__ */ React.createElement(
13155
+ "div",
13131
13156
  {
13132
- key,
13133
- value: {
13134
- fieldName: props.field.name,
13135
- templates: props.field.templates,
13136
- rawMode,
13137
- setRawMode
13138
- }
13157
+ className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13139
13158
  },
13140
- /* @__PURE__ */ React.createElement(
13141
- "div",
13142
- {
13143
- className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13144
- },
13145
- /* @__PURE__ */ React.createElement(RichEditor, { ...props })
13146
- )
13147
- );
13148
- }
13149
- )
13159
+ /* @__PURE__ */ React.createElement(RichEditor, { ...props })
13160
+ )
13161
+ );
13162
+ })
13150
13163
  };
13151
13164
  const MdxFieldPluginExtendible = {
13152
13165
  name: "rich-text",
@@ -13157,37 +13170,35 @@ var __publicField = (obj, key, value) => {
13157
13170
  return void 0;
13158
13171
  }
13159
13172
  },
13160
- Component: wrapFieldsWithMeta(
13161
- (props) => {
13162
- const [key, setKey] = React.useState(0);
13163
- React.useMemo(() => {
13164
- const { reset } = props.form;
13165
- props.form.reset = (initialValues) => {
13166
- setKey((key2) => key2 + 1);
13167
- return reset(initialValues);
13168
- };
13169
- }, []);
13170
- return /* @__PURE__ */ React.createElement(
13171
- EditorContext.Provider,
13173
+ Component: wrapFieldsWithMeta((props) => {
13174
+ const [key, setKey] = React.useState(0);
13175
+ React.useMemo(() => {
13176
+ const { reset } = props.form;
13177
+ props.form.reset = (initialValues) => {
13178
+ setKey((key2) => key2 + 1);
13179
+ return reset(initialValues);
13180
+ };
13181
+ }, []);
13182
+ return /* @__PURE__ */ React.createElement(
13183
+ EditorContext.Provider,
13184
+ {
13185
+ key,
13186
+ value: {
13187
+ fieldName: props.field.name,
13188
+ templates: props.field.templates,
13189
+ rawMode: props.rawMode,
13190
+ setRawMode: props.setRawMode
13191
+ }
13192
+ },
13193
+ /* @__PURE__ */ React.createElement(
13194
+ "div",
13172
13195
  {
13173
- key,
13174
- value: {
13175
- fieldName: props.field.name,
13176
- templates: props.field.templates,
13177
- rawMode: props.rawMode,
13178
- setRawMode: props.setRawMode
13179
- }
13196
+ className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13180
13197
  },
13181
- /* @__PURE__ */ React.createElement(
13182
- "div",
13183
- {
13184
- className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13185
- },
13186
- props.rawMode ? props.rawEditor : /* @__PURE__ */ React.createElement(RichEditor, { ...props })
13187
- )
13188
- );
13189
- }
13190
- )
13198
+ props.rawMode ? props.rawEditor : /* @__PURE__ */ React.createElement(RichEditor, { ...props })
13199
+ )
13200
+ );
13201
+ })
13191
13202
  };
13192
13203
  class FormMetaPlugin {
13193
13204
  constructor(options) {
package/dist/index.mjs CHANGED
@@ -3706,7 +3706,18 @@ const supportedFileTypes = [
3706
3706
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
3707
3707
  "application/msword",
3708
3708
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
3709
- "image/*"
3709
+ "application/postscript",
3710
+ "model/fbx",
3711
+ "model/gltf+json",
3712
+ "model/ply",
3713
+ "model/u3d+mesh",
3714
+ "model/vnd.usdz+zip",
3715
+ "application/x-indesign",
3716
+ "application/vnd.apple.mpegurl",
3717
+ "application/dash+xml",
3718
+ "application/mxf",
3719
+ "image/*",
3720
+ "video/*"
3710
3721
  ];
3711
3722
  const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
3712
3723
  const dropzoneAcceptFromString = (str) => {
@@ -12777,6 +12788,7 @@ const ICON_WIDTH = 40;
12777
12788
  const EMBED_ICON_WIDTH = 85;
12778
12789
  function Toolbar({
12779
12790
  templates,
12791
+ toolbarOverride,
12780
12792
  tinaForm
12781
12793
  }) {
12782
12794
  const { setRawMode } = useEditorContext();
@@ -12792,8 +12804,8 @@ function Toolbar({
12792
12804
  const codeBlockActive = helpers.isNodeActive(editor, ELEMENT_CODE_BLOCK);
12793
12805
  const blockQuoteActive = helpers.isNodeActive(editor, ELEMENT_BLOCKQUOTE);
12794
12806
  const isImgActive = helpers.isNodeActive(editor, ELEMENT_IMG);
12795
- const toolbarItems = [
12796
- {
12807
+ const toolbarItemLookup = {
12808
+ heading: {
12797
12809
  tinaForm,
12798
12810
  name: "heading",
12799
12811
  label: "Heading",
@@ -12814,19 +12826,19 @@ function Toolbar({
12814
12826
  item.render
12815
12827
  ))
12816
12828
  },
12817
- {
12829
+ link: {
12818
12830
  tinaForm,
12819
12831
  name: "link",
12820
12832
  label: "Link",
12821
12833
  active: isLinkActive2
12822
12834
  },
12823
- {
12835
+ image: {
12824
12836
  tinaForm,
12825
12837
  name: "image",
12826
12838
  label: "Image",
12827
12839
  active: isImgActive
12828
12840
  },
12829
- {
12841
+ quote: {
12830
12842
  tinaForm,
12831
12843
  name: "quote",
12832
12844
  label: "Quote",
@@ -12837,7 +12849,7 @@ function Toolbar({
12837
12849
  toggleNodeType(editor, { activeType: ELEMENT_BLOCKQUOTE });
12838
12850
  }
12839
12851
  },
12840
- {
12852
+ ul: {
12841
12853
  tinaForm,
12842
12854
  name: "ul",
12843
12855
  label: "Bullet List",
@@ -12848,7 +12860,7 @@ function Toolbar({
12848
12860
  toggleList(editor, { type: ELEMENT_UL });
12849
12861
  }
12850
12862
  },
12851
- {
12863
+ ol: {
12852
12864
  tinaForm,
12853
12865
  name: "ol",
12854
12866
  label: "List",
@@ -12859,7 +12871,7 @@ function Toolbar({
12859
12871
  toggleList(editor, { type: ELEMENT_OL });
12860
12872
  }
12861
12873
  },
12862
- {
12874
+ code: {
12863
12875
  tinaForm,
12864
12876
  name: "code",
12865
12877
  label: "Code",
@@ -12870,7 +12882,7 @@ function Toolbar({
12870
12882
  toggleMark(editor, { key: MARK_CODE });
12871
12883
  }
12872
12884
  },
12873
- {
12885
+ codeBlock: {
12874
12886
  tinaForm,
12875
12887
  name: "codeBlock",
12876
12888
  label: "Code Block",
@@ -12881,7 +12893,7 @@ function Toolbar({
12881
12893
  insertEmptyCodeBlock(editor);
12882
12894
  }
12883
12895
  },
12884
- {
12896
+ bold: {
12885
12897
  tinaForm,
12886
12898
  name: "bold",
12887
12899
  label: "Bold",
@@ -12892,7 +12904,7 @@ function Toolbar({
12892
12904
  toggleMark(editor, { key: MARK_BOLD });
12893
12905
  }
12894
12906
  },
12895
- {
12907
+ italic: {
12896
12908
  tinaForm,
12897
12909
  name: "italic",
12898
12910
  label: "Italic",
@@ -12903,14 +12915,15 @@ function Toolbar({
12903
12915
  toggleMark(editor, { key: MARK_ITALIC });
12904
12916
  }
12905
12917
  },
12906
- {
12918
+ raw: {
12907
12919
  tinaForm,
12908
12920
  name: "raw",
12909
12921
  label: "Raw",
12910
12922
  active: false,
12911
12923
  onMouseDown: () => setRawMode(true)
12912
12924
  }
12913
- ];
12925
+ };
12926
+ const toolbarItems = toolbarOverride === void 0 ? Object.values(toolbarItemLookup) : toolbarOverride.map((item) => toolbarItemLookup[item]).filter((item) => item !== void 0);
12914
12927
  const [itemsShown, setItemsShown] = React.useState(toolbarItems.length);
12915
12928
  useResize(toolbarRef, (entry) => {
12916
12929
  const width = entry.target.getBoundingClientRect().width;
@@ -13055,10 +13068,11 @@ function ErrorMessage({ error }) {
13055
13068
  ))));
13056
13069
  }
13057
13070
  const RichEditor = (props) => {
13071
+ var _a;
13058
13072
  const initialValue = React__default.useMemo(
13059
13073
  () => {
13060
- var _a, _b;
13061
- return ((_b = (_a = props.input.value) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? props.input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
13074
+ var _a2, _b;
13075
+ return ((_b = (_a2 = props.input.value) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) ? props.input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
13062
13076
  },
13063
13077
  []
13064
13078
  );
@@ -13086,8 +13100,8 @@ const RichEditor = (props) => {
13086
13100
  React__default.useEffect(() => {
13087
13101
  if (ref.current) {
13088
13102
  setTimeout(() => {
13089
- var _a;
13090
- const plateElement = (_a = ref.current) == null ? void 0 : _a.querySelector(
13103
+ var _a2;
13104
+ const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
13091
13105
  '[role="textbox"]'
13092
13106
  );
13093
13107
  if (props.field.experimental_focusIntent && plateElement) {
@@ -13113,6 +13127,7 @@ const RichEditor = (props) => {
13113
13127
  Toolbar,
13114
13128
  {
13115
13129
  tinaForm: props.tinaForm,
13130
+ toolbarOverride: (_a = props.field) == null ? void 0 : _a.toolbarOverride,
13116
13131
  templates: props.field.templates,
13117
13132
  inlineOnly: false
13118
13133
  }
@@ -13122,38 +13137,36 @@ const RichEditor = (props) => {
13122
13137
  };
13123
13138
  const MdxFieldPlugin = {
13124
13139
  name: "rich-text",
13125
- Component: wrapFieldsWithMeta(
13126
- (props) => {
13127
- const [rawMode, setRawMode] = React__default.useState(false);
13128
- const [key, setKey] = React__default.useState(0);
13129
- React__default.useMemo(() => {
13130
- const { reset } = props.form;
13131
- props.form.reset = (initialValues) => {
13132
- setKey((key2) => key2 + 1);
13133
- return reset(initialValues);
13134
- };
13135
- }, []);
13136
- return /* @__PURE__ */ React__default.createElement(
13137
- EditorContext.Provider,
13140
+ Component: wrapFieldsWithMeta((props) => {
13141
+ const [rawMode, setRawMode] = React__default.useState(false);
13142
+ const [key, setKey] = React__default.useState(0);
13143
+ React__default.useMemo(() => {
13144
+ const { reset } = props.form;
13145
+ props.form.reset = (initialValues) => {
13146
+ setKey((key2) => key2 + 1);
13147
+ return reset(initialValues);
13148
+ };
13149
+ }, []);
13150
+ return /* @__PURE__ */ React__default.createElement(
13151
+ EditorContext.Provider,
13152
+ {
13153
+ key,
13154
+ value: {
13155
+ fieldName: props.field.name,
13156
+ templates: props.field.templates,
13157
+ rawMode,
13158
+ setRawMode
13159
+ }
13160
+ },
13161
+ /* @__PURE__ */ React__default.createElement(
13162
+ "div",
13138
13163
  {
13139
- key,
13140
- value: {
13141
- fieldName: props.field.name,
13142
- templates: props.field.templates,
13143
- rawMode,
13144
- setRawMode
13145
- }
13164
+ className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13146
13165
  },
13147
- /* @__PURE__ */ React__default.createElement(
13148
- "div",
13149
- {
13150
- className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13151
- },
13152
- /* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
13153
- )
13154
- );
13155
- }
13156
- )
13166
+ /* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
13167
+ )
13168
+ );
13169
+ })
13157
13170
  };
13158
13171
  const MdxFieldPluginExtendible = {
13159
13172
  name: "rich-text",
@@ -13164,37 +13177,35 @@ const MdxFieldPluginExtendible = {
13164
13177
  return void 0;
13165
13178
  }
13166
13179
  },
13167
- Component: wrapFieldsWithMeta(
13168
- (props) => {
13169
- const [key, setKey] = React__default.useState(0);
13170
- React__default.useMemo(() => {
13171
- const { reset } = props.form;
13172
- props.form.reset = (initialValues) => {
13173
- setKey((key2) => key2 + 1);
13174
- return reset(initialValues);
13175
- };
13176
- }, []);
13177
- return /* @__PURE__ */ React__default.createElement(
13178
- EditorContext.Provider,
13180
+ Component: wrapFieldsWithMeta((props) => {
13181
+ const [key, setKey] = React__default.useState(0);
13182
+ React__default.useMemo(() => {
13183
+ const { reset } = props.form;
13184
+ props.form.reset = (initialValues) => {
13185
+ setKey((key2) => key2 + 1);
13186
+ return reset(initialValues);
13187
+ };
13188
+ }, []);
13189
+ return /* @__PURE__ */ React__default.createElement(
13190
+ EditorContext.Provider,
13191
+ {
13192
+ key,
13193
+ value: {
13194
+ fieldName: props.field.name,
13195
+ templates: props.field.templates,
13196
+ rawMode: props.rawMode,
13197
+ setRawMode: props.setRawMode
13198
+ }
13199
+ },
13200
+ /* @__PURE__ */ React__default.createElement(
13201
+ "div",
13179
13202
  {
13180
- key,
13181
- value: {
13182
- fieldName: props.field.name,
13183
- templates: props.field.templates,
13184
- rawMode: props.rawMode,
13185
- setRawMode: props.setRawMode
13186
- }
13203
+ className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13187
13204
  },
13188
- /* @__PURE__ */ React__default.createElement(
13189
- "div",
13190
- {
13191
- className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
13192
- },
13193
- props.rawMode ? props.rawEditor : /* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
13194
- )
13195
- );
13196
- }
13197
- )
13205
+ props.rawMode ? props.rawEditor : /* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
13206
+ )
13207
+ );
13208
+ })
13198
13209
  };
13199
13210
  class FormMetaPlugin {
13200
13211
  constructor(options) {
@@ -1,14 +1,17 @@
1
1
  import React from 'react';
2
2
  import { InputProps } from 'react-select/lib/components/Input';
3
3
  import { InputFieldType } from '../wrap-field-with-meta';
4
+ import { toolbarItemName } from './plate/plugins/ui/toolbar';
4
5
  import type { MdxTemplate } from './plate/types';
5
6
  export declare type RichTextType = React.PropsWithChildren<InputFieldType<InputProps, {
6
7
  templates: MdxTemplate[];
8
+ toolbarOverride?: toolbarItemName[];
7
9
  }>>;
8
10
  export declare const MdxFieldPlugin: {
9
11
  name: string;
10
12
  Component: (props: InputFieldType<InputProps, {
11
13
  templates: MdxTemplate[];
14
+ toolbarOverride?: toolbarItemName[];
12
15
  }>) => React.JSX.Element;
13
16
  };
14
17
  export declare const MdxFieldPluginExtendible: {
@@ -16,5 +19,6 @@ export declare const MdxFieldPluginExtendible: {
16
19
  validate(value: any): string;
17
20
  Component: (props: InputFieldType<InputProps, {
18
21
  templates: MdxTemplate[];
22
+ toolbarOverride?: toolbarItemName[];
19
23
  }>) => React.JSX.Element;
20
24
  };
@@ -1,13 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import type { MdxTemplate } from '../../../types';
3
3
  import type { Form } from '../../../../../../../forms';
4
- export declare function Toolbar({ templates, tinaForm, }: {
4
+ export declare type toolbarItemName = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw';
5
+ export declare function Toolbar({ templates, toolbarOverride, tinaForm, }: {
5
6
  tinaForm: Form;
6
7
  inlineOnly: boolean;
7
8
  templates: MdxTemplate[];
9
+ toolbarOverride?: toolbarItemName[];
8
10
  }): React.JSX.Element;
9
- export declare const FloatingToolbar: ({ templates, tinaForm, }: {
11
+ export declare const FloatingToolbar: ({ templates, tinaForm, toolbarOverride, }: {
10
12
  tinaForm: Form;
11
13
  templates: MdxTemplate[];
14
+ toolbarOverride?: toolbarItemName[];
12
15
  }) => React.JSX.Element;
13
16
  export declare const FloatingLink: () => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -90,9 +90,9 @@
90
90
  "webfontloader": "1.6.28",
91
91
  "yup": "^0.32.0",
92
92
  "zod": "^3.14.3",
93
- "@tinacms/mdx": "1.3.28",
94
- "@tinacms/schema-tools": "1.4.19",
95
- "@tinacms/search": "1.0.23"
93
+ "@tinacms/mdx": "1.3.29",
94
+ "@tinacms/schema-tools": "1.5.0",
95
+ "@tinacms/search": "1.0.24"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@graphql-tools/utils": "^8.6.1",