tinacms 0.0.0-ed38135-20250102012919 → 0.0.0-ee8d9a3-20250429131017

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/admin/api.d.ts +1 -0
  3. package/dist/admin/components/GetCollection.d.ts +2 -2
  4. package/dist/auth/TinaCloudProvider.d.ts +1 -1
  5. package/dist/client.js +82 -42
  6. package/dist/client.js.map +1 -0
  7. package/dist/client.mjs +59 -31
  8. package/dist/client.mjs.map +1 -0
  9. package/dist/hooks/create-page-plugin.d.ts +1 -1
  10. package/dist/index.js +2340 -981
  11. package/dist/index.js.map +1 -0
  12. package/dist/index.mjs +2350 -991
  13. package/dist/index.mjs.map +1 -0
  14. package/dist/internalClient/index.d.ts +3 -3
  15. package/dist/{node-cache-4c336858.mjs → node-cache-5e8db9f0.mjs} +24 -10
  16. package/dist/node-cache-5e8db9f0.mjs.map +1 -0
  17. package/dist/react.d.ts +1 -0
  18. package/dist/react.js +14 -1
  19. package/dist/react.js.map +1 -0
  20. package/dist/react.mjs +14 -1
  21. package/dist/react.mjs.map +1 -0
  22. package/dist/rich-text/index.js +1 -0
  23. package/dist/rich-text/index.js.map +1 -0
  24. package/dist/rich-text/index.mjs +1 -0
  25. package/dist/rich-text/index.mjs.map +1 -0
  26. package/dist/rich-text/prism.js +2 -1
  27. package/dist/rich-text/prism.js.map +1 -0
  28. package/dist/rich-text/prism.mjs +2 -1
  29. package/dist/rich-text/prism.mjs.map +1 -0
  30. package/dist/toolkit/components/media/media-manager.d.ts +1 -1
  31. package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
  32. package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +4 -1
  33. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +17 -5
  34. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
  35. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +1 -1
  36. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +6 -11
  37. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +5 -1
  38. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +2 -2
  39. package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
  40. package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
  41. package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
  42. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +5 -4
  43. package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
  44. package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
  45. package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
  46. package/dist/toolkit/tina-state.d.ts +4 -0
  47. package/dist/unifiedClient/index.d.ts +8 -1
  48. package/package.json +36 -35
  49. package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate"), require("@udecode/plate-common"), require("@udecode/plate-slash-command"), require("slate-react"), require("@udecode/plate-code-block"), require("@monaco-editor/react"), require("@headlessui/react"), require("class-variance-authority"), require("lucide-react"), require("mermaid"), require("@udecode/plate-heading"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-table"), require("@udecode/plate-resizable"), require("@radix-ui/react-popover"), require("@radix-ui/react-slot"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-separator"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("react-color"), require("color-string"), require("react-dropzone"), require("clsx"), require("tailwind-merge"), require("cmdk"), require("is-hotkey"), require("slate"), require("lodash.get"), require("moment"), require("date-fns"), require("@udecode/plate-link"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-tooltip"), require("@udecode/plate-paragraph"), require("@udecode/plate-block-quote"), require("@udecode/plate-floating"), require("@react-hook/window-size"), require("graphql"), require("graphql-tag"), require("@tinacms/schema-tools"), require("yup"), require("@graphql-inspector/core"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate", "@udecode/plate-common", "@udecode/plate-slash-command", "slate-react", "@udecode/plate-code-block", "@monaco-editor/react", "@headlessui/react", "class-variance-authority", "lucide-react", "mermaid", "@udecode/plate-heading", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-table", "@udecode/plate-resizable", "@radix-ui/react-popover", "@radix-ui/react-slot", "@radix-ui/react-dropdown-menu", "@radix-ui/react-separator", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "react-color", "color-string", "react-dropzone", "clsx", "tailwind-merge", "cmdk", "is-hotkey", "slate", "lodash.get", "moment", "date-fns", "@udecode/plate-link", "@radix-ui/react-toolbar", "@radix-ui/react-tooltip", "@udecode/plate-paragraph", "@udecode/plate-block-quote", "@udecode/plate-floating", "@react-hook/window-size", "graphql", "graphql-tag", "@tinacms/schema-tools", "yup", "@graphql-inspector/core", "react-router-dom", "@tinacms/mdx"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
3
- })(this, function(exports2, zod, React, reactDom, cn$1, plate, plateCommon, plateSlashCommand, slateReact, plateCodeBlock, MonacoEditor, react, classVarianceAuthority, lucideReact, mermaid, plateHeading, react$1, plateCombobox, plateTable, plateResizable, PopoverPrimitive, reactSlot, DropdownMenuPrimitive, SeparatorPrimitive, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, pkg$1, pkg, dropzone, clsx, tailwindMerge, cmdk, isHotkey, slate, get, moment, dateFns, plateLink, ToolbarPrimitive, TooltipPrimitive, plateParagraph, plateBlockQuote, plateFloating, windowSize, graphql, gql, schemaTools, yup, core, reactRouterDom, mdx) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate"), require("@udecode/plate-common"), require("@udecode/plate-slash-command"), require("@udecode/plate-code-block"), require("@monaco-editor/react"), require("slate-react"), require("@headlessui/react"), require("class-variance-authority"), require("lucide-react"), require("mermaid"), require("@udecode/plate-heading"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-table"), require("@udecode/plate-resizable"), require("@radix-ui/react-popover"), require("@radix-ui/react-slot"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-separator"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("react-color"), require("color-string"), require("react-dropzone"), require("clsx"), require("tailwind-merge"), require("cmdk"), require("is-hotkey"), require("slate"), require("@react-hook/window-size"), require("lodash.get"), require("moment"), require("date-fns"), require("@udecode/plate-link"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-tooltip"), require("@udecode/plate-paragraph"), require("@udecode/plate-block-quote"), require("@udecode/plate-floating"), require("graphql"), require("@tinacms/schema-tools"), require("graphql-tag"), require("@graphql-inspector/core"), require("yup"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate", "@udecode/plate-common", "@udecode/plate-slash-command", "@udecode/plate-code-block", "@monaco-editor/react", "slate-react", "@headlessui/react", "class-variance-authority", "lucide-react", "mermaid", "@udecode/plate-heading", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-table", "@udecode/plate-resizable", "@radix-ui/react-popover", "@radix-ui/react-slot", "@radix-ui/react-dropdown-menu", "@radix-ui/react-separator", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "react-color", "color-string", "react-dropzone", "clsx", "tailwind-merge", "cmdk", "is-hotkey", "slate", "@react-hook/window-size", "lodash.get", "moment", "date-fns", "@udecode/plate-link", "@radix-ui/react-toolbar", "@radix-ui/react-tooltip", "@udecode/plate-paragraph", "@udecode/plate-block-quote", "@udecode/plate-floating", "graphql", "@tinacms/schema-tools", "graphql-tag", "@graphql-inspector/core", "yup", "react-router-dom", "@tinacms/mdx"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
3
+ })(this, function(exports2, zod, React, reactDom, cn$1, plate, plateCommon, plateSlashCommand, plateCodeBlock, MonacoEditor, slateReact, react, classVarianceAuthority, lucideReact, mermaid, plateHeading, react$1, plateCombobox, plateTable, plateResizable, PopoverPrimitive, reactSlot, DropdownMenuPrimitive, SeparatorPrimitive, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, pkg$1, pkg, dropzone, clsx, tailwindMerge, cmdk, isHotkey, slate, windowSize, get, moment, dateFns, plateLink, ToolbarPrimitive, TooltipPrimitive, plateParagraph, plateBlockQuote, plateFloating, graphql, schemaTools, gql, core, yup, reactRouterDom, mdx) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => {
@@ -2943,7 +2943,7 @@ flowchart TD
2943
2943
  ),
2944
2944
  [plate.MARK_CODE]: CodeLeaf,
2945
2945
  [plate.MARK_UNDERLINE]: cn$1.withProps(plateCommon.PlateLeaf, { as: "u" }),
2946
- [plate.MARK_STRIKETHROUGH]: cn$1.withProps(plateCommon.PlateLeaf, { as: "s" }),
2946
+ [plate.MARK_STRIKETHROUGH]: ({ editor, leaf, text, ...props }) => /* @__PURE__ */ React.createElement("s", { ...props.attributes, ...props }),
2947
2947
  [plate.MARK_ITALIC]: cn$1.withProps(plateCommon.PlateLeaf, { as: "em" }),
2948
2948
  [plate.MARK_BOLD]: ({ editor, leaf, text, ...props }) => /* @__PURE__ */ React.createElement("strong", { ...props.attributes, ...props }),
2949
2949
  [plate.ELEMENT_HR]: ({
@@ -2954,7 +2954,6 @@ flowchart TD
2954
2954
  children,
2955
2955
  ...props
2956
2956
  }) => {
2957
- const selected = slateReact.useSelected();
2958
2957
  return /* @__PURE__ */ React.createElement(
2959
2958
  "div",
2960
2959
  {
@@ -2965,8 +2964,7 @@ flowchart TD
2965
2964
  ...attributes,
2966
2965
  ...props
2967
2966
  },
2968
- children,
2969
- selected && /* @__PURE__ */ React.createElement("span", { className: "absolute h-4 -top-2 inset-0 ring-2 ring-blue-100 ring-inset rounded-md z-10 pointer-events-none" })
2967
+ children
2970
2968
  );
2971
2969
  },
2972
2970
  [plate.ELEMENT_TABLE]: TableElement,
@@ -4403,36 +4401,6 @@ flowchart TD
4403
4401
  function MdOutlinePerson(props) {
4404
4402
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }, "child": [] }] })(props);
4405
4403
  }
4406
- const BranchContext = React__namespace.createContext({
4407
- currentBranch: null,
4408
- setCurrentBranch: (branch) => {
4409
- console.warn("BranchContext not initialized");
4410
- }
4411
- });
4412
- const BranchDataProvider = ({
4413
- currentBranch,
4414
- setCurrentBranch,
4415
- children
4416
- }) => {
4417
- return /* @__PURE__ */ React__namespace.createElement(
4418
- BranchContext.Provider,
4419
- {
4420
- value: {
4421
- currentBranch,
4422
- setCurrentBranch
4423
- }
4424
- },
4425
- children
4426
- );
4427
- };
4428
- const useBranchData = () => {
4429
- const branchData = React__namespace.useContext(BranchContext);
4430
- const { dispatch } = useEvent("branch:change");
4431
- React__namespace.useEffect(() => {
4432
- dispatch({ branchName: branchData.currentBranch });
4433
- }, [branchData.currentBranch]);
4434
- return branchData;
4435
- };
4436
4404
  const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded-md";
4437
4405
  const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
4438
4406
  const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
@@ -5197,7 +5165,7 @@ flowchart TD
5197
5165
  side: "bottom",
5198
5166
  className: cn(
5199
5167
  "rounded-md border bg-white p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
5200
- "max-h-[30vh] max-w-[30vh] overflow-y-auto",
5168
+ "max-h-[30vh] max-w-[30vw] overflow-y-auto",
5201
5169
  className
5202
5170
  ),
5203
5171
  ...props
@@ -5289,11 +5257,7 @@ flowchart TD
5289
5257
  const node = nodes.find((node2) => node2.id === value);
5290
5258
  return node ? node._internalSys.filename : null;
5291
5259
  };
5292
- const ComboboxDemo = ({
5293
- cms,
5294
- input,
5295
- field
5296
- }) => {
5260
+ const Combobox = ({ cms, input, field }) => {
5297
5261
  const [open2, setOpen] = React__namespace.useState(false);
5298
5262
  const [value, setValue] = React__namespace.useState(input.value);
5299
5263
  const [displayText, setDisplayText] = React__namespace.useState(null);
@@ -5309,7 +5273,9 @@ flowchart TD
5309
5273
  }, [value, input, optionSets]);
5310
5274
  React__namespace.useEffect(() => {
5311
5275
  if (field.experimental___filter && optionSets.length > 0) {
5312
- setFilteredOptionsList(field.experimental___filter(optionSets, void 0));
5276
+ setFilteredOptionsList(
5277
+ field.experimental___filter(optionSets, void 0)
5278
+ );
5313
5279
  } else {
5314
5280
  setFilteredOptionsList(optionSets);
5315
5281
  }
@@ -5317,17 +5283,17 @@ flowchart TD
5317
5283
  if (loading === true) {
5318
5284
  return /* @__PURE__ */ React__namespace.createElement(LoadingDots, { color: "var(--tina-color-primary)" });
5319
5285
  }
5320
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Popover, { open: open2, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
5286
+ return /* @__PURE__ */ React__namespace.createElement(Popover, { open: open2, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
5321
5287
  Button,
5322
5288
  {
5323
5289
  variant: "outline",
5324
5290
  role: "combobox",
5325
5291
  "aria-expanded": open2,
5326
- className: "w-52 justify-between"
5292
+ className: "w-full justify-between"
5327
5293
  },
5328
5294
  /* @__PURE__ */ React__namespace.createElement("p", { className: "truncate" }, displayText ?? "Choose an option..."),
5329
5295
  open2 ? /* @__PURE__ */ React__namespace.createElement(IoMdArrowDropup, { size: 20 }) : /* @__PURE__ */ React__namespace.createElement(IoMdArrowDropdown, { size: 20 })
5330
- )), /* @__PURE__ */ React__namespace.createElement(PopoverContent, { className: "p-0 relative" }, /* @__PURE__ */ React__namespace.createElement(
5296
+ )), /* @__PURE__ */ React__namespace.createElement(PopoverContent, { className: "p-0 relative min-w-[var(--radix-popover-trigger-width)]" }, /* @__PURE__ */ React__namespace.createElement(
5331
5297
  Command,
5332
5298
  {
5333
5299
  shouldFilter: !field.experimental___filter,
@@ -5351,32 +5317,25 @@ flowchart TD
5351
5317
  }
5352
5318
  ),
5353
5319
  /* @__PURE__ */ React__namespace.createElement(CommandEmpty, null, "No reference found"),
5354
- /* @__PURE__ */ React__namespace.createElement(CommandList, null, filteredOptionsList.length > 0 && (filteredOptionsList == null ? void 0 : filteredOptionsList.map(({ collection, edges }) => /* @__PURE__ */ React__namespace.createElement(
5355
- CommandGroup,
5356
- {
5357
- key: `${collection}-group`,
5358
- heading: collection
5359
- },
5360
- /* @__PURE__ */ React__namespace.createElement(CommandList, null, edges == null ? void 0 : edges.map(({ node }) => {
5361
- const { id, _values } = node;
5362
- return /* @__PURE__ */ React__namespace.createElement(
5363
- OptionComponent,
5364
- {
5365
- id,
5366
- key: id,
5367
- value,
5368
- field,
5369
- _values,
5370
- node,
5371
- onSelect: (currentValue) => {
5372
- setValue(currentValue);
5373
- setOpen(false);
5374
- }
5320
+ /* @__PURE__ */ React__namespace.createElement(CommandList, null, filteredOptionsList.length > 0 && (filteredOptionsList == null ? void 0 : filteredOptionsList.map(({ collection, edges }) => /* @__PURE__ */ React__namespace.createElement(CommandGroup, { key: `${collection}-group`, heading: collection }, /* @__PURE__ */ React__namespace.createElement(CommandList, null, edges == null ? void 0 : edges.map(({ node }) => {
5321
+ const { id, _values } = node;
5322
+ return /* @__PURE__ */ React__namespace.createElement(
5323
+ OptionComponent,
5324
+ {
5325
+ id,
5326
+ key: id,
5327
+ value,
5328
+ field,
5329
+ _values,
5330
+ node,
5331
+ onSelect: (currentValue) => {
5332
+ setValue(currentValue);
5333
+ setOpen(false);
5375
5334
  }
5376
- );
5377
- }))
5378
- ))))
5379
- ))));
5335
+ }
5336
+ );
5337
+ }))))))
5338
+ )));
5380
5339
  };
5381
5340
  const useGetNode = (cms, id) => {
5382
5341
  const [document2, setDocument] = React__namespace.useState(
@@ -5449,7 +5408,7 @@ flowchart TD
5449
5408
  };
5450
5409
  const Reference = ({ input, field }) => {
5451
5410
  const cms = useCMS();
5452
- return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__namespace.createElement(ComboboxDemo, { cms, input, field })), /* @__PURE__ */ React__namespace.createElement(ReferenceLink, { cms, input }));
5411
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__namespace.createElement(Combobox, { cms, input, field })), /* @__PURE__ */ React__namespace.createElement(ReferenceLink, { cms, input }));
5453
5412
  };
