tinacms 2.10.0 → 2.10.1

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
@@ -34615,25 +34615,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
34615
34615
  ))
34616
34616
  );
34617
34617
  }
34618
- function PlusIcon({ className = "" }) {
34619
- return /* @__PURE__ */ React.createElement(
34620
- "svg",
34621
- {
34622
- xmlns: "http://www.w3.org/2000/svg",
34623
- className: `h-4 w-4 ${className}`,
34624
- viewBox: "0 0 20 20",
34625
- fill: "currentColor"
34626
- },
34627
- /* @__PURE__ */ React.createElement(
34628
- "path",
34629
- {
34630
- fillRule: "evenodd",
34631
- d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",
34632
- clipRule: "evenodd"
34633
- }
34634
- )
34635
- );
34636
- }
34637
34618
  var useComboboxInput = ({
34638
34619
  autoFocus = true,
34639
34620
  cancelInputOnArrowLeftRight = true,
@@ -37032,7 +37013,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
37032
37013
  dropdownMenuLabelVariants,
37033
37014
  ["inset"]
37034
37015
  );
37035
- const DropdownMenuSeparator$1 = cn$2.withCn(
37016
+ cn$2.withCn(
37036
37017
  DropdownMenuPrimitive__namespace.Separator,
37037
37018
  "-mx-1 my-1 h-px bg-muted"
37038
37019
  );
@@ -46587,7 +46568,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
46587
46568
  requiredArgs(1, arguments);
46588
46569
  return formatDistance(dirtyDate, Date.now(), options);
46589
46570
  }
46590
- const version$1 = "2.10.0";
46571
+ const version$1 = "2.10.1";
46591
46572
  const VersionInfo = () => {
46592
46573
  var _a2, _b, _c, _d, _e, _f;
46593
46574
  const cms = useCMS();
@@ -66028,33 +66009,40 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
66028
66009
  },
66029
66010
  /* @__PURE__ */ React.createElement(SelectedItemIcon, { className: "size-5" }),
66030
66011
  /* @__PURE__ */ React.createElement("span", { className: "@md/toolbar:flex hidden" }, selectedItemLabel)
66031
- )), /* @__PURE__ */ React.createElement(DropdownMenuContent$1, { align: "start", className: "min-w-0 rounded-md" }, /* @__PURE__ */ React.createElement(
66032
- DropdownMenuRadioGroup,
66012
+ )), /* @__PURE__ */ React.createElement(
66013
+ DropdownMenuContent$1,
66033
66014
  {
66034
- className: "flex flex-col gap-0.5",
66035
- onValueChange: (type) => {
66036
- editor.tf.toggleBlock(type);
66037
- editor.tf.collapse();
66038
- editor.tf.focus();
66039
- },
66040
- value
66015
+ align: "start",
66016
+ className: "min-w-0 rounded-none rounded-bl rounded-br border-border"
66041
66017
  },
66042
- items$1.filter((item) => {
66043
- if (userInTable) {
66044
- return !unsupportedItemsInTable.has(item.label);
66045
- }
66046
- return true;
66047
- }).map(({ icon: Icon, label, value: itemValue }) => /* @__PURE__ */ React.createElement(
66048
- DropdownMenuRadioItem,
66018
+ /* @__PURE__ */ React.createElement(
66019
+ DropdownMenuRadioGroup,
66049
66020
  {
66050
- className: "min-w-[180px]",
66051
- key: itemValue,
66052
- value: itemValue
66021
+ className: "flex flex-col gap-0.5",
66022
+ onValueChange: (type) => {
66023
+ editor.tf.toggleBlock(type);
66024
+ editor.tf.collapse();
66025
+ editor.tf.focus();
66026
+ },
66027
+ value
66053
66028
  },
66054
- /* @__PURE__ */ React.createElement(Icon, { className: "mr-2 size-5" }),
66055
- label
66056
- ))
66057
- ))));
66029
+ items$1.filter((item) => {
66030
+ if (userInTable) {
66031
+ return !unsupportedItemsInTable.has(item.label);
66032
+ }
66033
+ return true;
66034
+ }).map(({ icon: Icon, label, value: itemValue }) => /* @__PURE__ */ React.createElement(
66035
+ DropdownMenuRadioItem,
66036
+ {
66037
+ className: "min-w-[180px]",
66038
+ key: itemValue,
66039
+ value: itemValue
66040
+ },
66041
+ /* @__PURE__ */ React.createElement(Icon, { className: "mr-2 size-5" }),
66042
+ label
66043
+ ))
66044
+ )
66045
+ )));
66058
66046
  }
66059
66047
  const useCodeBlockToolbarButtonState = () => {
66060
66048
  const editor = useEditorState();
@@ -66288,7 +66276,7 @@ flowchart TD
66288
66276
  return /* @__PURE__ */ React.createElement(EmbedButton, { templates, editor });
66289
66277
  }
