tinacms 0.0.0-ed3db71-20250205054832 → 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 (46) 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 +11 -1
  6. package/dist/client.js.map +1 -0
  7. package/dist/client.mjs +11 -1
  8. package/dist/client.mjs.map +1 -0
  9. package/dist/hooks/create-page-plugin.d.ts +1 -1
  10. package/dist/index.js +2278 -964
  11. package/dist/index.js.map +1 -0
  12. package/dist/index.mjs +2288 -974
  13. package/dist/index.mjs.map +1 -0
  14. package/dist/internalClient/index.d.ts +3 -3
  15. package/dist/node-cache-5e8db9f0.mjs +1 -0
  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/plate/components/plate-ui/indent-list-toolbar-button.d.ts +17 -5
  33. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
  34. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +6 -11
  35. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +1 -1
  36. package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
  37. package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
  38. package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
  39. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +5 -4
  40. package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
  41. package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
  42. package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
  43. package/dist/toolkit/tina-state.d.ts +4 -0
  44. package/dist/unifiedClient/index.d.ts +1 -1
  45. package/package.json +35 -35
  46. package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
package/dist/index.mjs CHANGED
@@ -9,18 +9,18 @@ import * as React from "react";
9
9
  import React__default, { useState, useCallback, useEffect, useRef, createContext, forwardRef, useContext, useMemo, startTransition } from "react";
10
10
  import { createPortal } from "react-dom";
11
11
  import { withRef, cn as cn$1, withVariants, withProps, withCn, createPrimitiveElement } from "@udecode/cn";
12
- import { toggleList, ELEMENT_UL, ELEMENT_OL, ELEMENT_H1 as ELEMENT_H1$1, ELEMENT_H2 as ELEMENT_H2$1, ELEMENT_H3 as ELEMENT_H3$1, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_PARAGRAPH, ELEMENT_BLOCKQUOTE, ELEMENT_CODE_BLOCK, ELEMENT_CODE_LINE, ELEMENT_CODE_SYNTAX, ELEMENT_LI, ELEMENT_LINK, MARK_CODE, MARK_UNDERLINE, MARK_STRIKETHROUGH, MARK_ITALIC, MARK_BOLD, ELEMENT_HR, ELEMENT_TABLE, ELEMENT_TR, ELEMENT_TD, ELEMENT_TH, unwrapList, ELEMENT_TODO_LI, createTrailingBlockPlugin, createAutoformatPlugin, createExitBreakPlugin, KEYS_HEADING, createResetNodePlugin, createHeadingPlugin, createParagraphPlugin, createBlockquotePlugin, createBoldPlugin, createItalicPlugin, createUnderlinePlugin, createCodePlugin, createListPlugin, createIndentListPlugin, createHorizontalRulePlugin, createNodeIdPlugin, createTablePlugin, getListItemEntry, useListToolbarButtonState, useListToolbarButton } from "@udecode/plate";
13
- import { PlateElement, isCollapsed, findNodePath, getPointAfter, insertNodes, ELEMENT_DEFAULT, focusEditor, getPointBefore, setNodes, isElement, PlateLeaf, createPluginFactory, useComposedRef, useEditorRef, createPointRef, insertText, moveSelection, toggleNodeType, useElement, useRemoveNodeButton, useEditorSelector, isSelectionExpanded, withHOC, normalizeEditor, getBlockAbove, queryNode, getParentNode, isType, someNode, isSelectionAtBlockStart, setElements, insertNode, getPluginType, isBlock, isBlockAboveEmpty, findNode, PlateContent, getNodeEntries, useEditorState, collapseSelection, useMarkToolbarButtonState, useMarkToolbarButton, insertEmptyElement, usePlateSelectors, useEventEditorSelectors, PortalBody, useFormInputProps, createPlugins, Plate } from "@udecode/plate-common";
12
+ import { toggleList, ELEMENT_UL, ELEMENT_OL, ELEMENT_H1 as ELEMENT_H1$1, ELEMENT_H2 as ELEMENT_H2$1, ELEMENT_H3 as ELEMENT_H3$1, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_PARAGRAPH, ELEMENT_BLOCKQUOTE, ELEMENT_CODE_BLOCK, ELEMENT_CODE_LINE, ELEMENT_CODE_SYNTAX, ELEMENT_LI, ELEMENT_LINK, MARK_CODE, MARK_UNDERLINE, MARK_STRIKETHROUGH, MARK_ITALIC, MARK_BOLD, ELEMENT_HR, ELEMENT_TABLE, ELEMENT_TR, ELEMENT_TD, ELEMENT_TH, unwrapList, ELEMENT_TODO_LI, createTrailingBlockPlugin, createAutoformatPlugin, createExitBreakPlugin, KEYS_HEADING, createResetNodePlugin, createBasicMarksPlugin, createHeadingPlugin, createParagraphPlugin, createBlockquotePlugin, createUnderlinePlugin, createListPlugin, createIndentListPlugin, createHorizontalRulePlugin, createNodeIdPlugin, createTablePlugin, getListItemEntry, useListToolbarButtonState, useListToolbarButton } from "@udecode/plate";
13
+ import { PlateElement, isCollapsed, findNodePath, getPointAfter, insertNodes, ELEMENT_DEFAULT, focusEditor, getPointBefore, setNodes, isElement, PlateLeaf, createPluginFactory, useComposedRef, useEditorRef, createPointRef, insertText, moveSelection, toggleNodeType, useElement, useRemoveNodeButton, useEditorSelector, isSelectionExpanded, withHOC, normalizeEditor, getBlockAbove, queryNode, getParentNode, isType, someNode, isSelectionAtBlockStart, setElements, insertNode, getPluginType, isBlock, isBlockAboveEmpty, findNode, PlateContent, getNodeEntries, useEditorState, collapseSelection, insertEmptyElement, useMarkToolbarButtonState, useMarkToolbarButton, usePlateSelectors, useEventEditorSelectors, PortalBody, useFormInputProps, createPlugins, Plate } from "@udecode/plate-common";
14
14
  import { ELEMENT_SLASH_INPUT, createSlashPlugin } from "@udecode/plate-slash-command";
15
- import { useSelected, useReadOnly, ReactEditor } from "slate-react";
16
15
  import { useCodeBlockElementState, useCodeSyntaxLeaf, ELEMENT_CODE_BLOCK as ELEMENT_CODE_BLOCK$1 } from "@udecode/plate-code-block";
17
16
  import MonacoEditor, { loader, useMonaco } from "@monaco-editor/react";
18
- import { Combobox, ComboboxInput, ComboboxButton, Transition, ComboboxOptions, ComboboxOption, Popover as Popover$3, PopoverButton, PopoverPanel, TransitionChild, Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItems, MenuItem } from "@headlessui/react";
17
+ import { useSelected, useReadOnly, ReactEditor } from "slate-react";
18
+ import { Combobox as Combobox$1, ComboboxInput, ComboboxButton, Transition, ComboboxOptions, ComboboxOption, Popover as Popover$3, PopoverButton, PopoverPanel, TransitionChild, Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItems, MenuItem } from "@headlessui/react";
19
19
  import { cva } from "class-variance-authority";
20
20
  import { Eye, SquarePen, Plus, AlignCenter as AlignCenter$1, AlignJustify, AlignLeft as AlignLeft$1, AlignRight as AlignRight$1, ChevronDown, PaintBucket, Quote, Check, ChevronRight, ChevronsUpDown, X, FileCode, Baseline, RectangleVertical, Combine, Ungroup, MessageSquare, MessageSquarePlus, Trash, GripVertical, Edit2, Smile, ExternalLink, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Indent, Keyboard, WrapText, Minus, MoreHorizontal, Outdent, Pilcrow, RotateCcw, RectangleHorizontal, Search, Settings, Strikethrough, Subscript, Superscript, Table, Text, Underline, Link2Off, Moon, SunMedium, Twitter } from "lucide-react";
21
21
  import mermaid from "mermaid";
22
22
  import { ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4 as ELEMENT_H4$1, ELEMENT_H5 as ELEMENT_H5$1, ELEMENT_H6 as ELEMENT_H6$1 } from "@udecode/plate-heading";
23
- import { useComboboxContext, Combobox as Combobox$1, useComboboxStore, ComboboxProvider, Portal, ComboboxPopover, ComboboxItem } from "@ariakit/react";
23
+ import { useComboboxContext, Combobox as Combobox$2, useComboboxStore, ComboboxProvider, Portal, ComboboxPopover, ComboboxItem } from "@ariakit/react";
24
24
  import { useHTMLInputCursorState, useComboboxInput, filterWords } from "@udecode/plate-combobox";
25
25
  import { useTableCellElementState, useTableCellElement, useTableCellElementResizableState, useTableCellElementResizable, useTableBordersDropdownMenuContentState, useTableMergeState, TableProvider, useTableElementState, useTableElement, mergeTableCells, unmergeTableCells, ELEMENT_TABLE as ELEMENT_TABLE$1, getTableColumnCount, insertTable, deleteTable, insertTableColumn, deleteColumn, insertTableRow, deleteRow } from "@udecode/plate-table";
26
26
  import { ResizeHandle as ResizeHandle$1 } from "@udecode/plate-resizable";
@@ -43,6 +43,7 @@ import { twMerge } from "tailwind-merge";
43
43
  import { Command as Command$1 } from "cmdk";
44
44
  import { isHotkey } from "is-hotkey";
45
45
  import { Transforms, Element, Range, Path, Node, Editor as Editor$1 } from "slate";
46
+ import { useWindowWidth } from "@react-hook/window-size";
46
47
  import get from "lodash.get";
47
48
  import moment from "moment";
48
49
  import { formatDistanceToNow } from "date-fns";
@@ -52,14 +53,13 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
52
53
  import { ELEMENT_PARAGRAPH as ELEMENT_PARAGRAPH$1 } from "@udecode/plate-paragraph";
53
54
  import { ELEMENT_BLOCKQUOTE as ELEMENT_BLOCKQUOTE$1 } from "@udecode/plate-block-quote";
54
55
  import { useFloatingToolbarState, offset, flip, useFloatingToolbar } from "@udecode/plate-floating";
55
- import { useWindowWidth } from "@react-hook/window-size";
56
56
  import { getIntrospectionQuery, buildClientSchema, print, parse as parse$3, buildSchema } from "graphql";
57
- import gql from "graphql-tag";
58
57
  import { TinaSchema, addNamespaceToSchema, parseURL, resolveForm, normalizePath, validateSchema } from "@tinacms/schema-tools";
59
58
  import { NAMER, resolveField } from "@tinacms/schema-tools";
60
- import * as yup from "yup";
59
+ import gql from "graphql-tag";
61
60
  import { diff } from "@graphql-inspector/core";
62
- import { NavLink, useNavigate, useLocation, useParams, Link, useSearchParams, HashRouter, Routes, Route } from "react-router-dom";
61
+ import * as yup from "yup";
62
+ import { NavLink, useLocation, useNavigate, useParams, Link, useSearchParams, HashRouter, Routes, Route } from "react-router-dom";
63
63
  import { stringifyMDX } from "@tinacms/mdx";