5454
5413
  const ButtonToggle = ({
5455
5414
  input,
@@ -5686,7 +5645,9 @@ flowchart TD
5686
5645
  onClick: () => {
5687
5646
  const state = tinaForm.finalForm.getState();
5688
5647
  if (state.invalid === true) {
5689
- cms.alerts.error("Cannot navigate away from an invalid form.");
5648
+ cms.alerts.error(
5649
+ "Cannot navigate away from an invalid form."
5650
+ );
5690
5651
  return;
5691
5652
  }
5692
5653
  cms.dispatch({
@@ -6270,7 +6231,9 @@ flowchart TD
6270
6231
  onClick: () => {
6271
6232
  const state = tinaForm.finalForm.getState();
6272
6233
  if (state.invalid === true) {
6273
- cms.alerts.error("Cannot navigate away from an invalid form.");
6234
+ cms.alerts.error(
6235
+ "Cannot navigate away from an invalid form."
6236
+ );
6274
6237
  return;
6275
6238
  }
6276
6239
  cms.dispatch({
@@ -6752,28 +6715,28 @@ flowchart TD
6752
6715
  }
6753
6716
  renderDayHeaders() {
6754
6717
  const locale = this.props.viewDate.localeData();
6755
- let dayItems = getDaysOfWeek(locale).map((day, index) => /* @__PURE__ */ React.createElement("th", { key: day + index, className: "dow" }, day));
6718
+ const dayItems = getDaysOfWeek(locale).map((day, index) => /* @__PURE__ */ React.createElement("th", { key: day + index, className: "dow" }, day));
6756
6719
  return /* @__PURE__ */ React.createElement("tr", null, dayItems);
6757
6720
  }
6758
6721
  renderDays() {
6759
6722
  const date = this.props.viewDate;
6760
6723
  const startOfMonth = date.clone().startOf("month");
6761
6724
  const endOfMonth = date.clone().endOf("month");
6762
- let rows = [[], [], [], [], [], []];
6763
- let startDate = date.clone().subtract(1, "months");
6725
+ const rows = [[], [], [], [], [], []];
6726
+ const startDate = date.clone().subtract(1, "months");
6764
6727
  startDate.date(startDate.daysInMonth()).startOf("week");
6765
- let endDate = startDate.clone().add(42, "d");
6728
+ const endDate = startDate.clone().add(42, "d");
6766
6729
  let i = 0;
6767
6730
  while (startDate.isBefore(endDate)) {
6768
- let row = getRow$2(rows, i++);
6731
+ const row = getRow$2(rows, i++);
6769
6732
  row.push(this.renderDay(startDate, startOfMonth, endOfMonth));
6770
6733
  startDate.add(1, "d");
6771
6734
  }
6772
6735
  return rows.map((r, i2) => /* @__PURE__ */ React.createElement("tr", { key: `${endDate.month()}_${i2}` }, r));
6773
6736
  }
6774
6737
  renderDay(date, startOfMonth, endOfMonth) {
6775
- let selectedDate = this.props.selectedDate;
6776
- let dayProps = {
6738
+ const selectedDate = this.props.selectedDate;
6739
+ const dayProps = {
6777
6740
  key: date.format("M_D"),
6778
6741
  "data-value": date.date(),
6779
6742
  "data-month": date.month(),
@@ -6827,7 +6790,7 @@ flowchart TD
6827
6790
  }
6828
6791
  function getDaysOfWeek(locale) {
6829
6792
  const first = locale.firstDayOfWeek();
6830
- let dow = [];
6793
+ const dow = [];
6831
6794
  let i = 0;
6832
6795
  locale._weekdaysMin.forEach(function(day) {
6833
6796
  dow[(7 + i++ - first) % 7] = day;
@@ -6845,7 +6808,7 @@ flowchart TD
6845
6808
  return /* @__PURE__ */ React.createElement("div", { className: "rdtMonths" }, /* @__PURE__ */ React.createElement("table", null, /* @__PURE__ */ React.createElement("thead", null, this.renderNavigation())), /* @__PURE__ */ React.createElement("table", null, /* @__PURE__ */ React.createElement("tbody", null, this.renderMonths())));
6846
6809
  }
6847
6810
  renderNavigation() {
6848
- let year = this.props.viewDate.year();
6811
+ const year = this.props.viewDate.year();
6849
6812
  return /* @__PURE__ */ React.createElement(
6850
6813
  ViewNavigation,
6851
6814
  {
@@ -6858,9 +6821,9 @@ flowchart TD
6858
6821
  );
6859
6822
  }
6860
6823
  renderMonths() {
6861
- let rows = [[], [], []];
6824
+ const rows = [[], [], []];
6862
6825
  for (let month = 0; month < 12; month++) {
6863
- let row = getRow$1(rows, month);
6826
+ const row = getRow$1(rows, month);
6864
6827
  row.push(this.renderMonth(month));
6865
6828
  }
6866
6829
  return rows.map((months, i) => /* @__PURE__ */ React.createElement("tr", { key: i }, months));
@@ -6877,7 +6840,7 @@ flowchart TD
6877
6840
  if (selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month) {
6878
6841
  className += " rdtActive";
6879
6842
  }
6880
- let props = { key: month, className, "data-value": month, onClick };
6843
+ const props = { key: month, className, "data-value": month, onClick };
6881
6844
  if (this.props.renderMonth) {
6882
6845
  return this.props.renderMonth(
6883
6846
  props,
@@ -6889,11 +6852,11 @@ flowchart TD
6889
6852
  return /* @__PURE__ */ React.createElement("td", { ...props }, this.getMonthText(month));
6890
6853
  }
6891
6854
  isDisabledMonth(month) {
6892
- let isValidDate = this.props.isValidDate;
6855
+ const isValidDate = this.props.isValidDate;
6893
6856
  if (!isValidDate) {
6894
6857
  return false;
6895
6858
  }
6896
- let date = this.props.viewDate.clone().set({ month });
6859
+ const date = this.props.viewDate.clone().set({ month });
6897
6860
  let day = date.endOf("month").date() + 1;
6898
6861
  while (day-- > 1) {
6899
6862
  if (isValidDate(date.date(day))) {
@@ -6945,9 +6908,9 @@ flowchart TD
6945
6908
  }
6946
6909
  renderYears() {
6947
6910
  const viewYear = this.getViewYear();
6948
- let rows = [[], [], []];
6911
+ const rows = [[], [], []];
6949
6912
  for (let year = viewYear - 1; year < viewYear + 11; year++) {
6950
- let row = getRow(rows, year - viewYear);
6913
+ const row = getRow(rows, year - viewYear);
6951
6914
  row.push(this.renderYear(year));
6952
6915
  }
6953
6916
  return rows.map((years, i) => /* @__PURE__ */ React.createElement("tr", { key: i }, years));
@@ -6964,7 +6927,7 @@ flowchart TD
6964
6927
  if (selectedYear === year) {
6965
6928
  className += " rdtActive";
6966
6929
  }
6967
- let props = { key: year, className, "data-value": year, onClick };
6930
+ const props = { key: year, className, "data-value": year, onClick };
6968
6931
  return this.props.renderYear(
6969
6932
  props,
6970
6933
  year,
@@ -6978,15 +6941,15 @@ flowchart TD
6978
6941
  return this.props.selectedDate && this.props.selectedDate.year();
6979
6942
  }
6980
6943
  isDisabledYear(year) {
6981
- let cache = this.disabledYearsCache;
6944
+ const cache = this.disabledYearsCache;
6982
6945
  if (cache[year] !== void 0) {
6983
6946
  return cache[year];
6984
6947
  }
6985
- let isValidDate = this.props.isValidDate;
6948
+ const isValidDate = this.props.isValidDate;
6986
6949
  if (!isValidDate) {
6987
6950
  return false;
6988
6951
  }
6989
- let date = this.props.viewDate.clone().set({ year });
6952
+ const date = this.props.viewDate.clone().set({ year });
6990
6953
  let day = date.endOf("year").dayOfYear() + 1;
6991
6954
  while (day-- > 1) {
6992
6955
  if (isValidDate(date.dayOfYear(day))) {
@@ -7033,7 +6996,7 @@ flowchart TD
7033
6996
  }
7034
6997
  };
7035
6998
  function createConstraints(overrideTimeConstraints) {
7036
- let constraints = {};
6999
+ const constraints = {};
7037
7000
  Object.keys(timeConstraints).forEach((type) => {
7038
7001
  constraints[type] = {
7039
7002
  ...timeConstraints[type],
@@ -7049,7 +7012,7 @@ flowchart TD
7049
7012
  this.state = this.getTimeParts(props.selectedDate || props.viewDate);
7050
7013
  }
7051
7014
  render() {
7052
- let items2 = [];
7015
+ const items2 = [];
7053
7016
  const timeParts = this.state;
7054
7017
  this.getCounters().forEach((c, i) => {
7055
7018
  if (i && c !== "ampm") {
@@ -7111,8 +7074,8 @@ flowchart TD
7111
7074
  }
7112
7075
  if (type === "ampm")
7113
7076
  return this.toggleDayPart();
7114
- let update = {};
7115
- let body = document.body;
7077
+ const update = {};
7078
+ const body = document.body;
7116
7079
  update[type] = this[action](type);
7117
7080
  this.setState(update);
7118
7081
  this.timer = setTimeout(() => {
@@ -7155,8 +7118,8 @@ flowchart TD
7155
7118
  return pad(type, value);
7156
7119
  }
7157
7120
  getCounters() {
7158
- let counters = [];
7159
- let format2 = this.props.timeFormat;
7121
+ const counters = [];
7122
+ const format2 = this.props.timeFormat;
7160
7123
  if (format2.toLowerCase().indexOf("h") !== -1) {
7161
7124
  counters.push("hours");
7162
7125
  if (format2.indexOf("m") !== -1) {
@@ -7288,7 +7251,7 @@ flowchart TD
7288
7251
  __publicField(this, "_renderCalendar", () => {
7289
7252
  const props = this.props;
7290
7253
  const state = this.state;
7291
- let viewProps = {
7254
+ const viewProps = {
7292
7255
  viewDate: state.viewDate.clone(),
7293
7256
  selectedDate: this.getSelectedDate(),
7294
7257
  isValidDate: props.isValidDate,
@@ -7331,10 +7294,10 @@ flowchart TD
7331
7294
  __publicField(this, "viewToMethod", { days: "date", months: "month", years: "year" });
7332
7295
  __publicField(this, "nextView", { days: "time", months: "days", years: "months" });
7333
7296
  __publicField(this, "_updateDate", (e) => {
7334
- let state = this.state;
7335
- let currentView = state.currentView;
7336
- let updateOnView = this.getUpdateOn(this.getFormat("date"));
7337
- let viewDate = this.state.viewDate.clone();
7297
+ const state = this.state;
7298
+ const currentView = state.currentView;
7299
+ const updateOnView = this.getUpdateOn(this.getFormat("date"));
7300
+ const viewDate = this.state.viewDate.clone();
7338
7301
  viewDate[this.viewToMethod[currentView]](
7339
7302
  parseInt(e.target.getAttribute("data-value"), 10)
7340
7303
  );
@@ -7342,7 +7305,7 @@ flowchart TD
7342
7305
  viewDate.month(parseInt(e.target.getAttribute("data-month"), 10));
7343
7306
  viewDate.year(parseInt(e.target.getAttribute("data-year"), 10));
7344
7307
  }
7345
- let update = { viewDate };
7308
+ const update = { viewDate };
7346
7309
  if (currentView === updateOnView) {
7347
7310
  update.selectedDate = viewDate.clone();
7348
7311
  update.inputValue = viewDate.format(this.getFormat("datetime"));
@@ -7356,7 +7319,7 @@ flowchart TD
7356
7319
  this.setState(update);
7357
7320
  });
7358
7321
  __publicField(this, "_viewNavigate", (modifier, unit) => {
7359
- let viewDate = this.state.viewDate.clone();
7322
+ const viewDate = this.state.viewDate.clone();
7360
7323
  viewDate.add(modifier, unit);
7361
7324
  if (modifier > 0) {
7362
7325
  this.props.onNavigateForward(modifier, unit);
@@ -7366,7 +7329,7 @@ flowchart TD
7366
7329
  this.setState({ viewDate });
7367
7330
  });
7368
7331
  __publicField(this, "_setTime", (type, value) => {
7369
- let date = (this.getSelectedDate() || this.state.viewDate).clone();
7332
+ const date = (this.getSelectedDate() || this.state.viewDate).clone();
7370
7333
  date[type](value);
7371
7334
  if (!this.props.value) {
7372
7335
  this.setState({
@@ -7390,7 +7353,7 @@ flowchart TD
7390
7353
  });
7391
7354
  });
7392
7355
  __publicField(this, "_handleClickOutside", () => {
7393
- let props = this.props;
7356
+ const props = this.props;
7394
7357
  if (props.input && this.state.open && props.open === void 0 && props.closeOnClickOutside) {
7395
7358
  this._closeCalendar();
7396
7359
  }
@@ -7405,7 +7368,7 @@ flowchart TD
7405
7368
  return;
7406
7369
  const value = e.target ? e.target.value : e;
7407
7370
  const localMoment = this.localMoment(value, this.getFormat("datetime"));
7408
- let update = { inputValue: value };
7371
+ const update = { inputValue: value };
7409
7372
  if (localMoment.isValid()) {
7410
7373
  update.selectedDate = localMoment;
7411
7374
  update.viewDate = localMoment.clone().startOf("month");
@@ -7469,9 +7432,9 @@ flowchart TD
7469
7432
  return this.props.renderView(this.state.currentView, this._renderCalendar);
7470
7433
  }
7471
7434
  getInitialState() {
7472
- let props = this.props;
7473
- let inputFormat = this.getFormat("datetime");
7474
- let selectedDate = this.parseDate(
7435
+ const props = this.props;
7436
+ const inputFormat = this.getFormat("datetime");
7437
+ const selectedDate = this.parseDate(
7475
7438
  props.value || props.initialValue,
7476
7439
  inputFormat
7477
7440
  );
@@ -7502,7 +7465,7 @@ flowchart TD
7502
7465
  return this.getInitialDate();
7503
7466
  }
7504
7467
  getInitialDate() {
7505
- let m = this.localMoment();
7468
+ const m = this.localMoment();
7506
7469
  m.hour(0).minute(0).second(0).millisecond(0);
7507
7470
  return m;
7508
7471
  }
@@ -7522,8 +7485,8 @@ flowchart TD
7522
7485
  }
7523
7486
  getClassName() {
7524
7487
  let cn2 = "rdt";
7525
- let props = this.props;
7526
- let propCn = props.className;
7488
+ const props = this.props;
7489
+ const propCn = props.className;
7527
7490
  if (Array.isArray(propCn)) {
7528
7491
  cn2 += " " + propCn.join(" ");
7529
7492
  } else if (propCn) {
@@ -7556,14 +7519,14 @@ flowchart TD
7556
7519
  return viewModes.DAYS;
7557
7520
  }
7558
7521
  getLocaleData() {
7559
- let p = this.props;
7522
+ const p = this.props;
7560
7523
  return this.localMoment(
7561
7524
  p.value || p.defaultValue || /* @__PURE__ */ new Date()
7562
7525
  ).localeData();
7563
7526
  }
7564
7527
  getDateFormat() {
7565
7528
  const locale = this.getLocaleData();
7566
- let format2 = this.props.dateFormat;
7529
+ const format2 = this.props.dateFormat;
7567
7530
  if (format2 === true)
7568
7531
  return locale.longDateFormat("L");
7569
7532
  if (format2)
@@ -7572,7 +7535,7 @@ flowchart TD
7572
7535
  }
7573
7536
  getTimeFormat() {
7574
7537
  const locale = this.getLocaleData();
7575
- let format2 = this.props.timeFormat;
7538
+ const format2 = this.props.timeFormat;
7576
7539
  if (format2 === true) {
7577
7540
  return locale.longDateFormat("LT");
7578
7541
  }
@@ -7584,12 +7547,12 @@ flowchart TD
7584
7547
  } else if (type === "time") {
7585
7548
  return this.getTimeFormat();
7586
7549
  }
7587
- let dateFormat = this.getDateFormat();
7588
- let timeFormat = this.getTimeFormat();
7550
+ const dateFormat = this.getDateFormat();
7551
+ const timeFormat = this.getTimeFormat();
7589
7552
  return dateFormat && timeFormat ? dateFormat + " " + timeFormat : dateFormat || timeFormat;
7590
7553
  }
7591
7554
  updateTime(op, amount, type, toSelected) {
7592
- let update = {};
7555
+ const update = {};
7593
7556
  const date = toSelected ? "selectedDate" : "viewDate";
7594
7557
  update[date] = this.state[date].clone()[op](amount, type);
7595
7558
  this.setState(update);
@@ -7622,7 +7585,7 @@ flowchart TD
7622
7585
  if (prevProps === this.props)
7623
7586
  return;
7624
7587
  let needsUpdate = false;
7625
- let thisProps = this.props;
7588
+ const thisProps = this.props;
7626
7589
  ["locale", "utc", "displayZone", "dateFormat", "timeFormat"].forEach(
7627
7590
  function(p) {
7628
7591
  prevProps[p] !== thisProps[p] && (needsUpdate = true);
@@ -7638,8 +7601,8 @@ flowchart TD
7638
7601
  }
7639
7602
  regenerateDates() {
7640
7603
  const props = this.props;
7641
- let viewDate = this.state.viewDate.clone();
7642
- let selectedDate = this.state.selectedDate && this.state.selectedDate.clone();
7604
+ const viewDate = this.state.viewDate.clone();
7605
+ const selectedDate = this.state.selectedDate && this.state.selectedDate.clone();
7643
7606
  if (props.locale) {
7644
7607
  viewDate.locale(props.locale);
7645
7608
  selectedDate && selectedDate.locale(props.locale);
@@ -7654,7 +7617,7 @@ flowchart TD
7654
7617
  viewDate.locale();
7655
7618
  selectedDate && selectedDate.locale();
7656
7619
  }
7657
- let update = { viewDate, selectedDate };
7620
+ const update = { viewDate, selectedDate };
7658
7621
  if (selectedDate && selectedDate.isValid()) {
7659
7622
  update.inputValue = selectedDate.format(this.getFormat("datetime"));
7660
7623
  }
@@ -7663,7 +7626,7 @@ flowchart TD
7663
7626
  getSelectedDate() {
7664
7627
  if (this.props.value === void 0)
7665
7628
  return this.state.selectedDate;
7666
- let selectedDate = this.parseDate(
7629
+ const selectedDate = this.parseDate(
7667
7630
  this.props.value,
7668
7631
  this.getFormat("datetime")
7669
7632
  );
@@ -7682,7 +7645,7 @@ flowchart TD
7682
7645
  return "";
7683
7646
  }
7684
7647
  getInputValue() {
7685
- let selectedDate = this.getSelectedDate();
7648
+ const selectedDate = this.getSelectedDate();
7686
7649
  return selectedDate ? selectedDate.format(this.getFormat("datetime")) : this.state.inputValue;
7687
7650
  }
7688
7651
  /**
@@ -7692,7 +7655,7 @@ flowchart TD
7692
7655
  * @public
7693
7656
  */
7694
7657
  setViewDate(date) {
7695
- let logError = function() {
7658
+ const logError = function() {
7696
7659
  return log("Invalid date passed to the `setViewDate` method: " + date);
7697
7660
  };
7698
7661
  if (!date)
@@ -7788,7 +7751,7 @@ flowchart TD
7788
7751
  // Make moment accessible through the Datetime class
7789
7752
  __publicField(Datetime, "moment", moment);
7790
7753
  function log(message, method) {
7791
- let con = typeof window !== "undefined" && window.console;
7754
+ const con = typeof window !== "undefined" && window.console;
7792
7755
  if (!con)
7793
7756
  return;
7794
7757
  if (!method) {
@@ -8041,9 +8004,6 @@ flowchart TD
8041
8004
  },
8042
8005
  parse: parse$2
8043
8006
  };
8044
- function GrCircleQuestion(props) {
8045
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
8046
- }
8047
8007
  function AiFillWarning(props) {
8048
8008
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
8049
8009
  }
@@ -8062,6 +8022,39 @@ flowchart TD
8062
8022
  function FaUnlock(props) {
8063
8023
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
8064
8024
  }
8025
+ function GrCircleQuestion(props) {
8026
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
8027
+ }
8028
+ const BranchContext = React__namespace.createContext({
8029
+ currentBranch: null,
8030
+ setCurrentBranch: (branch) => {
8031
+ console.warn("BranchContext not initialized");
8032
+ }
8033
+ });
8034
+ const BranchDataProvider = ({
8035
+ currentBranch,
8036
+ setCurrentBranch,
8037
+ children
8038
+ }) => {
8039
+ return /* @__PURE__ */ React__namespace.createElement(
8040
+ BranchContext.Provider,
8041
+ {
8042
+ value: {
8043
+ currentBranch,
8044
+ setCurrentBranch
8045
+ }
8046
+ },
8047
+ children
8048
+ );
8049
+ };
8050
+ const useBranchData = () => {
8051
+ const branchData = React__namespace.useContext(BranchContext);
8052
+ const { dispatch } = useEvent("branch:change");
8053
+ React__namespace.useEffect(() => {
8054
+ dispatch({ branchName: branchData.currentBranch });
8055
+ }, [branchData.currentBranch]);
8056
+ return branchData;
8057
+ };
8065
8058
  function formatBranchName$1(str) {
8066
8059
  const pattern = /[^/\w-]+/g;
8067
8060
  const formattedStr = str.replace(pattern, "");
@@ -8160,7 +8153,7 @@ flowchart TD
8160
8153
  className: "transition-all duration-150 ease-out text-blue-600 hover:text-blue-400 hover:underline no-underline",
8161
8154
  href: "https://tina.io/docs/tina-cloud/"
8162
8155
  },
8163
- "Learn more about moving to production with Tina Cloud."
8156
+ "Learn more about moving to production with TinaCloud."
8164
8157
  )), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
8165
8158
  Button$1,
8166
8159
  {
@@ -8396,7 +8389,7 @@ flowchart TD
8396
8389
  className: "transition-all duration-150 ease-out text-blue-600 hover:text-blue-400 hover:underline no-underline",
8397
8390
  href: "https://tina.io/docs/tina-cloud/"
8398
8391
  },
8399
- "Learn more about moving to production with Tina Cloud."
8392
+ "Learn more about moving to production with TinaCloud."
8400
8393
  )), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
8401
8394
  Button$1,
8402
8395
  {
@@ -8611,7 +8604,10 @@ flowchart TD
8611
8604
  label: "View in GitHub",
8612
8605
  Icon: /* @__PURE__ */ React__namespace.createElement(BiLinkExternal, { className: "w-5 h-auto text-blue-500 opacity-70" }),
8613
8606
  onMouseDown: () => {
8614
- window.open(branch.githubPullRequestUrl, "_blank");
8607
+ window.open(
8608
+ branch.githubPullRequestUrl,
8609
+ "_blank"
8610
+ );
8615
8611
  }
8616
8612
  },
8617
8613
  typeof previewFunction === "function" && ((_b2 = previewFunction({ branch: branch.name })) == null ? void 0 : _b2.url) && {
@@ -8917,7 +8913,9 @@ flowchart TD
8917
8913
  } else {
8918
8914
  events = event;
8919
8915
  }
8920
- const newListeners = events.map((event2) => new Listener(event2, callback));
8916
+ const newListeners = events.map(
8917
+ (event2) => new Listener(event2, callback)
8918
+ );
8921
8919
  newListeners.forEach((newListener) => this.listeners.add(newListener));
8922
8920
  return () => {
8923
8921
  newListeners.forEach((listener) => this.listeners.delete(listener));
@@ -9273,9 +9271,7 @@ flowchart TD
9273
9271
  const deleteStartTime = Date.now();
9274
9272
  while (true) {
9275
9273
  await new Promise((resolve) => setTimeout(resolve, 1e3));
9276
- const { error, message } = await this.api.getRequestStatus(
9277
- requestId
9278
- );
9274
+ const { error, message } = await this.api.getRequestStatus(requestId);
9279
9275
  if (error !== void 0) {
9280
9276
  if (error) {
9281
9277
  throw new Error(message);
@@ -9300,6 +9296,17 @@ flowchart TD
9300
9296
  }
9301
9297
  }
9302
9298
  }
9299
+ const encodeUrlIfNeeded = (url) => {
9300
+ if (url) {
9301
+ try {
9302
+ return new URL(url).toString();
9303
+ } catch (e) {
9304
+ return url;
9305
+ }
9306
+ } else {
9307
+ return url;
9308
+ }
9309
+ };
9303
9310
  let MediaManager$1 = class MediaManager {
9304
9311
  constructor(store, events) {
9305
9312
  this.store = store;
@@ -9372,6 +9379,20 @@ flowchart TD
9372
9379
  try {
9373
9380
  this.events.dispatch({ type: "media:list:start", ...options });
9374
9381
  const media = await this.store.list(options);
9382
+ media.items = media.items.map((item) => {
9383
+ if (item.type === "dir") {
9384
+ return item;
9385
+ }
9386
+ if (item.thumbnails) {
9387
+ for (const [size, src] of Object.entries(item.thumbnails)) {
9388
+ item.thumbnails[size] = encodeUrlIfNeeded(src);
9389
+ }
9390
+ }
9391
+ return {
9392
+ ...item,
9393
+ src: encodeUrlIfNeeded(item.src)
9394
+ };
9395
+ });
9375
9396
  this.events.dispatch({ type: "media:list:success", ...options, media });
9376
9397
  return media;
9377
9398
  } catch (error) {
@@ -9400,7 +9421,7 @@ flowchart TD
9400
9421
  });
9401
9422
  new MediaListError({
9402
9423
  title: "An Error Occurred",
9403
- message: "Something went wrong accessing your media from Tina Cloud.",
9424
+ message: "Something went wrong accessing your media from TinaCloud.",
9404
9425
  docsLink: ""
9405
9426
  // TODO
9406
9427
  });
@@ -9585,7 +9606,7 @@ flowchart TD
9585
9606
  return this.add("error", message, timeout);
9586
9607
  }
9587
9608
  };
9588
- const NoFormsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
9609
+ const SidebarLoadingPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
9589
9610
  "div",
9590
9611
  {
9591
9612
  className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
@@ -9598,25 +9619,8 @@ flowchart TD
9598
9619
  animationDuration: "150ms"
9599
9620
  }
9600
9621
  },
9601
- /* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "pb-5" }, "🔎"),
9602
- /* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, "Looks like there's ", /* @__PURE__ */ React__namespace.createElement("br", null), "nothing to edit on ", /* @__PURE__ */ React__namespace.createElement("br", null), "this page."),
9603
- /* @__PURE__ */ React__namespace.createElement("p", { className: "block" }, /* @__PURE__ */ React__namespace.createElement(
9604
- Button$1,
9605
- {
9606
- href: "https://tina.io/docs/tinacms-context/",
9607
- target: "_blank",
9608
- as: "a"
9609
- },
9610
- /* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "mr-1.5" }, "📖"),
9611
- " Contextual Editing"
9612
- ))
9613
- );
9614
- const Emoji$1 = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
9615
- "span",
9616
- {
9617
- className: `text-[24px] leading-none inline-block ${className}`,
9618
- ...props
9619
- }
9622
+ /* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, "Please wait while TinaCMS", /* @__PURE__ */ React__namespace.createElement("br", null), "loads your content"),
9623
+ /* @__PURE__ */ React__namespace.createElement(LoadingDots, { color: "var(--tina-color-primary)" })
9620
9624
  );
9621
9625
  class SidebarState {
9622
9626
  constructor(events, options = {}) {
@@ -9631,7 +9635,7 @@ flowchart TD
9631
9635
  };
9632
9636
  this.position = options.position || "displace";
9633
9637
  this.renderNav = options.renderNav || true;
9634
- this.placeholder = options.placeholder || NoFormsPlaceholder;
9638
+ this.loadingPlaceholder = options.placeholder || SidebarLoadingPlaceholder;
9635
9639
  if ((_a = options.buttons) == null ? void 0 : _a.save) {
9636
9640
  this.buttons.save = options.buttons.save;
9637
9641
  }
@@ -9705,238 +9709,6 @@ flowchart TD
9705
9709
  children
9706
9710
  )));
9707
9711
  };
9708
- const Item = ({
9709
- item,
9710
- depth,
9711
- setActiveFormId
9712
- }) => {
9713
- const cms = useCMS();
9714
- const depths = ["pl-6", "pl-10", "pl-14"];
9715
- const form = React__namespace.useMemo(
9716
- () => cms.state.forms.find(({ tinaForm }) => item.formId === tinaForm.id),
9717
- [item.formId]
9718
- );
9719
- return /* @__PURE__ */ React__namespace.createElement(
9720
- "button",
9721
- {
9722
- type: "button",
9723
- key: item.path,
9724
- onClick: () => setActiveFormId(item.formId),
9725
- className: `${depths[depth] || "pl-12"} pr-6 py-3 w-full h-full bg-transparent border-none text-lg text-gray-700 group hover:bg-gray-50 transition-all ease-out duration-150 flex items-center justify-between gap-2`
9726
- },
9727
- /* @__PURE__ */ React__namespace.createElement(BiEdit, { className: "opacity-70 w-5 h-auto text-blue-500 flex-none" }),
9728
- /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 flex flex-col gap-0.5 items-start" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 font-sans text-xs font-semibold text-gray-700 whitespace-normal" }, form.tinaForm.label), /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 text-base truncate leading-tight text-gray-600" }, form.tinaForm.id))
9729
- );
9730
- };
9731
- const FormListItem = ({
9732
- item,
9733
- depth,
9734
- setActiveFormId
9735
- }) => {
9736
- var _a;
9737
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "divide-y divide-gray-200" }, /* @__PURE__ */ React__namespace.createElement(Item, { setActiveFormId, item, depth }), item.subItems && /* @__PURE__ */ React__namespace.createElement("ul", { className: "divide-y divide-gray-200" }, (_a = item.subItems) == null ? void 0 : _a.map((subItem) => {
9738
- if (subItem.type === "document") {
9739
- return /* @__PURE__ */ React__namespace.createElement("li", { key: subItem.formId }, /* @__PURE__ */ React__namespace.createElement(
9740
- Item,
9741
- {
9742
- setActiveFormId,
9743
- depth: depth + 1,
9744
- item: subItem
9745
- }
9746
- ));
9747
- }
9748
- })));
9749
- };
9750
- const FormLists = (props) => {
9751
- const cms = useCMS();
9752
- return /* @__PURE__ */ React__namespace.createElement(
9753
- react.Transition,
9754
- {
9755
- appear: true,
9756
- show: true,
9757
- as: "div",
9758
- enter: "transition-all ease-out duration-150",
9759
- enterFrom: "opacity-0 -translate-x-1/2",
9760
- enterTo: "opacity-100",
9761
- leave: "transition-all ease-out duration-150",
9762
- leaveFrom: "opacity-100",
9763
- leaveTo: "opacity-0 -translate-x-1/2"
9764
- },
9765
- cms.state.formLists.map((formList, index) => /* @__PURE__ */ React__namespace.createElement("div", { key: `${formList.id}-${index}`, className: "pt-16" }, /* @__PURE__ */ React__namespace.createElement(
9766
- FormList,
9767
- {
9768
- isEditing: props.isEditing,
9769
- setActiveFormId: (id) => {
9770
- cms.dispatch({ type: "forms:set-active-form-id", value: id });
9771
- },
9772
- formList
9773
- }
9774
- )))
9775
- );
9776
- };
9777
- const FormList = (props) => {
9778
- const cms = useCMS();
9779
- const listItems = React__namespace.useMemo(() => {
9780
- var _a;
9781
- const orderedListItems = [];
9782
- const globalItems = [];
9783
- const topItems = [];
9784
- props.formList.items.forEach((item) => {
9785
- if (item.type === "document") {
9786
- const form = cms.state.forms.find(
9787
- ({ tinaForm }) => tinaForm.id === item.formId
9788
- );
9789
- if (form.tinaForm.global) {
9790
- globalItems.push(item);
9791
- } else {
9792
- orderedListItems.push(item);
9793
- }
9794
- } else {
9795
- orderedListItems.push(item);
9796
- }
9797
- });
9798
- if (((_a = orderedListItems[0]) == null ? void 0 : _a.type) === "document") {
9799
- topItems.push({ type: "list", label: "Documents" });
9800
- }
9801
- let extra = [];
9802
- if (globalItems.length) {
9803
- extra = [{ type: "list", label: "Global Documents" }, ...globalItems];
9804
- }
9805
- return [...topItems, ...orderedListItems, ...extra];
9806
- }, [JSON.stringify(props.formList.items)]);
9807
- return /* @__PURE__ */ React__namespace.createElement("ul", null, /* @__PURE__ */ React__namespace.createElement("li", { className: "divide-y divide-gray-200" }, listItems.map((item, index) => {
9808
- if (item.type === "list") {
9809
- return /* @__PURE__ */ React__namespace.createElement(
9810
- "div",
9811
- {
9812
- key: item.label,
9813
- className: `relative group text-left w-full bg-white shadow-sm
9814
- border-gray-100 px-6 -mt-px pb-3 ${index > 0 ? "pt-6 bg-gradient-to-b from-gray-50 via-white to-white" : "pt-3"}`
9815
- },
9816
- /* @__PURE__ */ React__namespace.createElement(
9817
- "span",
9818
- {
9819
- className: "text-sm tracking-wide font-bold text-gray-700 uppercase"
9820
- },
9821
- item.label
9822
- )
9823
- );
9824
- }
9825
- return /* @__PURE__ */ React__namespace.createElement(
9826
- FormListItem,
9827
- {
9828
- setActiveFormId: (id) => props.setActiveFormId(id),
9829
- key: item.formId,
9830
- item,
9831
- depth: 0
9832
- }
9833
- );
9834
- })));
9835
- };
9836
- const FormsView = ({
9837
- children
9838
- }) => {
9839
- const cms = useCMS$1();
9840
- const { setFormIsPristine } = React__namespace.useContext(SidebarContext);
9841
- const isMultiform = cms.state.forms.length > 1;
9842
- const activeForm = cms.state.forms.find(
9843
- ({ tinaForm }) => tinaForm.id === cms.state.activeFormId
9844
- );
9845
- const isEditing = !!activeForm;
9846
- if (!cms.state.formLists.length) {
9847
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " ", children, " ");
9848
- }
9849
- if (isMultiform && !activeForm) {
9850
- return /* @__PURE__ */ React__namespace.createElement(FormLists, { isEditing });
9851
- }
9852
- const formMetas = cms.plugins.all("form:meta");
9853
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, activeForm && /* @__PURE__ */ React__namespace.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React__namespace.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React__namespace.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: meta.name }, /* @__PURE__ */ React__namespace.createElement(meta.Component, null))), /* @__PURE__ */ React__namespace.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
9854
- };
9855
- const FormWrapper$1 = ({ isEditing, children }) => {
9856
- return /* @__PURE__ */ React__namespace.createElement(
9857
- "div",
9858
- {
9859
- className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white",
9860
- style: isEditing ? {
9861
- transform: "none",
9862
- animationName: "fly-in-left",
9863
- animationDuration: "150ms",
9864
- animationDelay: "0",
9865
- animationIterationCount: 1,
9866
- animationTimingFunction: "ease-out"
9867
- } : {
9868
- transform: "translate3d(100%, 0, 0)"
9869
- }
9870
- },
9871
- children
9872
- );
9873
- };
9874
- const MultiformFormHeader = ({
9875
- activeForm
9876
- }) => {
9877
- const cms = useCMS$1();
9878
- const { formIsPristine } = React__namespace.useContext(SidebarContext);
9879
- return /* @__PURE__ */ React__namespace.createElement(
9880
- "div",
9881
- {
9882
- className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
9883
- },
9884
- /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
9885
- "button",
9886
- {
9887
- type: "button",
9888
- className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
9889
- onClick: () => {
9890
- const state = activeForm.tinaForm.finalForm.getState();
9891
- if (state.invalid === true) {
9892
- cms.alerts.error("Cannot navigate away from an invalid form.");
9893
- } else {
9894
- cms.dispatch({ type: "forms:set-active-form-id", value: null });
9895
- }
9896
- }
9897
- },
9898
- /* @__PURE__ */ React__namespace.createElement(BiDotsVertical, { className: "h-auto w-5 inline-block opacity-70" })
9899
- ), /* @__PURE__ */ React__namespace.createElement(
9900
- "button",
9901
- {
9902
- type: "button",
9903
- className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
9904
- onClick: () => {
9905
- const collectionName = cms.api.tina.schema.getCollectionByFullPath(
9906
- cms.state.activeFormId
9907
- ).name;
9908
- window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
9909
- }
9910
- },
9911
- /* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
9912
- ), /* @__PURE__ */ React__namespace.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, activeForm.tinaForm.label || activeForm.tinaForm.id), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
9913
- );
9914
- };
9915
- const FormHeader = ({ activeForm }) => {
9916
- const { formIsPristine } = React__namespace.useContext(SidebarContext);
9917
- const cms = useCMS$1();
9918
- const shortFormLabel = activeForm.tinaForm.label ? activeForm.tinaForm.label.replace(/^.*[\\\/]/, "") : false;
9919
- return /* @__PURE__ */ React__namespace.createElement(
9920
- "div",
9921
- {
9922
- className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
9923
- },
9924
- /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
9925
- "button",
9926
- {
9927
- type: "button",
9928
- className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
9929
- onClick: () => {
9930
- const collectionName = cms.api.tina.schema.getCollectionByFullPath(
9931
- cms.state.activeFormId
9932
- ).name;
9933
- window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
9934
- }
9935
- },
9936
- /* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
9937
- ), shortFormLabel && /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
9938
- );
9939
- };
9940
9712
  function ImFilesEmpty(props) {
9941
9713
  return GenIcon({ "tag": "svg", "attr": { "version": "1.1", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M14.341 5.579c-0.347-0.473-0.831-1.027-1.362-1.558s-1.085-1.015-1.558-1.362c-0.806-0.591-1.197-0.659-1.421-0.659h-5.75c-0.689 0-1.25 0.561-1.25 1.25v11.5c0 0.689 0.561 1.25 1.25 1.25h9.5c0.689 0 1.25-0.561 1.25-1.25v-7.75c0-0.224-0.068-0.615-0.659-1.421zM12.271 4.729c0.48 0.48 0.856 0.912 1.134 1.271h-2.406v-2.405c0.359 0.278 0.792 0.654 1.271 1.134v0zM14 14.75c0 0.136-0.114 0.25-0.25 0.25h-9.5c-0.136 0-0.25-0.114-0.25-0.25v-11.5c0-0.135 0.114-0.25 0.25-0.25 0 0 5.749-0 5.75 0v3.5c0 0.276 0.224 0.5 0.5 0.5h3.5v7.75z" }, "child": [] }, { "tag": "path", "attr": { "d": "M9.421 0.659c-0.806-0.591-1.197-0.659-1.421-0.659h-5.75c-0.689 0-1.25 0.561-1.25 1.25v11.5c0 0.604 0.43 1.109 1 1.225v-12.725c0-0.135 0.115-0.25 0.25-0.25h7.607c-0.151-0.124-0.297-0.238-0.437-0.341z" }, "child": [] }] })(props);
9942
9714
  }
@@ -10179,7 +9951,7 @@ flowchart TD
10179
9951
  "Event Log"
10180
9952
  ));
10181
9953
  };
10182
- const version = "2.5.2";
9954
+ const version = "2.7.5";
10183
9955
  const Nav = ({
10184
9956
  isLocalMode,
10185
9957
  className = "",
@@ -10421,6 +10193,293 @@ flowchart TD
10421
10193
  /* @__PURE__ */ React__namespace.createElement("span", { className: "absolute top-1/2 left-1/2 h-4/6 w-px bg-gray-200 transform -translate-y-1/2 -translate-x-1/2 opacity-30 transition-opacity duration-150 ease-out group-hover:opacity-100" })
10422
10194
  );
10423
10195
  };
10196
+ const Item = ({
10197
+ item,
10198
+ depth,
10199
+ setActiveFormId
10200
+ }) => {
10201
+ const cms = useCMS();
10202
+ const depths = ["pl-6", "pl-10", "pl-14"];
10203
+ const form = React__namespace.useMemo(
10204
+ () => cms.state.forms.find(({ tinaForm }) => item.formId === tinaForm.id),
10205
+ [item.formId]
10206
+ );
10207
+ return /* @__PURE__ */ React__namespace.createElement(
10208
+ "button",
10209
+ {
10210
+ type: "button",
10211
+ key: item.path,
10212
+ onClick: () => setActiveFormId(item.formId),
10213
+ className: `${depths[depth] || "pl-12"} pr-6 py-3 w-full h-full bg-transparent border-none text-lg text-gray-700 group hover:bg-gray-50 transition-all ease-out duration-150 flex items-center justify-between gap-2`
10214
+ },
10215
+ /* @__PURE__ */ React__namespace.createElement(BiEdit, { className: "opacity-70 w-5 h-auto text-blue-500 flex-none" }),
10216
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 flex flex-col gap-0.5 items-start" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 font-sans text-xs font-semibold text-gray-700 whitespace-normal" }, form.tinaForm.label), /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 text-base truncate leading-tight text-gray-600" }, form.tinaForm.id))
10217
+ );
10218
+ };
10219
+ const FormListItem = ({
10220
+ item,
10221
+ depth,
10222
+ setActiveFormId
10223
+ }) => {
10224
+ var _a;
10225
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "divide-y divide-gray-200" }, /* @__PURE__ */ React__namespace.createElement(Item, { setActiveFormId, item, depth }), item.subItems && /* @__PURE__ */ React__namespace.createElement("ul", { className: "divide-y divide-gray-200" }, (_a = item.subItems) == null ? void 0 : _a.map((subItem) => {
10226
+ if (subItem.type === "document") {
10227
+ return /* @__PURE__ */ React__namespace.createElement("li", { key: subItem.formId }, /* @__PURE__ */ React__namespace.createElement(
10228
+ Item,
10229
+ {
10230
+ setActiveFormId,
10231
+ depth: depth + 1,
10232
+ item: subItem
10233
+ }
10234
+ ));
10235
+ }
10236
+ })));
10237
+ };
10238
+ const FormLists = (props) => {
10239
+ const cms = useCMS();
10240
+ return /* @__PURE__ */ React__namespace.createElement(
10241
+ react.Transition,
10242
+ {
10243
+ appear: true,
10244
+ show: true,
10245
+ as: "div",
10246
+ enter: "transition-all ease-out duration-150",
10247
+ enterFrom: "opacity-0 -translate-x-1/2",
10248
+ enterTo: "opacity-100",
10249
+ leave: "transition-all ease-out duration-150",
10250
+ leaveFrom: "opacity-100",
10251
+ leaveTo: "opacity-0 -translate-x-1/2"
10252
+ },
10253
+ cms.state.formLists.map((formList, index) => /* @__PURE__ */ React__namespace.createElement("div", { key: `${formList.id}-${index}`, className: "pt-16" }, /* @__PURE__ */ React__namespace.createElement(
10254
+ FormList,
10255
+ {
10256
+ isEditing: props.isEditing,
10257
+ setActiveFormId: (id) => {
10258
+ cms.dispatch({ type: "forms:set-active-form-id", value: id });
10259
+ },
10260
+ formList
10261
+ }
10262
+ )))
10263
+ );
10264
+ };
10265
+ const FormList = (props) => {
10266
+ const cms = useCMS();
10267
+ const listItems = React__namespace.useMemo(() => {
10268
+ var _a;
10269
+ const orderedListItems = [];
10270
+ const globalItems = [];
10271
+ const topItems = [];
10272
+ props.formList.items.forEach((item) => {
10273
+ if (item.type === "document") {
10274
+ const form = cms.state.forms.find(
10275
+ ({ tinaForm }) => tinaForm.id === item.formId
10276
+ );
10277
+ if (form.tinaForm.global) {
10278
+ globalItems.push(item);
10279
+ } else {
10280
+ orderedListItems.push(item);
10281
+ }
10282
+ } else {
10283
+ orderedListItems.push(item);
10284
+ }
10285
+ });
10286
+ if (((_a = orderedListItems[0]) == null ? void 0 : _a.type) === "document") {
10287
+ topItems.push({ type: "list", label: "Documents" });
10288
+ }
10289
+ let extra = [];
10290
+ if (globalItems.length) {
10291
+ extra = [{ type: "list", label: "Global Documents" }, ...globalItems];
10292
+ }
10293
+ return [...topItems, ...orderedListItems, ...extra];
10294
+ }, [JSON.stringify(props.formList.items)]);
10295
+ return /* @__PURE__ */ React__namespace.createElement("ul", null, /* @__PURE__ */ React__namespace.createElement("li", { className: "divide-y divide-gray-200" }, listItems.map((item, index) => {
10296
+ if (item.type === "list") {
10297
+ return /* @__PURE__ */ React__namespace.createElement(
10298
+ "div",
10299
+ {
10300
+ key: item.label,
10301
+ className: `relative group text-left w-full bg-white shadow-sm
10302
+ border-gray-100 px-6 -mt-px pb-3 ${index > 0 ? "pt-6 bg-gradient-to-b from-gray-50 via-white to-white" : "pt-3"}`
10303
+ },
10304
+ /* @__PURE__ */ React__namespace.createElement(
10305
+ "span",
10306
+ {
10307
+ className: "text-sm tracking-wide font-bold text-gray-700 uppercase"
10308
+ },
10309
+ item.label
10310
+ )
10311
+ );
10312
+ }
10313
+ return /* @__PURE__ */ React__namespace.createElement(
10314
+ FormListItem,
10315
+ {
10316
+ setActiveFormId: (id) => props.setActiveFormId(id),
10317
+ key: item.formId,
10318
+ item,
10319
+ depth: 0
10320
+ }
10321
+ );
10322
+ })));
10323
+ };
10324
+ const SidebarNoFormsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
10325
+ "div",
10326
+ {
10327
+ className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
10328
+ style: {
10329
+ animationName: "fade-in",
10330
+ animationDelay: "300ms",
10331
+ animationTimingFunction: "ease-out",
10332
+ animationIterationCount: 1,
10333
+ animationFillMode: "both",
10334
+ animationDuration: "150ms"
10335
+ }
10336
+ },
10337
+ /* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, "Looks like there's ", /* @__PURE__ */ React__namespace.createElement("br", null), "nothing to edit on ", /* @__PURE__ */ React__namespace.createElement("br", null), "this page."),
10338
+ /* @__PURE__ */ React__namespace.createElement("p", { className: "block pt-5" }, /* @__PURE__ */ React__namespace.createElement(
10339
+ Button$1,
10340
+ {
10341
+ href: "https://tina.io/docs/contextual-editing/overview",
10342
+ target: "_blank",
10343
+ as: "a"
10344
+ },
10345
+ /* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "mr-1.5" }, "📖"),
10346
+ " Contextual Editing Docs"
10347
+ ))
10348
+ );
10349
+ const Emoji$1 = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
10350
+ "span",
10351
+ {
10352
+ className: `text-[24px] leading-none inline-block ${className}`,
10353
+ ...props
10354
+ }
10355
+ );
10356
+ const minimumTimeToShowLoadingIndicator = 1e3;
10357
+ const FormsView = ({ loadingPlaceholder } = {}) => {
10358
+ const cms = useCMS$1();
10359
+ const { setFormIsPristine } = React__namespace.useContext(SidebarContext);
10360
+ const [isShowingLoading, setIsShowingLoading] = React__namespace.useState(true);
10361
+ const [initialLoadComplete, setInitialLoadComplete] = React__namespace.useState(false);
10362
+ React__namespace.useEffect(() => {
10363
+ if (cms.state.isLoadingContent) {
10364
+ setIsShowingLoading(true);
10365
+ const timer = setTimeout(() => {
10366
+ if (!cms.state.isLoadingContent) {
10367
+ setIsShowingLoading(false);
10368
+ setInitialLoadComplete(true);
10369
+ }
10370
+ }, minimumTimeToShowLoadingIndicator);
10371
+ return () => clearTimeout(timer);
10372
+ } else {
10373
+ const timer = setTimeout(() => {
10374
+ setIsShowingLoading(false);
10375
+ setInitialLoadComplete(true);
10376
+ }, minimumTimeToShowLoadingIndicator);
10377
+ return () => clearTimeout(timer);
10378
+ }
10379
+ }, [cms.state.isLoadingContent]);
10380
+ if (isShowingLoading || !initialLoadComplete) {
10381
+ const LoadingPlaceholder = loadingPlaceholder || SidebarLoadingPlaceholder;
10382
+ return /* @__PURE__ */ React__namespace.createElement(LoadingPlaceholder, null);
10383
+ }
10384
+ if (!cms.state.formLists.length) {
10385
+ return /* @__PURE__ */ React__namespace.createElement(SidebarNoFormsPlaceholder, null);
10386
+ }
10387
+ const isMultiform = cms.state.forms.length > 1;
10388
+ const activeForm = cms.state.forms.find(
10389
+ ({ tinaForm }) => tinaForm.id === cms.state.activeFormId
10390
+ );
10391
+ const isEditing = !!activeForm;
10392
+ if (isMultiform && !activeForm) {
10393
+ return /* @__PURE__ */ React__namespace.createElement(FormLists, { isEditing });
10394
+ }
10395
+ const formMetas = cms.plugins.all("form:meta");
10396
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, activeForm && /* @__PURE__ */ React__namespace.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React__namespace.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React__namespace.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: meta.name }, /* @__PURE__ */ React__namespace.createElement(meta.Component, null))), /* @__PURE__ */ React__namespace.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
10397
+ };
10398
+ const FormWrapper$1 = ({ isEditing, children }) => {
10399
+ return /* @__PURE__ */ React__namespace.createElement(
10400
+ "div",
10401
+ {
10402
+ className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white",
10403
+ style: isEditing ? {
10404
+ transform: "none",
10405
+ animationName: "fly-in-left",
10406
+ animationDuration: "150ms",
10407
+ animationDelay: "0",
10408
+ animationIterationCount: 1,
10409
+ animationTimingFunction: "ease-out"
10410
+ } : {
10411
+ transform: "translate3d(100%, 0, 0)"
10412
+ }
10413
+ },
10414
+ children
10415
+ );
10416
+ };
10417
+ const MultiformFormHeader = ({
10418
+ activeForm
10419
+ }) => {
10420
+ const cms = useCMS$1();
10421
+ const { formIsPristine } = React__namespace.useContext(SidebarContext);
10422
+ return /* @__PURE__ */ React__namespace.createElement(
10423
+ "div",
10424
+ {
10425
+ className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
10426
+ },
10427
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
10428
+ "button",
10429
+ {
10430
+ type: "button",
10431
+ className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
10432
+ onClick: () => {
10433
+ const state = activeForm.tinaForm.finalForm.getState();
10434
+ if (state.invalid === true) {
10435
+ cms.alerts.error("Cannot navigate away from an invalid form.");
10436
+ } else {
10437
+ cms.dispatch({ type: "forms:set-active-form-id", value: null });
10438
+ }
10439
+ }
10440
+ },
10441
+ /* @__PURE__ */ React__namespace.createElement(BiDotsVertical, { className: "h-auto w-5 inline-block opacity-70" })
10442
+ ), /* @__PURE__ */ React__namespace.createElement(
10443
+ "button",
10444
+ {
10445
+ type: "button",
10446
+ className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
10447
+ onClick: () => {
10448
+ const collectionName = cms.api.tina.schema.getCollectionByFullPath(
10449
+ cms.state.activeFormId
10450
+ ).name;
10451
+ window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
10452
+ }
10453
+ },
10454
+ /* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
10455
+ ), /* @__PURE__ */ React__namespace.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, activeForm.tinaForm.label || activeForm.tinaForm.id), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
10456
+ );
10457
+ };
10458
+ const FormHeader = ({ activeForm }) => {
10459
+ const { formIsPristine } = React__namespace.useContext(SidebarContext);
10460
+ const cms = useCMS$1();
10461
+ const shortFormLabel = activeForm.tinaForm.label ? activeForm.tinaForm.label.replace(/^.*[\\\/]/, "") : false;
10462
+ return /* @__PURE__ */ React__namespace.createElement(
10463
+ "div",
10464
+ {
10465
+ className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
10466
+ },
10467
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
10468
+ "button",
10469
+ {
10470
+ type: "button",
10471
+ className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
10472
+ onClick: () => {
10473
+ const collectionName = cms.api.tina.schema.getCollectionByFullPath(
10474
+ cms.state.activeFormId
10475
+ ).name;
10476
+ window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
10477
+ }
10478
+ },
10479
+ /* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
10480
+ ), shortFormLabel && /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
10481
+ );
10482
+ };
10424
10483
  const SidebarContext = React__namespace.createContext(null);
10425
10484
  const minPreviewWidth = 440;
10426
10485
  const minSidebarWidth = 360;
@@ -10639,7 +10698,7 @@ flowchart TD
10639
10698
  isLocalMode: (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isLocalMode,
10640
10699
  branchingEnabled
10641
10700
  }
10642
- ), /* @__PURE__ */ React__namespace.createElement(FormsView, null, /* @__PURE__ */ React__namespace.createElement(sidebar.placeholder, null)), activeScreen && /* @__PURE__ */ React__namespace.createElement(
10701
+ ), /* @__PURE__ */ React__namespace.createElement(FormsView, { loadingPlaceholder: sidebar.loadingPlaceholder }), activeScreen && /* @__PURE__ */ React__namespace.createElement(
10643
10702
  ScreenPluginModal,
10644
10703
  {
10645
10704
  screen: activeScreen,
@@ -10815,7 +10874,7 @@ flowchart TD
10815
10874
  className: "h-5 w-auto -mx-1 text-blue-500",
10816
10875
  stroke: "currentColor",
10817
10876
  fill: "currentColor",
10818
- "stroke-width": "0",
10877
+ strokeWidth: "0",
10819
10878
  viewBox: "0 0 24 24",
10820
10879
  xmlns: "http://www.w3.org/2000/svg"
10821
10880
  },
@@ -10955,6 +11014,93 @@ flowchart TD
10955
11014
  );
10956
11015
  };
10957
11016
  }
11017
+ function dirname(path) {
11018
+ var _a, _b;
11019
+ const pattern = new RegExp("(?<prevDir>.*)/");
11020
+ return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
11021
+ }
11022
+ const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
11023
+ "button",
11024
+ {
11025
+ className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
11026
+ ...props
11027
+ }
11028
+ );
11029
+ function Breadcrumb$1({ directory = "", setDirectory }) {
11030
+ directory = directory.replace(/^\/|\/$/g, "");
11031
+ let prevDir = dirname(directory) || "";
11032
+ if (prevDir === ".") {
11033
+ prevDir = "";
11034
+ }
11035
+ return /* @__PURE__ */ React.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React.createElement(
11036
+ IconButton,
11037
+ {
11038
+ variant: "ghost",
11039
+ className: "mr-2",
11040
+ onClick: () => setDirectory(prevDir)
11041
+ },
11042
+ /* @__PURE__ */ React.createElement(
11043
+ LeftArrowIcon,
11044
+ {
11045
+ className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
11046
+ }
11047
+ )
11048
+ ), /* @__PURE__ */ React.createElement(
11049
+ BreadcrumbButton,
11050
+ {
11051
+ onClick: () => setDirectory(""),
11052
+ className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
11053
+ },
11054
+ "Media"
11055
+ ), directory && directory.split("/").map((part, index, parts) => {
11056
+ const currentDir = parts.slice(0, index + 1).join("/");
11057
+ return /* @__PURE__ */ React.createElement(
11058
+ BreadcrumbButton,
11059
+ {
11060
+ className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
11061
+ key: currentDir,
11062
+ onClick: () => {
11063
+ setDirectory(currentDir);
11064
+ }
11065
+ },
11066
+ part
11067
+ );
11068
+ }));
11069
+ }
11070
+ const CopyField = ({ label, description, value }) => {
11071
+ const [copied, setCopied] = React.useState(false);
11072
+ const [fadeOut, setFadeOut] = React.useState(false);
11073
+ return /* @__PURE__ */ React.createElement("div", { className: "w-full" }, label && /* @__PURE__ */ React.createElement("label", { className: "w-full mb-1 block flex-1 text-sm font-bold leading-5 text-gray-700" }, label), /* @__PURE__ */ React.createElement(
11074
+ "span",
11075
+ {
11076
+ onClick: () => {
11077
+ if (copied === true)
11078
+ return;
11079
+ setCopied(true);
11080
+ setTimeout(() => {
11081
+ setFadeOut(true);
11082
+ }, 2500);
11083
+ setTimeout(() => {
11084
+ setCopied(false);
11085
+ setFadeOut(false);
11086
+ }, 3e3);
11087
+ navigator.clipboard.writeText(value);
11088
+ },
11089
+ className: `shadow-inner text-base leading-5 whitespace-normal break-all px-3 py-2 text-gray-600 w-full bg-gray-50 border border-gray-200 transition-all ease-out duration-150 rounded-md relative overflow-hidden appearance-none flex items-center w-full cursor-pointer hover:bg-white hover:text-blue-500 ${copied ? `pointer-events-none` : ``}`
11090
+ },
11091
+ /* @__PURE__ */ React.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
11092
+ " ",
11093
+ value,
11094
+ " ",
11095
+ copied && /* @__PURE__ */ React.createElement(
11096
+ "span",
11097
+ {
11098
+ className: `${fadeOut ? `opacity-0` : `opacity-100`} text-blue-500 transition-opacity duration-500 absolute right-0 w-full h-full px-3 py-2 bg-white bg-opacity-90 flex items-center justify-center text-center tracking-wide font-medium z-10`
11099
+ },
11100
+ /* @__PURE__ */ React.createElement("span", null, "Copied to clipboard!")
11101
+ )
11102
+ ), description && /* @__PURE__ */ React.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
11103
+ };
10958
11104
  function ListMediaItem({ item, onClick, active }) {
10959
11105
  let FileIcon = BiFile;
10960
11106
  if (item.type === "dir") {
@@ -11030,59 +11176,6 @@ flowchart TD
11030
11176
  )
11031
11177
  );
11032
11178
  }
11033
- function dirname(path) {
11034
- var _a, _b;
11035
- const pattern = new RegExp("(?<prevDir>.*)/");
11036
- return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
11037
- }
11038
- const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
11039
- "button",
11040
- {
11041
- className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
11042
- ...props
11043
- }
11044
- );
11045
- function Breadcrumb$1({ directory = "", setDirectory }) {
11046
- directory = directory.replace(/^\/|\/$/g, "");
11047
- let prevDir = dirname(directory) || "";
11048
- if (prevDir === ".") {
11049
- prevDir = "";
11050
- }
11051
- return /* @__PURE__ */ React.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React.createElement(
11052
- IconButton,
11053
- {
11054
- variant: "ghost",
11055
- className: "mr-2",
11056
- onClick: () => setDirectory(prevDir)
11057
- },
11058
- /* @__PURE__ */ React.createElement(
11059
- LeftArrowIcon,
11060
- {
11061
- className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
11062
- }
11063
- )
11064
- ), /* @__PURE__ */ React.createElement(
11065
- BreadcrumbButton,
11066
- {
11067
- onClick: () => setDirectory(""),
11068
- className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
11069
- },
11070
- "Media"
11071
- ), directory && directory.split("/").map((part, index, parts) => {
11072
- const currentDir = parts.slice(0, index + 1).join("/");
11073
- return /* @__PURE__ */ React.createElement(
11074
- BreadcrumbButton,
11075
- {
11076
- className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
11077
- key: currentDir,
11078
- onClick: () => {
11079
- setDirectory(currentDir);
11080
- }
11081
- },
11082
- part
11083
- );
11084
- }));
11085
- }
11086
11179
  const DeleteModal$1 = ({
11087
11180
  close: close2,
11088
11181
  deleteFunc,
@@ -11136,40 +11229,6 @@ flowchart TD
11136
11229
  "Create New Folder"
11137
11230
  ))));
11138
11231
  };
11139
- const CopyField = ({ label, description, value }) => {
11140
- const [copied, setCopied] = React.useState(false);
11141
- const [fadeOut, setFadeOut] = React.useState(false);
11142
- return /* @__PURE__ */ React.createElement("div", { className: "w-full" }, label && /* @__PURE__ */ React.createElement("label", { className: "w-full mb-1 block flex-1 text-sm font-bold leading-5 text-gray-700" }, label), /* @__PURE__ */ React.createElement(
11143
- "span",
11144
- {
11145
- onClick: () => {
11146
- if (copied === true)
11147
- return;
11148
- setCopied(true);
11149
- setTimeout(() => {
11150
- setFadeOut(true);
11151
- }, 2500);
11152
- setTimeout(() => {
11153
- setCopied(false);
11154
- setFadeOut(false);
11155
- }, 3e3);
11156
- navigator.clipboard.writeText(value);
11157
- },
11158
- className: `shadow-inner text-base leading-5 whitespace-normal break-all px-3 py-2 text-gray-600 w-full bg-gray-50 border border-gray-200 transition-all ease-out duration-150 rounded-md relative overflow-hidden appearance-none flex items-center w-full cursor-pointer hover:bg-white hover:text-blue-500 ${copied ? `pointer-events-none` : ``}`
11159
- },
11160
- /* @__PURE__ */ React.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
11161
- " ",
11162
- value,
11163
- " ",
11164
- copied && /* @__PURE__ */ React.createElement(
11165
- "span",
11166
- {
11167
- className: `${fadeOut ? `opacity-0` : `opacity-100`} text-blue-500 transition-opacity duration-500 absolute right-0 w-full h-full px-3 py-2 bg-white bg-opacity-90 flex items-center justify-center text-center tracking-wide font-medium z-10`
11168
- },
11169
- /* @__PURE__ */ React.createElement("span", null, "Copied to clipboard!")
11170
- )
11171
- ), description && /* @__PURE__ */ React.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
11172
- };
11173
11232
  const { useDropzone } = dropzone__namespace;
11174
11233
  const join = function(...parts) {
11175
11234
  const [first, last, slash] = [0, parts.length - 1, "/"];
@@ -11405,7 +11464,10 @@ flowchart TD
11405
11464
  const observer = new IntersectionObserver((entries) => {
11406
11465
  const target = entries[0];
11407
11466
  if (target.isIntersecting && list.nextOffset) {
11408
- setOffsetHistory((offsetHistory2) => [...offsetHistory2, list.nextOffset]);
11467
+ setOffsetHistory((offsetHistory2) => [
11468
+ ...offsetHistory2,
11469
+ list.nextOffset
11470
+ ]);
11409
11471
  }
11410
11472
  });
11411
11473
  if (loaderRef.current) {
@@ -11668,7 +11730,7 @@ flowchart TD
11668
11730
  target: "_blank",
11669
11731
  href: `${cms.api.tina.appDashboardLink}/media`
11670
11732
  },
11671
- "Sync Your Media In Tina Cloud.",
11733
+ "Sync Your Media In TinaCloud.",
11672
11734
  /* @__PURE__ */ React.createElement(BiLinkExternal, { className: `w-5 h-auto flex-shrink-0` })
11673
11735
  )
11674
11736
  )))) : /* @__PURE__ */ React.createElement(SyncStatusContext.Provider, { value: { syncStatus } }, children);
@@ -12000,6 +12062,7 @@ flowchart TD
12000
12062
  forms: [],
12001
12063
  formLists: [],
12002
12064
  editingMode: "basic",
12065
+ isLoadingContent: false,
12003
12066
  quickEditSupported: false,
12004
12067
  sidebarDisplayState: ((_a = cms == null ? void 0 : cms.sidebar) == null ? void 0 : _a.defaultState) || "open"
12005
12068
  };
@@ -12059,7 +12122,12 @@ flowchart TD
12059
12122
  }
12060
12123
  });
12061
12124
  }