66290
66278
  const EmbedButton = ({ editor, templates }) => {
66291
- const [open, setOpen] = React.useState(false);
66279
+ const { open, onOpenChange } = useOpenState();
66292
66280
  const [filteredTemplates, setFilteredTemplates] = React.useState(templates);
66293
66281
  const filterChange = (e3) => {
66294
66282
  const filterText = e3.target.value.toLowerCase();
@@ -66298,32 +66286,35 @@ flowchart TD
66298
66286
  )
66299
66287
  );
66300
66288
  };
66301
- return /* @__PURE__ */ React.createElement(DropdownMenu$1, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger$1, { className: "inline-flex items-center rounded-full text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg:not([data-icon])]:size-5 h-9 px-2 bg-transparent hover:bg-muted hover:text-muted-foreground aria-checked:bg-accent aria-checked:text-accent-foreground my-1 justify-between pr-1" }, /* @__PURE__ */ React.createElement("span", { className: "flex" }, "Embed"), /* @__PURE__ */ React.createElement(
66302
- PlusIcon,
66303
- {
66304
- className: `origin-center transition-all ease-out duration-150 ${open ? "rotate-45" : ""}`
66305
- }
66306
- )), /* @__PURE__ */ React.createElement(DropdownMenuContent$1, { className: "max-h-48 overflow-y-auto" }, templates.length > 10 && /* @__PURE__ */ React.createElement(
66307
- "input",
66308
- {
66309
- type: "text",
66310
- placeholder: "Filter templates...",
66311
- className: "w-full p-2 border border-gray-300 rounded",
66312
- onChange: filterChange
66313
- }
66314
- ), /* @__PURE__ */ React.createElement(DropdownMenuSeparator$1, null), filteredTemplates.map((template) => /* @__PURE__ */ React.createElement(
66315
- DropdownMenuItem$1,
66289
+ return /* @__PURE__ */ React.createElement(DropdownMenu$1, { modal: false, open, onOpenChange }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger$1, { asChild: true }, /* @__PURE__ */ React.createElement(ToolbarButton, { showArrow: true, isDropdown: true, pressed: open, tooltip: "Embed" }, "Embed")), /* @__PURE__ */ React.createElement(
66290
+ DropdownMenuContent$1,
66316
66291
  {
66317
- key: template.name,
66318
- onMouseDown: (e3) => {
66319
- e3.preventDefault();
66320
- setOpen(false);
66321
- insertMDX(editor, template);
66322
- },
66323
- className: ""
66292
+ align: "start",
66293
+ className: "max-h-72 overflow-y-auto border-border rounded-none rounded-bl rounded-br"
66324
66294
  },
66325
- template.label || template.name
66326
- ))));
66295
+ templates.length > 10 && /* @__PURE__ */ React.createElement(
66296
+ "input",
66297
+ {
66298
+ type: "text",
66299
+ placeholder: "Filter templates...",
66300
+ className: "w-full p-2 border border-gray-300 rounded",
66301
+ onChange: filterChange
66302
+ }
66303
+ ),
66304
+ filteredTemplates.map((template) => /* @__PURE__ */ React.createElement(
66305
+ DropdownMenuItem$1,
66306
+ {
66307
+ key: template.name,
66308
+ onMouseDown: (e3) => {
66309
+ e3.preventDefault();
66310
+ onOpenChange(false);
66311
+ insertMDX(editor, template);
66312
+ },
66313
+ className: ""
66314
+ },
66315
+ template.label || template.name
66316
+ ))
66317
+ ));
66327
66318
  };
66328
66319
  const MarkToolbarButton = cn$2.withRef(({ clear, nodeType, ...rest }, ref) => {
66329
66320
  const state = useMarkToolbarButtonState({ clear, nodeType });
package/dist/index.mjs CHANGED
@@ -34643,25 +34643,6 @@ function ItalicIcon(props) {
34643
34643
  ))
34644
34644
  );
34645
34645
  }