64
64
  const ModalProvider = ({ children }) => {
65
65
  const [modalRootContainerRef, setModalRootContainerRef] = useState(
@@ -992,7 +992,7 @@ const Autocomplete = ({
992
992
  }
993
993
  }, [items2, query]);
994
994
  return /* @__PURE__ */ React__default.createElement(
995
- Combobox,
995
+ Combobox$1,
996
996
  {
997
997
  value,
998
998
  onChange,
@@ -2173,7 +2173,7 @@ const InlineComboboxInput = forwardRef(({ className, ...props }, propRef) => {
2173
2173
  },
2174
2174
  value || "​"
2175
2175
  ), /* @__PURE__ */ React__default.createElement(
2176
- Combobox$1,
2176
+ Combobox$2,
2177
2177
  {
2178
2178
  autoSelect: true,
2179
2179
  className: cn$1(
@@ -2970,7 +2970,7 @@ const Components = () => {
2970
2970
  ),
2971
2971
  [MARK_CODE]: CodeLeaf,
2972
2972
  [MARK_UNDERLINE]: withProps(PlateLeaf, { as: "u" }),
2973
- [MARK_STRIKETHROUGH]: withProps(PlateLeaf, { as: "s" }),
2973
+ [MARK_STRIKETHROUGH]: ({ editor, leaf, text, ...props }) => /* @__PURE__ */ React__default.createElement("s", { ...props.attributes, ...props }),
2974
2974
  [MARK_ITALIC]: withProps(PlateLeaf, { as: "em" }),
2975
2975
  [MARK_BOLD]: ({ editor, leaf, text, ...props }) => /* @__PURE__ */ React__default.createElement("strong", { ...props.attributes, ...props }),
2976
2976
  [ELEMENT_HR]: ({
@@ -2981,7 +2981,6 @@ const Components = () => {
2981
2981
  children,
2982
2982
  ...props
2983
2983
  }) => {
2984
- const selected = useSelected();
2985
2984
  return /* @__PURE__ */ React__default.createElement(
2986
2985
  "div",
2987
2986
  {
@@ -2992,8 +2991,7 @@ const Components = () => {
2992
2991
  ...attributes,
2993
2992
  ...props
2994
2993
  },
2995
- children,
2996
- selected && /* @__PURE__ */ React__default.createElement("span", { className: "absolute h-4 -top-2 inset-0 ring-2 ring-blue-100 ring-inset rounded-md z-10 pointer-events-none" })
2994
+ children
2997
2995
  );
2998
2996
  },
2999
2997
  [ELEMENT_TABLE]: TableElement,
@@ -4430,36 +4428,6 @@ function MdOutlineArrowBackIos(props) {
4430
4428
  function MdOutlinePerson(props) {
4431
4429
  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);
4432
4430
  }
4433
- const BranchContext = React.createContext({
4434
- currentBranch: null,
4435
- setCurrentBranch: (branch) => {
4436
- console.warn("BranchContext not initialized");
4437
- }
4438
- });
4439
- const BranchDataProvider = ({
4440
- currentBranch,
4441
- setCurrentBranch,
4442
- children
4443
- }) => {
4444
- return /* @__PURE__ */ React.createElement(
4445
- BranchContext.Provider,
4446
- {
4447
- value: {
4448
- currentBranch,
4449
- setCurrentBranch
4450
- }
4451
- },
4452
- children
4453
- );
4454
- };
4455
- const useBranchData = () => {
4456
- const branchData = React.useContext(BranchContext);
4457
- const { dispatch } = useEvent("branch:change");
4458
- React.useEffect(() => {
4459
- dispatch({ branchName: branchData.currentBranch });
4460
- }, [branchData.currentBranch]);
4461
- return branchData;
4462
- };
4463
4431
  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";
4464
4432
  const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
4465
4433
  const BaseTextField = React.forwardRef(({ className, disabled, ...rest }, ref) => {
@@ -5224,7 +5192,7 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
5224
5192
  side: "bottom",
5225
5193
  className: cn(
5226
5194
  "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",
5227
- "max-h-[30vh] max-w-[30vh] overflow-y-auto",
5195
+ "max-h-[30vh] max-w-[30vw] overflow-y-auto",
5228
5196
  className
5229
5197
  ),
5230
5198
  ...props
@@ -5316,11 +5284,7 @@ const getFilename = (optionSets, value) => {
5316
5284
  const node = nodes.find((node2) => node2.id === value);
5317
5285
  return node ? node._internalSys.filename : null;
5318
5286
  };
5319
- const ComboboxDemo = ({
5320
- cms,
5321
- input,
5322
- field
5323
- }) => {
5287
+ const Combobox = ({ cms, input, field }) => {
5324
5288
  const [open2, setOpen] = React.useState(false);
5325
5289
  const [value, setValue] = React.useState(input.value);
5326
5290
  const [displayText, setDisplayText] = React.useState(null);
@@ -5336,7 +5300,9 @@ const ComboboxDemo = ({
5336
5300
  }, [value, input, optionSets]);
5337
5301
  React.useEffect(() => {
5338
5302
  if (field.experimental___filter && optionSets.length > 0) {
5339
- setFilteredOptionsList(field.experimental___filter(optionSets, void 0));
5303
+ setFilteredOptionsList(
5304
+ field.experimental___filter(optionSets, void 0)
5305
+ );
5340
5306
  } else {
5341
5307
  setFilteredOptionsList(optionSets);
5342
5308
  }
@@ -5344,17 +5310,17 @@ const ComboboxDemo = ({
5344
5310
  if (loading === true) {
5345
5311
  return /* @__PURE__ */ React.createElement(LoadingDots, { color: "var(--tina-color-primary)" });
5346
5312
  }
5347
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Popover, { open: open2, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
5313
+ return /* @__PURE__ */ React.createElement(Popover, { open: open2, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
5348
5314
  Button,
5349
5315
  {
5350
5316
  variant: "outline",
5351
5317
  role: "combobox",
5352
5318
  "aria-expanded": open2,
5353
- className: "w-52 justify-between"
5319
+ className: "w-full justify-between"
5354
5320
  },
5355
5321
  /* @__PURE__ */ React.createElement("p", { className: "truncate" }, displayText ?? "Choose an option..."),
5356
5322
  open2 ? /* @__PURE__ */ React.createElement(IoMdArrowDropup, { size: 20 }) : /* @__PURE__ */ React.createElement(IoMdArrowDropdown, { size: 20 })
5357
- )), /* @__PURE__ */ React.createElement(PopoverContent, { className: "p-0 relative" }, /* @__PURE__ */ React.createElement(
5323
+ )), /* @__PURE__ */ React.createElement(PopoverContent, { className: "p-0 relative min-w-[var(--radix-popover-trigger-width)]" }, /* @__PURE__ */ React.createElement(
5358
5324
  Command,
5359
5325
  {
5360
5326
  shouldFilter: !field.experimental___filter,
@@ -5378,32 +5344,25 @@ const ComboboxDemo = ({
5378
5344
  }
5379
5345
  ),
5380
5346
  /* @__PURE__ */ React.createElement(CommandEmpty, null, "No reference found"),
5381
- /* @__PURE__ */ React.createElement(CommandList, null, filteredOptionsList.length > 0 && (filteredOptionsList == null ? void 0 : filteredOptionsList.map(({ collection, edges }) => /* @__PURE__ */ React.createElement(
5382
- CommandGroup,
5383
- {
5384
- key: `${collection}-group`,
5385
- heading: collection
5386
- },
5387
- /* @__PURE__ */ React.createElement(CommandList, null, edges == null ? void 0 : edges.map(({ node }) => {
5388
- const { id, _values } = node;
5389
- return /* @__PURE__ */ React.createElement(
5390
- OptionComponent,
5391
- {
5392
- id,
5393
- key: id,
5394
- value,
5395
- field,
5396
- _values,
5397
- node,
5398
- onSelect: (currentValue) => {
5399
- setValue(currentValue);
5400
- setOpen(false);
5401
- }
5347
+ /* @__PURE__ */ React.createElement(CommandList, null, filteredOptionsList.length > 0 && (filteredOptionsList == null ? void 0 : filteredOptionsList.map(({ collection, edges }) => /* @__PURE__ */ React.createElement(CommandGroup, { key: `${collection}-group`, heading: collection }, /* @__PURE__ */ React.createElement(CommandList, null, edges == null ? void 0 : edges.map(({ node }) => {
5348
+ const { id, _values } = node;
5349
+ return /* @__PURE__ */ React.createElement(
5350
+ OptionComponent,
5351
+ {
5352
+ id,
5353
+ key: id,
5354
+ value,
5355
+ field,
5356
+ _values,
5357
+ node,
5358
+ onSelect: (currentValue) => {
5359
+ setValue(currentValue);
5360
+ setOpen(false);
5402
5361
  }
5403
- );
5404
- }))
5405
- ))))
5406
- ))));
5362
+ }
5363
+ );
5364
+ }))))))
5365
+ )));
5407
5366
  };
5408
5367
  const useGetNode = (cms, id) => {
5409
5368
  const [document2, setDocument] = React.useState(
@@ -5476,7 +5435,7 @@ const ReferenceLink = ({ cms, input }) => {
5476
5435
  };
5477
5436
  const Reference = ({ input, field }) => {
5478
5437
  const cms = useCMS();
5479
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "relative group" }, /* @__PURE__ */ React.createElement(ComboboxDemo, { cms, input, field })), /* @__PURE__ */ React.createElement(ReferenceLink, { cms, input }));
5438
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "relative group" }, /* @__PURE__ */ React.createElement(Combobox, { cms, input, field })), /* @__PURE__ */ React.createElement(ReferenceLink, { cms, input }));
5480
5439
  };
5481
5440
  const ButtonToggle = ({
5482
5441
  input,
@@ -5713,7 +5672,9 @@ const Item$2 = ({
5713
5672
  onClick: () => {
5714
5673
  const state = tinaForm.finalForm.getState();
5715
5674
  if (state.invalid === true) {
5716
- cms.alerts.error("Cannot navigate away from an invalid form.");
5675
+ cms.alerts.error(
5676
+ "Cannot navigate away from an invalid form."
5677
+ );
5717
5678
  return;
5718
5679
  }
5719
5680
  cms.dispatch({
@@ -6297,7 +6258,9 @@ const BlockListItem = ({
6297
6258
  onClick: () => {
6298
6259
  const state = tinaForm.finalForm.getState();
6299
6260
  if (state.invalid === true) {
6300
- cms.alerts.error("Cannot navigate away from an invalid form.");
6261
+ cms.alerts.error(
6262
+ "Cannot navigate away from an invalid form."
6263
+ );
6301
6264
  return;
6302
6265
  }
6303
6266
  cms.dispatch({
@@ -6779,28 +6742,28 @@ class DaysView extends React__default.Component {
6779
6742
  }
6780
6743
  renderDayHeaders() {
6781
6744
  const locale = this.props.viewDate.localeData();
6782
- let dayItems = getDaysOfWeek(locale).map((day, index) => /* @__PURE__ */ React__default.createElement("th", { key: day + index, className: "dow" }, day));
6745
+ const dayItems = getDaysOfWeek(locale).map((day, index) => /* @__PURE__ */ React__default.createElement("th", { key: day + index, className: "dow" }, day));
6783
6746
  return /* @__PURE__ */ React__default.createElement("tr", null, dayItems);
6784
6747
  }
6785
6748
  renderDays() {
6786
6749
  const date = this.props.viewDate;
6787
6750
  const startOfMonth = date.clone().startOf("month");
6788
6751
  const endOfMonth = date.clone().endOf("month");
6789
- let rows = [[], [], [], [], [], []];
6790
- let startDate = date.clone().subtract(1, "months");
6752
+ const rows = [[], [], [], [], [], []];
6753
+ const startDate = date.clone().subtract(1, "months");
6791
6754
  startDate.date(startDate.daysInMonth()).startOf("week");
6792
- let endDate = startDate.clone().add(42, "d");
6755
+ const endDate = startDate.clone().add(42, "d");
6793
6756
  let i = 0;
6794
6757
  while (startDate.isBefore(endDate)) {
6795
- let row = getRow$2(rows, i++);
6758
+ const row = getRow$2(rows, i++);
6796
6759
  row.push(this.renderDay(startDate, startOfMonth, endOfMonth));
6797
6760
  startDate.add(1, "d");
6798
6761
  }
6799
6762
  return rows.map((r, i2) => /* @__PURE__ */ React__default.createElement("tr", { key: `${endDate.month()}_${i2}` }, r));
6800
6763
  }
6801
6764
  renderDay(date, startOfMonth, endOfMonth) {
6802
- let selectedDate = this.props.selectedDate;
6803
- let dayProps = {
6765
+ const selectedDate = this.props.selectedDate;
6766
+ const dayProps = {
6804
6767
  key: date.format("M_D"),
6805
6768
  "data-value": date.date(),
6806
6769
  "data-month": date.month(),
@@ -6854,7 +6817,7 @@ function getRow$2(rows, day) {
6854
6817
  }
6855
6818
  function getDaysOfWeek(locale) {
6856
6819
  const first = locale.firstDayOfWeek();
6857
- let dow = [];
6820
+ const dow = [];
6858
6821
  let i = 0;
6859
6822
  locale._weekdaysMin.forEach(function(day) {
6860
6823
  dow[(7 + i++ - first) % 7] = day;
@@ -6872,7 +6835,7 @@ class MonthsView extends React__default.Component {
6872
6835
  return /* @__PURE__ */ React__default.createElement("div", { className: "rdtMonths" }, /* @__PURE__ */ React__default.createElement("table", null, /* @__PURE__ */ React__default.createElement("thead", null, this.renderNavigation())), /* @__PURE__ */ React__default.createElement("table", null, /* @__PURE__ */ React__default.createElement("tbody", null, this.renderMonths())));
6873
6836
  }
6874
6837
  renderNavigation() {
6875
- let year = this.props.viewDate.year();
6838
+ const year = this.props.viewDate.year();
6876
6839
  return /* @__PURE__ */ React__default.createElement(
6877
6840
  ViewNavigation,
6878
6841
  {
@@ -6885,9 +6848,9 @@ class MonthsView extends React__default.Component {
6885
6848
  );
6886
6849
  }
6887
6850
  renderMonths() {
6888
- let rows = [[], [], []];
6851
+ const rows = [[], [], []];
6889
6852
  for (let month = 0; month < 12; month++) {
6890
- let row = getRow$1(rows, month);
6853
+ const row = getRow$1(rows, month);
6891
6854
  row.push(this.renderMonth(month));
6892
6855
  }
6893
6856
  return rows.map((months, i) => /* @__PURE__ */ React__default.createElement("tr", { key: i }, months));
@@ -6904,7 +6867,7 @@ class MonthsView extends React__default.Component {
6904
6867
  if (selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month) {
6905
6868
  className += " rdtActive";
6906
6869
  }
6907
- let props = { key: month, className, "data-value": month, onClick };
6870
+ const props = { key: month, className, "data-value": month, onClick };
6908
6871
  if (this.props.renderMonth) {
6909
6872
  return this.props.renderMonth(
6910
6873
  props,
@@ -6916,11 +6879,11 @@ class MonthsView extends React__default.Component {
6916
6879
  return /* @__PURE__ */ React__default.createElement("td", { ...props }, this.getMonthText(month));
6917
6880
  }
6918
6881
  isDisabledMonth(month) {
6919
- let isValidDate = this.props.isValidDate;
6882
+ const isValidDate = this.props.isValidDate;
6920
6883
  if (!isValidDate) {
6921
6884
  return false;
6922
6885
  }
6923
- let date = this.props.viewDate.clone().set({ month });
6886
+ const date = this.props.viewDate.clone().set({ month });
6924
6887
  let day = date.endOf("month").date() + 1;
6925
6888
  while (day-- > 1) {
6926
6889
  if (isValidDate(date.date(day))) {
@@ -6972,9 +6935,9 @@ class YearsView extends React__default.Component {
6972
6935
  }
6973
6936
  renderYears() {
6974
6937
  const viewYear = this.getViewYear();
6975
- let rows = [[], [], []];
6938
+ const rows = [[], [], []];
6976
6939
  for (let year = viewYear - 1; year < viewYear + 11; year++) {
6977
- let row = getRow(rows, year - viewYear);
6940
+ const row = getRow(rows, year - viewYear);
6978
6941
  row.push(this.renderYear(year));
6979
6942
  }
6980
6943
  return rows.map((years, i) => /* @__PURE__ */ React__default.createElement("tr", { key: i }, years));
@@ -6991,7 +6954,7 @@ class YearsView extends React__default.Component {
6991
6954
  if (selectedYear === year) {
6992
6955
  className += " rdtActive";
6993
6956
  }
6994
- let props = { key: year, className, "data-value": year, onClick };
6957
+ const props = { key: year, className, "data-value": year, onClick };
6995
6958
  return this.props.renderYear(
6996
6959
  props,
6997
6960
  year,
@@ -7005,15 +6968,15 @@ class YearsView extends React__default.Component {
7005
6968
  return this.props.selectedDate && this.props.selectedDate.year();
7006
6969
  }
7007
6970
  isDisabledYear(year) {
7008
- let cache = this.disabledYearsCache;
6971
+ const cache = this.disabledYearsCache;
7009
6972
  if (cache[year] !== void 0) {
7010
6973
  return cache[year];
7011
6974
  }
7012
- let isValidDate = this.props.isValidDate;
6975
+ const isValidDate = this.props.isValidDate;
7013
6976
  if (!isValidDate) {
7014
6977
  return false;
7015
6978
  }
7016
- let date = this.props.viewDate.clone().set({ year });
6979
+ const date = this.props.viewDate.clone().set({ year });
7017
6980
  let day = date.endOf("year").dayOfYear() + 1;
7018
6981
  while (day-- > 1) {
7019
6982
  if (isValidDate(date.dayOfYear(day))) {
@@ -7060,7 +7023,7 @@ const timeConstraints = {
7060
7023
  }
7061
7024
  };
7062
7025
  function createConstraints(overrideTimeConstraints) {
7063
- let constraints = {};
7026
+ const constraints = {};
7064
7027
  Object.keys(timeConstraints).forEach((type) => {
7065
7028
  constraints[type] = {
7066
7029
  ...timeConstraints[type],
@@ -7076,7 +7039,7 @@ class TimeView extends React__default.Component {
7076
7039
  this.state = this.getTimeParts(props.selectedDate || props.viewDate);
7077
7040
  }
7078
7041
  render() {
7079
- let items2 = [];
7042
+ const items2 = [];
7080
7043
  const timeParts = this.state;
7081
7044
  this.getCounters().forEach((c, i) => {
7082
7045
  if (i && c !== "ampm") {
@@ -7138,8 +7101,8 @@ class TimeView extends React__default.Component {
7138
7101
  }
7139
7102
  if (type === "ampm")
7140
7103
  return this.toggleDayPart();
7141
- let update = {};
7142
- let body = document.body;
7104
+ const update = {};
7105
+ const body = document.body;
7143
7106
  update[type] = this[action](type);
7144
7107
  this.setState(update);
7145
7108
  this.timer = setTimeout(() => {
@@ -7182,8 +7145,8 @@ class TimeView extends React__default.Component {
7182
7145
  return pad(type, value);
7183
7146
  }
7184
7147
  getCounters() {
7185
- let counters = [];
7186
- let format2 = this.props.timeFormat;
7148
+ const counters = [];
7149
+ const format2 = this.props.timeFormat;
7187
7150
  if (format2.toLowerCase().indexOf("h") !== -1) {
7188
7151
  counters.push("hours");
7189
7152
  if (format2.indexOf("m") !== -1) {
@@ -7315,7 +7278,7 @@ class Datetime extends React__default.Component {
7315
7278
  __publicField(this, "_renderCalendar", () => {
7316
7279
  const props = this.props;
7317
7280
  const state = this.state;
7318
- let viewProps = {
7281
+ const viewProps = {
7319
7282
  viewDate: state.viewDate.clone(),
7320
7283
  selectedDate: this.getSelectedDate(),
7321
7284
  isValidDate: props.isValidDate,
@@ -7358,10 +7321,10 @@ class Datetime extends React__default.Component {
7358
7321
  __publicField(this, "viewToMethod", { days: "date", months: "month", years: "year" });
7359
7322
  __publicField(this, "nextView", { days: "time", months: "days", years: "months" });
7360
7323
  __publicField(this, "_updateDate", (e) => {
7361
- let state = this.state;
7362
- let currentView = state.currentView;
7363
- let updateOnView = this.getUpdateOn(this.getFormat("date"));
7364
- let viewDate = this.state.viewDate.clone();
7324
+ const state = this.state;
7325
+ const currentView = state.currentView;
7326
+ const updateOnView = this.getUpdateOn(this.getFormat("date"));
7327
+ const viewDate = this.state.viewDate.clone();
7365
7328
  viewDate[this.viewToMethod[currentView]](
7366
7329
  parseInt(e.target.getAttribute("data-value"), 10)
7367
7330
  );
@@ -7369,7 +7332,7 @@ class Datetime extends React__default.Component {
7369
7332
  viewDate.month(parseInt(e.target.getAttribute("data-month"), 10));
7370
7333
  viewDate.year(parseInt(e.target.getAttribute("data-year"), 10));
7371
7334
  }
7372
- let update = { viewDate };
7335
+ const update = { viewDate };
7373
7336
  if (currentView === updateOnView) {
7374
7337
  update.selectedDate = viewDate.clone();
7375
7338
  update.inputValue = viewDate.format(this.getFormat("datetime"));
@@ -7383,7 +7346,7 @@ class Datetime extends React__default.Component {
7383
7346
  this.setState(update);
7384
7347
  });
7385
7348
  __publicField(this, "_viewNavigate", (modifier, unit) => {
7386
- let viewDate = this.state.viewDate.clone();
7349
+ const viewDate = this.state.viewDate.clone();
7387
7350
  viewDate.add(modifier, unit);
7388
7351
  if (modifier > 0) {
7389
7352
  this.props.onNavigateForward(modifier, unit);
@@ -7393,7 +7356,7 @@ class Datetime extends React__default.Component {
7393
7356
  this.setState({ viewDate });
7394
7357
  });
7395
7358
  __publicField(this, "_setTime", (type, value) => {
7396
- let date = (this.getSelectedDate() || this.state.viewDate).clone();
7359
+ const date = (this.getSelectedDate() || this.state.viewDate).clone();
7397
7360
  date[type](value);
7398
7361
  if (!this.props.value) {
7399
7362
  this.setState({
@@ -7417,7 +7380,7 @@ class Datetime extends React__default.Component {
7417
7380
  });
7418
7381
  });
7419
7382
  __publicField(this, "_handleClickOutside", () => {
7420
- let props = this.props;
7383
+ const props = this.props;
7421
7384
  if (props.input && this.state.open && props.open === void 0 && props.closeOnClickOutside) {
7422
7385
  this._closeCalendar();
7423
7386
  }
@@ -7432,7 +7395,7 @@ class Datetime extends React__default.Component {
7432
7395
  return;
7433
7396
  const value = e.target ? e.target.value : e;
7434
7397
  const localMoment = this.localMoment(value, this.getFormat("datetime"));
7435
- let update = { inputValue: value };
7398
+ const update = { inputValue: value };
7436
7399
  if (localMoment.isValid()) {
7437
7400
  update.selectedDate = localMoment;
7438
7401
  update.viewDate = localMoment.clone().startOf("month");
@@ -7496,9 +7459,9 @@ class Datetime extends React__default.Component {
7496
7459
  return this.props.renderView(this.state.currentView, this._renderCalendar);
7497
7460
  }
7498
7461
  getInitialState() {
7499
- let props = this.props;
7500
- let inputFormat = this.getFormat("datetime");
7501
- let selectedDate = this.parseDate(
7462
+ const props = this.props;
7463
+ const inputFormat = this.getFormat("datetime");
7464
+ const selectedDate = this.parseDate(
7502
7465
  props.value || props.initialValue,
7503
7466
  inputFormat
7504
7467
  );
@@ -7529,7 +7492,7 @@ class Datetime extends React__default.Component {
7529
7492
  return this.getInitialDate();
7530
7493
  }
7531
7494
  getInitialDate() {
7532
- let m = this.localMoment();
7495
+ const m = this.localMoment();
7533
7496
  m.hour(0).minute(0).second(0).millisecond(0);
7534
7497
  return m;
7535
7498
  }
@@ -7549,8 +7512,8 @@ class Datetime extends React__default.Component {
7549
7512
  }
7550
7513
  getClassName() {
7551
7514
  let cn2 = "rdt";
7552
- let props = this.props;
7553
- let propCn = props.className;
7515
+ const props = this.props;
7516
+ const propCn = props.className;
7554
7517
  if (Array.isArray(propCn)) {
7555
7518
  cn2 += " " + propCn.join(" ");
7556
7519
  } else if (propCn) {
@@ -7583,14 +7546,14 @@ class Datetime extends React__default.Component {
7583
7546
  return viewModes.DAYS;
7584
7547
  }
7585
7548
  getLocaleData() {
7586
- let p = this.props;
7549
+ const p = this.props;
7587
7550
  return this.localMoment(
7588
7551
  p.value || p.defaultValue || /* @__PURE__ */ new Date()
7589
7552
  ).localeData();
7590
7553
  }
7591
7554
  getDateFormat() {
7592
7555
  const locale = this.getLocaleData();
7593
- let format2 = this.props.dateFormat;
7556
+ const format2 = this.props.dateFormat;
7594
7557
  if (format2 === true)
7595
7558
  return locale.longDateFormat("L");
7596
7559
  if (format2)
@@ -7599,7 +7562,7 @@ class Datetime extends React__default.Component {
7599
7562
  }
7600
7563
  getTimeFormat() {
7601
7564
  const locale = this.getLocaleData();
7602
- let format2 = this.props.timeFormat;
7565
+ const format2 = this.props.timeFormat;
7603
7566
  if (format2 === true) {
7604
7567
  return locale.longDateFormat("LT");
7605
7568
  }
@@ -7611,12 +7574,12 @@ class Datetime extends React__default.Component {
7611
7574
  } else if (type === "time") {
7612
7575
  return this.getTimeFormat();
7613
7576
  }
7614
- let dateFormat = this.getDateFormat();
7615
- let timeFormat = this.getTimeFormat();
7577
+ const dateFormat = this.getDateFormat();
7578
+ const timeFormat = this.getTimeFormat();
7616
7579
  return dateFormat && timeFormat ? dateFormat + " " + timeFormat : dateFormat || timeFormat;
7617
7580
  }
7618
7581
  updateTime(op, amount, type, toSelected) {
7619
- let update = {};
7582
+ const update = {};
7620
7583
  const date = toSelected ? "selectedDate" : "viewDate";
7621
7584
  update[date] = this.state[date].clone()[op](amount, type);
7622
7585
  this.setState(update);
@@ -7649,7 +7612,7 @@ class Datetime extends React__default.Component {
7649
7612
  if (prevProps === this.props)
7650
7613
  return;
7651
7614
  let needsUpdate = false;
7652
- let thisProps = this.props;
7615
+ const thisProps = this.props;
7653
7616
  ["locale", "utc", "displayZone", "dateFormat", "timeFormat"].forEach(
7654
7617
  function(p) {
7655
7618
  prevProps[p] !== thisProps[p] && (needsUpdate = true);
@@ -7665,8 +7628,8 @@ class Datetime extends React__default.Component {
7665
7628
  }
7666
7629
  regenerateDates() {
7667
7630
  const props = this.props;
7668
- let viewDate = this.state.viewDate.clone();
7669
- let selectedDate = this.state.selectedDate && this.state.selectedDate.clone();
7631
+ const viewDate = this.state.viewDate.clone();
7632
+ const selectedDate = this.state.selectedDate && this.state.selectedDate.clone();
7670
7633
  if (props.locale) {
7671
7634
  viewDate.locale(props.locale);
7672
7635
  selectedDate && selectedDate.locale(props.locale);
@@ -7681,7 +7644,7 @@ class Datetime extends React__default.Component {
7681
7644
  viewDate.locale();
7682
7645
  selectedDate && selectedDate.locale();
7683
7646
  }
7684
- let update = { viewDate, selectedDate };
7647
+ const update = { viewDate, selectedDate };
7685
7648
  if (selectedDate && selectedDate.isValid()) {
7686
7649
  update.inputValue = selectedDate.format(this.getFormat("datetime"));
7687
7650
  }
@@ -7690,7 +7653,7 @@ class Datetime extends React__default.Component {
7690
7653
  getSelectedDate() {
7691
7654
  if (this.props.value === void 0)
7692
7655
  return this.state.selectedDate;
7693
- let selectedDate = this.parseDate(
7656
+ const selectedDate = this.parseDate(
7694
7657
  this.props.value,
7695
7658
  this.getFormat("datetime")
7696
7659
  );
@@ -7709,7 +7672,7 @@ class Datetime extends React__default.Component {
7709
7672
  return "";
7710
7673
  }
7711
7674
  getInputValue() {
7712
- let selectedDate = this.getSelectedDate();
7675
+ const selectedDate = this.getSelectedDate();
7713
7676
  return selectedDate ? selectedDate.format(this.getFormat("datetime")) : this.state.inputValue;
7714
7677
  }
7715
7678
  /**
@@ -7719,7 +7682,7 @@ class Datetime extends React__default.Component {
7719
7682
  * @public
7720
7683
  */
7721
7684
  setViewDate(date) {
7722
- let logError = function() {
7685
+ const logError = function() {
7723
7686
  return log("Invalid date passed to the `setViewDate` method: " + date);
7724
7687
  };
7725
7688
  if (!date)
@@ -7815,7 +7778,7 @@ __publicField(Datetime, "defaultProps", {
7815
7778
  // Make moment accessible through the Datetime class
7816
7779
  __publicField(Datetime, "moment", moment);
7817
7780
  function log(message, method) {
7818
- let con = typeof window !== "undefined" && window.console;
7781
+ const con = typeof window !== "undefined" && window.console;
7819
7782
  if (!con)
7820
7783
  return;
7821
7784
  if (!method) {
@@ -8068,9 +8031,6 @@ const PasswordFieldPlugin = {
8068
8031
  },
8069
8032
  parse: parse$2
8070
8033
  };
8071
- function GrCircleQuestion(props) {
8072
- 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);
8073
- }
8074
8034
  function AiFillWarning(props) {
8075
8035
  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);
8076
8036
  }
@@ -8089,6 +8049,39 @@ function FaSpinner(props) {
8089
8049
  function FaUnlock(props) {
8090
8050
  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);
8091
8051
  }
8052
+ function GrCircleQuestion(props) {
8053
+ 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);
8054
+ }
8055
+ const BranchContext = React.createContext({
8056
+ currentBranch: null,
8057
+ setCurrentBranch: (branch) => {
8058
+ console.warn("BranchContext not initialized");
8059
+ }
8060
+ });
8061
+ const BranchDataProvider = ({
8062
+ currentBranch,
8063
+ setCurrentBranch,
8064
+ children
8065
+ }) => {
8066
+ return /* @__PURE__ */ React.createElement(
8067
+ BranchContext.Provider,
8068
+ {
8069
+ value: {
8070
+ currentBranch,
8071
+ setCurrentBranch
8072
+ }
8073
+ },
8074
+ children
8075
+ );
8076
+ };
8077
+ const useBranchData = () => {
8078
+ const branchData = React.useContext(BranchContext);
8079
+ const { dispatch } = useEvent("branch:change");
8080
+ React.useEffect(() => {
8081
+ dispatch({ branchName: branchData.currentBranch });
8082
+ }, [branchData.currentBranch]);
8083
+ return branchData;
8084
+ };
8092
8085
  function formatBranchName$1(str) {
8093
8086
  const pattern = /[^/\w-]+/g;
8094
8087
  const formattedStr = str.replace(pattern, "");
@@ -8187,7 +8180,7 @@ const BranchSwitcherLegacy = ({
8187
8180
  className: "transition-all duration-150 ease-out text-blue-600 hover:text-blue-400 hover:underline no-underline",
8188
8181
  href: "https://tina.io/docs/tina-cloud/"
8189
8182
  },
8190
- "Learn more about moving to production with Tina Cloud."
8183
+ "Learn more about moving to production with TinaCloud."
8191
8184
  )), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement(
8192
8185
  Button$1,
8193
8186
  {
@@ -8423,7 +8416,7 @@ const EditoralBranchSwitcher = ({
8423
8416
  className: "transition-all duration-150 ease-out text-blue-600 hover:text-blue-400 hover:underline no-underline",
8424
8417
  href: "https://tina.io/docs/tina-cloud/"
8425
8418
  },
8426
- "Learn more about moving to production with Tina Cloud."
8419
+ "Learn more about moving to production with TinaCloud."
8427
8420
  )), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement(
8428
8421
  Button$1,
8429
8422
  {
@@ -8638,7 +8631,10 @@ const BranchSelector = ({
8638
8631
  label: "View in GitHub",
8639
8632
  Icon: /* @__PURE__ */ React.createElement(BiLinkExternal, { className: "w-5 h-auto text-blue-500 opacity-70" }),
8640
8633
  onMouseDown: () => {
8641
- window.open(branch.githubPullRequestUrl, "_blank");
8634
+ window.open(
8635
+ branch.githubPullRequestUrl,
8636
+ "_blank"
8637
+ );
8642
8638
  }
8643
8639
  },
8644
8640
  typeof previewFunction === "function" && ((_b2 = previewFunction({ branch: branch.name })) == null ? void 0 : _b2.url) && {
@@ -8944,7 +8940,9 @@ class EventBus {
8944
8940
  } else {
8945
8941
  events = event;
8946
8942
  }
8947
- const newListeners = events.map((event2) => new Listener(event2, callback));
8943
+ const newListeners = events.map(
8944
+ (event2) => new Listener(event2, callback)
8945
+ );
8948
8946
  newListeners.forEach((newListener) => this.listeners.add(newListener));
8949
8947
  return () => {
8950
8948
  newListeners.forEach((listener) => this.listeners.delete(listener));
@@ -9300,9 +9298,7 @@ class TinaMediaStore {
9300
9298
  const deleteStartTime = Date.now();
9301
9299
  while (true) {
9302
9300
  await new Promise((resolve) => setTimeout(resolve, 1e3));
9303
- const { error, message } = await this.api.getRequestStatus(
9304
- requestId
9305
- );
9301
+ const { error, message } = await this.api.getRequestStatus(requestId);
9306
9302
  if (error !== void 0) {
9307
9303
  if (error) {
9308
9304
  throw new Error(message);
@@ -9330,11 +9326,8 @@ class TinaMediaStore {
9330
9326
  const encodeUrlIfNeeded = (url) => {
9331
9327
  if (url) {
9332
9328
  try {
9333
- const parsed = new URL(url);
9334
- parsed.pathname = parsed.pathname.split("/").filter((part) => part !== "").map(encodeURIComponent).join("/");
9335
- return parsed.toString();
9329
+ return new URL(url).toString();
9336
9330
  } catch (e) {
9337
- console.error("Failed to parse URL:", e);
9338
9331
  return url;
9339
9332
  }
9340
9333
  } else {
@@ -9455,7 +9448,7 @@ const E_BAD_ROUTE = new MediaListError({
9455
9448
  });
9456
9449
  new MediaListError({
9457
9450
  title: "An Error Occurred",
9458
- message: "Something went wrong accessing your media from Tina Cloud.",
9451
+ message: "Something went wrong accessing your media from TinaCloud.",
9459
9452
  docsLink: ""
9460
9453
  // TODO
9461
9454
  });
@@ -9640,7 +9633,7 @@ let Alerts$1 = class Alerts {
9640
9633
  return this.add("error", message, timeout);
9641
9634
  }
9642
9635
  };
9643
- const NoFormsPlaceholder = () => /* @__PURE__ */ React.createElement(
9636
+ const SidebarLoadingPlaceholder = () => /* @__PURE__ */ React.createElement(
9644
9637
  "div",
9645
9638
  {
9646
9639
  className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
@@ -9653,25 +9646,8 @@ const NoFormsPlaceholder = () => /* @__PURE__ */ React.createElement(
9653
9646
  animationDuration: "150ms"
9654
9647
  }
9655
9648
  },
9656
- /* @__PURE__ */ React.createElement(Emoji$1, { className: "pb-5" }, "🔎"),
9657
- /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, "Looks like there's ", /* @__PURE__ */ React.createElement("br", null), "nothing to edit on ", /* @__PURE__ */ React.createElement("br", null), "this page."),
9658
- /* @__PURE__ */ React.createElement("p", { className: "block" }, /* @__PURE__ */ React.createElement(
9659
- Button$1,
9660
- {
9661
- href: "https://tina.io/docs/tinacms-context/",
9662
- target: "_blank",
9663
- as: "a"
9664
- },
9665
- /* @__PURE__ */ React.createElement(Emoji$1, { className: "mr-1.5" }, "📖"),
9666
- " Contextual Editing"
9667
- ))
9668
- );
9669
- const Emoji$1 = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
9670
- "span",
9671
- {
9672
- className: `text-[24px] leading-none inline-block ${className}`,
9673
- ...props
9674
- }
9649
+ /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, "Please wait while TinaCMS", /* @__PURE__ */ React.createElement("br", null), "loads your content"),
9650
+ /* @__PURE__ */ React.createElement(LoadingDots, { color: "var(--tina-color-primary)" })
9675
9651
  );
9676
9652
  class SidebarState {
9677
9653
  constructor(events, options = {}) {
@@ -9686,7 +9662,7 @@ class SidebarState {
9686
9662
  };
9687
9663
  this.position = options.position || "displace";
9688
9664
  this.renderNav = options.renderNav || true;
9689
- this.placeholder = options.placeholder || NoFormsPlaceholder;
9665
+ this.loadingPlaceholder = options.placeholder || SidebarLoadingPlaceholder;
9690
9666
  if ((_a = options.buttons) == null ? void 0 : _a.save) {
9691
9667
  this.buttons.save = options.buttons.save;
9692
9668
  }
@@ -9760,238 +9736,6 @@ const ModalLayout = ({ children, name, close: close2, layout }) => {
9760
9736
  children
9761
9737
  )));
9762
9738
  };
9763
- const Item = ({
9764
- item,
9765
- depth,
9766
- setActiveFormId
9767
- }) => {
9768
- const cms = useCMS();
9769
- const depths = ["pl-6", "pl-10", "pl-14"];
9770
- const form = React.useMemo(
9771
- () => cms.state.forms.find(({ tinaForm }) => item.formId === tinaForm.id),
9772
- [item.formId]
9773
- );
9774
- return /* @__PURE__ */ React.createElement(
9775
- "button",
9776
- {
9777
- type: "button",
9778
- key: item.path,
9779
- onClick: () => setActiveFormId(item.formId),
9780
- 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`
9781
- },
9782
- /* @__PURE__ */ React.createElement(BiEdit, { className: "opacity-70 w-5 h-auto text-blue-500 flex-none" }),
9783
- /* @__PURE__ */ React.createElement("div", { className: "flex-1 flex flex-col gap-0.5 items-start" }, /* @__PURE__ */ React.createElement("div", { className: "group-hover:text-blue-500 font-sans text-xs font-semibold text-gray-700 whitespace-normal" }, form.tinaForm.label), /* @__PURE__ */ React.createElement("div", { className: "group-hover:text-blue-500 text-base truncate leading-tight text-gray-600" }, form.tinaForm.id))
9784
- );
9785
- };
9786
- const FormListItem = ({
9787
- item,
9788
- depth,
9789
- setActiveFormId
9790
- }) => {
9791
- var _a;
9792
- return /* @__PURE__ */ React.createElement("div", { className: "divide-y divide-gray-200" }, /* @__PURE__ */ React.createElement(Item, { setActiveFormId, item, depth }), item.subItems && /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-gray-200" }, (_a = item.subItems) == null ? void 0 : _a.map((subItem) => {
9793
- if (subItem.type === "document") {
9794
- return /* @__PURE__ */ React.createElement("li", { key: subItem.formId }, /* @__PURE__ */ React.createElement(
9795
- Item,
9796
- {
9797
- setActiveFormId,
9798
- depth: depth + 1,
9799
- item: subItem
9800
- }
9801
- ));
9802
- }
9803
- })));
9804
- };
9805
- const FormLists = (props) => {
9806
- const cms = useCMS();
9807
- return /* @__PURE__ */ React.createElement(
9808
- Transition,
9809
- {
9810
- appear: true,
9811
- show: true,
9812
- as: "div",
9813
- enter: "transition-all ease-out duration-150",
9814
- enterFrom: "opacity-0 -translate-x-1/2",
9815
- enterTo: "opacity-100",
9816
- leave: "transition-all ease-out duration-150",
9817
- leaveFrom: "opacity-100",
9818
- leaveTo: "opacity-0 -translate-x-1/2"
9819
- },
9820
- cms.state.formLists.map((formList, index) => /* @__PURE__ */ React.createElement("div", { key: `${formList.id}-${index}`, className: "pt-16" }, /* @__PURE__ */ React.createElement(
9821
- FormList,
9822
- {
9823
- isEditing: props.isEditing,
9824
- setActiveFormId: (id) => {
9825
- cms.dispatch({ type: "forms:set-active-form-id", value: id });
9826
- },
9827
- formList
9828
- }
9829
- )))
9830
- );
9831
- };
9832
- const FormList = (props) => {
9833
- const cms = useCMS();
9834
- const listItems = React.useMemo(() => {
9835
- var _a;
9836
- const orderedListItems = [];
9837
- const globalItems = [];
9838
- const topItems = [];
9839
- props.formList.items.forEach((item) => {
9840
- if (item.type === "document") {
9841
- const form = cms.state.forms.find(
9842
- ({ tinaForm }) => tinaForm.id === item.formId
9843
- );
9844
- if (form.tinaForm.global) {
9845
- globalItems.push(item);
9846
- } else {
9847
- orderedListItems.push(item);
9848
- }
9849
- } else {
9850
- orderedListItems.push(item);
9851
- }
9852
- });
9853
- if (((_a = orderedListItems[0]) == null ? void 0 : _a.type) === "document") {
9854
- topItems.push({ type: "list", label: "Documents" });
9855
- }
9856
- let extra = [];
9857
- if (globalItems.length) {
9858
- extra = [{ type: "list", label: "Global Documents" }, ...globalItems];
9859
- }
9860
- return [...topItems, ...orderedListItems, ...extra];
9861
- }, [JSON.stringify(props.formList.items)]);
9862
- return /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", { className: "divide-y divide-gray-200" }, listItems.map((item, index) => {
9863
- if (item.type === "list") {
9864
- return /* @__PURE__ */ React.createElement(
9865
- "div",
9866
- {
9867
- key: item.label,
9868
- className: `relative group text-left w-full bg-white shadow-sm
9869
- 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"}`
9870
- },
9871
- /* @__PURE__ */ React.createElement(
9872
- "span",
9873
- {
9874
- className: "text-sm tracking-wide font-bold text-gray-700 uppercase"
9875
- },
9876
- item.label
9877
- )
9878
- );
9879
- }
9880
- return /* @__PURE__ */ React.createElement(
9881
- FormListItem,
9882
- {
9883
- setActiveFormId: (id) => props.setActiveFormId(id),
9884
- key: item.formId,
9885
- item,
9886
- depth: 0
9887
- }
9888
- );
9889
- })));
9890
- };
9891
- const FormsView = ({
9892
- children
9893
- }) => {
9894
- const cms = useCMS$1();
9895
- const { setFormIsPristine } = React.useContext(SidebarContext);
9896
- const isMultiform = cms.state.forms.length > 1;
9897
- const activeForm = cms.state.forms.find(
9898
- ({ tinaForm }) => tinaForm.id === cms.state.activeFormId
9899
- );
9900
- const isEditing = !!activeForm;
9901
- if (!cms.state.formLists.length) {
9902
- return /* @__PURE__ */ React.createElement(React.Fragment, null, " ", children, " ");
9903
- }
9904
- if (isMultiform && !activeForm) {
9905
- return /* @__PURE__ */ React.createElement(FormLists, { isEditing });
9906
- }
9907
- const formMetas = cms.plugins.all("form:meta");
9908
- return /* @__PURE__ */ React.createElement(React.Fragment, null, activeForm && /* @__PURE__ */ React.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React.createElement(React.Fragment, { key: meta.name }, /* @__PURE__ */ React.createElement(meta.Component, null))), /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
9909
- };
9910
- const FormWrapper$1 = ({ isEditing, children }) => {
9911
- return /* @__PURE__ */ React.createElement(
9912
- "div",
9913
- {
9914
- className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white",
9915
- style: isEditing ? {
9916
- transform: "none",
9917
- animationName: "fly-in-left",
9918
- animationDuration: "150ms",
9919
- animationDelay: "0",
9920
- animationIterationCount: 1,
9921
- animationTimingFunction: "ease-out"
9922
- } : {
9923
- transform: "translate3d(100%, 0, 0)"
9924
- }
9925
- },
9926
- children
9927
- );
9928
- };
9929
- const MultiformFormHeader = ({
9930
- activeForm
9931
- }) => {
9932
- const cms = useCMS$1();
9933
- const { formIsPristine } = React.useContext(SidebarContext);
9934
- return /* @__PURE__ */ React.createElement(
9935
- "div",
9936
- {
9937
- className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
9938
- },
9939
- /* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React.createElement(
9940
- "button",
9941
- {
9942
- type: "button",
9943
- className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
9944
- onClick: () => {
9945
- const state = activeForm.tinaForm.finalForm.getState();
9946
- if (state.invalid === true) {
9947
- cms.alerts.error("Cannot navigate away from an invalid form.");
9948
- } else {
9949
- cms.dispatch({ type: "forms:set-active-form-id", value: null });
9950
- }
9951
- }
9952
- },
9953
- /* @__PURE__ */ React.createElement(BiDotsVertical, { className: "h-auto w-5 inline-block opacity-70" })
9954
- ), /* @__PURE__ */ React.createElement(
9955
- "button",
9956
- {
9957
- type: "button",
9958
- className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
9959
- onClick: () => {
9960
- const collectionName = cms.api.tina.schema.getCollectionByFullPath(
9961
- cms.state.activeFormId
9962
- ).name;
9963
- window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
9964
- }
9965
- },
9966
- /* @__PURE__ */ React.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
9967
- ), /* @__PURE__ */ React.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, activeForm.tinaForm.label || activeForm.tinaForm.id), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
9968
- );
9969
- };
9970
- const FormHeader = ({ activeForm }) => {
9971
- const { formIsPristine } = React.useContext(SidebarContext);
9972
- const cms = useCMS$1();
9973
- const shortFormLabel = activeForm.tinaForm.label ? activeForm.tinaForm.label.replace(/^.*[\\\/]/, "") : false;
9974
- return /* @__PURE__ */ React.createElement(
9975
- "div",
9976
- {
9977
- className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
9978
- },
9979
- /* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React.createElement(
9980
- "button",
9981
- {
9982
- type: "button",
9983
- className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
9984
- onClick: () => {
9985
- const collectionName = cms.api.tina.schema.getCollectionByFullPath(
9986
- cms.state.activeFormId
9987
- ).name;
9988
- window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
9989
- }
9990
- },
9991
- /* @__PURE__ */ React.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
9992
- ), shortFormLabel && /* @__PURE__ */ React.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
9993
- );
9994
- };
9995
9739
  function ImFilesEmpty(props) {
9996
9740
  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);
9997
9741
  }
@@ -10234,7 +9978,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
10234
9978
  "Event Log"
10235
9979
  ));
10236
9980
  };
10237
- const version = "2.6.2";
9981
+ const version = "2.7.5";
10238
9982
  const Nav = ({
10239
9983
  isLocalMode,
10240
9984
  className = "",
@@ -10476,6 +10220,293 @@ const ResizeHandle = () => {
10476
10220
  /* @__PURE__ */ React.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" })
10477
10221
  );
10478
10222
  };
10223
+ const Item = ({
10224
+ item,
10225
+ depth,
10226
+ setActiveFormId
10227
+ }) => {
10228
+ const cms = useCMS();
10229
+ const depths = ["pl-6", "pl-10", "pl-14"];
10230
+ const form = React.useMemo(
10231
+ () => cms.state.forms.find(({ tinaForm }) => item.formId === tinaForm.id),
10232
+ [item.formId]
10233
+ );
10234
+ return /* @__PURE__ */ React.createElement(
10235
+ "button",
10236
+ {
10237
+ type: "button",
10238
+ key: item.path,
10239
+ onClick: () => setActiveFormId(item.formId),
10240
+ 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`
10241
+ },
10242
+ /* @__PURE__ */ React.createElement(BiEdit, { className: "opacity-70 w-5 h-auto text-blue-500 flex-none" }),
10243
+ /* @__PURE__ */ React.createElement("div", { className: "flex-1 flex flex-col gap-0.5 items-start" }, /* @__PURE__ */ React.createElement("div", { className: "group-hover:text-blue-500 font-sans text-xs font-semibold text-gray-700 whitespace-normal" }, form.tinaForm.label), /* @__PURE__ */ React.createElement("div", { className: "group-hover:text-blue-500 text-base truncate leading-tight text-gray-600" }, form.tinaForm.id))
10244
+ );
10245
+ };
10246
+ const FormListItem = ({
10247
+ item,
10248
+ depth,
10249
+ setActiveFormId
10250
+ }) => {
10251
+ var _a;
10252
+ return /* @__PURE__ */ React.createElement("div", { className: "divide-y divide-gray-200" }, /* @__PURE__ */ React.createElement(Item, { setActiveFormId, item, depth }), item.subItems && /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-gray-200" }, (_a = item.subItems) == null ? void 0 : _a.map((subItem) => {
10253
+ if (subItem.type === "document") {
10254
+ return /* @__PURE__ */ React.createElement("li", { key: subItem.formId }, /* @__PURE__ */ React.createElement(
10255
+ Item,
10256
+ {
10257
+ setActiveFormId,
10258
+ depth: depth + 1,
10259
+ item: subItem
10260
+ }
10261
+ ));
10262
+ }
10263
+ })));
10264
+ };
10265
+ const FormLists = (props) => {
10266
+ const cms = useCMS();
10267
+ return /* @__PURE__ */ React.createElement(
10268
+ Transition,
10269
+ {
10270
+ appear: true,
10271
+ show: true,
10272
+ as: "div",
10273
+ enter: "transition-all ease-out duration-150",
10274
+ enterFrom: "opacity-0 -translate-x-1/2",
10275
+ enterTo: "opacity-100",
10276
+ leave: "transition-all ease-out duration-150",
10277
+ leaveFrom: "opacity-100",
10278
+ leaveTo: "opacity-0 -translate-x-1/2"
10279
+ },
10280
+ cms.state.formLists.map((formList, index) => /* @__PURE__ */ React.createElement("div", { key: `${formList.id}-${index}`, className: "pt-16" }, /* @__PURE__ */ React.createElement(
10281
+ FormList,
10282
+ {
10283
+ isEditing: props.isEditing,
10284
+ setActiveFormId: (id) => {
10285
+ cms.dispatch({ type: "forms:set-active-form-id", value: id });
10286
+ },
10287
+ formList
10288
+ }
10289
+ )))
10290
+ );
10291
+ };
10292
+ const FormList = (props) => {
10293
+ const cms = useCMS();
10294
+ const listItems = React.useMemo(() => {
10295
+ var _a;
10296
+ const orderedListItems = [];
10297
+ const globalItems = [];
10298
+ const topItems = [];
10299
+ props.formList.items.forEach((item) => {
10300
+ if (item.type === "document") {
10301
+ const form = cms.state.forms.find(
10302
+ ({ tinaForm }) => tinaForm.id === item.formId
10303
+ );
10304
+ if (form.tinaForm.global) {
10305
+ globalItems.push(item);
10306
+ } else {
10307
+ orderedListItems.push(item);
10308
+ }
10309
+ } else {
10310
+ orderedListItems.push(item);
10311
+ }
10312
+ });
10313
+ if (((_a = orderedListItems[0]) == null ? void 0 : _a.type) === "document") {
10314
+ topItems.push({ type: "list", label: "Documents" });
10315
+ }
10316
+ let extra = [];
10317
+ if (globalItems.length) {
10318
+ extra = [{ type: "list", label: "Global Documents" }, ...globalItems];
10319
+ }
10320
+ return [...topItems, ...orderedListItems, ...extra];
10321
+ }, [JSON.stringify(props.formList.items)]);
10322
+ return /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", { className: "divide-y divide-gray-200" }, listItems.map((item, index) => {
10323
+ if (item.type === "list") {
10324
+ return /* @__PURE__ */ React.createElement(
10325
+ "div",
10326
+ {
10327
+ key: item.label,
10328
+ className: `relative group text-left w-full bg-white shadow-sm
10329
+ 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"}`
10330
+ },
10331
+ /* @__PURE__ */ React.createElement(
10332
+ "span",
10333
+ {
10334
+ className: "text-sm tracking-wide font-bold text-gray-700 uppercase"
10335
+ },
10336
+ item.label
10337
+ )
10338
+ );
10339
+ }
10340
+ return /* @__PURE__ */ React.createElement(
10341
+ FormListItem,
10342
+ {
10343
+ setActiveFormId: (id) => props.setActiveFormId(id),
10344
+ key: item.formId,
10345
+ item,
10346
+ depth: 0
10347
+ }
10348
+ );
10349
+ })));
10350
+ };
10351
+ const SidebarNoFormsPlaceholder = () => /* @__PURE__ */ React.createElement(
10352
+ "div",
10353
+ {
10354
+ className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
10355
+ style: {
10356
+ animationName: "fade-in",
10357
+ animationDelay: "300ms",
10358
+ animationTimingFunction: "ease-out",
10359
+ animationIterationCount: 1,
10360
+ animationFillMode: "both",
10361
+ animationDuration: "150ms"
10362
+ }
10363
+ },
10364
+ /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, "Looks like there's ", /* @__PURE__ */ React.createElement("br", null), "nothing to edit on ", /* @__PURE__ */ React.createElement("br", null), "this page."),
10365
+ /* @__PURE__ */ React.createElement("p", { className: "block pt-5" }, /* @__PURE__ */ React.createElement(
10366
+ Button$1,
10367
+ {
10368
+ href: "https://tina.io/docs/contextual-editing/overview",
10369
+ target: "_blank",
10370
+ as: "a"
10371
+ },
10372
+ /* @__PURE__ */ React.createElement(Emoji$1, { className: "mr-1.5" }, "📖"),
10373
+ " Contextual Editing Docs"
10374
+ ))
10375
+ );
10376
+ const Emoji$1 = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
10377
+ "span",
10378
+ {
10379
+ className: `text-[24px] leading-none inline-block ${className}`,
10380
+ ...props
10381
+ }
10382
+ );
10383
+ const minimumTimeToShowLoadingIndicator = 1e3;
10384
+ const FormsView = ({ loadingPlaceholder } = {}) => {
10385
+ const cms = useCMS$1();
10386
+ const { setFormIsPristine } = React.useContext(SidebarContext);
10387
+ const [isShowingLoading, setIsShowingLoading] = React.useState(true);
10388
+ const [initialLoadComplete, setInitialLoadComplete] = React.useState(false);
10389
+ React.useEffect(() => {
10390
+ if (cms.state.isLoadingContent) {
10391
+ setIsShowingLoading(true);
10392
+ const timer = setTimeout(() => {
10393
+ if (!cms.state.isLoadingContent) {
10394
+ setIsShowingLoading(false);
10395
+ setInitialLoadComplete(true);
10396
+ }
10397
+ }, minimumTimeToShowLoadingIndicator);
10398
+ return () => clearTimeout(timer);
10399
+ } else {
10400
+ const timer = setTimeout(() => {
10401
+ setIsShowingLoading(false);
10402
+ setInitialLoadComplete(true);
10403
+ }, minimumTimeToShowLoadingIndicator);
10404
+ return () => clearTimeout(timer);
10405
+ }
10406
+ }, [cms.state.isLoadingContent]);
10407
+ if (isShowingLoading || !initialLoadComplete) {
10408
+ const LoadingPlaceholder = loadingPlaceholder || SidebarLoadingPlaceholder;
10409
+ return /* @__PURE__ */ React.createElement(LoadingPlaceholder, null);
10410
+ }
10411
+ if (!cms.state.formLists.length) {
10412
+ return /* @__PURE__ */ React.createElement(SidebarNoFormsPlaceholder, null);
10413
+ }
10414
+ const isMultiform = cms.state.forms.length > 1;
10415
+ const activeForm = cms.state.forms.find(
10416
+ ({ tinaForm }) => tinaForm.id === cms.state.activeFormId
10417
+ );
10418
+ const isEditing = !!activeForm;
10419
+ if (isMultiform && !activeForm) {
10420
+ return /* @__PURE__ */ React.createElement(FormLists, { isEditing });
10421
+ }
10422
+ const formMetas = cms.plugins.all("form:meta");
10423
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, activeForm && /* @__PURE__ */ React.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React.createElement(React.Fragment, { key: meta.name }, /* @__PURE__ */ React.createElement(meta.Component, null))), /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
10424
+ };
10425
+ const FormWrapper$1 = ({ isEditing, children }) => {
10426
+ return /* @__PURE__ */ React.createElement(
10427
+ "div",
10428
+ {
10429
+ className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white",
10430
+ style: isEditing ? {
10431
+ transform: "none",
10432
+ animationName: "fly-in-left",
10433
+ animationDuration: "150ms",
10434
+ animationDelay: "0",
10435
+ animationIterationCount: 1,
10436
+ animationTimingFunction: "ease-out"
10437
+ } : {
10438
+ transform: "translate3d(100%, 0, 0)"
10439
+ }
10440
+ },
10441
+ children
10442
+ );
10443
+ };
10444
+ const MultiformFormHeader = ({
10445
+ activeForm
10446
+ }) => {
10447
+ const cms = useCMS$1();
10448
+ const { formIsPristine } = React.useContext(SidebarContext);
10449
+ return /* @__PURE__ */ React.createElement(
10450
+ "div",
10451
+ {
10452
+ className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
10453
+ },
10454
+ /* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React.createElement(
10455
+ "button",
10456
+ {
10457
+ type: "button",
10458
+ className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
10459
+ onClick: () => {
10460
+ const state = activeForm.tinaForm.finalForm.getState();
10461
+ if (state.invalid === true) {
10462
+ cms.alerts.error("Cannot navigate away from an invalid form.");
10463
+ } else {
10464
+ cms.dispatch({ type: "forms:set-active-form-id", value: null });
10465
+ }
10466
+ }
10467
+ },
10468
+ /* @__PURE__ */ React.createElement(BiDotsVertical, { className: "h-auto w-5 inline-block opacity-70" })
10469
+ ), /* @__PURE__ */ React.createElement(
10470
+ "button",
10471
+ {
10472
+ type: "button",
10473
+ className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
10474
+ onClick: () => {
10475
+ const collectionName = cms.api.tina.schema.getCollectionByFullPath(
10476
+ cms.state.activeFormId
10477
+ ).name;
10478
+ window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
10479
+ }
10480
+ },
10481
+ /* @__PURE__ */ React.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
10482
+ ), /* @__PURE__ */ React.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, activeForm.tinaForm.label || activeForm.tinaForm.id), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
10483
+ );
10484
+ };
10485
+ const FormHeader = ({ activeForm }) => {
10486
+ const { formIsPristine } = React.useContext(SidebarContext);
10487
+ const cms = useCMS$1();
10488
+ const shortFormLabel = activeForm.tinaForm.label ? activeForm.tinaForm.label.replace(/^.*[\\\/]/, "") : false;
10489
+ return /* @__PURE__ */ React.createElement(
10490
+ "div",
10491
+ {
10492
+ className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
10493
+ },
10494
+ /* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React.createElement(
10495
+ "button",
10496
+ {
10497
+ type: "button",
10498
+ className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
10499
+ onClick: () => {
10500
+ const collectionName = cms.api.tina.schema.getCollectionByFullPath(
10501
+ cms.state.activeFormId
10502
+ ).name;
10503
+ window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
10504
+ }
10505
+ },
10506
+ /* @__PURE__ */ React.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
10507
+ ), shortFormLabel && /* @__PURE__ */ React.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
10508
+ );
10509
+ };
10479
10510
  const SidebarContext = React.createContext(null);
10480
10511
  const minPreviewWidth = 440;
10481
10512
  const minSidebarWidth = 360;
@@ -10694,7 +10725,7 @@ const Sidebar$1 = ({
10694
10725
  isLocalMode: (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isLocalMode,
10695
10726
  branchingEnabled
10696
10727
  }
10697
- ), /* @__PURE__ */ React.createElement(FormsView, null, /* @__PURE__ */ React.createElement(sidebar.placeholder, null)), activeScreen && /* @__PURE__ */ React.createElement(
10728
+ ), /* @__PURE__ */ React.createElement(FormsView, { loadingPlaceholder: sidebar.loadingPlaceholder }), activeScreen && /* @__PURE__ */ React.createElement(
10698
10729
  ScreenPluginModal,
10699
10730
  {
10700
10731
  screen: activeScreen,
@@ -10870,7 +10901,7 @@ const SidebarHeader = ({
10870
10901
  className: "h-5 w-auto -mx-1 text-blue-500",
10871
10902
  stroke: "currentColor",
10872
10903
  fill: "currentColor",
10873
- "stroke-width": "0",
10904
+ strokeWidth: "0",
10874
10905
  viewBox: "0 0 24 24",
10875
10906
  xmlns: "http://www.w3.org/2000/svg"
10876
10907
  },
@@ -11010,6 +11041,93 @@ function createPlaceholder(name, _pr) {
11010
11041
  );
11011
11042
  };
11012
11043
  }
11044
+ function dirname(path) {
11045
+ var _a, _b;
11046
+ const pattern = new RegExp("(?<prevDir>.*)/");
11047
+ return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
11048
+ }
11049
+ const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React__default.createElement(
11050
+ "button",
11051
+ {
11052
+ className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
11053
+ ...props
11054
+ }
11055
+ );
11056
+ function Breadcrumb$1({ directory = "", setDirectory }) {
11057
+ directory = directory.replace(/^\/|\/$/g, "");
11058
+ let prevDir = dirname(directory) || "";
11059
+ if (prevDir === ".") {
11060
+ prevDir = "";
11061
+ }
11062
+ return /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React__default.createElement(
11063
+ IconButton,
11064
+ {
11065
+ variant: "ghost",
11066
+ className: "mr-2",
11067
+ onClick: () => setDirectory(prevDir)
11068
+ },
11069
+ /* @__PURE__ */ React__default.createElement(
11070
+ LeftArrowIcon,
11071
+ {
11072
+ className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
11073
+ }
11074
+ )
11075
+ ), /* @__PURE__ */ React__default.createElement(
11076
+ BreadcrumbButton,
11077
+ {
11078
+ onClick: () => setDirectory(""),
11079
+ className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
11080
+ },
11081
+ "Media"
11082
+ ), directory && directory.split("/").map((part, index, parts) => {
11083
+ const currentDir = parts.slice(0, index + 1).join("/");
11084
+ return /* @__PURE__ */ React__default.createElement(
11085
+ BreadcrumbButton,
11086
+ {
11087
+ className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
11088
+ key: currentDir,
11089
+ onClick: () => {
11090
+ setDirectory(currentDir);
11091
+ }
11092
+ },
11093
+ part
11094
+ );
11095
+ }));
11096
+ }
11097
+ const CopyField = ({ label, description, value }) => {
11098
+ const [copied, setCopied] = React__default.useState(false);
11099
+ const [fadeOut, setFadeOut] = React__default.useState(false);
11100
+ return /* @__PURE__ */ React__default.createElement("div", { className: "w-full" }, label && /* @__PURE__ */ React__default.createElement("label", { className: "w-full mb-1 block flex-1 text-sm font-bold leading-5 text-gray-700" }, label), /* @__PURE__ */ React__default.createElement(
11101
+ "span",
11102
+ {
11103
+ onClick: () => {
11104
+ if (copied === true)
11105
+ return;
11106
+ setCopied(true);
11107
+ setTimeout(() => {
11108
+ setFadeOut(true);
11109
+ }, 2500);
11110
+ setTimeout(() => {
11111
+ setCopied(false);
11112
+ setFadeOut(false);
11113
+ }, 3e3);
11114
+ navigator.clipboard.writeText(value);
11115
+ },
11116
+ 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` : ``}`
11117
+ },
11118
+ /* @__PURE__ */ React__default.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
11119
+ " ",
11120
+ value,
11121
+ " ",
11122
+ copied && /* @__PURE__ */ React__default.createElement(
11123
+ "span",
11124
+ {
11125
+ 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`
11126
+ },
11127
+ /* @__PURE__ */ React__default.createElement("span", null, "Copied to clipboard!")
11128
+ )
11129
+ ), description && /* @__PURE__ */ React__default.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
11130
+ };
11013
11131
  function ListMediaItem({ item, onClick, active }) {
11014
11132
  let FileIcon = BiFile;
11015
11133
  if (item.type === "dir") {
@@ -11085,59 +11203,6 @@ function GridMediaItem({ item, active, onClick }) {
11085
11203
  )
11086
11204
  );
11087
11205
  }
11088
- function dirname(path) {
11089
- var _a, _b;
11090
- const pattern = new RegExp("(?<prevDir>.*)/");
11091
- return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
11092
- }
11093
- const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React__default.createElement(
11094
- "button",
11095
- {
11096
- className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
11097
- ...props
11098
- }
11099
- );
11100
- function Breadcrumb$1({ directory = "", setDirectory }) {
11101
- directory = directory.replace(/^\/|\/$/g, "");
11102
- let prevDir = dirname(directory) || "";
11103
- if (prevDir === ".") {
11104
- prevDir = "";
11105
- }
11106
- return /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React__default.createElement(
11107
- IconButton,
11108
- {
11109
- variant: "ghost",
11110
- className: "mr-2",
11111
- onClick: () => setDirectory(prevDir)
11112
- },
11113
- /* @__PURE__ */ React__default.createElement(
11114
- LeftArrowIcon,
11115
- {
11116
- className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
11117
- }
11118
- )
11119
- ), /* @__PURE__ */ React__default.createElement(
11120
- BreadcrumbButton,
11121
- {
11122
- onClick: () => setDirectory(""),
11123
- className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
11124
- },
11125
- "Media"
11126
- ), directory && directory.split("/").map((part, index, parts) => {
11127
- const currentDir = parts.slice(0, index + 1).join("/");
11128
- return /* @__PURE__ */ React__default.createElement(
11129
- BreadcrumbButton,
11130
- {
11131
- className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
11132
- key: currentDir,
11133
- onClick: () => {
11134
- setDirectory(currentDir);
11135
- }
11136
- },
11137
- part
11138
- );
11139
- }));
11140
- }
11141
11206
  const DeleteModal$1 = ({
11142
11207
  close: close2,
11143
11208
  deleteFunc,
@@ -11191,40 +11256,6 @@ const NewFolderModal = ({ onSubmit, close: close2 }) => {
11191
11256
  "Create New Folder"
11192
11257
  ))));
11193
11258
  };
11194
- const CopyField = ({ label, description, value }) => {
11195
- const [copied, setCopied] = React__default.useState(false);
11196
- const [fadeOut, setFadeOut] = React__default.useState(false);
11197
- return /* @__PURE__ */ React__default.createElement("div", { className: "w-full" }, label && /* @__PURE__ */ React__default.createElement("label", { className: "w-full mb-1 block flex-1 text-sm font-bold leading-5 text-gray-700" }, label), /* @__PURE__ */ React__default.createElement(
11198
- "span",
11199
- {
11200
- onClick: () => {
11201
- if (copied === true)
11202
- return;
11203
- setCopied(true);
11204
- setTimeout(() => {
11205
- setFadeOut(true);
11206
- }, 2500);
11207
- setTimeout(() => {
11208
- setCopied(false);
11209
- setFadeOut(false);
11210
- }, 3e3);
11211
- navigator.clipboard.writeText(value);
11212
- },
11213
- 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` : ``}`
11214
- },
11215
- /* @__PURE__ */ React__default.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
11216
- " ",
11217
- value,
11218
- " ",
11219
- copied && /* @__PURE__ */ React__default.createElement(
11220
- "span",
11221
- {
11222
- 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`
11223
- },
11224
- /* @__PURE__ */ React__default.createElement("span", null, "Copied to clipboard!")
11225
- )
11226
- ), description && /* @__PURE__ */ React__default.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
11227
- };
11228
11259
  const { useDropzone } = dropzone;
11229
11260
  const join = function(...parts) {
11230
11261
  const [first, last, slash] = [0, parts.length - 1, "/"];
@@ -11460,7 +11491,10 @@ function MediaPicker({
11460
11491
  const observer = new IntersectionObserver((entries) => {
11461
11492
  const target = entries[0];
11462
11493
  if (target.isIntersecting && list.nextOffset) {
11463
- setOffsetHistory((offsetHistory2) => [...offsetHistory2, list.nextOffset]);
11494
+ setOffsetHistory((offsetHistory2) => [
11495
+ ...offsetHistory2,
11496
+ list.nextOffset
11497
+ ]);
11464
11498
  }
11465
11499
  });
11466
11500
  if (loaderRef.current) {
@@ -11723,7 +11757,7 @@ const SyncStatusContainer = ({ children }) => {
11723
11757
  target: "_blank",
11724
11758
  href: `${cms.api.tina.appDashboardLink}/media`
11725
11759
  },
11726
- "Sync Your Media In Tina Cloud.",
11760
+ "Sync Your Media In TinaCloud.",
11727
11761
  /* @__PURE__ */ React__default.createElement(BiLinkExternal, { className: `w-5 h-auto flex-shrink-0` })
11728
11762
  )
11729
11763
  )))) : /* @__PURE__ */ React__default.createElement(SyncStatusContext.Provider, { value: { syncStatus } }, children);
@@ -12055,6 +12089,7 @@ const initialState = (cms) => {
12055
12089
  forms: [],
12056
12090
  formLists: [],
12057
12091
  editingMode: "basic",
12092
+ isLoadingContent: false,
12058
12093
  quickEditSupported: false,
12059
12094
  sidebarDisplayState: ((_a = cms == null ? void 0 : cms.sidebar) == null ? void 0 : _a.defaultState) || "open"
12060
12095
  };
@@ -12114,7 +12149,12 @@ function tinaReducer(state, action) {
12114
12149
  }
12115
12150
  });
12116
12151
  }
12117
- return { ...state, activeFormId, formLists: nextFormLists };
12152
+ return {
12153
+ ...state,
12154
+ activeFormId,
12155
+ formLists: nextFormLists,
12156
+ isLoadingContent: false
12157
+ };
12118
12158
  }
12119
12159
  case "form-lists:remove": {
12120
12160
  const nextFormLists = state.formLists.filter(
@@ -12183,6 +12223,9 @@ function tinaReducer(state, action) {
12183
12223
  }
12184
12224
  return { ...state, sidebarDisplayState: action.value };
12185
12225
  }
12226
+ case "sidebar:set-loading-state": {
12227
+ return { ...state, isLoadingContent: action.value };
12228
+ }
12186
12229
  default:
12187
12230
  throw new Error(`Unhandled action ${action.type}`);
12188
12231
  }
@@ -12424,7 +12467,9 @@ const ActiveFieldIndicator = () => {
12424
12467
  if (activeEle) {
12425
12468
  setDisplay(true);
12426
12469
  setPosition(activeEle.getBoundingClientRect());
12427
- const iframe = document.getElementById("tina-iframe");
12470
+ const iframe = document.getElementById(
12471
+ "tina-iframe"
12472
+ );
12428
12473
  if (iframe) {
12429
12474
  setIframePosition(iframe.getBoundingClientRect());
12430
12475
  }
@@ -12866,7 +12911,6 @@ const CreateBranchModel = ({
12866
12911
  }) => {
12867
12912
  const cms = useCMS$1();
12868
12913
  const tinaApi = cms.api.tina;
12869
- tinaApi.branch;
12870
12914
  const [disabled, setDisabled] = React.useState(false);
12871
12915
  const [newBranchName, setNewBranchName] = React.useState("");
12872
12916
  const [error, setError] = React.useState("");
@@ -12892,10 +12936,10 @@ const CreateBranchModel = ({
12892
12936
  const newUrl = window.location.href.replace(hash, newHash);
12893
12937
  window.location.href = newUrl;
12894
12938
  };
12895
- return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, /* @__PURE__ */ React.createElement(BiGitBranch, { className: "w-6 h-auto mr-1 text-blue-500 opacity-70" }), " ", "Create Branch"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", { className: "text-base text-gray-700 mb-2" }, "This branch is ", /* @__PURE__ */ React.createElement("strong", null, "protected"), ". Create a new branch to save your changes."), /* @__PURE__ */ React.createElement(
12939
+ return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, /* @__PURE__ */ React.createElement(BiGitBranch, { className: "w-6 h-auto mr-1 text-blue-500 opacity-70" }), " ", "Create Branch"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "This content is protected 🚧"), /* @__PURE__ */ React.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.createElement(
12896
12940
  PrefixedTextField,
12897
12941
  {
12898
- placeholder: "Branch Name",
12942
+ placeholder: "e.g. {{PAGE-NAME}}-updates",
12899
12943
  value: newBranchName,
12900
12944
  onChange: (e) => {
12901
12945
  setError("");
@@ -13042,7 +13086,9 @@ const ImgEmbed = ({
13042
13086
  const { fieldName } = useTemplates();
13043
13087
  const { handleClose, handleRemove, handleSelect, isExpanded } = useEmbedHandles(editor, element, fieldName);
13044
13088
  useHotkey("enter", () => {
13045
- insertNodes(editor, [{ type: ELEMENT_PARAGRAPH, children: [{ text: "" }] }]);
13089
+ insertNodes(editor, [
13090
+ { type: ELEMENT_PARAGRAPH, children: [{ text: "" }] }
13091
+ ]);
13046
13092
  });
13047
13093
  return /* @__PURE__ */ React__default.createElement("span", { ...attributes, className: "" }, children, element.url ? /* @__PURE__ */ React__default.createElement(
13048
13094
  "div",
@@ -13185,7 +13231,9 @@ const InlineEmbed = ({
13185
13231
  const { templates, fieldName } = useTemplates();
13186
13232
  const { handleClose, handleRemove, handleSelect, isExpanded } = useEmbedHandles(editor, element, fieldName);
13187
13233
  useHotkey("enter", () => {
13188
- insertNodes(editor, [{ type: ELEMENT_PARAGRAPH, children: [{ text: "" }] }]);
13234
+ insertNodes(editor, [
13235
+ { type: ELEMENT_PARAGRAPH, children: [{ text: "" }] }
13236
+ ]);
13189
13237
  });
13190
13238
  useHotkey("space", () => {
13191
13239
  insertNodes(editor, [{ text: " " }], {
@@ -13241,7 +13289,9 @@ const BlockEmbed = ({
13241
13289
  const { templates, fieldName } = useTemplates();
13242
13290
  const { handleClose, handleRemove, handleSelect, isExpanded } = useEmbedHandles(editor, element, fieldName);
13243
13291
  useHotkey("enter", () => {
13244
- insertNodes(editor, [{ type: ELEMENT_PARAGRAPH, children: [{ text: "" }] }]);
13292
+ insertNodes(editor, [
13293
+ { type: ELEMENT_PARAGRAPH, children: [{ text: "" }] }
13294
+ ]);
13245
13295
  });
13246
13296
  const activeTemplate = templates.find(
13247
13297
  (template) => template.name === element.name
@@ -13587,6 +13637,11 @@ const autoformatMarks = [
13587
13637
  mode: "mark",
13588
13638
  type: MARK_CODE,
13589
13639
  match: "`"
13640
+ },
13641
+ {
13642
+ mode: "mark",
13643
+ type: MARK_STRIKETHROUGH,
13644
+ match: ["~~", "~"]
13590
13645
  }
13591
13646
  ];
13592
13647
  const autoformatRules = [
@@ -13728,16 +13783,14 @@ const plugins$1 = [
13728
13783
  })
13729
13784
  ];
13730
13785
  const plugins = [
13786
+ createBasicMarksPlugin(),
13731
13787
  createHeadingPlugin(),
13732
13788
  createParagraphPlugin(),
13733
13789
  createCodeBlockPlugin(),
13734
13790
  createHTMLBlockPlugin(),
13735
13791
  createHTMLInlinePlugin(),
13736
13792
  createBlockquotePlugin(),
13737
- createBoldPlugin(),
13738
- createItalicPlugin(),
13739
13793
  createUnderlinePlugin(),
13740
- createCodePlugin(),
13741
13794
  createListPlugin(),
13742
13795
  createIndentListPlugin(),
13743
13796
  createHorizontalRulePlugin(),
@@ -14097,7 +14150,9 @@ const EMBED_ICON_WIDTH = 78;
14097
14150
  const CONTAINER_MD_BREAKPOINT = 448;
14098
14151
  const FLOAT_BUTTON_WIDTH = 25;
14099
14152
  const HEADING_LABEL = "Headings";
14100
- const ToolbarContext = createContext(void 0);
14153
+ const ToolbarContext = createContext(
14154
+ void 0
14155
+ );
14101
14156
  const ToolbarProvider = ({
14102
14157
  tinaForm,
14103
14158
  templates,
@@ -14247,7 +14302,7 @@ const useCodeBlockToolbarButton = (state) => {
14247
14302
  const CodeBlockToolbarButton = withRef(({ clear, ...rest }, ref) => {
14248
14303
  const state = useCodeBlockToolbarButtonState();
14249
14304
  const { props } = useCodeBlockToolbarButton(state);
14250
- return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.codeBlock, null));
14305
+ return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Code Block", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.codeBlock, null));
14251
14306
  });
14252
14307
  const useImageToolbarButtonState = () => {
14253
14308
  const editor = useEditorState();
@@ -14279,36 +14334,54 @@ const useImageToolbarButton = (state) => {
14279
14334
  const ImageToolbarButton = withRef(({ clear, ...rest }, ref) => {
14280
14335
  const state = useImageToolbarButtonState();
14281
14336
  const { props } = useImageToolbarButton(state);
14282
- return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.image, null));
14283
- });
14284
- const IndentListToolbarButton = withRef(({ nodeType = ELEMENT_UL }, ref) => {
14285
- const editor = useEditorState();
14286
- const state = useListToolbarButtonState({ nodeType });
14287
- const { props } = useListToolbarButton(state);
14288
- return /* @__PURE__ */ React__default.createElement(
14289
- ToolbarButton,
14290
- {
14291
- ref,
14292
- tooltip: nodeType === ELEMENT_UL ? "Bulleted List" : "Numbered List",
14293
- ...props,
14294
- onClick: (e) => {
14295
- e.preventDefault();
14296
- e.stopPropagation();
14297
- toggleList(editor, { type: nodeType });
14298
- }
14299
- },
14300
- nodeType === ELEMENT_UL ? /* @__PURE__ */ React__default.createElement(Icons.ul, null) : /* @__PURE__ */ React__default.createElement(Icons.ol, null)
14301
- );
14337
+ return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Image", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.image, null));
14302
14338
  });
14339
+ const UnorderedListToolbarButton = withRef(
14340
+ (props, ref) => {
14341
+ const editor = useEditorState();
14342
+ const state = useListToolbarButtonState({ nodeType: ELEMENT_UL });
14343
+ const { props: buttonProps } = useListToolbarButton(state);
14344
+ return /* @__PURE__ */ React__default.createElement(
14345
+ ToolbarButton,
14346
+ {
14347
+ ref,
14348
+ tooltip: "Bulleted List",
14349
+ ...buttonProps,
14350
+ onClick: (e) => {
14351
+ e.preventDefault();
14352
+ e.stopPropagation();
14353
+ toggleList(editor, { type: ELEMENT_UL });
14354
+ }
14355
+ },
14356
+ /* @__PURE__ */ React__default.createElement(Icons.ul, null)
14357
+ );
14358
+ }
14359
+ );
14360
+ const OrderedListToolbarButton = withRef(
14361
+ (props, ref) => {
14362
+ const editor = useEditorState();
14363
+ const state = useListToolbarButtonState({ nodeType: ELEMENT_OL });
14364
+ const { props: buttonProps } = useListToolbarButton(state);
14365
+ return /* @__PURE__ */ React__default.createElement(
14366
+ ToolbarButton,
14367
+ {
14368
+ ref,
14369
+ tooltip: "Numbered List",
14370
+ ...buttonProps,
14371
+ onClick: (e) => {
14372
+ e.preventDefault();
14373
+ e.stopPropagation();
14374
+ toggleList(editor, { type: ELEMENT_OL });
14375
+ }
14376
+ },
14377
+ /* @__PURE__ */ React__default.createElement(Icons.ol, null)
14378
+ );
14379
+ }
14380
+ );
14303
14381
  const LinkToolbarButton = withRef((rest, ref) => {
14304
14382
  const state = useLinkToolbarButtonState();
14305
14383
  const { props } = useLinkToolbarButton(state);
14306
- return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...props, ...rest }, /* @__PURE__ */ React__default.createElement(Icons.link, null));
14307
- });
14308
- const MarkToolbarButton = withRef(({ clear, nodeType, ...rest }, ref) => {
14309
- const state = useMarkToolbarButtonState({ clear, nodeType });
14310
- const { props } = useMarkToolbarButton(state);
14311
- return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest });
14384
+ return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest, tooltip: "Link" }, /* @__PURE__ */ React__default.createElement(Icons.link, null));
14312
14385
  });
14313
14386
  const useMermaidToolbarButtonState = () => {
14314
14387
  const editor = useEditorState();
@@ -14389,7 +14462,7 @@ const useBlockQuoteToolbarButton = (state) => {
14389
14462
  const QuoteToolbarButton = withRef(({ clear, ...rest }, ref) => {
14390
14463
  const state = useBlockQuoteToolbarButtonState();
14391
14464
  const { props } = useBlockQuoteToolbarButton(state);
14392
- return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.quote, null));
14465
+ return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Quote (⌘+⇧+.)", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.quote, null));
14393
14466
  });
14394
14467
  const useRawMarkdownToolbarButton = () => {
14395
14468
  const { setRawMode } = useEditorContext();
@@ -14409,7 +14482,7 @@ const RawMarkdownToolbarButton = withRef(({ clear, ...rest }, ref) => {
14409
14482
  ToolbarButton,
14410
14483
  {
14411
14484
  ref,
14412
- tooltip: "Link",
14485
+ tooltip: "Raw Markdown",
14413
14486
  ...rest,
14414
14487
  ...props,
14415
14488
  "data-testid": "markdown-button"
@@ -14562,6 +14635,15 @@ const EmbedButton = ({ editor, templates }) => {
14562
14635
  template.label || template.name
14563
14636
  ))));
14564
14637
  };
14638
+ const MarkToolbarButton = withRef(({ clear, nodeType, ...rest }, ref) => {
14639
+ const state = useMarkToolbarButtonState({ clear, nodeType });
14640
+ const { props } = useMarkToolbarButton(state);
14641
+ return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest });
14642
+ });
14643
+ const BoldToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: MARK_BOLD }, /* @__PURE__ */ React__default.createElement(Icons.bold, null));
14644
+ const StrikethroughToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Strikethrough", nodeType: MARK_STRIKETHROUGH }, /* @__PURE__ */ React__default.createElement(Icons.strikethrough, null));
14645
+ const ItalicToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: MARK_ITALIC }, /* @__PURE__ */ React__default.createElement(Icons.italic, null));
14646
+ const CodeToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: MARK_CODE }, /* @__PURE__ */ React__default.createElement(Icons.code, null));
14565
14647
  const toolbarItems = {
14566
14648
  heading: {
14567
14649
  label: HEADING_LABEL,
@@ -14582,32 +14664,37 @@ const toolbarItems = {
14582
14664
  quote: {
14583
14665
  label: "Quote",
14584
14666
  width: () => STANDARD_ICON_WIDTH,
14585
- Component: /* @__PURE__ */ React__default.createElement(QuoteToolbarButton, { tooltip: "Quote Quote (⌘+⇧+.)" })
14667
+ Component: /* @__PURE__ */ React__default.createElement(QuoteToolbarButton, null)
14586
14668
  },
14587
14669
  ul: {
14588
14670
  label: "Unordered List",
14589
14671
  width: () => STANDARD_ICON_WIDTH,
14590
- Component: /* @__PURE__ */ React__default.createElement(IndentListToolbarButton, { nodeType: ELEMENT_UL })
14672
+ Component: /* @__PURE__ */ React__default.createElement(UnorderedListToolbarButton, null)
14591
14673
  },
14592
14674
  ol: {
14593
14675
  label: "Ordered List",
14594
14676
  width: () => STANDARD_ICON_WIDTH,
14595
- Component: /* @__PURE__ */ React__default.createElement(IndentListToolbarButton, { nodeType: ELEMENT_OL })
14677
+ Component: /* @__PURE__ */ React__default.createElement(OrderedListToolbarButton, null)
14596
14678
  },
14597
14679
  bold: {
14598
14680
  label: "Bold",
14599
14681
  width: () => STANDARD_ICON_WIDTH,
14600
- Component: /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: MARK_BOLD }, /* @__PURE__ */ React__default.createElement(Icons.bold, null))
14682
+ Component: /* @__PURE__ */ React__default.createElement(BoldToolbarButton, null)
14683
+ },
14684
+ strikethrough: {
14685
+ label: "Strikethrough",
14686
+ width: () => STANDARD_ICON_WIDTH,
14687
+ Component: /* @__PURE__ */ React__default.createElement(StrikethroughToolbarButton, null)
14601
14688
  },
14602
14689
  italic: {
14603
14690
  label: "Italic",
14604
14691
  width: () => STANDARD_ICON_WIDTH,
14605
- Component: /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: MARK_ITALIC }, /* @__PURE__ */ React__default.createElement(Icons.italic, null))
14692
+ Component: /* @__PURE__ */ React__default.createElement(ItalicToolbarButton, null)
14606
14693
  },
14607
14694
  code: {
14608
14695
  label: "Code",
14609
14696
  width: () => STANDARD_ICON_WIDTH,
14610
- Component: /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: MARK_CODE }, /* @__PURE__ */ React__default.createElement(Icons.code, null))
14697
+ Component: /* @__PURE__ */ React__default.createElement(CodeToolbarButton, null)
14611
14698
  },
14612
14699
  codeBlock: {
14613
14700
  label: "Code Block",
@@ -16256,132 +16343,1209 @@ const ben = [
16256
16343
  "হয়"
16257
16344
  ];
16258
16345
  const bre = [
16346
+ "'blam",
16347
+ "'d",
16348
+ "'m",
16349
+ "'r",
16350
+ "'ta",
16351
+ "'vat",
16352
+ "'z",
16353
+ "'zo",
16259
16354
  "a",
16260
- "ainda",
16261
- "alem",
16262
- "ambas",
16263
- "ambos",
16264
- "antes",
16265
- "ao",
16266
- "aonde",
16267
- "aos",
16268
- "apos",
16269
- "aquele",
16270
- "aqueles",
16271
- "as",
16272
- "assim",
16273
- "com",
16274
- "como",
16275
- "contra",
16276
- "contudo",
16277
- "cuja",
16278
- "cujas",
16279
- "cujo",
16280
- "cujos",
16355
+ "a:",
16356
+ "aba",
16357
+ "abalamour",
16358
+ "abaoe",
16359
+ "ac'hane",
16360
+ "ac'hanoc'h",
16361
+ "ac'hanomp",
16362
+ "ac'hanon",
16363
+ "ac'hanout",
16364
+ "adal",
16365
+ "adalek",
16366
+ "adarre",
16367
+ "ae",
16368
+ "aec'h",
16369
+ "aed",
16370
+ "aemp",
16371
+ "aen",
16372
+ "aent",
16373
+ "aes",
16374
+ "afe",
16375
+ "afec'h",
16376
+ "afed",
16377
+ "afemp",
16378
+ "afen",
16379
+ "afent",
16380
+ "afes",
16381
+ "ag",
16382
+ "ah",
16383
+ "aimp",
16384
+ "aint",
16385
+ "aio",
16386
+ "aiou",
16387
+ "aje",
16388
+ "ajec'h",
16389
+ "ajed",
16390
+ "ajemp",
16391
+ "ajen",
16392
+ "ajent",
16393
+ "ajes",
16394
+ "al",
16395
+ "alato",
16396
+ "alies",
16397
+ "aliesañ",
16398
+ "alkent",
16399
+ "all",
16400
+ "allas",
16401
+ "allo",
16402
+ "allô",
16403
+ "am",
16404
+ "amañ",
16405
+ "amzer",
16406
+ "an",
16407
+ "anezhañ",
16408
+ "anezhe",
16409
+ "anezhi",
16410
+ "anezho",
16411
+ "anvet",
16412
+ "aon",
16413
+ "aotren",
16414
+ "ar",
16415
+ "arall",
16416
+ "araok",
16417
+ "araoki",
16418
+ "araozañ",
16419
+ "araozo",
16420
+ "araozoc'h",
16421
+ "araozomp",
16422
+ "araozon",
16423
+ "araozor",
16424
+ "araozout",
16425
+ "arbenn",
16426
+ "arre",
16427
+ "atalek",
16428
+ "atav",
16429
+ "az",
16430
+ "azalek",
16431
+ "azirazañ",
16432
+ "azirazi",
16433
+ "azirazo",
16434
+ "azirazoc'h",
16435
+ "azirazomp",
16436
+ "azirazon",
16437
+ "azirazor",
16438
+ "azirazout",
16439
+ "b:",
16440
+ "ba",
16441
+ "ba'l",
16442
+ "ba'n",
16443
+ "ba'r",
16444
+ "bad",
16445
+ "bah",
16446
+ "bal",
16447
+ "ban",
16448
+ "bar",
16449
+ "bastañ",
16450
+ "befe",
16451
+ "bell",
16452
+ "benaos",
16453
+ "benn",
16454
+ "bennag",
16455
+ "bennak",
16456
+ "bennozh",
16457
+ "bep",
16458
+ "bepred",
16459
+ "berr",
16460
+ "berzh",
16461
+ "bet",
16462
+ "betek",
16463
+ "betra",
16464
+ "bev",
16465
+ "bevet",
16466
+ "bez",
16467
+ "bezañ",
16468
+ "beze",
16469
+ "bezent",
16470
+ "bezet",
16471
+ "bezh",
16472
+ "bezit",
16473
+ "bezomp",
16474
+ "bihan",
16475
+ "bije",
16476
+ "biou",
16477
+ "biskoazh",
16478
+ "blam",
16479
+ "bo",
16480
+ "boa",
16481
+ "bominapl",
16482
+ "boudoudom",
16483
+ "bouez",
16484
+ "boull",
16485
+ "boum",
16486
+ "bout",
16487
+ "bras",
16488
+ "brasañ",
16489
+ "brav",
16490
+ "bravo",
16491
+ "bremañ",
16492
+ "bres",
16493
+ "brokenn",
16494
+ "bronn",
16495
+ "brrr",
16496
+ "brutal",
16497
+ "buhezek",
16498
+ "c'h:",
16499
+ "c'haout",
16500
+ "c'he",
16501
+ "c'hem",
16502
+ "c'herz",
16503
+ "c'heñver",
16504
+ "c'hichen",
16505
+ "c'hiz",
16506
+ "c'hoazh",
16507
+ "c'horre",
16508
+ "c'houde",
16509
+ "c'houst",
16510
+ "c'hreiz",
16511
+ "c'hwec'h",
16512
+ "c'hwec'hvet",
16513
+ "c'hwezek",
16514
+ "c'hwi",
16515
+ "ch:",
16516
+ "chaous",
16517
+ "chik",
16518
+ "chit",
16519
+ "chom",
16520
+ "chut",
16521
+ "d'",
16522
+ "d'al",
16523
+ "d'an",
16524
+ "d'ar",
16525
+ "d'az",
16526
+ "d'e",
16527
+ "d'he",
16528
+ "d'ho",
16529
+ "d'hol",
16530
+ "d'hon",
16531
+ "d'hor",
16532
+ "d'o",
16533
+ "d'ober",
16534
+ "d'ul",
16535
+ "d'un",
16536
+ "d'ur",
16537
+ "d:",
16281
16538
  "da",
16282
- "das",
16283
- "de",
16284
- "dela",
16285
- "dele",
16286
- "deles",
16287
- "demais",
16288
- "depois",
16289
- "desde",
16290
- "desta",
16291
- "deste",
16292
- "dispoe",
16293
- "dispoem",
16294
- "diversa",
16295
- "diversas",
16296
- "diversos",
16539
+ "dak",
16540
+ "daka",
16541
+ "dal",
16542
+ "dalbezh",
16543
+ "dalc'hmat",
16544
+ "dalit",
16545
+ "damdost",
16546
+ "damheñvel",
16547
+ "damm",
16548
+ "dan",
16549
+ "danvez",
16550
+ "dao",
16551
+ "daol",
16552
+ "daonet",
16553
+ "daou",
16554
+ "daoust",
16555
+ "daouzek",
16556
+ "daouzekvet",
16557
+ "darn",
16558
+ "dastrewiñ",
16559
+ "dav",
16560
+ "davedoc'h",
16561
+ "davedomp",
16562
+ "davedon",
16563
+ "davedor",
16564
+ "davedout",
16565
+ "davet",
16566
+ "davetañ",
16567
+ "davete",
16568
+ "daveti",
16569
+ "daveto",
16570
+ "defe",
16571
+ "dehou",
16572
+ "dek",
16573
+ "dekvet",
16574
+ "den",
16575
+ "deoc'h",
16576
+ "deomp",
16577
+ "deor",
16578
+ "derc'hel",
16579
+ "deus",
16580
+ "dez",
16581
+ "deze",
16582
+ "dezhañ",
16583
+ "dezhe",
16584
+ "dezhi",
16585
+ "dezho",
16586
+ "di",
16587
+ "diabarzh",
16588
+ "diagent",
16589
+ "diar",
16590
+ "diaraok",
16591
+ "diavaez",
16592
+ "dibaoe",
16593
+ "dibaot",
16594
+ "dibar",
16595
+ "dic'halañ",
16596
+ "didiac'h",
16597
+ "dienn",
16598
+ "difer",
16599
+ "diganeoc'h",
16600
+ "diganeomp",
16601
+ "diganeor",
16602
+ "diganimp",
16603
+ "diganin",
16604
+ "diganit",
16605
+ "digant",
16606
+ "digantañ",
16607
+ "digante",
16608
+ "diganti",
16609
+ "diganto",
16610
+ "digemmesk",
16611
+ "diget",
16612
+ "digor",
16613
+ "digoret",
16614
+ "dija",
16615
+ "dije",
16616
+ "dimp",
16617
+ "din",
16618
+ "dinaou",
16619
+ "dindan",
16620
+ "dindanañ",
16621
+ "dindani",
16622
+ "dindano",
16623
+ "dindanoc'h",
16624
+ "dindanomp",
16625
+ "dindanon",
16626
+ "dindanor",
16627
+ "dindanout",
16628
+ "dioutañ",
16629
+ "dioute",
16630
+ "diouti",
16631
+ "diouto",
16632
+ "diouzh",
16633
+ "diouzhin",
16634
+ "diouzhit",
16635
+ "diouzhoc'h",
16636
+ "diouzhomp",
16637
+ "diouzhor",
16638
+ "dirak",
16639
+ "dirazañ",
16640
+ "dirazi",
16641
+ "dirazo",
16642
+ "dirazoc'h",
16643
+ "dirazomp",
16644
+ "dirazon",
16645
+ "dirazor",
16646
+ "dirazout",
16647
+ "disheñvel",
16648
+ "dispar",
16649
+ "distank",
16650
+ "dister",
16651
+ "disterañ",
16652
+ "disterig",
16653
+ "distro",
16654
+ "dit",
16655
+ "divaez",
16656
+ "diwar",
16657
+ "diwezhat",
16658
+ "diwezhañ",
16297
16659
  "do",
16298
- "dos",
16299
- "durante",
16660
+ "doa",
16661
+ "doare",
16662
+ "dont",
16663
+ "dost",
16664
+ "doue",
16665
+ "douetus",
16666
+ "douez",
16667
+ "doug",
16668
+ "draou",
16669
+ "draoñ",
16670
+ "dre",
16671
+ "drede",
16672
+ "dreist",
16673
+ "dreistañ",
16674
+ "dreisti",
16675
+ "dreisto",
16676
+ "dreistoc'h",
16677
+ "dreistomp",
16678
+ "dreiston",
16679
+ "dreistor",
16680
+ "dreistout",
16681
+ "drek",
16682
+ "dreñv",
16683
+ "dring",
16684
+ "dro",
16685
+ "du",
16300
16686
  "e",
16301
- "ela",
16302
- "elas",
16303
- "ele",
16304
- "eles",
16687
+ "e:",
16688
+ "eas",
16689
+ "ebet",
16690
+ "ec'h",
16691
+ "edo",
16692
+ "edoc'h",
16693
+ "edod",
16694
+ "edomp",
16695
+ "edon",
16696
+ "edont",
16697
+ "edos",
16698
+ "eer",
16699
+ "eeun",
16700
+ "efed",
16701
+ "egedoc'h",
16702
+ "egedomp",
16703
+ "egedon",
16704
+ "egedor",
16705
+ "egedout",
16706
+ "eget",
16707
+ "egetañ",
16708
+ "egete",
16709
+ "egeti",
16710
+ "egeto",
16711
+ "eh",
16712
+ "eil",
16713
+ "eilvet",
16714
+ "eizh",
16715
+ "eizhvet",
16716
+ "ejoc'h",
16717
+ "ejod",
16718
+ "ejomp",
16719
+ "ejont",
16720
+ "ejout",
16721
+ "el",
16305
16722
  "em",
16306
- "entao",
16307
- "entre",
16308
- "essa",
16309
- "essas",
16310
- "esse",
16311
- "esses",
16312
- "esta",
16313
- "estas",
16314
- "este",
16315
- "estes",
16723
+ "emaint",
16724
+ "emaoc'h",
16725
+ "emaomp",
16726
+ "emaon",
16727
+ "emaout",
16728
+ "emañ",
16729
+ "eme",
16730
+ "emeur",
16731
+ "emezañ",
16732
+ "emezi",
16733
+ "emezo",
16734
+ "emezoc'h",
16735
+ "emezomp",
16736
+ "emezon",
16737
+ "emezout",
16738
+ "emporzhiañ",
16739
+ "en",
16740
+ "end",
16741
+ "endan",
16742
+ "endra",
16743
+ "enep",
16744
+ "ennañ",
16745
+ "enni",
16746
+ "enno",
16747
+ "ennoc'h",
16748
+ "ennomp",
16749
+ "ennon",
16750
+ "ennor",
16751
+ "ennout",
16752
+ "enta",
16753
+ "eo",
16754
+ "eomp",
16755
+ "eont",
16756
+ "eor",
16757
+ "eot",
16758
+ "er",
16759
+ "erbet",
16760
+ "erfin",
16761
+ "esa",
16762
+ "esae",
16763
+ "espar",
16764
+ "estlamm",
16765
+ "estrañj",
16766
+ "eta",
16767
+ "etre",
16768
+ "etreoc'h",
16769
+ "etrezo",
16770
+ "etrezoc'h",
16771
+ "etrezomp",
16772
+ "etrezor",
16773
+ "euh",
16774
+ "eur",
16775
+ "eus",
16776
+ "evel",
16777
+ "evelato",
16778
+ "eveldoc'h",
16779
+ "eveldomp",
16780
+ "eveldon",
16781
+ "eveldor",
16782
+ "eveldout",
16783
+ "evelkent",
16784
+ "eveltañ",
16785
+ "evelte",
16786
+ "evelti",
16787
+ "evelto",
16788
+ "evidoc'h",
16789
+ "evidomp",
16790
+ "evidon",
16791
+ "evidor",
16792
+ "evidout",
16793
+ "evit",
16794
+ "evitañ",
16795
+ "evite",
16796
+ "eviti",
16797
+ "evito",
16798
+ "ez",
16799
+ "eñ",
16800
+ "f:",
16801
+ "fac'h",
16802
+ "fall",
16803
+ "fed",
16804
+ "feiz",
16805
+ "fenn",
16806
+ "fezh",
16807
+ "fin",
16808
+ "finsalvet",
16809
+ "foei",
16810
+ "fouilhezañ",
16811
+ "g:",
16812
+ "gallout",
16813
+ "ganeoc'h",
16814
+ "ganeomp",
16815
+ "ganin",
16816
+ "ganit",
16817
+ "gant",
16818
+ "gantañ",
16819
+ "ganti",
16820
+ "ganto",
16821
+ "gaout",
16822
+ "gast",
16823
+ "gein",
16824
+ "gellout",
16825
+ "genndost",
16826
+ "gentañ",
16827
+ "ger",
16828
+ "gerz",
16829
+ "get",
16830
+ "geñver",
16831
+ "gichen",
16832
+ "gin",
16833
+ "giz",
16834
+ "glan",
16835
+ "gloev",
16836
+ "goll",
16837
+ "gorre",
16838
+ "goude",
16839
+ "gouez",
16840
+ "gouezit",
16841
+ "gouezomp",
16842
+ "goulz",
16843
+ "gounnar",
16844
+ "gour",
16845
+ "goust",
16846
+ "gouze",
16847
+ "gouzout",
16848
+ "gra",
16849
+ "grak",
16850
+ "grec'h",
16851
+ "greiz",
16852
+ "grenn",
16853
+ "greomp",
16854
+ "grit",
16855
+ "groñs",
16856
+ "gutez",
16857
+ "gwall",
16858
+ "gwashoc'h",
16859
+ "gwazh",
16860
+ "gwech",
16861
+ "gwechall",
16862
+ "gwechoù",
16863
+ "gwell",
16864
+ "gwezh",
16865
+ "gwezhall",
16866
+ "gwezharall",
16867
+ "gwezhoù",
16868
+ "gwig",
16869
+ "gwirionez",
16870
+ "gwitibunan",
16871
+ "gêr",
16872
+ "h:",
16316
16873
  "ha",
16317
- "isso",
16318
- "isto",
16319
- "logo",
16320
- "mais",
16321
- "mas",
16322
- "mediante",
16323
- "menos",
16324
- "mesma",
16325
- "mesmas",
16326
- "mesmo",
16327
- "mesmos",
16874
+ "hag",
16875
+ "han",
16876
+ "hanter",
16877
+ "hanterc'hantad",
16878
+ "hanterkantved",
16879
+ "harz",
16880
+ "hañ",
16881
+ "hañval",
16882
+ "he",
16883
+ "hebioù",
16884
+ "hec'h",
16885
+ "hei",
16886
+ "hein",
16887
+ "hem",
16888
+ "hemañ",
16889
+ "hen",
16890
+ "hend",
16891
+ "henhont",
16892
+ "henn",
16893
+ "hennezh",
16894
+ "hent",
16895
+ "hep",
16896
+ "hervez",
16897
+ "hervezañ",
16898
+ "hervezi",
16899
+ "hervezo",
16900
+ "hervezoc'h",
16901
+ "hervezomp",
16902
+ "hervezon",
16903
+ "hervezor",
16904
+ "hervezout",
16905
+ "heul",
16906
+ "heuliañ",
16907
+ "hevelep",
16908
+ "heverk",
16909
+ "heñvel",
16910
+ "heñvelat",
16911
+ "heñvelañ",
16912
+ "heñveliñ",
16913
+ "heñveloc'h",
16914
+ "heñvelout",
16915
+ "hi",
16916
+ "hilh",
16917
+ "hini",
16918
+ "hirie",
16919
+ "hirio",
16920
+ "hiziv",
16921
+ "hiziviken",
16922
+ "ho",
16923
+ "hoaliñ",
16924
+ "hoc'h",
16925
+ "hogen",
16926
+ "hogos",
16927
+ "hogozik",
16928
+ "hol",
16929
+ "holl",
16930
+ "holà",
16931
+ "homañ",
16932
+ "hon",
16933
+ "honhont",
16934
+ "honnezh",
16935
+ "hont",
16936
+ "hop",
16937
+ "hopala",
16938
+ "hor",
16939
+ "hou",
16940
+ "houp",
16941
+ "hudu",
16942
+ "hue",
16943
+ "hui",
16944
+ "hum",
16945
+ "hurrah",
16946
+ "i",
16947
+ "i:",
16948
+ "in",
16949
+ "int",
16950
+ "is",
16951
+ "ispisial",
16952
+ "isurzhiet",
16953
+ "it",
16954
+ "ivez",
16955
+ "izelañ",
16956
+ "j:",
16957
+ "just",
16958
+ "k:",
16959
+ "kae",
16960
+ "kaer",
16961
+ "kalon",
16962
+ "kalz",
16963
+ "kant",
16964
+ "kaout",
16965
+ "kar",
16966
+ "kazi",
16967
+ "keid",
16968
+ "kein",
16969
+ "keit",
16970
+ "kel",
16971
+ "kellies",
16972
+ "keloù",
16973
+ "kement",
16974
+ "ken",
16975
+ "kenkent",
16976
+ "kenkoulz",
16977
+ "kenment",
16978
+ "kent",
16979
+ "kentañ",
16980
+ "kentizh",
16981
+ "kentoc'h",
16982
+ "kentre",
16983
+ "ker",
16984
+ "kerkent",
16985
+ "kerz",
16986
+ "kerzh",
16987
+ "ket",
16988
+ "keta",
16989
+ "keñver",
16990
+ "keñverel",
16991
+ "keñverius",
16992
+ "kichen",
16993
+ "kichenik",
16994
+ "kit",
16995
+ "kiz",
16996
+ "klak",
16997
+ "klek",
16998
+ "klik",
16999
+ "komprenet",
17000
+ "komz",
17001
+ "kont",
17002
+ "korf",
17003
+ "korre",
17004
+ "koulskoude",
17005
+ "koulz",
17006
+ "koust",
17007
+ "krak",
17008
+ "krampouezh",
17009
+ "krec'h",
17010
+ "kreiz",
17011
+ "kuit",
17012
+ "kwir",
17013
+ "l:",
17014
+ "la",
17015
+ "laez",
17016
+ "laoskel",
17017
+ "laouen",
17018
+ "lavar",
17019
+ "lavaret",
17020
+ "lavarout",
17021
+ "lec'h",
17022
+ "lein",
17023
+ "leizh",
17024
+ "lerc'h",
17025
+ "leun",
17026
+ "leuskel",
17027
+ "lew",
17028
+ "lies",
17029
+ "liesañ",
17030
+ "lod",
17031
+ "lusk",
17032
+ "lâr",
17033
+ "lârout",
17034
+ "m:",
17035
+ "ma",
17036
+ "ma'z",
17037
+ "mac'h",
17038
+ "mac'hat",
17039
+ "mac'hañ",
17040
+ "mac'hoc'h",
17041
+ "mad",
17042
+ "maez",
17043
+ "maksimal",
17044
+ "mann",
17045
+ "mar",
17046
+ "mard",
17047
+ "marg",
17048
+ "marzh",
17049
+ "mat",
17050
+ "mañ",
17051
+ "me",
17052
+ "memes",
17053
+ "memestra",
17054
+ "merkapl",
17055
+ "mersi",
17056
+ "mes",
17057
+ "mesk",
17058
+ "met",
17059
+ "meur",
17060
+ "mil",
17061
+ "minimal",
17062
+ "moan",
17063
+ "moaniaat",
17064
+ "mod",
17065
+ "mont",
17066
+ "mout",
17067
+ "mui",
17068
+ "muiañ",
17069
+ "muioc'h",
17070
+ "n",
17071
+ "n'",
17072
+ "n:",
16328
17073
  "na",
16329
- "nao",
16330
- "nas",
16331
- "nem",
16332
- "nesse",
16333
- "neste",
16334
- "nos",
17074
+ "nag",
17075
+ "naontek",
17076
+ "naturel",
17077
+ "nav",
17078
+ "navet",
17079
+ "ne",
17080
+ "nebeudig",
17081
+ "nebeut",
17082
+ "nebeutañ",
17083
+ "nebeutoc'h",
17084
+ "neketa",
17085
+ "nemedoc'h",
17086
+ "nemedomp",
17087
+ "nemedon",
17088
+ "nemedor",
17089
+ "nemedout",
17090
+ "nemet",
17091
+ "nemetañ",
17092
+ "nemete",
17093
+ "nemeti",
17094
+ "nemeto",
17095
+ "nemeur",
17096
+ "neoac'h",
17097
+ "nepell",
17098
+ "nerzh",
17099
+ "nes",
17100
+ "neseser",
17101
+ "netra",
17102
+ "neubeudoù",
17103
+ "neuhe",
17104
+ "neuze",
17105
+ "nevez",
17106
+ "newazh",
17107
+ "nez",
17108
+ "ni",
17109
+ "nikun",
17110
+ "niverus",
17111
+ "nul",
16335
17112
  "o",
16336
- "os",
16337
- "ou",
16338
- "outra",
16339
- "outras",
16340
- "outro",
16341
- "outros",
16342
- "pelas",
16343
- "pelo",
16344
- "pelos",
16345
- "perante",
16346
- "pois",
16347
- "por",
16348
- "porque",
16349
- "portanto",
16350
- "propios",
16351
- "proprio",
16352
- "quais",
16353
- "qual",
16354
- "qualquer",
16355
- "quando",
16356
- "quanto",
16357
- "que",
16358
- "quem",
16359
- "quer",
17113
+ "o:",
17114
+ "oa",
17115
+ "oac'h",
17116
+ "oad",
17117
+ "oamp",
17118
+ "oan",
17119
+ "oant",
17120
+ "oar",
17121
+ "oas",
17122
+ "ober",
17123
+ "oc'h",
17124
+ "oc'ho",
17125
+ "oc'hola",
17126
+ "oc'hpenn",
17127
+ "oh",
17128
+ "ohe",
17129
+ "ollé",
17130
+ "olole",
17131
+ "olé",
17132
+ "omp",
17133
+ "on",
17134
+ "ordin",
17135
+ "ordinal",
17136
+ "ouejoc'h",
17137
+ "ouejod",
17138
+ "ouejomp",
17139
+ "ouejont",
17140
+ "ouejout",
17141
+ "ouek",
17142
+ "ouezas",
17143
+ "ouezi",
17144
+ "ouezimp",
17145
+ "ouezin",
17146
+ "ouezint",
17147
+ "ouezis",
17148
+ "ouezo",
17149
+ "ouezoc'h",
17150
+ "ouezor",
17151
+ "ouf",
17152
+ "oufe",
17153
+ "oufec'h",
17154
+ "oufed",
17155
+ "oufemp",
17156
+ "oufen",
17157
+ "oufent",
17158
+ "oufes",
17159
+ "ouie",
17160
+ "ouiec'h",
17161
+ "ouied",
17162
+ "ouiemp",
17163
+ "ouien",
17164
+ "ouient",
17165
+ "ouies",
17166
+ "ouije",
17167
+ "ouijec'h",
17168
+ "ouijed",
17169
+ "ouijemp",
17170
+ "ouijen",
17171
+ "ouijent",
17172
+ "ouijes",
17173
+ "out",
17174
+ "outañ",
17175
+ "outi",
17176
+ "outo",
17177
+ "ouzer",
17178
+ "ouzh",
17179
+ "ouzhin",
17180
+ "ouzhit",
17181
+ "ouzhoc'h",
17182
+ "ouzhomp",
17183
+ "ouzhor",
17184
+ "ouzhpenn",
17185
+ "ouzhpennik",
17186
+ "ouzoc'h",
17187
+ "ouzomp",
17188
+ "ouzon",
17189
+ "ouzont",
17190
+ "ouzout",
17191
+ "p'",
17192
+ "p:",
17193
+ "pa",
17194
+ "pad",
17195
+ "padal",
17196
+ "paf",
17197
+ "pan",
17198
+ "panevedeoc'h",
17199
+ "panevedo",
17200
+ "panevedomp",
17201
+ "panevedon",
17202
+ "panevedout",
17203
+ "panevet",
17204
+ "panevetañ",
17205
+ "paneveti",
17206
+ "pas",
17207
+ "paseet",
17208
+ "pe",
17209
+ "peadra",
17210
+ "peder",
17211
+ "pedervet",
17212
+ "pedervetvet",
17213
+ "pefe",
17214
+ "pegeit",
17215
+ "pegement",
17216
+ "pegen",
17217
+ "pegiz",
17218
+ "pegoulz",
17219
+ "pehini",
17220
+ "pelec'h",
17221
+ "pell",
17222
+ "pemod",
17223
+ "pemp",
17224
+ "pempved",
17225
+ "pemzek",
17226
+ "penaos",
17227
+ "penn",
17228
+ "peogwir",
17229
+ "peotramant",
17230
+ "pep",
17231
+ "perak",
17232
+ "perc'hennañ",
17233
+ "pergen",
17234
+ "permetiñ",
17235
+ "peseurt",
17236
+ "pet",
17237
+ "petiaoul",
17238
+ "petoare",
17239
+ "petra",
17240
+ "peur",
17241
+ "peurgetket",
17242
+ "peurheñvel",
17243
+ "peurliesañ",
17244
+ "peurvuiañ",
17245
+ "peus",
17246
+ "peustost",
17247
+ "peuz",
17248
+ "pevar",
17249
+ "pevare",
17250
+ "pevarevet",
17251
+ "pevarzek",
17252
+ "pez",
17253
+ "peze",
17254
+ "pezh",
17255
+ "pff",
17256
+ "pfft",
17257
+ "pfut",
17258
+ "picher",
17259
+ "pif",
17260
+ "pife",
17261
+ "pign",
17262
+ "pije",
17263
+ "pikol",
17264
+ "pitiaoul",
17265
+ "piv",
17266
+ "plaouf",
17267
+ "plok",
17268
+ "plouf",
17269
+ "po",
17270
+ "poa",
17271
+ "poelladus",
17272
+ "pof",
17273
+ "pok",
17274
+ "posupl",
17275
+ "pouah",
17276
+ "pourc'henn",
17277
+ "prest",
17278
+ "prestik",
17279
+ "prim",
17280
+ "prin",
17281
+ "provostapl",
17282
+ "pst",
17283
+ "pu",
17284
+ "pur",
17285
+ "r:",
17286
+ "ra",
17287
+ "rae",
17288
+ "raec'h",
17289
+ "raed",
17290
+ "raemp",
17291
+ "raen",
17292
+ "raent",
17293
+ "raes",
17294
+ "rafe",
17295
+ "rafec'h",
17296
+ "rafed",
17297
+ "rafemp",
17298
+ "rafen",
17299
+ "rafent",
17300
+ "rafes",
17301
+ "rag",
17302
+ "raimp",
17303
+ "raint",
17304
+ "raio",
17305
+ "raje",
17306
+ "rajec'h",
17307
+ "rajed",
17308
+ "rajemp",
17309
+ "rajen",
17310
+ "rajent",
17311
+ "rajes",
17312
+ "rak",
17313
+ "ral",
17314
+ "ran",
17315
+ "rankout",
17316
+ "raok",
17317
+ "razh",
17318
+ "re",
17319
+ "reas",
17320
+ "reer",
17321
+ "regennoù",
17322
+ "reiñ",
17323
+ "rejoc'h",
17324
+ "rejod",
17325
+ "rejomp",
17326
+ "rejont",
17327
+ "rejout",
17328
+ "rener",
17329
+ "rentañ",
17330
+ "reoc'h",
17331
+ "reomp",
17332
+ "reont",
17333
+ "reor",
17334
+ "reot",
17335
+ "resis",
17336
+ "ret",
17337
+ "reve",
17338
+ "rez",
17339
+ "ri",
17340
+ "rik",
17341
+ "rin",
17342
+ "ris",
17343
+ "rit",
17344
+ "rouez",
17345
+ "s:",
17346
+ "sac'h",
17347
+ "sant",
17348
+ "sav",
17349
+ "sañset",
16360
17350
  "se",
16361
- "seja",
16362
- "sem",
16363
- "sendo",
16364
- "seu",
16365
- "seus",
16366
- "sob",
16367
- "sobre",
16368
- "sua",
16369
- "suas",
17351
+ "sed",
17352
+ "seitek",
17353
+ "seizh",
17354
+ "seizhvet",
17355
+ "sell",
17356
+ "sellit",
17357
+ "ser",
17358
+ "setu",
17359
+ "seul",
17360
+ "seurt",
17361
+ "siwazh",
17362
+ "skignañ",
17363
+ "skoaz",
17364
+ "skouer",
17365
+ "sort",
17366
+ "souden",
17367
+ "souvitañ",
17368
+ "soñj",
17369
+ "speriañ",
17370
+ "spririñ",
17371
+ "stad",
17372
+ "stlabezañ",
17373
+ "stop",
17374
+ "stranañ",
17375
+ "strewiñ",
17376
+ "strishaat",
17377
+ "stumm",
17378
+ "sujed",
17379
+ "surtoud",
17380
+ "t:",
17381
+ "ta",
17382
+ "taer",
17383
+ "tailh",
17384
+ "tak",
16370
17385
  "tal",
16371
- "tambem",
16372
- "teu",
17386
+ "talvoudegezh",
17387
+ "tamm",
17388
+ "tanav",
17389
+ "taol",
17390
+ "te",
17391
+ "techet",
17392
+ "teir",
17393
+ "teirvet",
17394
+ "telt",
17395
+ "teltenn",
16373
17396
  "teus",
16374
- "toda",
16375
- "todas",
16376
- "todo",
16377
- "todos",
16378
- "tua",
16379
- "tuas",
16380
- "tudo",
16381
- "um",
16382
- "uma",
16383
- "umas",
16384
- "uns"
17397
+ "teut",
17398
+ "teuteu",
17399
+ "ti",
17400
+ "tik",
17401
+ "toa",
17402
+ "tok",
17403
+ "tost",
17404
+ "tostig",
17405
+ "toud",
17406
+ "touesk",
17407
+ "touez",
17408
+ "toull",
17409
+ "tra",
17410
+ "trantenn",
17411
+ "traoñ",
17412
+ "trawalc'h",
17413
+ "tre",
17414
+ "trede",
17415
+ "tregont",
17416
+ "tremenet",
17417
+ "tri",
17418
+ "trivet",
17419
+ "triwec'h",
17420
+ "trizek",
17421
+ "tro",
17422
+ "trugarez",
17423
+ "trumm",
17424
+ "tsoin",
17425
+ "tsouin",
17426
+ "tu",
17427
+ "tud",
17428
+ "u:",
17429
+ "ugent",
17430
+ "uhel",
17431
+ "uhelañ",
17432
+ "ul",
17433
+ "un",
17434
+ "unan",
17435
+ "unanez",
17436
+ "unanig",
17437
+ "unnek",
17438
+ "unnekvet",
17439
+ "ur",
17440
+ "urzh",
17441
+ "us",
17442
+ "v:",
17443
+ "va",
17444
+ "vale",
17445
+ "van",
17446
+ "vare",
17447
+ "vat",
17448
+ "vefe",
17449
+ "vefec'h",
17450
+ "vefed",
17451
+ "vefemp",
17452
+ "vefen",
17453
+ "vefent",
17454
+ "vefes",
17455
+ "vesk",
17456
+ "vete",
17457
+ "vez",
17458
+ "vezan",
17459
+ "vezañ",
17460
+ "veze",
17461
+ "vezec'h",
17462
+ "vezed",
17463
+ "vezemp",
17464
+ "vezen",
17465
+ "vezent",
17466
+ "vezer",
17467
+ "vezes",
17468
+ "vezez",
17469
+ "vezit",
17470
+ "vezomp",
17471
+ "vezont",
17472
+ "vi",
17473
+ "vihan",
17474
+ "vihanañ",
17475
+ "vije",
17476
+ "vijec'h",
17477
+ "vijed",
17478
+ "vijemp",
17479
+ "vijen",
17480
+ "vijent",
17481
+ "vijes",
17482
+ "viken",
17483
+ "vimp",
17484
+ "vin",
17485
+ "vint",
17486
+ "vior",
17487
+ "viot",
17488
+ "virviken",
17489
+ "viskoazh",
17490
+ "vlan",
17491
+ "vlaou",
17492
+ "vo",
17493
+ "vod",
17494
+ "voe",
17495
+ "voec'h",
17496
+ "voed",
17497
+ "voemp",
17498
+ "voen",
17499
+ "voent",
17500
+ "voes",
17501
+ "vont",
17502
+ "vostapl",
17503
+ "vrac'h",
17504
+ "vrasañ",
17505
+ "vremañ",
17506
+ "w:",
17507
+ "walc'h",
17508
+ "war",
17509
+ "warnañ",
17510
+ "warni",
17511
+ "warno",
17512
+ "warnoc'h",
17513
+ "warnomp",
17514
+ "warnon",
17515
+ "warnor",
17516
+ "warnout",
17517
+ "wazh",
17518
+ "wech",
17519
+ "wechoù",
17520
+ "well",
17521
+ "y:",
17522
+ "you",
17523
+ "youadenn",
17524
+ "youc'hadenn",
17525
+ "youc'hou",
17526
+ "z:",
17527
+ "za",
17528
+ "zan",
17529
+ "zaw",
17530
+ "zeu",
17531
+ "zi",
17532
+ "ziar",
17533
+ "zigarez",
17534
+ "ziget",
17535
+ "zindan",
17536
+ "zioc'h",
17537
+ "ziouzh",
17538
+ "zirak",
17539
+ "zivout",
17540
+ "ziwar",
17541
+ "ziwezhañ",
17542
+ "zo",
17543
+ "zoken",
17544
+ "zokenoc'h",
17545
+ "zouesk",
17546
+ "zouez",
17547
+ "zro",
17548
+ "zu"
16385
17549
  ];
16386
17550
  const bul = [
16387
17551
  "а",
@@ -28037,22 +29201,32 @@ const tur = [
28037
29201
  "şöyle"
28038
29202
  ];
28039
29203
  const ukr = [
29204
+ "а",
29205
+ "або",
28040
29206
  "авжеж",
28041
29207
  "адже",
29208
+ "аж",
28042
29209
  "але",
29210
+ "ані",
28043
29211
  "б",
28044
29212
  "без",
29213
+ "би",
29214
+ "бо",
28045
29215
  "був",
28046
29216
  "була",
28047
29217
  "були",
28048
29218
  "було",
28049
29219
  "бути",
28050
29220
  "більш",
29221
+ "в",
28051
29222
  "вам",
29223
+ "вами",
28052
29224
  "вас",
28053
29225
  "весь",
29226
+ "вже",
28054
29227
  "вздовж",
28055
29228
  "ви",
29229
+ "від",
28056
29230
  "вниз",
28057
29231
  "внизу",
28058
29232
  "вона",
@@ -28061,55 +29235,138 @@ const ukr = [
28061
29235
  "все",
28062
29236
  "всередині",
28063
29237
  "всіх",
29238
+ "вся",
28064
29239
  "від",
28065
29240
  "він",
28066
29241
  "да",
28067
29242
  "давай",
28068
29243
  "давати",
28069
29244
  "де",
29245
+ "десь",
28070
29246
  "дещо",
28071
29247
  "для",
28072
29248
  "до",
29249
+ "є",
29250
+ "ж",
29251
+ "же",
28073
29252
  "з",
29253
+ "за",
28074
29254
  "завжди",
28075
29255
  "замість",
29256
+ "зі",
29257
+ "і",
29258
+ "із",
29259
+ "інших",
29260
+ "її",
29261
+ "їй",
29262
+ "їм",
29263
+ "їх",
28076
29264
  "й",
29265
+ "його",
29266
+ "йому",
28077
29267
  "коли",
28078
29268
  "ледве",
29269
+ "лиш",
28079
29270
  "майже",
29271
+ "мене",
29272
+ "мені",
28080
29273
  "ми",
29274
+ "між",
29275
+ "мій",
29276
+ "мною",
29277
+ "мов",
29278
+ "мого",
29279
+ "моєї",
29280
+ "моє",
29281
+ "може",
29282
+ "мої",
29283
+ "моїх",
29284
+ "моя",
29285
+ "на",
29286
+ "над",
28081
29287
  "навколо",
28082
29288
  "навіть",
28083
29289
  "нам",
29290
+ "нами",
29291
+ "нас",
29292
+ "наче",
29293
+ "наш",
29294
+ "не",
29295
+ "нє",
29296
+ "неї",
29297
+ "нема",
29298
+ "немов",
29299
+ "неначе",
29300
+ "нею",
29301
+ "ним",
29302
+ "ними",
29303
+ "них",
29304
+ "ні",
29305
+ "ніби",
29306
+ "ніщо",
29307
+ "нього",
29308
+ "о",
29309
+ "ось",
28084
29310
  "от",
28085
29311
  "отже",
28086
29312
  "отож",
29313
+ "під",
29314
+ "по",
28087
29315
  "поза",
28088
29316
  "про",
28089
29317
  "під",
29318
+ "сам",
29319
+ "сама",
29320
+ "свій",
29321
+ "свої",
29322
+ "своя",
29323
+ "свою",
29324
+ "себе",
29325
+ "собі",
28090
29326
  "та",
29327
+ "там",
28091
29328
  "так",
29329
+ "така",
28092
29330
  "такий",
28093
29331
  "також",
29332
+ "твій",
29333
+ "твого",
29334
+ "твоєї",
29335
+ "твої",
29336
+ "твоя",
28094
29337
  "те",
29338
+ "тебе",
28095
29339
  "ти",
29340
+ "ті",
29341
+ "тільки",
29342
+ "то",
29343
+ "тобі",
29344
+ "тобою",
28096
29345
  "тобто",
29346
+ "тоді",
28097
29347
  "тож",
29348
+ "той",
28098
29349
  "тощо",
29350
+ "тут",
29351
+ "у",
29352
+ "хіба",
29353
+ "хоч",
28099
29354
  "хоча",
28100
29355
  "це",
28101
29356
  "цей",
29357
+ "ці",
29358
+ "ця",
28102
29359
  "чи",
28103
29360
  "чого",
29361
+ "ще",
28104
29362
  "що",
29363
+ "щоб",
29364
+ "щось",
29365
+ "я",
28105
29366
  "як",
29367
+ "яка",
28106
29368
  "який",
28107
- "якої",
28108
- "є",
28109
- "із",
28110
- "інших",
28111
- "їх",
28112
- "її"
29369
+ "якої"
28113
29370
  ];
28114
29371
  const urd = [
28115
29372
  "آئی",
@@ -29107,7 +30364,14 @@ const TINA_LOGIN_EVENT = "tinaCloudLogin";
29107
30364
  const AUTH_TOKEN_KEY = "tinacms-auth";
29108
30365
  const authenticate = (clientId, frontendUrl) => {
29109
30366
  return new Promise((resolve) => {
29110
- let authTab;
30367
+ const origin = `${window.location.protocol}//${window.location.host}`;
30368
+ const authTab = popupWindow(
30369
+ `${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`,
30370
+ "_blank",
30371
+ window,
30372
+ 1e3,
30373
+ 700
30374
+ );
29111
30375
  window.addEventListener("message", function(e) {
29112
30376
  if (e.data.source === TINA_LOGIN_EVENT) {
29113
30377
  if (authTab) {
@@ -29120,14 +30384,6 @@ const authenticate = (clientId, frontendUrl) => {
29120
30384
  });
29121
30385
  }
29122
30386
  });
29123
- const origin = `${window.location.protocol}//${window.location.host}`;
29124
- authTab = popupWindow(
29125
- `${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`,
29126
- "_blank",
29127
- window,
29128
- 1e3,
29129
- 700
29130
- );
29131
30387
  });
29132
30388
  };
29133
30389
  const DefaultSessionProvider = ({
@@ -29438,6 +30694,7 @@ mutation addPendingDocumentMutation(
29438
30694
  setBranch(branchName) {
29439
30695
  var _a, _b, _c, _d;
29440
30696
  const encodedBranch = encodeURIComponent(branchName);
30697
+ document.cookie = `x-branch=${encodedBranch}; path=/; max-age=3600`;
29441
30698
  this.branch = encodedBranch;
29442
30699
  this.assetsApiUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.assetsApiUrlOverride) || "https://assets.tinajs.io";
29443
30700
  this.frontendUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.frontendUrlOverride) || "https://app.tina.io";
@@ -29480,7 +30737,7 @@ mutation addPendingDocumentMutation(
29480
30737
  branch: ${this.branch}.`;
29481
30738
  if (this.branch !== "main") {
29482
30739
  errorMessage = `${errorMessage}
29483
- Note: This error can occur if the branch does not exist on GitHub or on Tina Cloud`;
30740
+ Note: This error can occur if the branch does not exist on GitHub or on TinaCloud`;
29484
30741
  }
29485
30742
  }
29486
30743
  throw new Error(errorMessage);
@@ -29616,7 +30873,7 @@ mutation addPendingDocumentMutation(
29616
30873
  unknownCount++;
29617
30874
  if (unknownCount > 5) {
29618
30875
  throw new Error(
29619
- "AsyncPoller: status unknown for too long, please check indexing progress the Tina Cloud dashboard"
30876
+ "AsyncPoller: status unknown for too long, please check indexing progress the TinaCloud dashboard"
29620
30877
  );
29621
30878
  }
29622
30879
  }
@@ -29833,56 +31090,6 @@ const AsyncButton = ({ name, primary, action }) => {
29833
31090
  !submitting && name
29834
31091
  );
29835
31092
  };
29836
- const TINA_AUTH_CONFIG = "tina_auth_config";
29837
- const useTinaAuthRedirect = () => {
29838
- useEffect(() => {
29839
- const urlParams = new URLSearchParams(window.location.search);
29840
- const config = {
29841
- code: urlParams.get("code") || "",
29842
- scope: urlParams.get("scope") || "email",
29843
- state: urlParams.get("state")
29844
- };
29845
- if (!config.code) {
29846
- return;
29847
- }
29848
- localStorage[TINA_AUTH_CONFIG] = JSON.stringify(config);
29849
- }, []);
29850
- };
29851
- const createClient = ({
29852
- clientId,
29853
- isLocalClient = true,
29854
- branch,
29855
- tinaioConfig,
29856
- schema,
29857
- apiUrl,
29858
- tinaGraphQLVersion
29859
- }) => {
29860
- return isLocalClient ? new LocalClient({ customContentApiUrl: apiUrl, schema }) : new Client({
29861
- clientId: clientId || "",
29862
- branch: branch || "main",
29863
- tokenStorage: "LOCAL_STORAGE",
29864
- tinaioConfig,
29865
- schema,
29866
- tinaGraphQLVersion
29867
- });
29868
- };
29869
- function assertShape(value, yupSchema, errorMessage) {
29870
- const shape = yupSchema(yup);
29871
- try {
29872
- shape.validateSync(value);
29873
- } catch (e) {
29874
- const message = errorMessage || `Failed to assertShape - ${e.message}`;
29875
- throw new Error(message);
29876
- }
29877
- }
29878
- function safeAssertShape(value, yupSchema) {
29879
- try {
29880
- assertShape(value, yupSchema);
29881
- return true;
29882
- } catch (e) {
29883
- return false;
29884
- }
29885
- }
29886
31093
  class TinaAdminApi {
29887
31094
  constructor(cms) {
29888
31095
  var _a, _b, _c, _d;
@@ -30229,6 +31436,56 @@ class TinaAdminApi {
30229
31436
  );
30230
31437
  }
30231
31438
  }
31439
+ const createClient = ({
31440
+ clientId,
31441
+ isLocalClient = true,
31442
+ branch,
31443
+ tinaioConfig,
31444
+ schema,
31445
+ apiUrl,
31446
+ tinaGraphQLVersion
31447
+ }) => {
31448
+ return isLocalClient ? new LocalClient({ customContentApiUrl: apiUrl, schema }) : new Client({
31449
+ clientId: clientId || "",
31450
+ branch: branch || "main",
31451
+ tokenStorage: "LOCAL_STORAGE",
31452
+ tinaioConfig,
31453
+ schema,
31454
+ tinaGraphQLVersion
31455
+ });
31456
+ };
31457
+ function assertShape(value, yupSchema, errorMessage) {
31458
+ const shape = yupSchema(yup);
31459
+ try {
31460
+ shape.validateSync(value);
31461
+ } catch (e) {
31462
+ const message = errorMessage || `Failed to assertShape - ${e.message}`;
31463
+ throw new Error(message);
31464
+ }
31465
+ }
31466
+ function safeAssertShape(value, yupSchema) {
31467
+ try {
31468
+ assertShape(value, yupSchema);
31469
+ return true;
31470
+ } catch (e) {
31471
+ return false;
31472
+ }
31473
+ }
31474
+ const TINA_AUTH_CONFIG = "tina_auth_config";
31475
+ const useTinaAuthRedirect = () => {
31476
+ useEffect(() => {
31477
+ const urlParams = new URLSearchParams(window.location.search);
31478
+ const config = {
31479
+ code: urlParams.get("code") || "",
31480
+ scope: urlParams.get("scope") || "email",
31481
+ state: urlParams.get("state")
31482
+ };
31483
+ if (!config.code) {
31484
+ return;
31485
+ }
31486
+ localStorage[TINA_AUTH_CONFIG] = JSON.stringify(config);
31487
+ }, []);
31488
+ };
30232
31489
  function sleep(ms) {
30233
31490
  return new Promise((resolve) => setTimeout(resolve, ms));
30234
31491
  }
@@ -30327,7 +31584,7 @@ const AuthWallInner = ({
30327
31584
  });
30328
31585
  }
30329
31586
  };
30330
- let modalTitle = "Tina Cloud";
31587
+ let modalTitle = "TinaCloud";
30331
31588
  if (activeModal === "authenticate" && loginStrategy === "Redirect" && !isTinaCloud) {
30332
31589
  modalTitle = "Enter into edit mode";
30333
31590
  } else if (activeModal === "authenticate" && loginStrategy === "UsernamePassword") {
@@ -30343,7 +31600,7 @@ const AuthWallInner = ({
30343
31600
  ModalBuilder,
30344
31601
  {
30345
31602
  title: modalTitle,
30346
- 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.",
31603
+ 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.",
30347
31604
  close,
30348
31605
  actions: [
30349
31606
  ...otherModalActions,
@@ -30565,6 +31822,9 @@ const TinaCloudProvider = (props) => {
30565
31822
  cms.flags.set("branch-switcher", true);
30566
31823
  client.usingEditorialWorkflow = true;
30567
31824
  client.protectedBranches = project.protectedBranches;
31825
+ if (!project.metadata[currentBranch]) {
31826
+ setCurrentBranch(project.defaultBranch || "main");
31827
+ }
30568
31828
  }
30569
31829
  });
30570
31830
  };
@@ -30577,7 +31837,7 @@ const TinaCloudProvider = (props) => {
30577
31837
  }
30578
31838
  });
30579
31839
  return unsubscribe;
30580
- }, [isTinaCloud, cms]);
31840
+ }, [currentBranch, isTinaCloud, cms]);
30581
31841
  return /* @__PURE__ */ React__default.createElement(SessionProvider, { basePath: "/api/tina/auth" }, /* @__PURE__ */ React__default.createElement(
30582
31842
  BranchDataProvider,
30583
31843
  {
@@ -31063,6 +32323,14 @@ This will work when developing locally but NOT when deployed to production.
31063
32323
  }
31064
32324
  return client.request(query, { variables });
31065
32325
  };
32326
+ const GetCMS = ({ children }) => {
32327
+ const cms = useCMS$1();
32328
+ try {
32329
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(cms));
32330
+ } catch (e) {
32331
+ return null;
32332
+ }
32333
+ };
31066
32334
  const Layout = ({ children }) => {
31067
32335
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
31068
32336
  "div",
@@ -31274,47 +32542,6 @@ const SidebarCloudLink = ({ config }) => {
31274
32542
  }
31275
32543
  return /* @__PURE__ */ React__default.createElement("span", { className: "text-base tracking-wide text-gray-500 hover:text-blue-600 flex items-center opacity-90 hover:opacity-100" }, /* @__PURE__ */ React__default.createElement(config.Icon, { className: "mr-2 h-6 opacity-80 w-auto" }), /* @__PURE__ */ React__default.createElement("a", { target: "_blank", href: config.link.href }, config.link.text));
31276
32544
  };
31277
- const GetCMS = ({ children }) => {
31278
- try {
31279
- const cms = useCMS$1();
31280
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(cms));
31281
- } catch (e) {
31282
- return null;
31283
- }
31284
- };
31285
- const PageWrapper = ({ children }) => {
31286
- var _a, _b;
31287
- const cms = useCMS$1();
31288
- const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
31289
- const [branchingEnabled, setBranchingEnabled] = React__default.useState(
31290
- () => cms.flags.get("branch-switcher")
31291
- );
31292
- React__default.useEffect(() => {
31293
- cms.events.subscribe("flag:set", ({ key, value }) => {
31294
- if (key === "branch-switcher") {
31295
- setBranchingEnabled(value);
31296
- }
31297
- });
31298
- }, [cms.events]);
31299
- return /* @__PURE__ */ React__default.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__default.createElement(BranchBanner, null), children);
31300
- };
31301
- const PageHeader = ({
31302
- isLocalMode,
31303
- children
31304
- }) => {
31305
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
31306
- };
31307
- const PageBody = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
31308
- const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
31309
- const DashboardPage = () => {
31310
- return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
31311
- var _a, _b;
31312
- return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(PageHeader, { isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode }, /* @__PURE__ */ React__default.createElement("h3", { className: "text-2xl font-sans text-gray-700" }, "Welcome to Tina!")), /* @__PURE__ */ React__default.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
31313
- });
31314
- };
31315
- function RiHome2Line(props) {
31316
- 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);
31317
- }
31318
32545
  const LoadingPage = () => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
31319
32546
  "div",
31320
32547
  {
@@ -31424,203 +32651,33 @@ const LoadingPage = () => /* @__PURE__ */ React__default.createElement(React__de
31424
32651
  )
31425
32652
  )
31426
32653
  ));
31427
- const FullscreenError = ({
31428
- title = "Error",
31429
- errorMessage = "It looks like something went wrong."
31430
- }) => {
31431
- return /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col justify-center items-center h-screen bg-gray-100" }, /* @__PURE__ */ React__default.createElement("div", { className: "text-red-500 text-4xl mb-6 flex items-center" }, /* @__PURE__ */ React__default.createElement(BiError, { className: "w-12 h-auto fill-current text-red-400 opacity-70 mr-1" }), " ", title), /* @__PURE__ */ React__default.createElement("p", { className: "text-gray-700 text-xl mb-8" }, errorMessage), /* @__PURE__ */ React__default.createElement(Button$1, { variant: "danger", onClick: () => window.location.reload() }, /* @__PURE__ */ React__default.createElement(BiSync, { className: "w-7 h-auto fill-current opacity-70 mr-1" }), " Reload"));
31432
- };
31433
- const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
31434
- const api = new TinaAdminApi(cms);
31435
- const schema = cms.api.tina.schema;
31436
- const collectionExtra = schema.getCollection(collectionName);
31437
- const [collection, setCollection] = useState(void 0);
31438
- const [loading, setLoading] = useState(true);
31439
- const [error, setError] = useState(void 0);
31440
- const [resetState, setResetSate] = useState(0);
31441
- useEffect(() => {
31442
- let cancelled = false;
31443
- const fetchCollection = async () => {
31444
- var _a;
31445
- if (await api.isAuthenticated() && !folder.loading && !cancelled) {
31446
- const { name, order } = JSON.parse(sortKey || "{}");
31447
- const validSortKey = ((_a = collectionExtra.fields) == null ? void 0 : _a.map((x) => x.name).includes(name)) ? name : void 0;
31448
- try {
31449
- const collection2 = await api.fetchCollection(
31450
- collectionName,
31451
- includeDocuments,
31452
- (filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
31453
- after,
31454
- validSortKey,
31455
- order,
31456
- filterArgs
31457
- );
31458
- setCollection(collection2);
31459
- } catch (error2) {
31460
- cms.alerts.error(
31461
- `[${error2.name}] GetCollection failed: ${error2.message}`
31462
- );
31463
- console.error(error2);
31464
- setCollection(void 0);
31465
- setError(error2);
31466
- }
31467
- setLoading(false);
31468
- }
31469
- };
31470
- if (cancelled)
31471
- return;
31472
- setLoading(true);
31473
- fetchCollection();
31474
- return () => {
31475
- cancelled = true;
31476
- };
31477
- }, [
31478
- cms,
31479
- collectionName,
31480
- folder.loading,
31481
- folder.fullyQualifiedName,
31482
- resetState,
31483
- after,
31484
- sortKey
31485
- ]);
31486
- const reFetchCollection = () => setResetSate((x) => x + 1);
31487
- return { collection, loading, error, reFetchCollection, collectionExtra };
31488
- };
31489
- const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
31490
- const api = new TinaAdminApi(cms);
31491
- const schema = cms.api.tina.schema;
31492
- const collectionExtra = schema.getCollection(collectionName);
31493
- const [collection, setCollection] = useState(void 0);
31494
- const [loading, setLoading] = useState(true);
31495
- const [error, setError] = useState(void 0);
31496
- const [resetState, setResetSate] = useState(0);
31497
- useEffect(() => {
31498
- let cancelled = false;
31499
- const searchCollection = async () => {
31500
- if (await api.isAuthenticated() && !folder.loading && !cancelled) {
31501
- try {
31502
- const response = await cms.api.search.query(
31503
- `${search} AND _collection:${collectionName}`,
31504
- {
31505
- limit: 15,
31506
- cursor: after
31507
- }
31508
- );
31509
- const docs = await Promise.allSettled(
31510
- response.results.map((result) => {
31511
- const [collection2, relativePath2] = result._id.split(":");
31512
- return api.fetchDocument(collection2, relativePath2, false);
31513
- })
31514
- );
31515
- const edges = docs.filter((p) => {
31516
- var _a;
31517
- return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
31518
- }).map((result) => ({ node: result.value.document }));
31519
- const c = await api.fetchCollection(collectionName, false, "");
31520
- setCollection({
31521
- format: collection.format,
31522
- label: collection.label,
31523
- name: collectionName,
31524
- templates: collection.templates,
31525
- documents: {
31526
- pageInfo: {
31527
- hasNextPage: !!response.nextCursor,
31528
- hasPreviousPage: !!response.prevCursor,
31529
- startCursor: "",
31530
- endCursor: response.nextCursor || ""
31531
- },
31532
- edges
31533
- }
31534
- });
31535
- } catch (error2) {
31536
- cms.alerts.error(
31537
- `[${error2.name}] GetCollection failed: ${error2.message}`
31538
- );
31539
- console.error(error2);
31540
- setCollection(void 0);
31541
- setError(error2);
31542
- }
31543
- setLoading(false);
32654
+ function RiHome2Line(props) {
32655
+ 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);
32656
+ }
32657
+ const PageWrapper = ({ children }) => {
32658
+ var _a, _b;
32659
+ const cms = useCMS$1();
32660
+ const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
32661
+ const [branchingEnabled, setBranchingEnabled] = React__default.useState(
32662
+ () => cms.flags.get("branch-switcher")
32663
+ );
32664
+ React__default.useEffect(() => {
32665
+ cms.events.subscribe("flag:set", ({ key, value }) => {
32666
+ if (key === "branch-switcher") {
32667
+ setBranchingEnabled(value);
31544
32668
  }
31545
- };
31546
- if (cancelled)
31547
- return;
31548
- setLoading(true);
31549
- searchCollection();
31550
- return () => {
31551
- cancelled = true;
31552
- };
31553
- }, [
31554
- cms,
31555
- collectionName,
31556
- folder.loading,
31557
- folder.fullyQualifiedName,
31558
- resetState,
31559
- after,
31560
- search
31561
- ]);
31562
- const reFetchCollection = () => setResetSate((x) => x + 1);
31563
- return { collection, loading, error, reFetchCollection, collectionExtra };
32669
+ });
32670
+ }, [cms.events]);
32671
+ return /* @__PURE__ */ React__default.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__default.createElement(BranchBanner, null), children);
31564
32672
  };
31565
- const GetCollection = ({
31566
- cms,
31567
- collectionName,
31568
- folder,
31569
- includeDocuments = true,
31570
- startCursor,
31571
- sortKey,
31572
- children,
31573
- filterArgs,
31574
- search
32673
+ const PageHeader = ({
32674
+ isLocalMode,
32675
+ children
31575
32676
  }) => {
31576
- const navigate = useNavigate();
31577
- const { collection, loading, error, reFetchCollection, collectionExtra } = search ? useSearchCollection(
31578
- cms,
31579
- collectionName,
31580
- includeDocuments,
31581
- folder,
31582
- startCursor || "",
31583
- search
31584
- ) : useGetCollection(
31585
- cms,
31586
- collectionName,
31587
- includeDocuments,
31588
- folder,
31589
- startCursor || "",
31590
- sortKey,
31591
- filterArgs
31592
- ) || {};
31593
- useEffect(() => {
31594
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
31595
- if (loading)
31596
- return;
31597
- const collectionDefinition = cms.api.tina.schema.getCollection(
31598
- collection.name
31599
- );
31600
- const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
31601
- const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
31602
- const collectionResponse = collection;
31603
- if (!allowCreate && !allowDelete && // Check there is only one document
31604
- ((_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
31605
- ((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
31606
- const doc = collectionResponse.documents.edges[0].node;
31607
- handleNavigate(
31608
- navigate,
31609
- cms,
31610
- collectionResponse,
31611
- collectionDefinition,
31612
- doc
31613
- );
31614
- }
31615
- }, [(collection == null ? void 0 : collection.name) || "", loading]);
31616
- if (error) {
31617
- return /* @__PURE__ */ React__default.createElement(FullscreenError, null);
31618
- }
31619
- if (loading) {
31620
- return /* @__PURE__ */ React__default.createElement(LoadingPage, null);
31621
- }
31622
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
32677
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
31623
32678
  };
32679
+ const PageBody = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
32680
+ const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
31624
32681
  const folderRegex = /^.*\/~\/*(.*)$/;
31625
32682
  const parentFolder = (folder) => {
31626
32683
  return {
@@ -31740,6 +32797,7 @@ const CollectionListPage = () => {
31740
32797
  const [vars, setVars] = React__default.useState({
31741
32798
  collection: collectionName,
31742
32799
  relativePath: "",
32800
+ relativePathWithoutExtension: "",
31743
32801
  newRelativePath: "",
31744
32802
  filterField: "",
31745
32803
  folderName: "",
@@ -31781,6 +32839,7 @@ const CollectionListPage = () => {
31781
32839
  ...old,
31782
32840
  collection: collectionName,
31783
32841
  relativePath: "",
32842
+ relativePathWithoutExtension: "",
31784
32843
  newRelativePath: "",
31785
32844
  filterField: "",
31786
32845
  startsWith: "",
@@ -31806,6 +32865,7 @@ const CollectionListPage = () => {
31806
32865
  collectionName === vars.collection ? vars : {
31807
32866
  collection: collectionName,
31808
32867
  relativePath: "",
32868
+ relativePathWithoutExtension: "",
31809
32869
  newRelativePath: "",
31810
32870
  filterField: "",
31811
32871
  startsWith: "",
@@ -31893,7 +32953,9 @@ const CollectionListPage = () => {
31893
32953
  safeSubmit: async () => {
31894
32954
  try {
31895
32955
  await admin.deleteDocument(vars);
31896
- cms.alerts.info("Document was successfully deleted");
32956
+ cms.alerts.info(
32957
+ "Document was successfully deleted"
32958
+ );
31897
32959
  reFetchCollection();
31898
32960
  } catch (error) {
31899
32961
  cms.alerts.warn(
@@ -31907,7 +32969,7 @@ const CollectionListPage = () => {
31907
32969
  ), renameModalOpen && /* @__PURE__ */ React__default.createElement(
31908
32970
  RenameModal,
31909
32971
  {
31910
- filename: vars.relativePath,
32972
+ filename: vars.relativePathWithoutExtension,
31911
32973
  newRelativePath: vars.newRelativePath,
31912
32974
  setNewRelativePath: (newRelativePath) => {
31913
32975
  setVars((vars2) => {
@@ -31922,7 +32984,9 @@ const CollectionListPage = () => {
31922
32984
  relativePath: vars.relativePath,
31923
32985
  newRelativePath
31924
32986
  });
31925
- cms.alerts.info("Document was successfully renamed");
32987
+ cms.alerts.info(
32988
+ "Document was successfully renamed"
32989
+ );
31926
32990
  reFetchCollection();
31927
32991
  } catch (error) {
31928
32992
  if (error.message.indexOf("has references")) {
@@ -32022,7 +33086,9 @@ const CollectionListPage = () => {
32022
33086
  name: "sort",
32023
33087
  value: sortKey,
32024
33088
  onChange: (e) => {
32025
- const val = JSON.parse(e.target.value);
33089
+ const val = JSON.parse(
33090
+ e.target.value
33091
+ );
32026
33092
  setEndCursor("");
32027
33093
  setPrevCursors([]);
32028
33094
  window == null ? void 0 : window.localStorage.setItem(
@@ -32228,6 +33294,9 @@ const CollectionListPage = () => {
32228
33294
  setVars((old) => ({
32229
33295
  ...old,
32230
33296
  collection: collectionName,
33297
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
33298
+ "/"
33299
+ ),
32231
33300
  relativePath: document2.node._sys.breadcrumbs.join(
32232
33301
  "/"
32233
33302
  ) + document2.node._sys.extension,
@@ -32250,6 +33319,9 @@ const CollectionListPage = () => {
32250
33319
  setVars((old) => ({
32251
33320
  ...old,
32252
33321
  collection: collectionName,
33322
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
33323
+ "/"
33324
+ ),
32253
33325
  relativePath: document2.node._sys.breadcrumbs.join(
32254
33326
  "/"
32255
33327
  ) + document2.node._sys.extension,
@@ -32462,7 +33534,7 @@ const RenameModal = ({
32462
33534
  newRelativePath,
32463
33535
  setNewRelativePath
32464
33536
  }) => {
32465
- return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Rename ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("p", { className: "mb-4" }, "Are you sure you want to rename ", /* @__PURE__ */ React__default.createElement("strong", null, filename), "? TinaCMS uses the filename as the ID; renaming this file could result in unresolved references."), /* @__PURE__ */ React__default.createElement(
33537
+ return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Rename ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("p", { className: "mb-4" }, "Are you sure you want to rename ", /* @__PURE__ */ React__default.createElement("strong", null, filename), "?"), /* @__PURE__ */ React__default.createElement(
32466
33538
  BaseTextField,
32467
33539
  {
32468
33540
  placeholder: "Enter a new name for the document's file",
@@ -32477,11 +33549,243 @@ const RenameModal = ({
32477
33549
  onClick: async () => {
32478
33550
  await renameFunc();
32479
33551
  close2();
32480
- }
33552
+ },
33553
+ disabled: !newRelativePath || newRelativePath === filename
32481
33554
  },
32482
33555
  "Rename"
32483
33556
  ))));
32484
33557
  };
33558
+ const FullscreenError = ({
33559
+ title = "Error",
33560
+ errorMessage = "It looks like something went wrong."
33561
+ }) => {
33562
+ return /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col justify-center items-center h-screen bg-gray-100" }, /* @__PURE__ */ React__default.createElement("div", { className: "text-red-500 text-4xl mb-6 flex items-center" }, /* @__PURE__ */ React__default.createElement(BiError, { className: "w-12 h-auto fill-current text-red-400 opacity-70 mr-1" }), " ", title), /* @__PURE__ */ React__default.createElement("p", { className: "text-gray-700 text-xl mb-8" }, errorMessage), /* @__PURE__ */ React__default.createElement(Button$1, { variant: "danger", onClick: () => window.location.reload() }, /* @__PURE__ */ React__default.createElement(BiSync, { className: "w-7 h-auto fill-current opacity-70 mr-1" }), " Reload"));
33563
+ };
33564
+ const isValidSortKey = (sortKey, collection) => {
33565
+ if (collection.fields) {
33566
+ const sortKeys = collection.fields.map((x) => x.name);
33567
+ return sortKeys.includes(sortKey);
33568
+ } else if (collection.templates) {
33569
+ const collectionMap = {};
33570
+ const conflictedFields = /* @__PURE__ */ new Set();
33571
+ for (const template of collection.templates) {
33572
+ for (const field of template.fields) {
33573
+ if (collectionMap[field.name]) {
33574
+ if (collectionMap[field.name].type !== field.type) {
33575
+ conflictedFields.add(field.name);
33576
+ }
33577
+ } else {
33578
+ collectionMap[field.name] = field;
33579
+ }
33580
+ }
33581
+ }
33582
+ for (const key in conflictedFields) {
33583
+ delete collectionMap[key];
33584
+ }
33585
+ for (const key in collectionMap) {
33586
+ if (key === sortKey) {
33587
+ return true;
33588
+ }
33589
+ }
33590
+ return false;
33591
+ }
33592
+ };
33593
+ const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
33594
+ const api = new TinaAdminApi(cms);
33595
+ const schema = cms.api.tina.schema;
33596
+ const collectionExtra = schema.getCollection(collectionName);
33597
+ const [collection, setCollection] = useState(void 0);
33598
+ const [loading, setLoading] = useState(true);
33599
+ const [error, setError] = useState(void 0);
33600
+ const [resetState, setResetSate] = useState(0);
33601
+ useEffect(() => {
33602
+ let cancelled = false;
33603
+ const fetchCollection = async () => {
33604
+ if (await api.isAuthenticated() && !folder.loading && !cancelled) {
33605
+ const { name, order } = JSON.parse(sortKey || "{}");
33606
+ const validSortKey = isValidSortKey(name, collectionExtra) ? name : void 0;
33607
+ try {
33608
+ const collection2 = await api.fetchCollection(
33609
+ collectionName,
33610
+ includeDocuments,
33611
+ (filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
33612
+ after,
33613
+ validSortKey,
33614
+ order,
33615
+ filterArgs
33616
+ );
33617
+ setCollection(collection2);
33618
+ } catch (error2) {
33619
+ cms.alerts.error(
33620
+ `[${error2.name}] GetCollection failed: ${error2.message}`
33621
+ );
33622
+ console.error(error2);
33623
+ setCollection(void 0);
33624
+ setError(error2);
33625
+ }
33626
+ setLoading(false);
33627
+ }
33628
+ };
33629
+ if (cancelled)
33630
+ return;
33631
+ setLoading(true);
33632
+ fetchCollection();
33633
+ return () => {
33634
+ cancelled = true;
33635
+ };
33636
+ }, [
33637
+ cms,
33638
+ collectionName,
33639
+ folder.loading,
33640
+ folder.fullyQualifiedName,
33641
+ resetState,
33642
+ after,
33643
+ sortKey
33644
+ ]);
33645
+ const reFetchCollection = () => setResetSate((x) => x + 1);
33646
+ return { collection, loading, error, reFetchCollection, collectionExtra };
33647
+ };
33648
+ const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
33649
+ const api = new TinaAdminApi(cms);
33650
+ const schema = cms.api.tina.schema;
33651
+ const collectionExtra = schema.getCollection(collectionName);
33652
+ const [collection, setCollection] = useState(void 0);
33653
+ const [loading, setLoading] = useState(true);
33654
+ const [error, setError] = useState(void 0);
33655
+ const [resetState, setResetSate] = useState(0);
33656
+ useEffect(() => {
33657
+ let cancelled = false;
33658
+ const searchCollection = async () => {
33659
+ if (await api.isAuthenticated() && !folder.loading && !cancelled) {
33660
+ try {
33661
+ const response = await cms.api.search.query(
33662
+ `${search} AND _collection:${collectionName}`,
33663
+ {
33664
+ limit: 15,
33665
+ cursor: after
33666
+ }
33667
+ );
33668
+ const docs = await Promise.allSettled(
33669
+ response.results.map((result) => {
33670
+ const [collection2, relativePath2] = result._id.split(":");
33671
+ return api.fetchDocument(collection2, relativePath2, false);
33672
+ })
33673
+ );
33674
+ const edges = docs.filter((p) => {
33675
+ var _a;
33676
+ return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
33677
+ }).map((result) => ({ node: result.value.document }));
33678
+ const c = await api.fetchCollection(collectionName, false, "");
33679
+ setCollection({
33680
+ format: collection.format,
33681
+ label: collection.label,
33682
+ name: collectionName,
33683
+ templates: collection.templates,
33684
+ documents: {
33685
+ pageInfo: {
33686
+ hasNextPage: !!response.nextCursor,
33687
+ hasPreviousPage: !!response.prevCursor,
33688
+ startCursor: "",
33689
+ endCursor: response.nextCursor || ""
33690
+ },
33691
+ edges
33692
+ }
33693
+ });
33694
+ } catch (error2) {
33695
+ cms.alerts.error(
33696
+ `[${error2.name}] GetCollection failed: ${error2.message}`
33697
+ );
33698
+ console.error(error2);
33699
+ setCollection(void 0);
33700
+ setError(error2);
33701
+ }
33702
+ setLoading(false);
33703
+ }
33704
+ };
33705
+ if (cancelled)
33706
+ return;
33707
+ setLoading(true);
33708
+ searchCollection();
33709
+ return () => {
33710
+ cancelled = true;
33711
+ };
33712
+ }, [
33713
+ cms,
33714
+ collectionName,
33715
+ folder.loading,
33716
+ folder.fullyQualifiedName,
33717
+ resetState,
33718
+ after,
33719
+ search
33720
+ ]);
33721
+ const reFetchCollection = () => setResetSate((x) => x + 1);
33722
+ return { collection, loading, error, reFetchCollection, collectionExtra };
33723
+ };
33724
+ const GetCollection = ({
33725
+ cms,
33726
+ collectionName,
33727
+ folder,
33728
+ includeDocuments = true,
33729
+ startCursor,
33730
+ sortKey,
33731
+ children,
33732
+ filterArgs,
33733
+ search
33734
+ }) => {
33735
+ const navigate = useNavigate();
33736
+ const { collection, loading, error, reFetchCollection, collectionExtra } = search ? (
33737
+ // biome-ignore lint/correctness/useHookAtTopLevel: not ready to fix these yet
33738
+ useSearchCollection(
33739
+ cms,
33740
+ collectionName,
33741
+ includeDocuments,
33742
+ folder,
33743
+ startCursor || "",
33744
+ search
33745
+ )
33746
+ ) : (
33747
+ // biome-ignore lint/correctness/useHookAtTopLevel: not ready to fix these yet
33748
+ useGetCollection(
33749
+ cms,
33750
+ collectionName,
33751
+ includeDocuments,
33752
+ folder,
33753
+ startCursor || "",
33754
+ sortKey,
33755
+ filterArgs
33756
+ ) || {}
33757
+ );
33758
+ useEffect(() => {
33759
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
33760
+ if (loading)
33761
+ return;
33762
+ const collectionDefinition = cms.api.tina.schema.getCollection(
33763
+ collection.name
33764
+ );
33765
+ const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
33766
+ const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
33767
+ const collectionResponse = collection;
33768
+ if (!allowCreate && !allowDelete && // Check there is only one document
33769
+ ((_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
33770
+ ((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
33771
+ const doc = collectionResponse.documents.edges[0].node;
33772
+ handleNavigate(
33773
+ navigate,
33774
+ cms,
33775
+ collectionResponse,
33776
+ collectionDefinition,
33777
+ doc
33778
+ );
33779
+ }
33780
+ }, [(collection == null ? void 0 : collection.name) || "", loading]);
33781
+ if (error) {
33782
+ return /* @__PURE__ */ React__default.createElement(FullscreenError, null);
33783
+ }
33784
+ if (loading) {
33785
+ return /* @__PURE__ */ React__default.createElement(LoadingPage, null);
33786
+ }
33787
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
33788
+ };
32485
33789
  const ErrorDialog = (props) => {
32486
33790
  return /* @__PURE__ */ React__default.createElement(
32487
33791
  "div",
@@ -32804,7 +34108,10 @@ const useGetDocument = (cms, collectionName, relativePath2) => {
32804
34108
  const fetchDocument = async () => {
32805
34109
  if (api.isAuthenticated()) {
32806
34110
  try {
32807
- const response = await api.fetchDocument(collectionName, relativePath2);
34111
+ const response = await api.fetchDocument(
34112
+ collectionName,
34113
+ relativePath2
34114
+ );
32808
34115
  setDocument(response.document);
32809
34116
  } catch (error2) {
32810
34117
  cms.alerts.error(
@@ -33022,6 +34329,12 @@ const RenderForm = ({
33022
34329
  ), /* @__PURE__ */ React__default.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React__default.createElement("span", { className: "flex-1 w-full text-sm leading-tight whitespace-nowrap truncate" }, `${filename}.${collection.format}`), /* @__PURE__ */ React__default.createElement(FormStatus, { pristine: formIsPristine }))
33023
34330
  ), activeForm && /* @__PURE__ */ React__default.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine }));
33024
34331
  };
34332
+ const DashboardPage = () => {
34333
+ return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
34334
+ var _a, _b;
34335
+ return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(PageHeader, { isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode }, /* @__PURE__ */ React__default.createElement("h3", { className: "text-2xl font-sans text-gray-700" }, "Welcome to Tina!")), /* @__PURE__ */ React__default.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
34336
+ });
34337
+ };
33025
34338
  const ScreenPage = () => {
33026
34339
  const { screenName } = useParams();
33027
34340
  return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
@@ -33104,7 +34417,7 @@ const IndexingPage = () => {
33104
34417
  } catch {
33105
34418
  cms.alerts.error("Branch indexing failed.");
33106
34419
  setErrorMessage(
33107
- 'Branch indexing failed, please check the Tina Cloud dashboard for more information. To try again chick "re-index" on the branch in the dashboard.'
34420
+ 'Branch indexing failed, please check the TinaCloud dashboard for more information. To try again chick "re-index" on the branch in the dashboard.'
33108
34421
  );
33109
34422
  setState("error");
33110
34423
  }
@@ -33272,7 +34585,7 @@ const CheckSchema = ({
33272
34585
  );
33273
34586
  }
33274
34587
  }).catch((e) => {
33275
- if (e.message.includes("has not been indexed by Tina Cloud")) {
34588
+ if (e.message.includes("has not been indexed by TinaCloud")) {
33276
34589
  setSchemaMissingError(true);
33277
34590
  } else {
33278
34591
  cms.alerts.error(`Unexpected error checking schema: ${e}`);
@@ -33790,3 +35103,4 @@ export {
33790
35103
  wrapFieldWithNoHeader,
33791
35104
  wrapFieldsWithMeta
33792
35105
  };
35106
+ //# sourceMappingURL=index.mjs.map