12062
- return { ...state, activeFormId, formLists: nextFormLists };
12125
+ return {
12126
+ ...state,
12127
+ activeFormId,
12128
+ formLists: nextFormLists,
12129
+ isLoadingContent: false
12130
+ };
12063
12131
  }
12064
12132
  case "form-lists:remove": {
12065
12133
  const nextFormLists = state.formLists.filter(
@@ -12128,6 +12196,9 @@ flowchart TD
12128
12196
  }
12129
12197
  return { ...state, sidebarDisplayState: action.value };
12130
12198
  }
12199
+ case "sidebar:set-loading-state": {
12200
+ return { ...state, isLoadingContent: action.value };
12201
+ }
12131
12202
  default:
12132
12203
  throw new Error(`Unhandled action ${action.type}`);
12133
12204
  }
@@ -12369,7 +12440,9 @@ flowchart TD
12369
12440
  if (activeEle) {
12370
12441
  setDisplay(true);
12371
12442
  setPosition(activeEle.getBoundingClientRect());
12372
- const iframe = document.getElementById("tina-iframe");
12443
+ const iframe = document.getElementById(
12444
+ "tina-iframe"
12445
+ );
12373
12446
  if (iframe) {
12374
12447
  setIframePosition(iframe.getBoundingClientRect());
12375
12448
  }
@@ -12811,7 +12884,6 @@ flowchart TD
12811
12884
  }) => {
12812
12885
  const cms = useCMS$1();
12813
12886
  const tinaApi = cms.api.tina;
12814
- tinaApi.branch;
12815
12887
  const [disabled, setDisabled] = React__namespace.useState(false);
12816
12888
  const [newBranchName, setNewBranchName] = React__namespace.useState("");
12817
12889
  const [error, setError] = React__namespace.useState("");
@@ -12837,10 +12909,10 @@ flowchart TD
12837
12909
  const newUrl = window.location.href.replace(hash, newHash);
12838
12910
  window.location.href = newUrl;
12839
12911
  };