34646
- function PlusIcon({ className = "" }) {
34647
- return /* @__PURE__ */ React__default.createElement(
34648
- "svg",
34649
- {
34650
- xmlns: "http://www.w3.org/2000/svg",
34651
- className: `h-4 w-4 ${className}`,
34652
- viewBox: "0 0 20 20",
34653
- fill: "currentColor"
34654
- },
34655
- /* @__PURE__ */ React__default.createElement(
34656
- "path",
34657
- {
34658
- fillRule: "evenodd",
34659
- d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",
34660
- clipRule: "evenodd"
34661
- }
34662
- )
34663
- );
34664
- }
34665
34646
  var useComboboxInput = ({
34666
34647
  autoFocus = true,
34667
34648
  cancelInputOnArrowLeftRight = true,
@@ -37060,7 +37041,7 @@ const DropdownMenuLabel = withVariants(
37060
37041
  dropdownMenuLabelVariants,
37061
37042
  ["inset"]
37062
37043
  );
37063
- const DropdownMenuSeparator$1 = withCn(
37044
+ withCn(
37064
37045
  DropdownMenuPrimitive.Separator,
37065
37046
  "-mx-1 my-1 h-px bg-muted"
37066
37047
  );
@@ -46615,7 +46596,7 @@ function formatDistanceToNow(dirtyDate, options) {
46615
46596
  requiredArgs(1, arguments);
46616
46597
  return formatDistance2(dirtyDate, Date.now(), options);
46617
46598
  }
46618
- const version$1 = "2.10.0";
46599
+ const version$1 = "2.10.1";
46619
46600
  const VersionInfo = () => {
46620
46601
  var _a2, _b, _c, _d, _e, _f;
46621
46602
  const cms = useCMS();
@@ -66056,33 +66037,40 @@ function HeadingsMenu(props) {
66056
66037
  },
66057
66038
  /* @__PURE__ */ React__default.createElement(SelectedItemIcon, { className: "size-5" }),
66058
66039
  /* @__PURE__ */ React__default.createElement("span", { className: "@md/toolbar:flex hidden" }, selectedItemLabel)
66059
- )), /* @__PURE__ */ React__default.createElement(DropdownMenuContent$1, { align: "start", className: "min-w-0 rounded-md" }, /* @__PURE__ */ React__default.createElement(
66060
- DropdownMenuRadioGroup,
66040
+ )), /* @__PURE__ */ React__default.createElement(
66041
+ DropdownMenuContent$1,
66061
66042
  {
66062
- className: "flex flex-col gap-0.5",
66063
- onValueChange: (type) => {
66064
- editor.tf.toggleBlock(type);
66065
- editor.tf.collapse();
66066
- editor.tf.focus();
66067
- },
66068
- value
66043
+ align: "start",
66044
+ className: "min-w-0 rounded-none rounded-bl rounded-br border-border"
66069
66045
  },
66070
- items$1.filter((item) => {
66071
- if (userInTable) {
66072
- return !unsupportedItemsInTable.has(item.label);
66073
- }
66074
- return true;
66075
- }).map(({ icon: Icon, label, value: itemValue }) => /* @__PURE__ */ React__default.createElement(
66076
- DropdownMenuRadioItem,
66046
+ /* @__PURE__ */ React__default.createElement(
66047
+ DropdownMenuRadioGroup,
66077
66048
  {
66078
- className: "min-w-[180px]",
66079
- key: itemValue,
66080
- value: itemValue
66049
+ className: "flex flex-col gap-0.5",
66050
+ onValueChange: (type) => {
66051
+ editor.tf.toggleBlock(type);
66052
+ editor.tf.collapse();
66053
+ editor.tf.focus();
66054
+ },
66055
+ value
66081
66056
  },
66082
- /* @__PURE__ */ React__default.createElement(Icon, { className: "mr-2 size-5" }),
66083
- label
66084
- ))
66085
- ))));
66057
+ items$1.filter((item) => {
66058
+ if (userInTable) {
66059
+ return !unsupportedItemsInTable.has(item.label);
66060
+ }
66061
+ return true;
66062
+ }).map(({ icon: Icon, label, value: itemValue }) => /* @__PURE__ */ React__default.createElement(
66063
+ DropdownMenuRadioItem,
66064
+ {
66065
+ className: "min-w-[180px]",
66066
+ key: itemValue,
66067
+ value: itemValue
66068
+ },
66069
+ /* @__PURE__ */ React__default.createElement(Icon, { className: "mr-2 size-5" }),
66070
+ label
66071
+ ))
66072
+ )
66073
+ )));
66086
66074
  }