12840
- return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(PopupModal, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, /* @__PURE__ */ React__namespace.createElement(BiGitBranch, { className: "w-6 h-auto mr-1 text-blue-500 opacity-70" }), " ", "Create Branch"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-base text-gray-700 mb-2" }, "This branch is ", /* @__PURE__ */ React__namespace.createElement("strong", null, "protected"), ". Create a new branch to save your changes."), /* @__PURE__ */ React__namespace.createElement(
12912
+ return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(PopupModal, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, /* @__PURE__ */ React__namespace.createElement(BiGitBranch, { className: "w-6 h-auto mr-1 text-blue-500 opacity-70" }), " ", "Create Branch"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "This content is protected 🚧"), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-gray-700 mb-4" }, "To make changes, you need to create a copy then get it approved and merged for it to go live."), /* @__PURE__ */ React__namespace.createElement(
12841
12913
  PrefixedTextField,
12842
12914
  {
12843
- placeholder: "Branch Name",
12915
+ placeholder: "e.g. {{PAGE-NAME}}-updates",
12844
12916
  value: newBranchName,
12845
12917
  onChange: (e) => {
12846
12918
  setError("");
@@ -12987,7 +13059,9 @@ flowchart TD
12987
13059
  const { fieldName } = useTemplates();
12988
13060
  const { handleClose, handleRemove, handleSelect, isExpanded } = useEmbedHandles(editor, element, fieldName);
12989
13061
  useHotkey("enter", () => {
12990
- plateCommon.insertNodes(editor, [{ type: plate.ELEMENT_PARAGRAPH, children: [{ text: "" }] }]);
13062
+ plateCommon.insertNodes(editor, [
13063
+ { type: plate.ELEMENT_PARAGRAPH, children: [{ text: "" }] }
13064
+ ]);
12991
13065
  });
12992
13066
  return /* @__PURE__ */ React.createElement("span", { ...attributes, className: "" }, children, element.url ? /* @__PURE__ */ React.createElement(
12993
13067
  "div",
@@ -13130,7 +13204,9 @@ flowchart TD
13130
13204
  const { templates, fieldName } = useTemplates();
13131
13205
  const { handleClose, handleRemove, handleSelect, isExpanded } = useEmbedHandles(editor, element, fieldName);
13132
13206
  useHotkey("enter", () => {
13133
- plateCommon.insertNodes(editor, [{ type: plate.ELEMENT_PARAGRAPH, children: [{ text: "" }] }]);
13207
+ plateCommon.insertNodes(editor, [
13208
+ { type: plate.ELEMENT_PARAGRAPH, children: [{ text: "" }] }
13209
+ ]);
13134
13210
  });
13135
13211
  useHotkey("space", () => {
13136
13212
  plateCommon.insertNodes(editor, [{ text: " " }], {
@@ -13186,7 +13262,9 @@ flowchart TD
13186
13262
  const { templates, fieldName } = useTemplates();
13187
13263
  const { handleClose, handleRemove, handleSelect, isExpanded } = useEmbedHandles(editor, element, fieldName);
13188
13264
  useHotkey("enter", () => {
13189
- plateCommon.insertNodes(editor, [{ type: plate.ELEMENT_PARAGRAPH, children: [{ text: "" }] }]);
13265
+ plateCommon.insertNodes(editor, [
13266
+ { type: plate.ELEMENT_PARAGRAPH, children: [{ text: "" }] }
13267
+ ]);
13190
13268
  });
13191
13269
  const activeTemplate = templates.find(
13192
13270
  (template) => template.name === element.name
@@ -13532,6 +13610,11 @@ flowchart TD
13532
13610
  mode: "mark",
13533
13611
  type: plate.MARK_CODE,
13534
13612
  match: "`"
13613
+ },
13614
+ {
13615
+ mode: "mark",
13616
+ type: plate.MARK_STRIKETHROUGH,
13617
+ match: ["~~", "~"]
13535
13618
  }
13536
13619
  ];
13537
13620
  const autoformatRules = [
@@ -13673,16 +13756,14 @@ flowchart TD
13673
13756
  })
13674
13757
  ];
13675
13758
  const plugins = [
13759
+ plate.createBasicMarksPlugin(),
13676
13760
  plate.createHeadingPlugin(),
13677
13761
  plate.createParagraphPlugin(),
13678
13762
  createCodeBlockPlugin(),
13679
13763
  createHTMLBlockPlugin(),
13680
13764
  createHTMLInlinePlugin(),
13681
13765
  plate.createBlockquotePlugin(),
13682
- plate.createBoldPlugin(),
13683
- plate.createItalicPlugin(),
13684
13766
  plate.createUnderlinePlugin(),
13685
- plate.createCodePlugin(),
13686
13767
  plate.createListPlugin(),
13687
13768
  plate.createIndentListPlugin(),
13688
13769
  plate.createHorizontalRulePlugin(),
@@ -14042,7 +14123,9 @@ flowchart TD
14042
14123
  const CONTAINER_MD_BREAKPOINT = 448;
14043
14124
  const FLOAT_BUTTON_WIDTH = 25;
14044
14125
  const HEADING_LABEL = "Headings";
14045
- const ToolbarContext = React.createContext(void 0);
14126
+ const ToolbarContext = React.createContext(
14127
+ void 0
14128
+ );
14046
14129
  const ToolbarProvider = ({
14047
14130
  tinaForm,
14048
14131
  templates,
@@ -14192,7 +14275,7 @@ flowchart TD
14192
14275
  const CodeBlockToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
14193
14276
  const state = useCodeBlockToolbarButtonState();
14194
14277
  const { props } = useCodeBlockToolbarButton(state);
14195
- return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.codeBlock, null));
14278
+ return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Code Block", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.codeBlock, null));
14196
14279
  });
14197
14280
  const useImageToolbarButtonState = () => {
14198
14281
  const editor = plateCommon.useEditorState();
@@ -14224,36 +14307,54 @@ flowchart TD
14224
14307
  const ImageToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
14225
14308
  const state = useImageToolbarButtonState();
14226
14309
  const { props } = useImageToolbarButton(state);
14227
- return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.image, null));
14228
- });
14229
- const IndentListToolbarButton = cn$1.withRef(({ nodeType = plate.ELEMENT_UL }, ref) => {
14230
- const editor = plateCommon.useEditorState();
14231
- const state = plate.useListToolbarButtonState({ nodeType });
14232
- const { props } = plate.useListToolbarButton(state);
14233
- return /* @__PURE__ */ React.createElement(
14234
- ToolbarButton,
14235
- {
14236
- ref,
14237
- tooltip: nodeType === plate.ELEMENT_UL ? "Bulleted List" : "Numbered List",
14238
- ...props,
14239
- onClick: (e) => {
14240
- e.preventDefault();
14241
- e.stopPropagation();
14242
- plate.toggleList(editor, { type: nodeType });
14243
- }
14244
- },
14245
- nodeType === plate.ELEMENT_UL ? /* @__PURE__ */ React.createElement(Icons.ul, null) : /* @__PURE__ */ React.createElement(Icons.ol, null)
14246
- );
14310
+ return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Image", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.image, null));
14247
14311
  });
14312
+ const UnorderedListToolbarButton = cn$1.withRef(
14313
+ (props, ref) => {
14314
+ const editor = plateCommon.useEditorState();
14315
+ const state = plate.useListToolbarButtonState({ nodeType: plate.ELEMENT_UL });
14316
+ const { props: buttonProps } = plate.useListToolbarButton(state);
14317
+ return /* @__PURE__ */ React.createElement(
14318
+ ToolbarButton,
14319
+ {
14320
+ ref,
14321
+ tooltip: "Bulleted List",
14322
+ ...buttonProps,
14323
+ onClick: (e) => {
14324
+ e.preventDefault();
14325
+ e.stopPropagation();
14326
+ plate.toggleList(editor, { type: plate.ELEMENT_UL });
14327
+ }
14328
+ },
14329
+ /* @__PURE__ */ React.createElement(Icons.ul, null)
14330
+ );
14331
+ }
14332
+ );
14333
+ const OrderedListToolbarButton = cn$1.withRef(
14334
+ (props, ref) => {
14335
+ const editor = plateCommon.useEditorState();
14336
+ const state = plate.useListToolbarButtonState({ nodeType: plate.ELEMENT_OL });
14337
+ const { props: buttonProps } = plate.useListToolbarButton(state);
14338
+ return /* @__PURE__ */ React.createElement(
14339
+ ToolbarButton,
14340
+ {
14341
+ ref,
14342
+ tooltip: "Numbered List",
14343
+ ...buttonProps,
14344
+ onClick: (e) => {
14345
+ e.preventDefault();
14346
+ e.stopPropagation();
14347
+ plate.toggleList(editor, { type: plate.ELEMENT_OL });
14348
+ }
14349
+ },
14350
+ /* @__PURE__ */ React.createElement(Icons.ol, null)
14351
+ );
14352
+ }
14353
+ );
14248
14354
  const LinkToolbarButton = cn$1.withRef((rest, ref) => {
14249
14355
  const state = plateLink.useLinkToolbarButtonState();
14250
14356
  const { props } = plateLink.useLinkToolbarButton(state);
14251
- return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...props, ...rest }, /* @__PURE__ */ React.createElement(Icons.link, null));
14252
- });
14253
- const MarkToolbarButton = cn$1.withRef(({ clear, nodeType, ...rest }, ref) => {
14254
- const state = plateCommon.useMarkToolbarButtonState({ clear, nodeType });
14255
- const { props } = plateCommon.useMarkToolbarButton(state);
14256
- return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest });
14357
+ return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest, tooltip: "Link" }, /* @__PURE__ */ React.createElement(Icons.link, null));
14257
14358
  });
14258
14359
  const useMermaidToolbarButtonState = () => {
14259
14360
  const editor = plateCommon.useEditorState();
@@ -14334,7 +14435,7 @@ flowchart TD
14334
14435
  const QuoteToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
14335
14436
  const state = useBlockQuoteToolbarButtonState();
14336
14437
  const { props } = useBlockQuoteToolbarButton(state);
14337
- return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.quote, null));
14438
+ return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Quote (⌘+⇧+.)", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.quote, null));
14338
14439
  });
14339
14440
  const useRawMarkdownToolbarButton = () => {
14340
14441
  const { setRawMode } = useEditorContext();
@@ -14354,7 +14455,7 @@ flowchart TD
14354
14455
  ToolbarButton,
14355
14456
  {
14356
14457
  ref,
14357
- tooltip: "Link",
14458
+ tooltip: "Raw Markdown",
14358
14459
  ...rest,
14359
14460
  ...props,
14360
14461
  "data-testid": "markdown-button"
@@ -14499,7 +14600,7 @@ flowchart TD
14499
14600
  key: template.name,
14500
14601
  onMouseDown: (e) => {
14501
14602
  e.preventDefault();
14502
- close();
14603
+ setOpen(false);
14503
14604
  insertMDX(editor, template);
14504
14605
  },
14505
14606
  className: ""
@@ -14507,6 +14608,15 @@ flowchart TD
14507
14608
  template.label || template.name
14508
14609
  ))));
14509
14610
  };
14611
+ const MarkToolbarButton = cn$1.withRef(({ clear, nodeType, ...rest }, ref) => {
14612
+ const state = plateCommon.useMarkToolbarButtonState({ clear, nodeType });
14613
+ const { props } = plateCommon.useMarkToolbarButton(state);
14614
+ return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest });
14615
+ });
14616
+ const BoldToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: plate.MARK_BOLD }, /* @__PURE__ */ React.createElement(Icons.bold, null));
14617
+ const StrikethroughToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Strikethrough", nodeType: plate.MARK_STRIKETHROUGH }, /* @__PURE__ */ React.createElement(Icons.strikethrough, null));
14618
+ const ItalicToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: plate.MARK_ITALIC }, /* @__PURE__ */ React.createElement(Icons.italic, null));
14619
+ const CodeToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: plate.MARK_CODE }, /* @__PURE__ */ React.createElement(Icons.code, null));
14510
14620
  const toolbarItems = {
14511
14621
  heading: {
14512
14622
  label: HEADING_LABEL,
@@ -14527,32 +14637,37 @@ flowchart TD
14527
14637
  quote: {
14528
14638
  label: "Quote",
14529
14639
  width: () => STANDARD_ICON_WIDTH,
14530
- Component: /* @__PURE__ */ React.createElement(QuoteToolbarButton, { tooltip: "Quote Quote (⌘+⇧+.)" })
14640
+ Component: /* @__PURE__ */ React.createElement(QuoteToolbarButton, null)
14531
14641
  },
14532
14642
  ul: {
14533
14643
  label: "Unordered List",
14534
14644
  width: () => STANDARD_ICON_WIDTH,
14535
- Component: /* @__PURE__ */ React.createElement(IndentListToolbarButton, { nodeType: plate.ELEMENT_UL })
14645
+ Component: /* @__PURE__ */ React.createElement(UnorderedListToolbarButton, null)
14536
14646
  },
14537
14647
  ol: {
14538
14648
  label: "Ordered List",
14539
14649
  width: () => STANDARD_ICON_WIDTH,
14540
- Component: /* @__PURE__ */ React.createElement(IndentListToolbarButton, { nodeType: plate.ELEMENT_OL })
14650
+ Component: /* @__PURE__ */ React.createElement(OrderedListToolbarButton, null)
14541
14651
  },
14542
14652
  bold: {
14543
14653
  label: "Bold",
14544
14654
  width: () => STANDARD_ICON_WIDTH,
14545
- Component: /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: plate.MARK_BOLD }, /* @__PURE__ */ React.createElement(Icons.bold, null))
14655
+ Component: /* @__PURE__ */ React.createElement(BoldToolbarButton, null)
14656
+ },
14657
+ strikethrough: {
14658
+ label: "Strikethrough",
14659
+ width: () => STANDARD_ICON_WIDTH,
14660
+ Component: /* @__PURE__ */ React.createElement(StrikethroughToolbarButton, null)
14546
14661
  },
14547
14662
  italic: {
14548
14663
  label: "Italic",
14549
14664
  width: () => STANDARD_ICON_WIDTH,
14550
- Component: /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: plate.MARK_ITALIC }, /* @__PURE__ */ React.createElement(Icons.italic, null))
14665
+ Component: /* @__PURE__ */ React.createElement(ItalicToolbarButton, null)
14551
14666
  },
14552
14667
  code: {
14553
14668
  label: "Code",
14554
14669
  width: () => STANDARD_ICON_WIDTH,
14555
- Component: /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: plate.MARK_CODE }, /* @__PURE__ */ React.createElement(Icons.code, null))
14670
+ Component: /* @__PURE__ */ React.createElement(CodeToolbarButton, null)
14556
14671
  },
14557
14672
  codeBlock: {
14558
14673
  label: "Code Block",
@@ -14585,7 +14700,12 @@ flowchart TD
14585
14700
  const [itemsShown, setItemsShown] = React.useState(11);
14586
14701
  const { overrides, templates } = useToolbarContext();
14587
14702
  const showEmbedButton = templates.length > 0;
14588
- let items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
14703
+ let items2 = [];
14704
+ if (Array.isArray(overrides)) {
14705
+ items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
14706
+ } else {
14707
+ items2 = (overrides == null ? void 0 : overrides.toolbar) === void 0 ? Object.values(toolbarItems) : overrides.toolbar.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
14708
+ }
14589
14709
  if (!showEmbedButton) {
14590
14710
  items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
14591
14711
  }
@@ -14913,6 +15033,9 @@ flowchart TD
14913
15033
  if (typeof string !== "string") {
14914
15034
  return false;
14915
15035
  }
15036
+ if (string.startsWith("#")) {
15037
+ return true;
15038
+ }
14916
15039
  const generalMatch = string.match(protocolAndDomainRE);
14917
15040
  const emailLinkMatch = string.match(emailLintRE);
14918
15041
  const localUrlMatch = string.match(localUrlRE);
@@ -14934,12 +15057,12 @@ flowchart TD
14934
15057
  }
14935
15058
  return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
14936
15059
  };
14937
- const RichEditor = (props) => {
15060
+ const RichEditor = ({ input, tinaForm, field }) => {
14938
15061
  var _a;
14939
15062
  const initialValue = React.useMemo(
14940
15063
  () => {
14941
15064
  var _a2, _b;
14942
- 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: "" }] }];
15065
+ return ((_b = (_a2 = input.value) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) ? input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
14943
15066
  },
14944
15067
  []
14945
15068
  );
@@ -14967,7 +15090,7 @@ flowchart TD
14967
15090
  ),
14968
15091
  []
14969
15092
  );
14970
- const tempId = [props.tinaForm.id, props.input.name].join(".");
15093
+ const tempId = [tinaForm.id, input.name].join(".");
14971
15094
  const id = React.useMemo(() => uuid() + tempId, [tempId]);
14972
15095
  const ref = React.useRef(null);
14973
15096
  React.useEffect(() => {
@@ -14977,13 +15100,13 @@ flowchart TD
14977
15100
  const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
14978
15101
  '[role="textbox"]'
14979
15102
  );
14980
- if (props.field.experimental_focusIntent && plateElement) {
15103
+ if (field.experimental_focusIntent && plateElement) {
14981
15104
  if (plateElement)
14982
15105
  plateElement.focus();
14983
15106
  }
14984
15107
  }, 100);
14985
15108
  }