66087
66075
  const useCodeBlockToolbarButtonState = () => {
66088
66076
  const editor = useEditorState();
@@ -66316,7 +66304,7 @@ function TemplatesToolbarButton() {
66316
66304
  return /* @__PURE__ */ React__default.createElement(EmbedButton, { templates, editor });
66317
66305
  }
66318
66306
  const EmbedButton = ({ editor, templates }) => {
66319
- const [open, setOpen] = useState(false);
66307
+ const { open, onOpenChange } = useOpenState();
66320
66308
  const [filteredTemplates, setFilteredTemplates] = useState(templates);
66321
66309
  const filterChange = (e3) => {
66322
66310
  const filterText = e3.target.value.toLowerCase();
@@ -66326,32 +66314,35 @@ const EmbedButton = ({ editor, templates }) => {
66326
66314
  )
66327
66315
  );
66328
66316
  };
66329
- return /* @__PURE__ */ React__default.createElement(DropdownMenu$1, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger$1, { className: "inline-flex items-center rounded-full text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg:not([data-icon])]:size-5 h-9 px-2 bg-transparent hover:bg-muted hover:text-muted-foreground aria-checked:bg-accent aria-checked:text-accent-foreground my-1 justify-between pr-1" }, /* @__PURE__ */ React__default.createElement("span", { className: "flex" }, "Embed"), /* @__PURE__ */ React__default.createElement(
66330
- PlusIcon,
66331
- {
66332
- className: `origin-center transition-all ease-out duration-150 ${open ? "rotate-45" : ""}`
66333
- }
66334
- )), /* @__PURE__ */ React__default.createElement(DropdownMenuContent$1, { className: "max-h-48 overflow-y-auto" }, templates.length > 10 && /* @__PURE__ */ React__default.createElement(
66335
- "input",
66336
- {
66337
- type: "text",
66338
- placeholder: "Filter templates...",
66339
- className: "w-full p-2 border border-gray-300 rounded",
66340
- onChange: filterChange
66341
- }
66342
- ), /* @__PURE__ */ React__default.createElement(DropdownMenuSeparator$1, null), filteredTemplates.map((template) => /* @__PURE__ */ React__default.createElement(
66343
- DropdownMenuItem$1,
66317
+ return /* @__PURE__ */ React__default.createElement(DropdownMenu$1, { modal: false, open, onOpenChange }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger$1, { asChild: true }, /* @__PURE__ */ React__default.createElement(ToolbarButton, { showArrow: true, isDropdown: true, pressed: open, tooltip: "Embed" }, "Embed")), /* @__PURE__ */ React__default.createElement(
66318
+ DropdownMenuContent$1,
66344
66319
  {
66345
- key: template.name,
66346
- onMouseDown: (e3) => {
66347
- e3.preventDefault();
66348
- setOpen(false);
66349
- insertMDX(editor, template);
66350
- },
66351
- className: ""
66320
+ align: "start",
66321
+ className: "max-h-72 overflow-y-auto border-border rounded-none rounded-bl rounded-br"
66352
66322
  },
66353
- template.label || template.name
66354
- ))));
66323
+ templates.length > 10 && /* @__PURE__ */ React__default.createElement(
66324
+ "input",
66325
+ {
66326
+ type: "text",
66327
+ placeholder: "Filter templates...",
66328
+ className: "w-full p-2 border border-gray-300 rounded",
66329
+ onChange: filterChange
66330
+ }
66331
+ ),
66332
+ filteredTemplates.map((template) => /* @__PURE__ */ React__default.createElement(
66333
+ DropdownMenuItem$1,
66334
+ {
66335
+ key: template.name,
66336
+ onMouseDown: (e3) => {
66337
+ e3.preventDefault();
66338
+ onOpenChange(false);
66339
+ insertMDX(editor, template);
66340
+ },
66341
+ className: ""
66342
+ },
66343
+ template.label || template.name
66344
+ ))
66345
+ ));
66355
66346
  };
66356
66347
  const MarkToolbarButton = withRef$1(({ clear, nodeType, ...rest }, ref) => {
66357
66348
  const state = useMarkToolbarButtonState({ clear, nodeType });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -140,14 +140,14 @@
140
140
  "webfontloader": "1.6.28",
141
141
  "yup": "^1.6.1",
142
142
  "zod": "^3.24.2",
143
- "@tinacms/mdx": "1.8.2",
144
- "@tinacms/schema-tools": "1.10.0",
145
- "@tinacms/search": "1.1.2"
143
+ "@tinacms/schema-tools": "1.10.1",
144
+ "@tinacms/mdx": "1.8.3",
145
+ "@tinacms/search": "1.1.3"
146
146
  },
147
147
  "devDependencies": {
148
148
  "@graphql-tools/utils": "^10.8.1",
149
149
  "@testing-library/dom": "^10.4.0",
150
- "@testing-library/jest-dom": "^6.6.3",
150
+ "@testing-library/jest-dom": "^6.7.0",
151
151
  "@testing-library/react": "^16.2.0",
152
152
  "@testing-library/user-event": "^14.6.1",
153
153
  "@types/atob": "^2.1.4",
@@ -158,7 +158,6 @@
158
158
  "@types/react": "^18.3.18",
159
159
  "@types/react-color": "^3.0.13",
160
160
  "@types/react-dom": "^18.3.5",
161
- "@types/yup": "^0.32.0",
162
161
  "happy-dom": "15.10.2",
163
162
  "identity-obj-proxy": "^3.0.0",
164
163
  "isomorphic-fetch": "^3.0.0",