14986
- }, [props.field.experimental_focusIntent, ref]);
15109
+ }, [field.experimental_focusIntent, ref]);
14987
15110
  return /* @__PURE__ */ React.createElement("div", { ref }, /* @__PURE__ */ React.createElement(
14988
15111
  plateCommon.Plate,
14989
15112
  {
@@ -14991,7 +15114,7 @@ flowchart TD
14991
15114
  initialValue,
14992
15115
  plugins: plugins$2,
14993
15116
  onChange: (value) => {
14994
- props.input.onChange({
15117
+ input.onChange({
14995
15118
  type: "root",
14996
15119
  children: value
14997
15120
  });
@@ -15000,12 +15123,12 @@ flowchart TD
15000
15123
  /* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(
15001
15124
  ToolbarProvider,
15002
15125
  {
15003
- tinaForm: props.tinaForm,
15004
- templates: props.field.templates,
15005
- overrides: (_a = props.field) == null ? void 0 : _a.toolbarOverride
15126
+ tinaForm,
15127
+ templates: field.templates,
15128
+ overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
15006
15129
  },
15007
15130
  /* @__PURE__ */ React.createElement(FixedToolbar, null, /* @__PURE__ */ React.createElement(FixedToolbarButtons, null)),
15008
- /* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null))
15131
+ ((_a = field == null ? void 0 : field.overrides) == null ? void 0 : _a.showFloatingToolbar) !== false ? /* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null)) : null
15009
15132
  ), /* @__PURE__ */ React.createElement(Editor, null))
15010
15133
  ));
15011
15134
  };
@@ -16193,132 +16316,1209 @@ flowchart TD
16193
16316
  "হয়"
16194
16317
  ];
16195
16318
  const bre = [
16319
+ "'blam",
16320
+ "'d",
16321
+ "'m",
16322
+ "'r",
16323
+ "'ta",
16324
+ "'vat",
16325
+ "'z",
16326
+ "'zo",
16196
16327
  "a",
16197
- "ainda",
16198
- "alem",
16199
- "ambas",
16200
- "ambos",
16201
- "antes",
16202
- "ao",
16203
- "aonde",
16204
- "aos",
16205
- "apos",
16206
- "aquele",
16207
- "aqueles",
16208
- "as",
16209
- "assim",
16210
- "com",
16211
- "como",
16212
- "contra",
16213
- "contudo",
16214
- "cuja",
16215
- "cujas",
16216
- "cujo",
16217
- "cujos",
16328
+ "a:",
16329
+ "aba",
16330
+ "abalamour",
16331
+ "abaoe",
16332
+ "ac'hane",
16333
+ "ac'hanoc'h",
16334
+ "ac'hanomp",
16335
+ "ac'hanon",
16336
+ "ac'hanout",
16337
+ "adal",
16338
+ "adalek",
16339
+ "adarre",
16340
+ "ae",
16341
+ "aec'h",
16342
+ "aed",
16343
+ "aemp",
16344
+ "aen",
16345
+ "aent",
16346
+ "aes",
16347
+ "afe",
16348
+ "afec'h",
16349
+ "afed",
16350
+ "afemp",
16351
+ "afen",
16352
+ "afent",
16353
+ "afes",
16354
+ "ag",
16355
+ "ah",
16356
+ "aimp",
16357
+ "aint",
16358
+ "aio",
16359
+ "aiou",
16360
+ "aje",
16361
+ "ajec'h",
16362
+ "ajed",
16363
+ "ajemp",
16364
+ "ajen",
16365
+ "ajent",
16366
+ "ajes",
16367
+ "al",
16368
+ "alato",
16369
+ "alies",
16370
+ "aliesañ",
16371
+ "alkent",
16372
+ "all",
16373
+ "allas",
16374
+ "allo",
16375
+ "allô",
16376
+ "am",
16377
+ "amañ",
16378
+ "amzer",
16379
+ "an",
16380
+ "anezhañ",
16381
+ "anezhe",
16382
+ "anezhi",
16383
+ "anezho",
16384
+ "anvet",
16385
+ "aon",
16386
+ "aotren",
16387
+ "ar",
16388
+ "arall",
16389
+ "araok",
16390
+ "araoki",
16391
+ "araozañ",
16392
+ "araozo",
16393
+ "araozoc'h",
16394
+ "araozomp",
16395
+ "araozon",
16396
+ "araozor",
16397
+ "araozout",
16398
+ "arbenn",
16399
+ "arre",
16400
+ "atalek",
16401
+ "atav",
16402
+ "az",
16403
+ "azalek",
16404
+ "azirazañ",
16405
+ "azirazi",
16406
+ "azirazo",
16407
+ "azirazoc'h",
16408
+ "azirazomp",
16409
+ "azirazon",
16410
+ "azirazor",
16411
+ "azirazout",
16412
+ "b:",
16413
+ "ba",
16414
+ "ba'l",
16415
+ "ba'n",
16416
+ "ba'r",
16417
+ "bad",
16418
+ "bah",
16419
+ "bal",
16420
+ "ban",
16421
+ "bar",
16422
+ "bastañ",
16423
+ "befe",
16424
+ "bell",
16425
+ "benaos",
16426
+ "benn",
16427
+ "bennag",
16428
+ "bennak",
16429
+ "bennozh",
16430
+ "bep",
16431
+ "bepred",
16432
+ "berr",
16433
+ "berzh",
16434
+ "bet",
16435
+ "betek",
16436
+ "betra",
16437
+ "bev",
16438
+ "bevet",
16439
+ "bez",
16440
+ "bezañ",
16441
+ "beze",
16442
+ "bezent",
16443
+ "bezet",
16444
+ "bezh",
16445
+ "bezit",
16446
+ "bezomp",
16447
+ "bihan",
16448
+ "bije",
16449
+ "biou",
16450
+ "biskoazh",
16451
+ "blam",
16452
+ "bo",
16453
+ "boa",
16454
+ "bominapl",
16455
+ "boudoudom",
16456
+ "bouez",
16457
+ "boull",
16458
+ "boum",
16459
+ "bout",
16460
+ "bras",
16461
+ "brasañ",
16462
+ "brav",
16463
+ "bravo",
16464
+ "bremañ",
16465
+ "bres",
16466
+ "brokenn",
16467
+ "bronn",
16468
+ "brrr",
16469
+ "brutal",
16470
+ "buhezek",
16471
+ "c'h:",
16472
+ "c'haout",
16473
+ "c'he",
16474
+ "c'hem",
16475
+ "c'herz",
16476
+ "c'heñver",
16477
+ "c'hichen",
16478
+ "c'hiz",
16479
+ "c'hoazh",
16480
+ "c'horre",
16481
+ "c'houde",
16482
+ "c'houst",
16483
+ "c'hreiz",
16484
+ "c'hwec'h",
16485
+ "c'hwec'hvet",
16486
+ "c'hwezek",
16487
+ "c'hwi",
16488
+ "ch:",
16489
+ "chaous",
16490
+ "chik",
16491
+ "chit",
16492
+ "chom",
16493
+ "chut",
16494
+ "d'",
16495
+ "d'al",
16496
+ "d'an",
16497
+ "d'ar",
16498
+ "d'az",
16499
+ "d'e",
16500
+ "d'he",
16501
+ "d'ho",
16502
+ "d'hol",
16503
+ "d'hon",
16504
+ "d'hor",
16505
+ "d'o",
16506
+ "d'ober",
16507
+ "d'ul",
16508
+ "d'un",
16509
+ "d'ur",
16510
+ "d:",
16218
16511
  "da",
16219
- "das",
16220
- "de",
16221
- "dela",
16222
- "dele",
16223
- "deles",
16224
- "demais",
16225
- "depois",
16226
- "desde",
16227
- "desta",
16228
- "deste",
16229
- "dispoe",
16230
- "dispoem",
16231
- "diversa",
16232
- "diversas",
16233
- "diversos",
16512
+ "dak",
16513
+ "daka",
16514
+ "dal",
16515
+ "dalbezh",
16516
+ "dalc'hmat",
16517
+ "dalit",
16518
+ "damdost",
16519
+ "damheñvel",
16520
+ "damm",
16521
+ "dan",
16522
+ "danvez",
16523
+ "dao",
16524
+ "daol",
16525
+ "daonet",
16526
+ "daou",
16527
+ "daoust",
16528
+ "daouzek",
16529
+ "daouzekvet",
16530
+ "darn",
16531
+ "dastrewiñ",
16532
+ "dav",
16533
+ "davedoc'h",
16534
+ "davedomp",
16535
+ "davedon",
16536
+ "davedor",
16537
+ "davedout",
16538
+ "davet",
16539
+ "davetañ",
16540
+ "davete",
16541
+ "daveti",
16542
+ "daveto",
16543
+ "defe",
16544
+ "dehou",
16545
+ "dek",
16546
+ "dekvet",
16547
+ "den",
16548
+ "deoc'h",
16549
+ "deomp",
16550
+ "deor",
16551
+ "derc'hel",
16552
+ "deus",
16553
+ "dez",
16554
+ "deze",
16555
+ "dezhañ",
16556
+ "dezhe",
16557
+ "dezhi",
16558
+ "dezho",
16559
+ "di",
16560
+ "diabarzh",
16561
+ "diagent",
16562
+ "diar",
16563
+ "diaraok",
16564
+ "diavaez",
16565
+ "dibaoe",
16566
+ "dibaot",
16567
+ "dibar",
16568
+ "dic'halañ",
16569
+ "didiac'h",
16570
+ "dienn",
16571
+ "difer",
16572
+ "diganeoc'h",
16573
+ "diganeomp",
16574
+ "diganeor",
16575
+ "diganimp",
16576
+ "diganin",
16577
+ "diganit",
16578
+ "digant",
16579
+ "digantañ",
16580
+ "digante",
16581
+ "diganti",
16582
+ "diganto",
16583
+ "digemmesk",
16584
+ "diget",
16585
+ "digor",
16586
+ "digoret",
16587
+ "dija",
16588
+ "dije",
16589
+ "dimp",
16590
+ "din",
16591
+ "dinaou",
16592
+ "dindan",
16593
+ "dindanañ",
16594
+ "dindani",
16595
+ "dindano",
16596
+ "dindanoc'h",
16597
+ "dindanomp",
16598
+ "dindanon",
16599
+ "dindanor",
16600
+ "dindanout",
16601
+ "dioutañ",
16602
+ "dioute",
16603
+ "diouti",
16604
+ "diouto",
16605
+ "diouzh",
16606
+ "diouzhin",
16607
+ "diouzhit",
16608
+ "diouzhoc'h",
16609
+ "diouzhomp",
16610
+ "diouzhor",
16611
+ "dirak",
16612
+ "dirazañ",
16613
+ "dirazi",
16614
+ "dirazo",
16615
+ "dirazoc'h",
16616
+ "dirazomp",
16617
+ "dirazon",
16618
+ "dirazor",
16619
+ "dirazout",
16620
+ "disheñvel",
16621
+ "dispar",
16622
+ "distank",
16623
+ "dister",
16624
+ "disterañ",
16625
+ "disterig",
16626
+ "distro",
16627
+ "dit",
16628
+ "divaez",
16629
+ "diwar",
16630
+ "diwezhat",
16631
+ "diwezhañ",
16234
16632
  "do",
16235
- "dos",
16236
- "durante",
16633
+ "doa",
16634
+ "doare",
16635
+ "dont",
16636
+ "dost",
16637
+ "doue",
16638
+ "douetus",
16639
+ "douez",
16640
+ "doug",
16641
+ "draou",
16642
+ "draoñ",
16643
+ "dre",
16644
+ "drede",
16645
+ "dreist",
16646
+ "dreistañ",
16647
+ "dreisti",
16648
+ "dreisto",
16649
+ "dreistoc'h",
16650
+ "dreistomp",
16651
+ "dreiston",
16652
+ "dreistor",
16653
+ "dreistout",
16654
+ "drek",
16655
+ "dreñv",
16656
+ "dring",
16657
+ "dro",
16658
+ "du",
16237
16659
  "e",
16238
- "ela",
16239
- "elas",
16240
- "ele",
16241
- "eles",
16660
+ "e:",
16661
+ "eas",
16662
+ "ebet",
16663
+ "ec'h",
16664
+ "edo",
16665
+ "edoc'h",
16666
+ "edod",
16667
+ "edomp",
16668
+ "edon",
16669
+ "edont",
16670
+ "edos",
16671
+ "eer",
16672
+ "eeun",
16673
+ "efed",
16674
+ "egedoc'h",
16675
+ "egedomp",
16676
+ "egedon",
16677
+ "egedor",
16678
+ "egedout",
16679
+ "eget",
16680
+ "egetañ",
16681
+ "egete",
16682
+ "egeti",
16683
+ "egeto",
16684
+ "eh",
16685
+ "eil",
16686
+ "eilvet",
16687
+ "eizh",
16688
+ "eizhvet",
16689
+ "ejoc'h",
16690
+ "ejod",
16691
+ "ejomp",
16692
+ "ejont",
16693
+ "ejout",
16694
+ "el",
16242
16695
  "em",
16243
- "entao",
16244
- "entre",
16245
- "essa",
16246
- "essas",
16247
- "esse",
16248
- "esses",
16249
- "esta",
16250
- "estas",
16251
- "este",
16252
- "estes",
16696
+ "emaint",
16697
+ "emaoc'h",
16698
+ "emaomp",
16699
+ "emaon",
16700
+ "emaout",
16701
+ "emañ",
16702
+ "eme",
16703
+ "emeur",
16704
+ "emezañ",
16705
+ "emezi",
16706
+ "emezo",
16707
+ "emezoc'h",
16708
+ "emezomp",
16709
+ "emezon",
16710
+ "emezout",
16711
+ "emporzhiañ",
16712
+ "en",
16713
+ "end",
16714
+ "endan",
16715
+ "endra",
16716
+ "enep",
16717
+ "ennañ",
16718
+ "enni",
16719
+ "enno",
16720
+ "ennoc'h",
16721
+ "ennomp",
16722
+ "ennon",
16723
+ "ennor",
16724
+ "ennout",
16725
+ "enta",
16726
+ "eo",
16727
+ "eomp",
16728
+ "eont",
16729
+ "eor",
16730
+ "eot",
16731
+ "er",
16732
+ "erbet",
16733
+ "erfin",
16734
+ "esa",
16735
+ "esae",
16736
+ "espar",
16737
+ "estlamm",
16738
+ "estrañj",
16739
+ "eta",
16740
+ "etre",
16741
+ "etreoc'h",
16742
+ "etrezo",
16743
+ "etrezoc'h",
16744
+ "etrezomp",
16745
+ "etrezor",
16746
+ "euh",
16747
+ "eur",
16748
+ "eus",
16749
+ "evel",
16750
+ "evelato",
16751
+ "eveldoc'h",
16752
+ "eveldomp",
16753
+ "eveldon",
16754
+ "eveldor",
16755
+ "eveldout",
16756
+ "evelkent",
16757
+ "eveltañ",
16758
+ "evelte",
16759
+ "evelti",
16760
+ "evelto",
16761
+ "evidoc'h",
16762
+ "evidomp",
16763
+ "evidon",
16764
+ "evidor",
16765
+ "evidout",
16766
+ "evit",
16767
+ "evitañ",
16768
+ "evite",
16769
+ "eviti",
16770
+ "evito",
16771
+ "ez",
16772
+ "eñ",
16773
+ "f:",
16774
+ "fac'h",
16775
+ "fall",
16776
+ "fed",
16777
+ "feiz",
16778
+ "fenn",
16779
+ "fezh",
16780
+ "fin",
16781
+ "finsalvet",
16782
+ "foei",
16783
+ "fouilhezañ",
16784
+ "g:",
16785
+ "gallout",
16786
+ "ganeoc'h",
16787
+ "ganeomp",
16788
+ "ganin",
16789
+ "ganit",
16790
+ "gant",
16791
+ "gantañ",
16792
+ "ganti",
16793
+ "ganto",
16794
+ "gaout",
16795
+ "gast",
16796
+ "gein",
16797
+ "gellout",
16798
+ "genndost",
16799
+ "gentañ",
16800
+ "ger",
16801
+ "gerz",
16802
+ "get",
16803
+ "geñver",
16804
+ "gichen",
16805
+ "gin",
16806
+ "giz",
16807
+ "glan",
16808
+ "gloev",
16809
+ "goll",
16810
+ "gorre",
16811
+ "goude",
16812
+ "gouez",
16813
+ "gouezit",
16814
+ "gouezomp",
16815
+ "goulz",
16816
+ "gounnar",
16817
+ "gour",
16818
+ "goust",
16819
+ "gouze",
16820
+ "gouzout",
16821
+ "gra",
16822
+ "grak",
16823
+ "grec'h",
16824
+ "greiz",
16825
+ "grenn",
16826
+ "greomp",
16827
+ "grit",
16828
+ "groñs",
16829
+ "gutez",
16830
+ "gwall",
16831
+ "gwashoc'h",
16832
+ "gwazh",
16833
+ "gwech",
16834
+ "gwechall",
16835
+ "gwechoù",
16836
+ "gwell",
16837
+ "gwezh",
16838
+ "gwezhall",
16839
+ "gwezharall",
16840
+ "gwezhoù",
16841
+ "gwig",
16842
+ "gwirionez",
16843
+ "gwitibunan",
16844
+ "gêr",
16845
+ "h:",
16253
16846
  "ha",
16254
- "isso",
16255
- "isto",
16256
- "logo",
16257
- "mais",
16258
- "mas",
16259
- "mediante",
16260
- "menos",
16261
- "mesma",
16262
- "mesmas",
16263
- "mesmo",
16264
- "mesmos",
16847
+ "hag",
16848
+ "han",
16849
+ "hanter",
16850
+ "hanterc'hantad",
16851
+ "hanterkantved",
16852
+ "harz",
16853
+ "hañ",
16854
+ "hañval",
16855
+ "he",
16856
+ "hebioù",
16857
+ "hec'h",
16858
+ "hei",
16859
+ "hein",
16860
+ "hem",
16861
+ "hemañ",
16862
+ "hen",
16863
+ "hend",
16864
+ "henhont",
16865
+ "henn",
16866
+ "hennezh",
16867
+ "hent",
16868
+ "hep",
16869
+ "hervez",
16870
+ "hervezañ",
16871
+ "hervezi",
16872
+ "hervezo",
16873
+ "hervezoc'h",
16874
+ "hervezomp",
16875
+ "hervezon",
16876
+ "hervezor",
16877
+ "hervezout",
16878
+ "heul",
16879
+ "heuliañ",
16880
+ "hevelep",
16881
+ "heverk",
16882
+ "heñvel",
16883
+ "heñvelat",
16884
+ "heñvelañ",
16885
+ "heñveliñ",
16886
+ "heñveloc'h",
16887
+ "heñvelout",
16888
+ "hi",
16889
+ "hilh",
16890
+ "hini",
16891
+ "hirie",
16892
+ "hirio",
16893
+ "hiziv",
16894
+ "hiziviken",
16895
+ "ho",
16896
+ "hoaliñ",
16897
+ "hoc'h",
16898
+ "hogen",
16899
+ "hogos",
16900
+ "hogozik",
16901
+ "hol",
16902
+ "holl",
16903
+ "holà",
16904
+ "homañ",
16905
+ "hon",
16906
+ "honhont",
16907
+ "honnezh",
16908
+ "hont",
16909
+ "hop",
16910
+ "hopala",
16911
+ "hor",
16912
+ "hou",
16913
+ "houp",
16914
+ "hudu",
16915
+ "hue",
16916
+ "hui",
16917
+ "hum",
16918
+ "hurrah",
16919
+ "i",
16920
+ "i:",
16921
+ "in",
16922
+ "int",
16923
+ "is",
16924
+ "ispisial",
16925
+ "isurzhiet",
16926
+ "it",
16927
+ "ivez",
16928
+ "izelañ",
16929
+ "j:",
16930
+ "just",
16931
+ "k:",
16932
+ "kae",
16933
+ "kaer",
16934
+ "kalon",
16935
+ "kalz",
16936
+ "kant",
16937
+ "kaout",
16938
+ "kar",
16939
+ "kazi",
16940
+ "keid",
16941
+ "kein",
16942
+ "keit",
16943
+ "kel",
16944
+ "kellies",
16945
+ "keloù",
16946
+ "kement",
16947
+ "ken",
16948
+ "kenkent",
16949
+ "kenkoulz",
16950
+ "kenment",
16951
+ "kent",
16952
+ "kentañ",
16953
+ "kentizh",
16954
+ "kentoc'h",
16955
+ "kentre",
16956
+ "ker",
16957
+ "kerkent",
16958
+ "kerz",
16959
+ "kerzh",
16960
+ "ket",
16961
+ "keta",
16962
+ "keñver",
16963
+ "keñverel",
16964
+ "keñverius",
16965
+ "kichen",
16966
+ "kichenik",
16967
+ "kit",
16968
+ "kiz",
16969
+ "klak",
16970
+ "klek",
16971
+ "klik",
16972
+ "komprenet",
16973
+ "komz",
16974
+ "kont",
16975
+ "korf",
16976
+ "korre",
16977
+ "koulskoude",
16978
+ "koulz",
16979
+ "koust",
16980
+ "krak",
16981
+ "krampouezh",
16982
+ "krec'h",
16983
+ "kreiz",
16984
+ "kuit",
16985
+ "kwir",
16986
+ "l:",
16987
+ "la",
16988
+ "laez",
16989
+ "laoskel",
16990
+ "laouen",
16991
+ "lavar",
16992
+ "lavaret",
16993
+ "lavarout",
16994
+ "lec'h",
16995
+ "lein",
16996
+ "leizh",
16997
+ "lerc'h",
16998
+ "leun",
16999
+ "leuskel",
17000
+ "lew",
17001
+ "lies",
17002
+ "liesañ",
17003
+ "lod",
17004
+ "lusk",
17005
+ "lâr",
17006
+ "lârout",
17007
+ "m:",
17008
+ "ma",
17009
+ "ma'z",
17010
+ "mac'h",
17011
+ "mac'hat",
17012
+ "mac'hañ",
17013
+ "mac'hoc'h",
17014
+ "mad",
17015
+ "maez",
17016
+ "maksimal",
17017
+ "mann",
17018
+ "mar",
17019
+ "mard",
17020
+ "marg",
17021
+ "marzh",
17022
+ "mat",
17023
+ "mañ",
17024
+ "me",
17025
+ "memes",
17026
+ "memestra",
17027
+ "merkapl",
17028
+ "mersi",
17029
+ "mes",
17030
+ "mesk",
17031
+ "met",
17032
+ "meur",
17033
+ "mil",
17034
+ "minimal",
17035
+ "moan",
17036
+ "moaniaat",
17037
+ "mod",
17038
+ "mont",
17039
+ "mout",
17040
+ "mui",
17041
+ "muiañ",
17042
+ "muioc'h",
17043
+ "n",
17044
+ "n'",
17045
+ "n:",
16265
17046
  "na",
16266
- "nao",
16267
- "nas",
16268
- "nem",
16269
- "nesse",
16270
- "neste",
16271
- "nos",
17047
+ "nag",
17048
+ "naontek",
17049
+ "naturel",
17050
+ "nav",
17051
+ "navet",
17052
+ "ne",
17053
+ "nebeudig",
17054
+ "nebeut",
17055
+ "nebeutañ",
17056
+ "nebeutoc'h",
17057
+ "neketa",
17058
+ "nemedoc'h",
17059
+ "nemedomp",
17060
+ "nemedon",
17061
+ "nemedor",
17062
+ "nemedout",
17063
+ "nemet",
17064
+ "nemetañ",
17065
+ "nemete",
17066
+ "nemeti",
17067
+ "nemeto",
17068
+ "nemeur",
17069
+ "neoac'h",
17070
+ "nepell",
17071
+ "nerzh",
17072
+ "nes",
17073
+ "neseser",
17074
+ "netra",
17075
+ "neubeudoù",
17076
+ "neuhe",
17077
+ "neuze",
17078
+ "nevez",
17079
+ "newazh",
17080
+ "nez",
17081
+ "ni",
17082
+ "nikun",
17083
+ "niverus",
17084
+ "nul",
16272
17085
  "o",
16273
- "os",
16274
- "ou",
16275
- "outra",
16276
- "outras",
16277
- "outro",
16278
- "outros",
16279
- "pelas",
16280
- "pelo",
16281
- "pelos",
16282
- "perante",
16283
- "pois",
16284
- "por",
16285
- "porque",
16286
- "portanto",
16287
- "propios",
16288
- "proprio",
16289
- "quais",
16290
- "qual",
16291
- "qualquer",
16292
- "quando",
16293
- "quanto",
16294
- "que",
16295
- "quem",
16296
- "quer",
17086
+ "o:",
17087
+ "oa",
17088
+ "oac'h",
17089
+ "oad",
17090
+ "oamp",
17091
+ "oan",
17092
+ "oant",
17093
+ "oar",
17094
+ "oas",
17095
+ "ober",
17096
+ "oc'h",
17097
+ "oc'ho",
17098
+ "oc'hola",
17099
+ "oc'hpenn",
17100
+ "oh",
17101
+ "ohe",
17102
+ "ollé",
17103
+ "olole",
17104
+ "olé",
17105
+ "omp",
17106
+ "on",
17107
+ "ordin",
17108
+ "ordinal",
17109
+ "ouejoc'h",
17110
+ "ouejod",
17111
+ "ouejomp",
17112
+ "ouejont",
17113
+ "ouejout",
17114
+ "ouek",
17115
+ "ouezas",
17116
+ "ouezi",
17117
+ "ouezimp",
17118
+ "ouezin",
17119
+ "ouezint",
17120
+ "ouezis",
17121
+ "ouezo",
17122
+ "ouezoc'h",
17123
+ "ouezor",
17124
+ "ouf",
17125
+ "oufe",
17126
+ "oufec'h",
17127
+ "oufed",
17128
+ "oufemp",
17129
+ "oufen",
17130
+ "oufent",
17131
+ "oufes",
17132
+ "ouie",
17133
+ "ouiec'h",
17134
+ "ouied",
17135
+ "ouiemp",
17136
+ "ouien",
17137
+ "ouient",
17138
+ "ouies",
17139
+ "ouije",
17140
+ "ouijec'h",
17141
+ "ouijed",
17142
+ "ouijemp",
17143
+ "ouijen",
17144
+ "ouijent",
17145
+ "ouijes",
17146
+ "out",
17147
+ "outañ",
17148
+ "outi",
17149
+ "outo",
17150
+ "ouzer",
17151
+ "ouzh",
17152
+ "ouzhin",
17153
+ "ouzhit",
17154
+ "ouzhoc'h",
17155
+ "ouzhomp",
17156
+ "ouzhor",
17157
+ "ouzhpenn",
17158
+ "ouzhpennik",
17159
+ "ouzoc'h",
17160
+ "ouzomp",
17161
+ "ouzon",
17162
+ "ouzont",
17163
+ "ouzout",
17164
+ "p'",
17165
+ "p:",
17166
+ "pa",
17167
+ "pad",
17168
+ "padal",
17169
+ "paf",
17170
+ "pan",
17171
+ "panevedeoc'h",
17172
+ "panevedo",
17173
+ "panevedomp",
17174
+ "panevedon",
17175
+ "panevedout",
17176
+ "panevet",
17177
+ "panevetañ",
17178
+ "paneveti",
17179
+ "pas",
17180
+ "paseet",
17181
+ "pe",
17182
+ "peadra",
17183
+ "peder",
17184
+ "pedervet",
17185
+ "pedervetvet",
17186
+ "pefe",
17187
+ "pegeit",
17188
+ "pegement",
17189
+ "pegen",
17190
+ "pegiz",
17191
+ "pegoulz",
17192
+ "pehini",
17193
+ "pelec'h",
17194
+ "pell",
17195
+ "pemod",
17196
+ "pemp",
17197
+ "pempved",
17198
+ "pemzek",
17199
+ "penaos",
17200
+ "penn",
17201
+ "peogwir",
17202
+ "peotramant",
17203
+ "pep",
17204
+ "perak",
17205
+ "perc'hennañ",
17206
+ "pergen",
17207
+ "permetiñ",
17208
+ "peseurt",
17209
+ "pet",
17210
+ "petiaoul",
17211
+ "petoare",
17212
+ "petra",
17213
+ "peur",
17214
+ "peurgetket",
17215
+ "peurheñvel",
17216
+ "peurliesañ",
17217
+ "peurvuiañ",
17218
+ "peus",
17219
+ "peustost",
17220
+ "peuz",
17221
+ "pevar",
17222
+ "pevare",
17223
+ "pevarevet",
17224
+ "pevarzek",
17225
+ "pez",
17226
+ "peze",
17227
+ "pezh",
17228
+ "pff",
17229
+ "pfft",
17230
+ "pfut",
17231
+ "picher",
17232
+ "pif",
17233
+ "pife",
17234
+ "pign",
17235
+ "pije",
17236
+ "pikol",
17237
+ "pitiaoul",
17238
+ "piv",
17239
+ "plaouf",
17240
+ "plok",
17241
+ "plouf",
17242
+ "po",
17243
+ "poa",
17244
+ "poelladus",
17245
+ "pof",
17246
+ "pok",
17247
+ "posupl",
17248
+ "pouah",
17249
+ "pourc'henn",
17250
+ "prest",
17251
+ "prestik",
17252
+ "prim",
17253
+ "prin",
17254
+ "provostapl",
17255
+ "pst",
17256
+ "pu",
17257
+ "pur",
17258
+ "r:",
17259
+ "ra",
17260
+ "rae",
17261
+ "raec'h",
17262
+ "raed",
17263
+ "raemp",
17264
+ "raen",
17265
+ "raent",
17266
+ "raes",
17267
+ "rafe",
17268
+ "rafec'h",
17269
+ "rafed",
17270
+ "rafemp",
17271
+ "rafen",
17272
+ "rafent",
17273
+ "rafes",
17274
+ "rag",
17275
+ "raimp",
17276
+ "raint",
17277
+ "raio",
17278
+ "raje",
17279
+ "rajec'h",
17280
+ "rajed",
17281
+ "rajemp",
17282
+ "rajen",
17283
+ "rajent",
17284
+ "rajes",
17285
+ "rak",
17286
+ "ral",
17287
+ "ran",
17288
+ "rankout",
17289
+ "raok",
17290
+ "razh",
17291
+ "re",
17292
+ "reas",
17293
+ "reer",
17294
+ "regennoù",
17295
+ "reiñ",
17296
+ "rejoc'h",
17297
+ "rejod",
17298
+ "rejomp",
17299
+ "rejont",
17300
+ "rejout",
17301
+ "rener",
17302
+ "rentañ",
17303
+ "reoc'h",
17304
+ "reomp",
17305
+ "reont",
17306
+ "reor",
17307
+ "reot",
17308
+ "resis",
17309
+ "ret",
17310
+ "reve",
17311
+ "rez",
17312
+ "ri",
17313
+ "rik",
17314
+ "rin",
17315
+ "ris",
17316
+ "rit",
17317
+ "rouez",
17318
+ "s:",
17319
+ "sac'h",
17320
+ "sant",
17321
+ "sav",
17322
+ "sañset",
16297
17323
  "se",
16298
- "seja",
16299
- "sem",
16300
- "sendo",
16301
- "seu",
16302
- "seus",
16303
- "sob",
16304
- "sobre",
16305
- "sua",
16306
- "suas",
17324
+ "sed",
17325
+ "seitek",
17326
+ "seizh",
17327
+ "seizhvet",
17328
+ "sell",
17329
+ "sellit",
17330
+ "ser",
17331
+ "setu",
17332
+ "seul",
17333
+ "seurt",
17334
+ "siwazh",
17335
+ "skignañ",
17336
+ "skoaz",
17337
+ "skouer",
17338
+ "sort",
17339
+ "souden",
17340
+ "souvitañ",
17341
+ "soñj",
17342
+ "speriañ",
17343
+ "spririñ",
17344
+ "stad",
17345
+ "stlabezañ",
17346
+ "stop",
17347
+ "stranañ",
17348
+ "strewiñ",
17349
+ "strishaat",
17350
+ "stumm",
17351
+ "sujed",
17352
+ "surtoud",
17353
+ "t:",
17354
+ "ta",
17355
+ "taer",
17356
+ "tailh",
17357
+ "tak",
16307
17358
  "tal",
16308
- "tambem",
16309
- "teu",
17359
+ "talvoudegezh",
17360
+ "tamm",
17361
+ "tanav",
17362
+ "taol",
17363
+ "te",
17364
+ "techet",
17365
+ "teir",
17366
+ "teirvet",
17367
+ "telt",
17368
+ "teltenn",
16310
17369
  "teus",
16311
- "toda",
16312
- "todas",
16313
- "todo",
16314
- "todos",
16315
- "tua",
16316
- "tuas",
16317
- "tudo",
16318
- "um",
16319
- "uma",
16320
- "umas",
16321
- "uns"
17370
+ "teut",
17371
+ "teuteu",
17372
+ "ti",
17373
+ "tik",
17374
+ "toa",
17375
+ "tok",
17376
+ "tost",
17377
+ "tostig",
17378
+ "toud",
17379
+ "touesk",
17380
+ "touez",
17381
+ "toull",
17382
+ "tra",
17383
+ "trantenn",
17384
+ "traoñ",
17385
+ "trawalc'h",
17386
+ "tre",
17387
+ "trede",
17388
+ "tregont",
17389
+ "tremenet",
17390
+ "tri",
17391
+ "trivet",
17392
+ "triwec'h",
17393
+ "trizek",
17394
+ "tro",
17395
+ "trugarez",
17396
+ "trumm",
17397
+ "tsoin",
17398
+ "tsouin",
17399
+ "tu",
17400
+ "tud",
17401
+ "u:",
17402
+ "ugent",
17403
+ "uhel",
17404
+ "uhelañ",
17405
+ "ul",
17406
+ "un",
17407
+ "unan",
17408
+ "unanez",
17409
+ "unanig",
17410
+ "unnek",
17411
+ "unnekvet",
17412
+ "ur",
17413
+ "urzh",
17414
+ "us",
17415
+ "v:",
17416
+ "va",
17417
+ "vale",
17418
+ "van",
17419
+ "vare",
17420
+ "vat",
17421
+ "vefe",
17422
+ "vefec'h",
17423
+ "vefed",
17424
+ "vefemp",
17425
+ "vefen",
17426
+ "vefent",
17427
+ "vefes",
17428
+ "vesk",
17429
+ "vete",
17430
+ "vez",
17431
+ "vezan",
17432
+ "vezañ",
17433
+ "veze",
17434
+ "vezec'h",
17435
+ "vezed",
17436
+ "vezemp",
17437
+ "vezen",
17438
+ "vezent",
17439
+ "vezer",
17440
+ "vezes",
17441
+ "vezez",
17442
+ "vezit",
17443
+ "vezomp",
17444
+ "vezont",
17445
+ "vi",
17446
+ "vihan",
17447
+ "vihanañ",
17448
+ "vije",
17449
+ "vijec'h",
17450
+ "vijed",
17451
+ "vijemp",
17452
+ "vijen",
17453
+ "vijent",
17454
+ "vijes",
17455
+ "viken",
17456
+ "vimp",
17457
+ "vin",
17458
+ "vint",
17459
+ "vior",
17460
+ "viot",
17461
+ "virviken",
17462
+ "viskoazh",
17463
+ "vlan",
17464
+ "vlaou",
17465
+ "vo",
17466
+ "vod",
17467
+ "voe",
17468
+ "voec'h",
17469
+ "voed",
17470
+ "voemp",
17471
+ "voen",
17472
+ "voent",
17473
+ "voes",
17474
+ "vont",
17475
+ "vostapl",
17476
+ "vrac'h",
17477
+ "vrasañ",
17478
+ "vremañ",
17479
+ "w:",
17480
+ "walc'h",
17481
+ "war",
17482
+ "warnañ",
17483
+ "warni",
17484
+ "warno",
17485
+ "warnoc'h",
17486
+ "warnomp",
17487
+ "warnon",
17488
+ "warnor",
17489
+ "warnout",
17490
+ "wazh",
17491
+ "wech",
17492
+ "wechoù",
17493
+ "well",
17494
+ "y:",
17495
+ "you",
17496
+ "youadenn",
17497
+ "youc'hadenn",
17498
+ "youc'hou",
17499
+ "z:",
17500
+ "za",
17501
+ "zan",
17502
+ "zaw",
17503
+ "zeu",
17504
+ "zi",
17505
+ "ziar",
17506
+ "zigarez",
17507
+ "ziget",
17508
+ "zindan",
17509
+ "zioc'h",
17510
+ "ziouzh",
17511
+ "zirak",
17512
+ "zivout",
17513
+ "ziwar",
17514
+ "ziwezhañ",
17515
+ "zo",
17516
+ "zoken",
17517
+ "zokenoc'h",
17518
+ "zouesk",
17519
+ "zouez",
17520
+ "zro",
17521
+ "zu"
16322
17522
  ];
16323
17523
  const bul = [
16324
17524
  "а",
@@ -27974,22 +29174,32 @@ flowchart TD
27974
29174
  "şöyle"
27975
29175
  ];
27976
29176
  const ukr = [
29177
+ "а",
29178
+ "або",
27977
29179
  "авжеж",
27978
29180
  "адже",
29181
+ "аж",
27979
29182
  "але",
29183
+ "ані",
27980
29184
  "б",
27981
29185
  "без",
29186
+ "би",
29187
+ "бо",
27982
29188
  "був",
27983
29189
  "була",
27984
29190
  "були",
27985
29191
  "було",
27986
29192
  "бути",
27987
29193
  "більш",
29194
+ "в",
27988
29195
  "вам",
29196
+ "вами",
27989
29197
  "вас",
27990
29198
  "весь",
29199
+ "вже",
27991
29200
  "вздовж",
27992
29201
  "ви",
29202
+ "від",
27993
29203
  "вниз",
27994
29204
  "внизу",
27995
29205
  "вона",
@@ -27998,55 +29208,138 @@ flowchart TD
27998
29208
  "все",
27999
29209
  "всередині",
28000
29210
  "всіх",
29211
+ "вся",
28001
29212
  "від",
28002
29213
  "він",
28003
29214
  "да",
28004
29215
  "давай",
28005
29216
  "давати",
28006
29217
  "де",
29218
+ "десь",
28007
29219
  "дещо",
28008
29220
  "для",
28009
29221
  "до",
29222
+ "є",
29223
+ "ж",
29224
+ "же",
28010
29225
  "з",
29226
+ "за",
28011
29227
  "завжди",
28012
29228
  "замість",
29229
+ "зі",
29230
+ "і",
29231
+ "із",
29232
+ "інших",
29233
+ "її",
29234
+ "їй",
29235
+ "їм",
29236
+ "їх",
28013
29237
  "й",
29238
+ "його",
29239
+ "йому",
28014
29240
  "коли",
28015
29241
  "ледве",
29242
+ "лиш",
28016
29243
  "майже",
29244
+ "мене",
29245
+ "мені",
28017
29246
  "ми",
29247
+ "між",
29248
+ "мій",
29249
+ "мною",
29250
+ "мов",
29251
+ "мого",
29252
+ "моєї",
29253
+ "моє",
29254
+ "може",
29255
+ "мої",
29256
+ "моїх",
29257
+ "моя",
29258
+ "на",
29259
+ "над",
28018
29260
  "навколо",
28019
29261
  "навіть",
28020
29262
  "нам",
29263
+ "нами",
29264
+ "нас",
29265
+ "наче",
29266
+ "наш",
29267
+ "не",
29268
+ "нє",
29269
+ "неї",
29270
+ "нема",
29271
+ "немов",
29272
+ "неначе",
29273
+ "нею",
29274
+ "ним",
29275
+ "ними",
29276
+ "них",
29277
+ "ні",
29278
+ "ніби",
29279
+ "ніщо",
29280
+ "нього",
29281
+ "о",
29282
+ "ось",
28021
29283
  "от",
28022
29284
  "отже",
28023
29285
  "отож",
29286
+ "під",
29287
+ "по",
28024
29288
  "поза",
28025
29289
  "про",
28026
29290
  "під",
29291
+ "сам",
29292
+ "сама",
29293
+ "свій",
29294
+ "свої",
29295
+ "своя",
29296
+ "свою",
29297
+ "себе",
29298
+ "собі",
28027
29299
  "та",
29300
+ "там",
28028
29301
  "так",
29302
+ "така",
28029
29303
  "такий",
28030
29304
  "також",
29305
+ "твій",
29306
+ "твого",
29307
+ "твоєї",
29308
+ "твої",
29309
+ "твоя",
28031
29310
  "те",
29311
+ "тебе",
28032
29312
  "ти",
29313
+ "ті",
29314
+ "тільки",
29315
+ "то",
29316
+ "тобі",
29317
+ "тобою",
28033
29318
  "тобто",
29319
+ "тоді",
28034
29320
  "тож",
29321
+ "той",
28035
29322
  "тощо",
29323
+ "тут",
29324
+ "у",
29325
+ "хіба",
29326
+ "хоч",
28036
29327
  "хоча",
28037
29328
  "це",
28038
29329
  "цей",
29330
+ "ці",
29331
+ "ця",
28039
29332
  "чи",
28040
29333
  "чого",
29334
+ "ще",
28041
29335
  "що",
29336
+ "щоб",
29337
+ "щось",
29338
+ "я",
28042
29339
  "як",
29340
+ "яка",
28043
29341
  "який",
28044
- "якої",
28045
- "є",
28046
- "із",
28047
- "інших",
28048
- "їх",
28049
- "її"
29342
+ "якої"
28050
29343
  ];
28051
29344
  const urd = [
28052
29345
  "آئی",
@@ -29044,7 +30337,14 @@ flowchart TD
29044
30337
  const AUTH_TOKEN_KEY = "tinacms-auth";
29045
30338
  const authenticate = (clientId, frontendUrl) => {
29046
30339
  return new Promise((resolve) => {
29047
- let authTab;
30340
+ const origin = `${window.location.protocol}//${window.location.host}`;
30341
+ const authTab = popupWindow(
30342
+ `${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`,
30343
+ "_blank",
30344
+ window,
30345
+ 1e3,
30346
+ 700
30347
+ );
29048
30348
  window.addEventListener("message", function(e) {
29049
30349
  if (e.data.source === TINA_LOGIN_EVENT) {
29050
30350
  if (authTab) {
@@ -29057,14 +30357,6 @@ flowchart TD
29057
30357
  });
29058
30358
  }
29059
30359
  });
29060
- const origin = `${window.location.protocol}//${window.location.host}`;
29061
- authTab = popupWindow(
29062
- `${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`,
29063
- "_blank",
29064
- window,
29065
- 1e3,
29066
- 700
29067
- );
29068
30360
  });
29069
30361
  };
29070
30362
  const DefaultSessionProvider = ({
@@ -29375,6 +30667,7 @@ mutation addPendingDocumentMutation(
29375
30667
  setBranch(branchName) {
29376
30668
  var _a, _b, _c, _d;
29377
30669
  const encodedBranch = encodeURIComponent(branchName);
30670
+ document.cookie = `x-branch=${encodedBranch}; path=/; max-age=3600`;
29378
30671
  this.branch = encodedBranch;
29379
30672
  this.assetsApiUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.assetsApiUrlOverride) || "https://assets.tinajs.io";
29380
30673
  this.frontendUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.frontendUrlOverride) || "https://app.tina.io";
@@ -29417,7 +30710,7 @@ mutation addPendingDocumentMutation(
29417
30710
  branch: ${this.branch}.`;
29418
30711
  if (this.branch !== "main") {
29419
30712
  errorMessage = `${errorMessage}
29420
- Note: This error can occur if the branch does not exist on GitHub or on Tina Cloud`;
30713
+ Note: This error can occur if the branch does not exist on GitHub or on TinaCloud`;
29421
30714
  }
29422
30715
  }
29423
30716
  throw new Error(errorMessage);
@@ -29553,7 +30846,7 @@ mutation addPendingDocumentMutation(
29553
30846
  unknownCount++;
29554
30847
  if (unknownCount > 5) {
29555
30848
  throw new Error(
29556
- "AsyncPoller: status unknown for too long, please check indexing progress the Tina Cloud dashboard"
30849
+ "AsyncPoller: status unknown for too long, please check indexing progress the TinaCloud dashboard"
29557
30850
  );
29558
30851
  }
29559
30852
  }
@@ -29770,56 +31063,6 @@ mutation addPendingDocumentMutation(
29770
31063
  !submitting && name
29771
31064
  );
29772
31065
  };
29773
- const TINA_AUTH_CONFIG = "tina_auth_config";
29774
- const useTinaAuthRedirect = () => {
29775
- React.useEffect(() => {
29776
- const urlParams = new URLSearchParams(window.location.search);
29777
- const config = {
29778
- code: urlParams.get("code") || "",
29779
- scope: urlParams.get("scope") || "email",
29780
- state: urlParams.get("state")
29781
- };
29782
- if (!config.code) {
29783
- return;
29784
- }
29785
- localStorage[TINA_AUTH_CONFIG] = JSON.stringify(config);
29786
- }, []);
29787
- };
29788
- const createClient = ({
29789
- clientId,
29790
- isLocalClient = true,
29791
- branch,
29792
- tinaioConfig,
29793
- schema,
29794
- apiUrl,
29795
- tinaGraphQLVersion
29796
- }) => {
29797
- return isLocalClient ? new LocalClient({ customContentApiUrl: apiUrl, schema }) : new Client({
29798
- clientId: clientId || "",
29799
- branch: branch || "main",
29800
- tokenStorage: "LOCAL_STORAGE",
29801
- tinaioConfig,
29802
- schema,
29803
- tinaGraphQLVersion
29804
- });
29805
- };
29806
- function assertShape(value, yupSchema, errorMessage) {
29807
- const shape = yupSchema(yup__namespace);
29808
- try {
29809
- shape.validateSync(value);
29810
- } catch (e) {
29811
- const message = errorMessage || `Failed to assertShape - ${e.message}`;
29812
- throw new Error(message);
29813
- }
29814
- }
29815
- function safeAssertShape(value, yupSchema) {
29816
- try {
29817
- assertShape(value, yupSchema);
29818
- return true;
29819
- } catch (e) {
29820
- return false;
29821
- }
29822
- }
29823
31066
  class TinaAdminApi {
29824
31067
  constructor(cms) {
29825
31068
  var _a, _b, _c, _d;
@@ -30166,6 +31409,56 @@ mutation addPendingDocumentMutation(
30166
31409
  );
30167
31410
  }
30168
31411
  }
31412
+ const createClient = ({
31413
+ clientId,
31414
+ isLocalClient = true,
31415
+ branch,
31416
+ tinaioConfig,
31417
+ schema,
31418
+ apiUrl,
31419
+ tinaGraphQLVersion
31420
+ }) => {
31421
+ return isLocalClient ? new LocalClient({ customContentApiUrl: apiUrl, schema }) : new Client({
31422
+ clientId: clientId || "",
31423
+ branch: branch || "main",
31424
+ tokenStorage: "LOCAL_STORAGE",
31425
+ tinaioConfig,
31426
+ schema,
31427
+ tinaGraphQLVersion
31428
+ });
31429
+ };
31430
+ function assertShape(value, yupSchema, errorMessage) {
31431
+ const shape = yupSchema(yup__namespace);
31432
+ try {
31433
+ shape.validateSync(value);
31434
+ } catch (e) {
31435
+ const message = errorMessage || `Failed to assertShape - ${e.message}`;
31436
+ throw new Error(message);
31437
+ }
31438
+ }
31439
+ function safeAssertShape(value, yupSchema) {
31440
+ try {
31441
+ assertShape(value, yupSchema);
31442
+ return true;
31443
+ } catch (e) {
31444
+ return false;
31445
+ }
31446
+ }
31447
+ const TINA_AUTH_CONFIG = "tina_auth_config";
31448
+ const useTinaAuthRedirect = () => {
31449
+ React.useEffect(() => {
31450
+ const urlParams = new URLSearchParams(window.location.search);
31451
+ const config = {
31452
+ code: urlParams.get("code") || "",
31453
+ scope: urlParams.get("scope") || "email",
31454
+ state: urlParams.get("state")
31455
+ };
31456
+ if (!config.code) {
31457
+ return;
31458
+ }
31459
+ localStorage[TINA_AUTH_CONFIG] = JSON.stringify(config);
31460
+ }, []);
31461
+ };
30169
31462
  function sleep(ms) {
30170
31463
  return new Promise((resolve) => setTimeout(resolve, ms));
30171
31464
  }
@@ -30264,7 +31557,7 @@ mutation addPendingDocumentMutation(
30264
31557
  });
30265
31558
  }
30266
31559
  };
30267
- let modalTitle = "Tina Cloud";
31560
+ let modalTitle = "TinaCloud";
30268
31561
  if (activeModal === "authenticate" && loginStrategy === "Redirect" && !isTinaCloud) {
30269
31562
  modalTitle = "Enter into edit mode";
30270
31563
  } else if (activeModal === "authenticate" && loginStrategy === "UsernamePassword") {
@@ -30280,7 +31573,7 @@ mutation addPendingDocumentMutation(
30280
31573
  ModalBuilder,
30281
31574
  {
30282
31575
  title: modalTitle,
30283
- message: isTinaCloud ? "Your site uses Tina Cloud to track changes. To make edits, you must log in." : "To save edits, enter into edit mode. On save, changes will saved to the local filesystem.",
31576
+ message: isTinaCloud ? "Your site uses TinaCloud to track changes. To make edits, you must log in." : "To save edits, enter into edit mode. On save, changes will saved to the local filesystem.",
30284
31577
  close,
30285
31578
  actions: [
30286
31579
  ...otherModalActions,
@@ -30502,6 +31795,9 @@ mutation addPendingDocumentMutation(
30502
31795
  cms.flags.set("branch-switcher", true);
30503
31796
  client.usingEditorialWorkflow = true;
30504
31797
  client.protectedBranches = project.protectedBranches;
31798
+ if (!project.metadata[currentBranch]) {
31799
+ setCurrentBranch(project.defaultBranch || "main");
31800
+ }
30505
31801
  }
30506
31802
  });
30507
31803
  };
@@ -30514,7 +31810,7 @@ mutation addPendingDocumentMutation(
30514
31810
  }
30515
31811
  });
30516
31812
  return unsubscribe;
30517
- }, [isTinaCloud, cms]);
31813
+ }, [currentBranch, isTinaCloud, cms]);
30518
31814
  return /* @__PURE__ */ React.createElement(SessionProvider, { basePath: "/api/tina/auth" }, /* @__PURE__ */ React.createElement(
30519
31815
  BranchDataProvider,
30520
31816
  {
@@ -31000,6 +32296,14 @@ This will work when developing locally but NOT when deployed to production.
31000
32296
  }
31001
32297
  return client.request(query, { variables });
31002
32298
  };
32299
+ const GetCMS = ({ children }) => {
32300
+ const cms = useCMS$1();
32301
+ try {
32302
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(cms));
32303
+ } catch (e) {
32304
+ return null;
32305
+ }
32306
+ };
31003
32307
  const Layout = ({ children }) => {
31004
32308
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
31005
32309
  "div",
@@ -31211,47 +32515,6 @@ This will work when developing locally but NOT when deployed to production.
31211
32515
  }
31212
32516
  return /* @__PURE__ */ React.createElement("span", { className: "text-base tracking-wide text-gray-500 hover:text-blue-600 flex items-center opacity-90 hover:opacity-100" }, /* @__PURE__ */ React.createElement(config.Icon, { className: "mr-2 h-6 opacity-80 w-auto" }), /* @__PURE__ */ React.createElement("a", { target: "_blank", href: config.link.href }, config.link.text));
31213
32517
  };
31214
- const GetCMS = ({ children }) => {
31215
- try {
31216
- const cms = useCMS$1();
31217
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(cms));
31218
- } catch (e) {
31219
- return null;
31220
- }
31221
- };
31222
- const PageWrapper = ({ children }) => {
31223
- var _a, _b;
31224
- const cms = useCMS$1();
31225
- const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
31226
- const [branchingEnabled, setBranchingEnabled] = React.useState(
31227
- () => cms.flags.get("branch-switcher")
31228
- );
31229
- React.useEffect(() => {
31230
- cms.events.subscribe("flag:set", ({ key, value }) => {
31231
- if (key === "branch-switcher") {
31232
- setBranchingEnabled(value);
31233
- }
31234
- });
31235
- }, [cms.events]);
31236
- return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 shadow-2xl overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, branchingEnabled && !isLocalMode && /* @__PURE__ */ React.createElement(BranchBanner, null), children);
31237
- };
31238
- const PageHeader = ({
31239
- isLocalMode,
31240
- children
31241
- }) => {
31242
- return /* @__PURE__ */ React.createElement(React.Fragment, null, isLocalMode && /* @__PURE__ */ React.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
31243
- };
31244
- const PageBody = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
31245
- const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
31246
- const DashboardPage = () => {
31247
- return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
31248
- var _a, _b;
31249
- return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PageHeader, { isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode }, /* @__PURE__ */ React.createElement("h3", { className: "text-2xl font-sans text-gray-700" }, "Welcome to Tina!")), /* @__PURE__ */ React.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
31250
- });
31251
- };
31252
- function RiHome2Line(props) {
31253
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M19 21H5C4.44772 21 4 20.5523 4 20V11L1 11L11.3273 1.6115C11.7087 1.26475 12.2913 1.26475 12.6727 1.6115L23 11L20 11V20C20 20.5523 19.5523 21 19 21ZM6 19H18V9.15745L12 3.7029L6 9.15745V19Z" }, "child": [] }] })(props);
31254
- }
31255
32518
  const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
31256
32519
  "div",
31257
32520
  {
@@ -31361,203 +32624,33 @@ This will work when developing locally but NOT when deployed to production.
31361
32624
  )
31362
32625
  )
31363
32626
  ));
31364
- const FullscreenError = ({
31365
- title = "Error",
31366
- errorMessage = "It looks like something went wrong."
31367
- }) => {
31368
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center items-center h-screen bg-gray-100" }, /* @__PURE__ */ React.createElement("div", { className: "text-red-500 text-4xl mb-6 flex items-center" }, /* @__PURE__ */ React.createElement(BiError, { className: "w-12 h-auto fill-current text-red-400 opacity-70 mr-1" }), " ", title), /* @__PURE__ */ React.createElement("p", { className: "text-gray-700 text-xl mb-8" }, errorMessage), /* @__PURE__ */ React.createElement(Button$1, { variant: "danger", onClick: () => window.location.reload() }, /* @__PURE__ */ React.createElement(BiSync, { className: "w-7 h-auto fill-current opacity-70 mr-1" }), " Reload"));
31369
- };
31370
- const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
31371
- const api = new TinaAdminApi(cms);
31372
- const schema = cms.api.tina.schema;
31373
- const collectionExtra = schema.getCollection(collectionName);
31374
- const [collection, setCollection] = React.useState(void 0);
31375
- const [loading, setLoading] = React.useState(true);
31376
- const [error, setError] = React.useState(void 0);
31377
- const [resetState, setResetSate] = React.useState(0);
31378
- React.useEffect(() => {
31379
- let cancelled = false;
31380
- const fetchCollection = async () => {
31381
- var _a;
31382
- if (await api.isAuthenticated() && !folder.loading && !cancelled) {
31383
- const { name, order } = JSON.parse(sortKey || "{}");
31384
- const validSortKey = ((_a = collectionExtra.fields) == null ? void 0 : _a.map((x) => x.name).includes(name)) ? name : void 0;
31385
- try {
31386
- const collection2 = await api.fetchCollection(
31387
- collectionName,
31388
- includeDocuments,
31389
- (filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
31390
- after,
31391
- validSortKey,
31392
- order,
31393
- filterArgs
31394
- );
31395
- setCollection(collection2);
31396
- } catch (error2) {
31397
- cms.alerts.error(
31398
- `[${error2.name}] GetCollection failed: ${error2.message}`
31399
- );
31400
- console.error(error2);
31401
- setCollection(void 0);
31402
- setError(error2);
31403
- }
31404
- setLoading(false);
31405
- }
31406
- };
31407
- if (cancelled)
31408
- return;
31409
- setLoading(true);
31410
- fetchCollection();
31411
- return () => {
31412
- cancelled = true;
31413
- };
31414
- }, [
31415
- cms,
31416
- collectionName,
31417
- folder.loading,
31418
- folder.fullyQualifiedName,
31419
- resetState,
31420
- after,
31421
- sortKey
31422
- ]);
31423
- const reFetchCollection = () => setResetSate((x) => x + 1);
31424
- return { collection, loading, error, reFetchCollection, collectionExtra };
31425
- };
31426
- const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
31427
- const api = new TinaAdminApi(cms);
31428
- const schema = cms.api.tina.schema;
31429
- const collectionExtra = schema.getCollection(collectionName);
31430
- const [collection, setCollection] = React.useState(void 0);
31431
- const [loading, setLoading] = React.useState(true);
31432
- const [error, setError] = React.useState(void 0);
31433
- const [resetState, setResetSate] = React.useState(0);
32627
+ function RiHome2Line(props) {
32628
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M19 21H5C4.44772 21 4 20.5523 4 20V11L1 11L11.3273 1.6115C11.7087 1.26475 12.2913 1.26475 12.6727 1.6115L23 11L20 11V20C20 20.5523 19.5523 21 19 21ZM6 19H18V9.15745L12 3.7029L6 9.15745V19Z" }, "child": [] }] })(props);
32629
+ }
32630
+ const PageWrapper = ({ children }) => {
32631
+ var _a, _b;
32632
+ const cms = useCMS$1();
32633
+ const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
32634
+ const [branchingEnabled, setBranchingEnabled] = React.useState(
32635
+ () => cms.flags.get("branch-switcher")
32636
+ );
31434
32637
  React.useEffect(() => {
31435
- let cancelled = false;
31436
- const searchCollection = async () => {
31437
- if (await api.isAuthenticated() && !folder.loading && !cancelled) {
31438
- try {
31439
- const response = await cms.api.search.query(
31440
- `${search} AND _collection:${collectionName}`,
31441
- {
31442
- limit: 15,
31443
- cursor: after
31444
- }
31445
- );
31446
- const docs = await Promise.allSettled(
31447
- response.results.map((result) => {
31448
- const [collection2, relativePath2] = result._id.split(":");
31449
- return api.fetchDocument(collection2, relativePath2, false);
31450
- })
31451
- );
31452
- const edges = docs.filter((p) => {
31453
- var _a;
31454
- return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
31455
- }).map((result) => ({ node: result.value.document }));
31456
- const c = await api.fetchCollection(collectionName, false, "");
31457
- setCollection({
31458
- format: collection.format,
31459
- label: collection.label,
31460
- name: collectionName,
31461
- templates: collection.templates,
31462
- documents: {
31463
- pageInfo: {
31464
- hasNextPage: !!response.nextCursor,
31465
- hasPreviousPage: !!response.prevCursor,
31466
- startCursor: "",
31467
- endCursor: response.nextCursor || ""
31468
- },
31469
- edges
31470
- }
31471
- });
31472
- } catch (error2) {
31473
- cms.alerts.error(
31474
- `[${error2.name}] GetCollection failed: ${error2.message}`
31475
- );
31476
- console.error(error2);
31477
- setCollection(void 0);
31478
- setError(error2);
31479
- }
31480
- setLoading(false);
32638
+ cms.events.subscribe("flag:set", ({ key, value }) => {
32639
+ if (key === "branch-switcher") {
32640
+ setBranchingEnabled(value);
31481
32641
  }
31482
- };
31483
- if (cancelled)
31484
- return;
31485
- setLoading(true);
31486
- searchCollection();
31487
- return () => {
31488
- cancelled = true;
31489
- };
31490
- }, [
31491
- cms,
31492
- collectionName,
31493
- folder.loading,
31494
- folder.fullyQualifiedName,
31495
- resetState,
31496
- after,
31497
- search
31498
- ]);
31499
- const reFetchCollection = () => setResetSate((x) => x + 1);
31500
- return { collection, loading, error, reFetchCollection, collectionExtra };
32642
+ });
32643
+ }, [cms.events]);
32644
+ return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 shadow-2xl overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, branchingEnabled && !isLocalMode && /* @__PURE__ */ React.createElement(BranchBanner, null), children);
31501
32645
  };
31502
- const GetCollection = ({
31503
- cms,
31504
- collectionName,
31505
- folder,
31506
- includeDocuments = true,
31507
- startCursor,
31508
- sortKey,
31509
- children,
31510
- filterArgs,
31511
- search
32646
+ const PageHeader = ({
32647
+ isLocalMode,
32648
+ children
31512
32649
  }) => {
31513
- const navigate = reactRouterDom.useNavigate();
31514
- const { collection, loading, error, reFetchCollection, collectionExtra } = search ? useSearchCollection(
31515
- cms,
31516
- collectionName,
31517
- includeDocuments,
31518
- folder,
31519
- startCursor || "",
31520
- search
31521
- ) : useGetCollection(
31522
- cms,
31523
- collectionName,
31524
- includeDocuments,
31525
- folder,
31526
- startCursor || "",
31527
- sortKey,
31528
- filterArgs
31529
- ) || {};
31530
- React.useEffect(() => {
31531
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
31532
- if (loading)
31533
- return;
31534
- const collectionDefinition = cms.api.tina.schema.getCollection(
31535
- collection.name
31536
- );
31537
- const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
31538
- const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
31539
- const collectionResponse = collection;
31540
- if (!allowCreate && !allowDelete && // Check there is only one document
31541
- ((_f = (_e = collectionResponse.documents) == null ? void 0 : _e.edges) == null ? void 0 : _f.length) === 1 && // Check to make sure the file is not a folder
31542
- ((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
31543
- const doc = collectionResponse.documents.edges[0].node;
31544
- handleNavigate(
31545
- navigate,
31546
- cms,
31547
- collectionResponse,
31548
- collectionDefinition,
31549
- doc
31550
- );
31551
- }
31552
- }, [(collection == null ? void 0 : collection.name) || "", loading]);
31553
- if (error) {
31554
- return /* @__PURE__ */ React.createElement(FullscreenError, null);
31555
- }
31556
- if (loading) {
31557
- return /* @__PURE__ */ React.createElement(LoadingPage, null);
31558
- }
31559
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
32650
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, isLocalMode && /* @__PURE__ */ React.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
31560
32651
  };
32652
+ const PageBody = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
32653
+ const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
31561
32654
  const folderRegex = /^.*\/~\/*(.*)$/;
31562
32655
  const parentFolder = (folder) => {
31563
32656
  return {
@@ -31677,6 +32770,7 @@ This will work when developing locally but NOT when deployed to production.
31677
32770
  const [vars, setVars] = React.useState({
31678
32771
  collection: collectionName,
31679
32772
  relativePath: "",
32773
+ relativePathWithoutExtension: "",
31680
32774
  newRelativePath: "",
31681
32775
  filterField: "",
31682
32776
  folderName: "",
@@ -31718,6 +32812,7 @@ This will work when developing locally but NOT when deployed to production.
31718
32812
  ...old,
31719
32813
  collection: collectionName,
31720
32814
  relativePath: "",
32815
+ relativePathWithoutExtension: "",
31721
32816
  newRelativePath: "",
31722
32817
  filterField: "",
31723
32818
  startsWith: "",
@@ -31743,6 +32838,7 @@ This will work when developing locally but NOT when deployed to production.
31743
32838
  collectionName === vars.collection ? vars : {
31744
32839
  collection: collectionName,
31745
32840
  relativePath: "",
32841
+ relativePathWithoutExtension: "",
31746
32842
  newRelativePath: "",
31747
32843
  filterField: "",
31748
32844
  startsWith: "",
@@ -31830,7 +32926,9 @@ This will work when developing locally but NOT when deployed to production.
31830
32926
  safeSubmit: async () => {
31831
32927
  try {
31832
32928
  await admin.deleteDocument(vars);
31833
- cms.alerts.info("Document was successfully deleted");
32929
+ cms.alerts.info(
32930
+ "Document was successfully deleted"
32931
+ );
31834
32932
  reFetchCollection();
31835
32933
  } catch (error) {
31836
32934
  cms.alerts.warn(
@@ -31844,7 +32942,7 @@ This will work when developing locally but NOT when deployed to production.
31844
32942
  ), renameModalOpen && /* @__PURE__ */ React.createElement(
31845
32943
  RenameModal,
31846
32944
  {
31847
- filename: vars.relativePath,
32945
+ filename: vars.relativePathWithoutExtension,
31848
32946
  newRelativePath: vars.newRelativePath,
31849
32947
  setNewRelativePath: (newRelativePath) => {
31850
32948
  setVars((vars2) => {
@@ -31859,7 +32957,9 @@ This will work when developing locally but NOT when deployed to production.
31859
32957
  relativePath: vars.relativePath,
31860
32958
  newRelativePath
31861
32959
  });
31862
- cms.alerts.info("Document was successfully renamed");
32960
+ cms.alerts.info(
32961
+ "Document was successfully renamed"
32962
+ );
31863
32963
  reFetchCollection();
31864
32964
  } catch (error) {
31865
32965
  if (error.message.indexOf("has references")) {
@@ -31959,7 +33059,9 @@ This will work when developing locally but NOT when deployed to production.
31959
33059
  name: "sort",
31960
33060
  value: sortKey,
31961
33061
  onChange: (e) => {
31962
- const val = JSON.parse(e.target.value);
33062
+ const val = JSON.parse(
33063
+ e.target.value
33064
+ );
31963
33065
  setEndCursor("");
31964
33066
  setPrevCursors([]);
31965
33067
  window == null ? void 0 : window.localStorage.setItem(
@@ -32165,6 +33267,9 @@ This will work when developing locally but NOT when deployed to production.
32165
33267
  setVars((old) => ({
32166
33268
  ...old,
32167
33269
  collection: collectionName,
33270
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
33271
+ "/"
33272
+ ),
32168
33273
  relativePath: document2.node._sys.breadcrumbs.join(
32169
33274
  "/"
32170
33275
  ) + document2.node._sys.extension,
@@ -32187,6 +33292,9 @@ This will work when developing locally but NOT when deployed to production.
32187
33292
  setVars((old) => ({
32188
33293
  ...old,
32189
33294
  collection: collectionName,
33295
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
33296
+ "/"
33297
+ ),
32190
33298
  relativePath: document2.node._sys.breadcrumbs.join(
32191
33299
  "/"
32192
33300
  ) + document2.node._sys.extension,
@@ -32399,7 +33507,7 @@ This will work when developing locally but NOT when deployed to production.
32399
33507
  newRelativePath,
32400
33508
  setNewRelativePath
32401
33509
  }) => {
32402
- return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Rename ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "mb-4" }, "Are you sure you want to rename ", /* @__PURE__ */ React.createElement("strong", null, filename), "? TinaCMS uses the filename as the ID; renaming this file could result in unresolved references."), /* @__PURE__ */ React.createElement(
33510
+ return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Rename ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "mb-4" }, "Are you sure you want to rename ", /* @__PURE__ */ React.createElement("strong", null, filename), "?"), /* @__PURE__ */ React.createElement(
32403
33511
  BaseTextField,
32404
33512
  {
32405
33513
  placeholder: "Enter a new name for the document's file",
@@ -32414,11 +33522,243 @@ This will work when developing locally but NOT when deployed to production.
32414
33522
  onClick: async () => {
32415
33523
  await renameFunc();
32416
33524
  close2();
32417
- }
33525
+ },
33526
+ disabled: !newRelativePath || newRelativePath === filename
32418
33527
  },
32419
33528
  "Rename"
32420
33529
  ))));
32421
33530
  };
33531
+ const FullscreenError = ({
33532
+ title = "Error",
33533
+ errorMessage = "It looks like something went wrong."
33534
+ }) => {
33535
+ return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center items-center h-screen bg-gray-100" }, /* @__PURE__ */ React.createElement("div", { className: "text-red-500 text-4xl mb-6 flex items-center" }, /* @__PURE__ */ React.createElement(BiError, { className: "w-12 h-auto fill-current text-red-400 opacity-70 mr-1" }), " ", title), /* @__PURE__ */ React.createElement("p", { className: "text-gray-700 text-xl mb-8" }, errorMessage), /* @__PURE__ */ React.createElement(Button$1, { variant: "danger", onClick: () => window.location.reload() }, /* @__PURE__ */ React.createElement(BiSync, { className: "w-7 h-auto fill-current opacity-70 mr-1" }), " Reload"));
33536
+ };
33537
+ const isValidSortKey = (sortKey, collection) => {
33538
+ if (collection.fields) {
33539
+ const sortKeys = collection.fields.map((x) => x.name);
33540
+ return sortKeys.includes(sortKey);
33541
+ } else if (collection.templates) {
33542
+ const collectionMap = {};
33543
+ const conflictedFields = /* @__PURE__ */ new Set();
33544
+ for (const template of collection.templates) {
33545
+ for (const field of template.fields) {
33546
+ if (collectionMap[field.name]) {
33547
+ if (collectionMap[field.name].type !== field.type) {
33548
+ conflictedFields.add(field.name);
33549
+ }
33550
+ } else {
33551
+ collectionMap[field.name] = field;
33552
+ }
33553
+ }
33554
+ }
33555
+ for (const key in conflictedFields) {
33556
+ delete collectionMap[key];
33557
+ }
33558
+ for (const key in collectionMap) {
33559
+ if (key === sortKey) {
33560
+ return true;
33561
+ }
33562
+ }
33563
+ return false;
33564
+ }
33565
+ };
33566
+ const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
33567
+ const api = new TinaAdminApi(cms);
33568
+ const schema = cms.api.tina.schema;
33569
+ const collectionExtra = schema.getCollection(collectionName);
33570
+ const [collection, setCollection] = React.useState(void 0);
33571
+ const [loading, setLoading] = React.useState(true);
33572
+ const [error, setError] = React.useState(void 0);
33573
+ const [resetState, setResetSate] = React.useState(0);
33574
+ React.useEffect(() => {
33575
+ let cancelled = false;
33576
+ const fetchCollection = async () => {
33577
+ if (await api.isAuthenticated() && !folder.loading && !cancelled) {
33578
+ const { name, order } = JSON.parse(sortKey || "{}");
33579
+ const validSortKey = isValidSortKey(name, collectionExtra) ? name : void 0;
33580
+ try {
33581
+ const collection2 = await api.fetchCollection(
33582
+ collectionName,
33583
+ includeDocuments,
33584
+ (filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
33585
+ after,
33586
+ validSortKey,
33587
+ order,
33588
+ filterArgs
33589
+ );
33590
+ setCollection(collection2);
33591
+ } catch (error2) {
33592
+ cms.alerts.error(
33593
+ `[${error2.name}] GetCollection failed: ${error2.message}`
33594
+ );
33595
+ console.error(error2);
33596
+ setCollection(void 0);
33597
+ setError(error2);
33598
+ }
33599
+ setLoading(false);
33600
+ }
33601
+ };
33602
+ if (cancelled)
33603
+ return;
33604
+ setLoading(true);
33605
+ fetchCollection();
33606
+ return () => {
33607
+ cancelled = true;
33608
+ };
33609
+ }, [
33610
+ cms,
33611
+ collectionName,
33612
+ folder.loading,
33613
+ folder.fullyQualifiedName,
33614
+ resetState,
33615
+ after,
33616
+ sortKey
33617
+ ]);
33618
+ const reFetchCollection = () => setResetSate((x) => x + 1);
33619
+ return { collection, loading, error, reFetchCollection, collectionExtra };
33620
+ };
33621
+ const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
33622
+ const api = new TinaAdminApi(cms);
33623
+ const schema = cms.api.tina.schema;
33624
+ const collectionExtra = schema.getCollection(collectionName);
33625
+ const [collection, setCollection] = React.useState(void 0);
33626
+ const [loading, setLoading] = React.useState(true);
33627
+ const [error, setError] = React.useState(void 0);
33628
+ const [resetState, setResetSate] = React.useState(0);
33629
+ React.useEffect(() => {
33630
+ let cancelled = false;
33631
+ const searchCollection = async () => {
33632
+ if (await api.isAuthenticated() && !folder.loading && !cancelled) {
33633
+ try {
33634
+ const response = await cms.api.search.query(
33635
+ `${search} AND _collection:${collectionName}`,
33636
+ {
33637
+ limit: 15,
33638
+ cursor: after
33639
+ }
33640
+ );
33641
+ const docs = await Promise.allSettled(
33642
+ response.results.map((result) => {
33643
+ const [collection2, relativePath2] = result._id.split(":");
33644
+ return api.fetchDocument(collection2, relativePath2, false);
33645
+ })
33646
+ );
33647
+ const edges = docs.filter((p) => {
33648
+ var _a;
33649
+ return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
33650
+ }).map((result) => ({ node: result.value.document }));
33651
+ const c = await api.fetchCollection(collectionName, false, "");
33652
+ setCollection({
33653
+ format: collection.format,
33654
+ label: collection.label,
33655
+ name: collectionName,
33656
+ templates: collection.templates,
33657
+ documents: {
33658
+ pageInfo: {
33659
+ hasNextPage: !!response.nextCursor,
33660
+ hasPreviousPage: !!response.prevCursor,
33661
+ startCursor: "",
33662
+ endCursor: response.nextCursor || ""
33663
+ },
33664
+ edges
33665
+ }
33666
+ });
33667
+ } catch (error2) {
33668
+ cms.alerts.error(
33669
+ `[${error2.name}] GetCollection failed: ${error2.message}`
33670
+ );
33671
+ console.error(error2);
33672
+ setCollection(void 0);
33673
+ setError(error2);
33674
+ }
33675
+ setLoading(false);
33676
+ }
33677
+ };
33678
+ if (cancelled)
33679
+ return;
33680
+ setLoading(true);
33681
+ searchCollection();
33682
+ return () => {
33683
+ cancelled = true;
33684
+ };
33685
+ }, [
33686
+ cms,
33687
+ collectionName,
33688
+ folder.loading,
33689
+ folder.fullyQualifiedName,
33690
+ resetState,
33691
+ after,
33692
+ search
33693
+ ]);
33694
+ const reFetchCollection = () => setResetSate((x) => x + 1);
33695
+ return { collection, loading, error, reFetchCollection, collectionExtra };
33696
+ };
33697
+ const GetCollection = ({
33698
+ cms,
33699
+ collectionName,
33700
+ folder,
33701
+ includeDocuments = true,
33702
+ startCursor,
33703
+ sortKey,
33704
+ children,
33705
+ filterArgs,
33706
+ search
33707
+ }) => {
33708
+ const navigate = reactRouterDom.useNavigate();
33709
+ const { collection, loading, error, reFetchCollection, collectionExtra } = search ? (
33710
+ // biome-ignore lint/correctness/useHookAtTopLevel: not ready to fix these yet
33711
+ useSearchCollection(
33712
+ cms,
33713
+ collectionName,
33714
+ includeDocuments,
33715
+ folder,
33716
+ startCursor || "",
33717
+ search
33718
+ )
33719
+ ) : (
33720
+ // biome-ignore lint/correctness/useHookAtTopLevel: not ready to fix these yet
33721
+ useGetCollection(
33722
+ cms,
33723
+ collectionName,
33724
+ includeDocuments,
33725
+ folder,
33726
+ startCursor || "",
33727
+ sortKey,
33728
+ filterArgs
33729
+ ) || {}
33730
+ );
33731
+ React.useEffect(() => {
33732
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
33733
+ if (loading)
33734
+ return;
33735
+ const collectionDefinition = cms.api.tina.schema.getCollection(
33736
+ collection.name
33737
+ );
33738
+ const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
33739
+ const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
33740
+ const collectionResponse = collection;
33741
+ if (!allowCreate && !allowDelete && // Check there is only one document
33742
+ ((_f = (_e = collectionResponse.documents) == null ? void 0 : _e.edges) == null ? void 0 : _f.length) === 1 && // Check to make sure the file is not a folder
33743
+ ((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
33744
+ const doc = collectionResponse.documents.edges[0].node;
33745
+ handleNavigate(
33746
+ navigate,
33747
+ cms,
33748
+ collectionResponse,
33749
+ collectionDefinition,
33750
+ doc
33751
+ );
33752
+ }
33753
+ }, [(collection == null ? void 0 : collection.name) || "", loading]);
33754
+ if (error) {
33755
+ return /* @__PURE__ */ React.createElement(FullscreenError, null);
33756
+ }
33757
+ if (loading) {
33758
+ return /* @__PURE__ */ React.createElement(LoadingPage, null);
33759
+ }
33760
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
33761
+ };
32422
33762
  const ErrorDialog = (props) => {
32423
33763
  return /* @__PURE__ */ React.createElement(
32424
33764
  "div",
@@ -32741,7 +34081,10 @@ This will work when developing locally but NOT when deployed to production.
32741
34081
  const fetchDocument = async () => {
32742
34082
  if (api.isAuthenticated()) {
32743
34083
  try {
32744
- const response = await api.fetchDocument(collectionName, relativePath2);
34084
+ const response = await api.fetchDocument(
34085
+ collectionName,
34086
+ relativePath2
34087
+ );
32745
34088
  setDocument(response.document);
32746
34089
  } catch (error2) {
32747
34090
  cms.alerts.error(
@@ -32959,6 +34302,12 @@ This will work when developing locally but NOT when deployed to production.
32959
34302
  ), /* @__PURE__ */ React.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "flex-1 w-full text-sm leading-tight whitespace-nowrap truncate" }, `${filename}.${collection.format}`), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
32960
34303
  ), activeForm && /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine }));
32961
34304
  };
34305
+ const DashboardPage = () => {
34306
+ return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
34307
+ var _a, _b;
34308
+ return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PageHeader, { isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode }, /* @__PURE__ */ React.createElement("h3", { className: "text-2xl font-sans text-gray-700" }, "Welcome to Tina!")), /* @__PURE__ */ React.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
34309
+ });
34310
+ };
32962
34311
  const ScreenPage = () => {
32963
34312
  const { screenName } = reactRouterDom.useParams();
32964
34313
  return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
@@ -33041,7 +34390,7 @@ This will work when developing locally but NOT when deployed to production.
33041
34390
  } catch {
33042
34391
  cms.alerts.error("Branch indexing failed.");
33043
34392
  setErrorMessage(
33044
- 'Branch indexing failed, please check the Tina Cloud dashboard for more information. To try again chick "re-index" on the branch in the dashboard.'
34393
+ 'Branch indexing failed, please check the TinaCloud dashboard for more information. To try again chick "re-index" on the branch in the dashboard.'
33045
34394
  );
33046
34395
  setState("error");
33047
34396
  }
@@ -33085,15 +34434,24 @@ This will work when developing locally but NOT when deployed to production.
33085
34434
  }
33086
34435
  }
33087
34436
  if (state === "creatingPR") {
33088
- const foo = await tinaApi.createPullRequest({
33089
- baseBranch,
33090
- branch,
33091
- title: `${branch.replace("tina/", "").replace("-", " ")} (PR from TinaCMS)`
33092
- });
33093
- console.log("PR created", foo);
33094
- cms.alerts.success("Pull request created.");
33095
- localStorage.setItem("tina.createBranchState", "done");
33096
- setState("done");
34437
+ try {
34438
+ const foo = await tinaApi.createPullRequest({
34439
+ baseBranch,
34440
+ branch,
34441
+ title: `${branch.replace("tina/", "").replace("-", " ")} (PR from TinaCMS)`
34442
+ });
34443
+ console.log("PR created", foo);
34444
+ cms.alerts.success("Pull request created.");
34445
+ localStorage.setItem("tina.createBranchState", "done");
34446
+ setState("done");
34447
+ } catch (e) {
34448
+ console.error(e);
34449
+ cms.alerts.error("Failed to create PR");
34450
+ setErrorMessage(
34451
+ "Failed to create PR, please try again. If the problem persists please contact support."
34452
+ );
34453
+ setState("error");
34454
+ }
33097
34455
  }
33098
34456
  if (state === "done") {
33099
34457
  window.location.href = back;
@@ -33200,7 +34558,7 @@ This will work when developing locally but NOT when deployed to production.
33200
34558
  );
33201
34559
  }
33202
34560
  }).catch((e) => {
33203
- if (e.message.includes("has not been indexed by Tina Cloud")) {
34561
+ if (e.message.includes("has not been indexed by TinaCloud")) {
33204
34562
  setSchemaMissingError(true);
33205
34563
  } else {
33206
34564
  cms.alerts.error(`Unexpected error checking schema: ${e}`);
@@ -33724,3 +35082,4 @@ This will work when developing locally but NOT when deployed to production.
33724
35082
  exports2.wrapFieldsWithMeta = wrapFieldsWithMeta;
33725
35083
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
33726
35084
  });
35085
+ //# sourceMappingURL=index.js.map