@rebasepro/admin 0.12.0 → 0.12.1-canary.g35be8cb

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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/{CollectionEditorDialog-Dpc75wIZ.js → CollectionEditorDialog-OBI2wDyv.js} +19 -11
  3. package/dist/{CollectionEditorDialog-Dpc75wIZ.js.map → CollectionEditorDialog-OBI2wDyv.js.map} +1 -1
  4. package/dist/{PropertyEditView-DH3XZC2x.js → PropertyEditView-QaEYldcT.js} +12 -9
  5. package/dist/{PropertyEditView-DH3XZC2x.js.map → PropertyEditView-QaEYldcT.js.map} +1 -1
  6. package/dist/{RouterCollectionsStudioView-BZLq4MGp.js → RouterCollectionsStudioView-CPRuGVXJ.js} +5 -5
  7. package/dist/{RouterCollectionsStudioView-BZLq4MGp.js.map → RouterCollectionsStudioView-CPRuGVXJ.js.map} +1 -1
  8. package/dist/collection_editor_ui.js +5 -5
  9. package/dist/collection_editor_ui.js.map +1 -1
  10. package/dist/editor.js +18 -10
  11. package/dist/editor.js.map +1 -1
  12. package/dist/{export-BzIpUdSK.js → export-BZZfQkT5.js} +2 -2
  13. package/dist/{export-BzIpUdSK.js.map → export-BZZfQkT5.js.map} +1 -1
  14. package/dist/{history-g9688IaK.js → history-Ao1HBAK3.js} +2 -2
  15. package/dist/{history-g9688IaK.js.map → history-Ao1HBAK3.js.map} +1 -1
  16. package/dist/{import-BjUG-cIY.js → import-AFJRUo99.js} +2 -2
  17. package/dist/{import-BjUG-cIY.js.map → import-AFJRUo99.js.map} +1 -1
  18. package/dist/index.js +22 -15
  19. package/dist/index.js.map +1 -1
  20. package/dist/markdown-CklalUUk.js.map +1 -1
  21. package/dist/{util-B5fJm1FA.js → util-ByPlsapJ.js} +103 -61
  22. package/dist/util-ByPlsapJ.js.map +1 -0
  23. package/package.json +32 -34
  24. package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
  25. package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +1 -1
  26. package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +1 -1
  27. package/src/collection_editor/useLocalCollectionsConfigController.tsx +6 -1
  28. package/src/components/AdminModeSyncer.tsx +1 -1
  29. package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +1 -1
  30. package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +1 -1
  31. package/src/components/CollectionViewBinding/SplitListView.tsx +1 -1
  32. package/src/components/DefaultAppBar.tsx +1 -1
  33. package/src/components/DefaultDrawer.tsx +1 -1
  34. package/src/components/DetailViewBinding.tsx +1 -1
  35. package/src/components/DrawerNavigationItem.tsx +1 -1
  36. package/src/components/EditViewBinding.tsx +1 -1
  37. package/src/components/HomePage/FavouritesView.tsx +1 -1
  38. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  39. package/src/components/HomePage/SmallNavigationCard.tsx +1 -1
  40. package/src/components/RebaseLayout.tsx +1 -1
  41. package/src/components/RebaseRouteDefs.tsx +1 -1
  42. package/src/components/SidePanelBinding.tsx +1 -1
  43. package/src/components/UserSelector.tsx +6 -5
  44. package/src/components/common/default_entity_actions.tsx +4 -3
  45. package/src/components/history/LastEditedByIndicator.tsx +4 -3
  46. package/src/hooks/navigation/useBuildUrlController.tsx +1 -1
  47. package/src/hooks/useBuildSideDialogsController.tsx +2 -2
  48. package/src/hooks/useBuildSidePanel.tsx +1 -1
  49. package/src/hooks/useHistory.ts +6 -5
  50. package/src/hooks/useResolvedUsers.ts +8 -5
  51. package/src/routes/RebaseRoute.tsx +2 -2
  52. package/dist/util-B5fJm1FA.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-CklalUUk.js","names":[],"sources":["../src/editor/schema.ts","../src/editor/markdown.ts"],"sourcesContent":["import { Schema, NodeSpec, MarkSpec } from \"prosemirror-model\";\nimport { tableNodes } from \"prosemirror-tables\";\n\nconst marks: { [key: string]: MarkSpec } = {\n link: {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: \"_blank\" }\n },\n inclusive: false,\n parseDOM: [\n {\n tag: \"a[href]\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return {\n href: dom.getAttribute(\"href\"),\n title: dom.getAttribute(\"title\"),\n target: dom.getAttribute(\"target\") || \"_blank\"\n };\n }\n }\n ],\n toDOM(node) {\n const {\n href,\n title,\n target\n } = node.attrs;\n return [\"a\", {\n href,\n title,\n target,\n class: \"text-surface-700 dark:text-surface-accent-200 underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer\"\n }, 0];\n }\n },\n bold: {\n parseDOM: [\n { tag: \"strong\" },\n {\n tag: \"b\",\n getAttrs: (node: HTMLElement | string) => typeof node !== \"string\" && node.style.fontWeight !== \"normal\" && null\n },\n {\n style: \"font-weight=400\",\n clearMark: m => m.type.name === \"bold\"\n },\n {\n style: \"font-weight\",\n getAttrs: (value: string | HTMLElement) => typeof value === \"string\" && /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null\n }\n ],\n toDOM() {\n return [\"strong\", 0];\n }\n },\n italic: {\n parseDOM: [{ tag: \"i\" }, { tag: \"em\" }, { style: \"font-style=italic\" }],\n toDOM() {\n return [\"em\", 0];\n }\n },\n strike: {\n parseDOM: [{ tag: \"s\" }, { tag: \"del\" }, { tag: \"strike\" }, { style: \"text-decoration=line-through\" }],\n toDOM() {\n return [\"s\", 0];\n }\n },\n underline: {\n parseDOM: [{ tag: \"u\" }, { style: \"text-decoration=underline\" }],\n toDOM() {\n return [\"u\", 0];\n }\n },\n code: {\n parseDOM: [{ tag: \"code\" }],\n toDOM() {\n return [\"code\", {\n class: \"rounded-md bg-surface-accent-50 dark:bg-surface-700 px-1.5 py-1 font-mono font-medium\",\n spellcheck: \"false\"\n }, 0];\n }\n },\n textStyle: {\n attrs: { color: { default: null } },\n parseDOM: [\n {\n style: \"color\",\n getAttrs: (value: string | HTMLElement) => {\n if (typeof value === \"string\") return { color: value };\n return false;\n }\n }\n ],\n toDOM(mark) {\n let style = \"\";\n if (mark.attrs.color) style += `color: ${mark.attrs.color};`;\n return [\"span\", { style }, 0];\n }\n },\n highlight: {\n attrs: { color: { default: null } },\n parseDOM: [\n {\n tag: \"mark\",\n getAttrs: (dom: HTMLElement | string) => {\n if (typeof dom === \"string\") return false;\n return { color: dom.style.backgroundColor || dom.getAttribute(\"data-color\") };\n }\n }\n ],\n toDOM(mark) {\n return [\"mark\", mark.attrs.color ? {\n style: `background-color: ${mark.attrs.color}; color: inherit;`,\n \"data-color\": mark.attrs.color\n } : {}, 0];\n }\n }\n};\n\nconst nodes: { [key: string]: NodeSpec } = {\n doc: {\n content: \"block+\"\n },\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [{ tag: \"p\" }],\n toDOM() {\n return [\"p\", 0];\n }\n },\n text: {\n group: \"inline\"\n },\n blockquote: {\n content: \"block+\",\n group: \"block\",\n defining: true,\n parseDOM: [{ tag: \"blockquote\" }],\n toDOM() {\n return [\"blockquote\", { class: \"border-l-4 border-primary\" }, 0];\n }\n },\n heading: {\n attrs: { level: { default: 1 } },\n content: \"inline*\",\n group: \"block\",\n defining: true,\n parseDOM: [\n {\n tag: \"h1\",\n attrs: { level: 1 }\n },\n {\n tag: \"h2\",\n attrs: { level: 2 }\n },\n {\n tag: \"h3\",\n attrs: { level: 3 }\n },\n {\n tag: \"h4\",\n attrs: { level: 4 }\n },\n {\n tag: \"h5\",\n attrs: { level: 5 }\n },\n {\n tag: \"h6\",\n attrs: { level: 6 }\n }\n ],\n toDOM(node) {\n return [\"h\" + node.attrs.level, 0];\n }\n },\n horizontal_rule: {\n group: \"block\",\n parseDOM: [{ tag: \"hr\" }],\n toDOM() {\n return [\"hr\", { class: \"mt-4 mb-6 border-t border-solid border-gray-200 dark:border-gray-800\" }];\n }\n },\n code_block: {\n content: \"text*\",\n marks: \"\",\n group: \"block\",\n code: true,\n defining: true,\n attrs: { language: { default: null } },\n parseDOM: [\n {\n tag: \"pre\",\n preserveWhitespace: \"full\"\n }\n ],\n toDOM(node) {\n return [\"pre\", { class: \"rounded bg-blue-50 dark:bg-surface-700 border border-solid border-gray-200 dark:border-gray-800 p-5 font-mono font-medium text-gray-800 dark:text-gray-200\" }, [\"code\", 0]];\n }\n },\n image: {\n inline: false,\n group: \"block\",\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null }\n },\n draggable: true,\n parseDOM: [\n {\n tag: \"img[src]\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return {\n src: dom.getAttribute(\"src\"),\n title: dom.getAttribute(\"title\"),\n alt: dom.getAttribute(\"alt\")\n };\n }\n }\n ],\n toDOM(node) {\n const {\n src,\n alt,\n title\n } = node.attrs;\n return [\"img\", {\n src,\n alt,\n title,\n class: \"rounded-lg max-w-full !m-0\"\n }];\n }\n },\n bullet_list: {\n content: \"list_item+\",\n group: \"block\",\n parseDOM: [{ tag: \"ul\" }],\n toDOM() {\n return [\"ul\", { class: \"list-disc list-outside leading-3 -mt-2\" }, 0];\n }\n },\n ordered_list: {\n content: \"list_item+\",\n group: \"block\",\n attrs: { order: { default: 1 } },\n parseDOM: [\n {\n tag: \"ol\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return { order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\")! : 1 };\n }\n }\n ],\n toDOM(node) {\n return node.attrs.order === 1 ? [\"ol\", { class: \"list-decimal list-outside leading-3 -mt-2\" }, 0] : [\"ol\", {\n start: node.attrs.order,\n class: \"list-decimal list-outside leading-3 -mt-2\"\n }, 0];\n }\n },\n list_item: {\n content: \"paragraph block*\",\n parseDOM: [{ tag: \"li\" }],\n toDOM() {\n return [\"li\", { class: \"leading-normal -mb-2\" }, 0];\n },\n defining: true\n },\n task_list: {\n group: \"block\",\n content: \"task_item+\",\n parseDOM: [{ tag: \"ul[data-type=\\\"taskList\\\"]\" }],\n toDOM() {\n return [\"ul\", {\n \"data-type\": \"taskList\",\n class: \"not-prose\"\n }, 0];\n }\n },\n task_item: {\n content: \"paragraph block*\",\n defining: true,\n attrs: { checked: { default: false } },\n parseDOM: [\n {\n tag: \"li[data-type=\\\"taskItem\\\"]\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return { checked: dom.getAttribute(\"data-checked\") === \"true\" };\n }\n }\n ],\n toDOM(node) {\n return [\"li\", {\n \"data-type\": \"taskItem\",\n \"data-checked\": node.attrs.checked ? \"true\" : \"false\",\n class: \"flex items-start my-4\"\n }, 0];\n }\n },\n hard_break: {\n inline: true,\n group: \"inline\",\n selectable: false,\n parseDOM: [{ tag: \"br\" }],\n toDOM() {\n return [\"br\"];\n }\n },\n ...tableNodes({\n tableGroup: \"block\",\n cellContent: \"block+\",\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom: HTMLElement) {\n return dom.style.backgroundColor || null\n },\n setDOMAttr(value: unknown, attrs: any) {\n if (value && typeof value === \"string\") attrs.style = (attrs.style || \"\") + `background-color: ${value};`\n }\n }\n }\n })\n};\n\nexport const schema = new Schema({\n nodes,\n marks\n});\n","/* eslint-disable @typescript-eslint/triple-slash-reference */\n/// <reference path=\"./markdown-it-plugins.d.ts\" />\nimport {\n MarkdownParser,\n MarkdownSerializer,\n defaultMarkdownParser,\n defaultMarkdownSerializer\n} from \"prosemirror-markdown\";\nimport markdownIt from \"markdown-it\";\nimport markdownItTaskLists from \"markdown-it-task-lists\";\nimport markdownItMark from \"markdown-it-mark\";\nimport markdownItIns from \"markdown-it-ins\";\n\nimport { schema } from \"./schema\";\n\n/**\n * ProseMirror's MarkdownSerializerState exposes an `out` string property\n * that accumulates the serialised output. The published typings do not\n * include it, so we extend the type locally to avoid `as any` casts.\n */\ninterface MarkdownSerializerStateWithOutput {\n out: string;\n}\n\nconst parserTokens: any = {\n ...defaultMarkdownParser.tokens,\n em: { mark: \"italic\" },\n strong: { mark: \"bold\" },\n html_inline: { ignore: true,\nnoCloseToken: true },\n html_block: { ignore: true,\nnoCloseToken: true },\n s: {\n mark: \"strike\"\n },\n task_list: {\n block: \"task_list\"\n },\n task_item: {\n block: \"task_item\",\n getAttrs: (tok: any) => ({ checked: tok.attrGet(\"checked\") === \"true\" })\n },\n mark: {\n mark: \"highlight\"\n },\n ins: {\n mark: \"underline\"\n },\n table: { block: \"table\" },\n thead: { ignore: true },\n tbody: { ignore: true },\n tr: { block: \"table_row\" },\n th: { block: \"table_header\" },\n td: { block: \"table_cell\" }\n};\n\nconst md = markdownIt({ html: false })\n .use(markdownItTaskLists)\n .use(markdownItMark)\n .use(markdownItIns);\n\n// Unwrap images from paragraphs so they can be parsed as block nodes by ProseMirror\nmd.core.ruler.after(\"inline\", \"image-to-block\", (state: any) => {\n const tokens = state.tokens;\n for (let i = tokens.length - 2; i >= 1; i--) {\n if (\n tokens[i - 1] && tokens[i - 1].type === \"paragraph_open\" &&\n tokens[i] && tokens[i].type === \"inline\" &&\n tokens[i + 1] && tokens[i + 1].type === \"paragraph_close\"\n ) {\n const inlineTokens = tokens[i].children || [];\n if (inlineTokens.length === 1 && inlineTokens[0].type === \"image\") {\n state.tokens.splice(i - 1, 3, inlineTokens[0]);\n // No need to adjust index when looping backward!\n }\n }\n }\n});\n\n// Wrap inline tokens inside table cells into paragraphs to satisfy ProseMirror table cell schema (block+)\nmd.core.ruler.after(\"inline\", \"tables-wrap-paragraphs\", (state: any) => {\n const tokens = state.tokens;\n for (let i = tokens.length - 1; i >= 0; i--) {\n if (tokens[i].type === \"td_open\" || tokens[i].type === \"th_open\") {\n let closeIndex = i + 1;\n while (closeIndex < tokens.length && tokens[closeIndex].type !== \"td_close\" && tokens[closeIndex].type !== \"th_close\") {\n closeIndex++;\n }\n if (closeIndex < tokens.length) {\n const pOpen = new state.Token(\"paragraph_open\", \"p\", 1);\n pOpen.block = true;\n const pClose = new state.Token(\"paragraph_close\", \"p\", -1);\n pClose.block = true;\n\n state.tokens.splice(closeIndex, 0, pClose);\n state.tokens.splice(i + 1, 0, pOpen);\n }\n }\n }\n});\n\nexport const markdownParser = new MarkdownParser(schema, md, parserTokens);\n\n\nexport const markdownSerializer = new MarkdownSerializer(\n {\n ...defaultMarkdownSerializer.nodes,\n // Use \"-\" as bullet character to match markdown-it output and prevent\n // serialization round-trip from changing \"- \" to \"* \" and dirtying the form.\n bullet_list(state, node) {\n state.renderList(node, \" \", () => \"- \");\n },\n // Add custom serialization for task lists\n task_list(state, node) {\n state.renderList(node, \" \", () => \"- \");\n },\n task_item(state, node) {\n state.write(`[${node.attrs.checked ? \"x\" : \" \"}] `);\n state.renderContent(node);\n },\n horizontal_rule(state, node) {\n state.write(node.attrs.markup || \"---\");\n state.closeBlock(node);\n },\n image(state, node) {\n const rawSrc = node.attrs.src || \"\";\n const src = rawSrc.replace(/ /g, \"%20\");\n state.write(\"![\" + state.esc(node.attrs.alt || \"\") + \"](\" + src.replace(/[\\(\\)]/g, \"\\\\$&\") +\n (node.attrs.title ? ' \"' + node.attrs.title.replace(/\"/g, '\\\\\"') + '\"' : \"\") + \")\");\n state.closeBlock(node);\n },\n table(state, node) {\n // Access the internal `.out` accumulator with a typed cast (see MarkdownSerializerStateWithOutput).\n const stateInternal = state as unknown as MarkdownSerializerStateWithOutput;\n node.forEach((row, _, i) => {\n row.forEach((cell, _, j) => {\n if (j === 0) state.write(\"| \");\n else state.write(\" \");\n\n // Capture cell content by tracking state.out length.\n // This avoids monkey-patching state.write which loses\n // flushClose/delim handling and can produce \"undefined\" text.\n const startLen = stateInternal.out.length;\n let first = true;\n cell.forEach((block) => {\n if (!first) stateInternal.out += \"<br>\";\n state.renderInline(block);\n first = false;\n });\n const cellContent = stateInternal.out.slice(startLen);\n // Remove the rendered content from state.out; we'll re-add it escaped\n stateInternal.out = stateInternal.out.slice(0, startLen);\n state.write(cellContent.replace(/\\|/g, \"\\\\|\").replace(/\\n/g, \" \"));\n state.write(\" |\");\n });\n state.write(\"\\n\");\n if (i === 0) {\n row.forEach((cell, _, j) => {\n state.write(j === 0 ? \"|---|\" : \"---|\");\n });\n state.write(\"\\n\");\n }\n });\n state.closeBlock(node);\n },\n table_row() {},\n table_cell() {},\n table_header() {}\n },\n {\n ...defaultMarkdownSerializer.marks,\n bold: defaultMarkdownSerializer.marks.strong,\n italic: defaultMarkdownSerializer.marks.em,\n strike: { open: \"~~\",\nclose: \"~~\",\nmixable: true,\nexpelEnclosingWhitespace: true },\n highlight: { open: \"==\",\nclose: \"==\",\nmixable: true,\nexpelEnclosingWhitespace: true },\n underline: { open: \"++\",\nclose: \"++\",\nmixable: true,\nexpelEnclosingWhitespace: true },\n link: {\n ...defaultMarkdownSerializer.marks.link,\n close(state: any, mark, parent, index) {\n const inAutolink = state.inAutolink;\n state.inAutolink = undefined;\n const href = mark.attrs.href.replace(/ /g, \"%20\");\n return inAutolink ? \">\"\n : \"](\" + href.replace(/[\\(\\)\"]/g, \"\\\\$&\") + (mark.attrs.title ? ` \"${mark.attrs.title.replace(/\"/g, '\\\\\"')}\"` : \"\") + \")\";\n }\n },\n // textStyle (colored text from HTML) has no markdown equivalent — emit content as-is\n textStyle: { open: \"\",\nclose: \"\",\nmixable: true,\nexpelEnclosingWhitespace: true }\n }\n);\nexport const parser = markdownParser;\nexport const serializer = markdownSerializer;\n"],"mappings":";;;;;;;;;AAGA,IAAM,QAAqC;CACvC,MAAM;EACF,OAAO;GACH,MAAM,CAAC;GACP,OAAO,EAAE,SAAS,KAAK;GACvB,QAAQ,EAAE,SAAS,SAAS;EAChC;EACA,WAAW;EACX,UAAU,CACN;GACI,KAAK;GACL,SAAS,KAA2B;IAChC,IAAI,OAAO,QAAQ,UAAU,OAAO;IACpC,OAAO;KACH,MAAM,IAAI,aAAa,MAAM;KAC7B,OAAO,IAAI,aAAa,OAAO;KAC/B,QAAQ,IAAI,aAAa,QAAQ,KAAK;IAC1C;GACJ;EACJ,CACJ;EACA,MAAM,MAAM;GACR,MAAM,EACF,MACA,OACA,WACA,KAAK;GACT,OAAO;IAAC;IAAK;KACT;KACA;KACA;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K;CACvB,WAAW;EAAE,MAAM;EAC3B,OAAO;EACP,SAAS;EACT,0BAA0B;CAAK;CACvB,WAAW;EAAE,MAAM;EAC3B,OAAO;EACP,SAAS;EACT,0BAA0B;CAAK;CACvB,MAAM;EACF,GAAG,0BAA0B,MAAM;EACnC,MAAM,OAAY,MAAM,QAAQ,OAAO;GACnC,MAAM,aAAa,MAAM;GACzB,MAAM,aAAa,KAAA;GACnB,MAAM,OAAO,KAAK,MAAM,KAAK,QAAQ,MAAM,KAAK;GAChD,OAAO,aAAa,MACd,OAAO,KAAK,QAAQ,YAAY,MAAM,KAAK,KAAK,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,QAAQ,MAAM,MAAK,EAAE,KAAK,MAAM;EAC9H;CACJ;CAEA,WAAW;EAAE,MAAM;EAC3B,OAAO;EACP,SAAS;EACT,0BAA0B;CAAK;AAC3B,CACJ;AACA,IAAa,SAAS;AACtB,IAAa,aAAa"}
1
+ {"version":3,"file":"markdown-CklalUUk.js","names":[],"sources":["../src/editor/schema.ts","../src/editor/markdown.ts"],"sourcesContent":["import { Schema, NodeSpec, MarkSpec } from \"prosemirror-model\";\nimport { tableNodes } from \"prosemirror-tables\";\n\nconst marks: { [key: string]: MarkSpec } = {\n link: {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: \"_blank\" }\n },\n inclusive: false,\n parseDOM: [\n {\n tag: \"a[href]\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return {\n href: dom.getAttribute(\"href\"),\n title: dom.getAttribute(\"title\"),\n target: dom.getAttribute(\"target\") || \"_blank\"\n };\n }\n }\n ],\n toDOM(node) {\n const {\n href,\n title,\n target\n } = node.attrs;\n return [\"a\", {\n href,\n title,\n target,\n class: \"text-surface-700 dark:text-surface-accent-200 underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer\"\n }, 0];\n }\n },\n bold: {\n parseDOM: [\n { tag: \"strong\" },\n {\n tag: \"b\",\n getAttrs: (node: HTMLElement | string) => typeof node !== \"string\" && node.style.fontWeight !== \"normal\" && null\n },\n {\n style: \"font-weight=400\",\n clearMark: m => m.type.name === \"bold\"\n },\n {\n style: \"font-weight\",\n getAttrs: (value: string | HTMLElement) => typeof value === \"string\" && /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null\n }\n ],\n toDOM() {\n return [\"strong\", 0];\n }\n },\n italic: {\n parseDOM: [{ tag: \"i\" }, { tag: \"em\" }, { style: \"font-style=italic\" }],\n toDOM() {\n return [\"em\", 0];\n }\n },\n strike: {\n parseDOM: [{ tag: \"s\" }, { tag: \"del\" }, { tag: \"strike\" }, { style: \"text-decoration=line-through\" }],\n toDOM() {\n return [\"s\", 0];\n }\n },\n underline: {\n parseDOM: [{ tag: \"u\" }, { style: \"text-decoration=underline\" }],\n toDOM() {\n return [\"u\", 0];\n }\n },\n code: {\n parseDOM: [{ tag: \"code\" }],\n toDOM() {\n return [\"code\", {\n class: \"rounded-md bg-surface-accent-50 dark:bg-surface-700 px-1.5 py-1 font-mono font-medium\",\n spellcheck: \"false\"\n }, 0];\n }\n },\n textStyle: {\n attrs: { color: { default: null } },\n parseDOM: [\n {\n style: \"color\",\n getAttrs: (value: string | HTMLElement) => {\n if (typeof value === \"string\") return { color: value };\n return false;\n }\n }\n ],\n toDOM(mark) {\n let style = \"\";\n if (mark.attrs.color) style += `color: ${mark.attrs.color};`;\n return [\"span\", { style }, 0];\n }\n },\n highlight: {\n attrs: { color: { default: null } },\n parseDOM: [\n {\n tag: \"mark\",\n getAttrs: (dom: HTMLElement | string) => {\n if (typeof dom === \"string\") return false;\n return { color: dom.style.backgroundColor || dom.getAttribute(\"data-color\") };\n }\n }\n ],\n toDOM(mark) {\n return [\"mark\", mark.attrs.color ? {\n style: `background-color: ${mark.attrs.color}; color: inherit;`,\n \"data-color\": mark.attrs.color\n } : {}, 0];\n }\n }\n};\n\nconst nodes: { [key: string]: NodeSpec } = {\n doc: {\n content: \"block+\"\n },\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [{ tag: \"p\" }],\n toDOM() {\n return [\"p\", 0];\n }\n },\n text: {\n group: \"inline\"\n },\n blockquote: {\n content: \"block+\",\n group: \"block\",\n defining: true,\n parseDOM: [{ tag: \"blockquote\" }],\n toDOM() {\n return [\"blockquote\", { class: \"border-l-4 border-primary\" }, 0];\n }\n },\n heading: {\n attrs: { level: { default: 1 } },\n content: \"inline*\",\n group: \"block\",\n defining: true,\n parseDOM: [\n {\n tag: \"h1\",\n attrs: { level: 1 }\n },\n {\n tag: \"h2\",\n attrs: { level: 2 }\n },\n {\n tag: \"h3\",\n attrs: { level: 3 }\n },\n {\n tag: \"h4\",\n attrs: { level: 4 }\n },\n {\n tag: \"h5\",\n attrs: { level: 5 }\n },\n {\n tag: \"h6\",\n attrs: { level: 6 }\n }\n ],\n toDOM(node) {\n return [\"h\" + node.attrs.level, 0];\n }\n },\n horizontal_rule: {\n group: \"block\",\n parseDOM: [{ tag: \"hr\" }],\n toDOM() {\n return [\"hr\", { class: \"mt-4 mb-6 border-t border-solid border-gray-200 dark:border-gray-800\" }];\n }\n },\n code_block: {\n content: \"text*\",\n marks: \"\",\n group: \"block\",\n code: true,\n defining: true,\n attrs: { language: { default: null } },\n parseDOM: [\n {\n tag: \"pre\",\n preserveWhitespace: \"full\"\n }\n ],\n toDOM(node) {\n return [\"pre\", { class: \"rounded bg-blue-50 dark:bg-surface-700 border border-solid border-gray-200 dark:border-gray-800 p-5 font-mono font-medium text-gray-800 dark:text-gray-200\" }, [\"code\", 0]];\n }\n },\n image: {\n inline: false,\n group: \"block\",\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null }\n },\n draggable: true,\n parseDOM: [\n {\n tag: \"img[src]\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return {\n src: dom.getAttribute(\"src\"),\n title: dom.getAttribute(\"title\"),\n alt: dom.getAttribute(\"alt\")\n };\n }\n }\n ],\n toDOM(node) {\n const {\n src,\n alt,\n title\n } = node.attrs;\n return [\"img\", {\n src,\n alt,\n title,\n class: \"rounded-lg max-w-full !m-0\"\n }];\n }\n },\n bullet_list: {\n content: \"list_item+\",\n group: \"block\",\n parseDOM: [{ tag: \"ul\" }],\n toDOM() {\n return [\"ul\", { class: \"list-disc list-outside leading-3 -mt-2\" }, 0];\n }\n },\n ordered_list: {\n content: \"list_item+\",\n group: \"block\",\n attrs: { order: { default: 1 } },\n parseDOM: [\n {\n tag: \"ol\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return { order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\")! : 1 };\n }\n }\n ],\n toDOM(node) {\n return node.attrs.order === 1 ? [\"ol\", { class: \"list-decimal list-outside leading-3 -mt-2\" }, 0] : [\"ol\", {\n start: node.attrs.order,\n class: \"list-decimal list-outside leading-3 -mt-2\"\n }, 0];\n }\n },\n list_item: {\n content: \"paragraph block*\",\n parseDOM: [{ tag: \"li\" }],\n toDOM() {\n return [\"li\", { class: \"leading-normal -mb-2\" }, 0];\n },\n defining: true\n },\n task_list: {\n group: \"block\",\n content: \"task_item+\",\n parseDOM: [{ tag: \"ul[data-type=\\\"taskList\\\"]\" }],\n toDOM() {\n return [\"ul\", {\n \"data-type\": \"taskList\",\n class: \"not-prose\"\n }, 0];\n }\n },\n task_item: {\n content: \"paragraph block*\",\n defining: true,\n attrs: { checked: { default: false } },\n parseDOM: [\n {\n tag: \"li[data-type=\\\"taskItem\\\"]\",\n getAttrs(dom: HTMLElement | string) {\n if (typeof dom === \"string\") return false;\n return { checked: dom.getAttribute(\"data-checked\") === \"true\" };\n }\n }\n ],\n toDOM(node) {\n return [\"li\", {\n \"data-type\": \"taskItem\",\n \"data-checked\": node.attrs.checked ? \"true\" : \"false\",\n class: \"flex items-start my-4\"\n }, 0];\n }\n },\n hard_break: {\n inline: true,\n group: \"inline\",\n selectable: false,\n parseDOM: [{ tag: \"br\" }],\n toDOM() {\n return [\"br\"];\n }\n },\n ...tableNodes({\n tableGroup: \"block\",\n cellContent: \"block+\",\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom: HTMLElement) {\n return dom.style.backgroundColor || null\n },\n setDOMAttr(value: unknown, attrs: any) {\n if (value && typeof value === \"string\") attrs.style = (attrs.style || \"\") + `background-color: ${value};`\n }\n }\n }\n })\n};\n\nexport const schema = new Schema({\n nodes,\n marks\n});\n","/* eslint-disable @typescript-eslint/triple-slash-reference */\n/// <reference path=\"./markdown-it-plugins.d.ts\" />\nimport {\n MarkdownParser,\n MarkdownSerializer,\n defaultMarkdownParser,\n defaultMarkdownSerializer\n} from \"prosemirror-markdown\";\nimport markdownIt from \"markdown-it\";\nimport markdownItTaskLists from \"markdown-it-task-lists\";\nimport markdownItMark from \"markdown-it-mark\";\nimport markdownItIns from \"markdown-it-ins\";\n\nimport { schema } from \"./schema\";\n\n/**\n * ProseMirror's MarkdownSerializerState exposes an `out` string property\n * that accumulates the serialised output. The published typings do not\n * include it, so we extend the type locally to avoid `as any` casts.\n */\ninterface MarkdownSerializerStateWithOutput {\n out: string;\n}\n\nconst parserTokens: any = {\n ...defaultMarkdownParser.tokens,\n em: { mark: \"italic\" },\n strong: { mark: \"bold\" },\n html_inline: { ignore: true,\nnoCloseToken: true },\n html_block: { ignore: true,\nnoCloseToken: true },\n s: {\n mark: \"strike\"\n },\n task_list: {\n block: \"task_list\"\n },\n task_item: {\n block: \"task_item\",\n getAttrs: (tok: any) => ({ checked: tok.attrGet(\"checked\") === \"true\" })\n },\n mark: {\n mark: \"highlight\"\n },\n ins: {\n mark: \"underline\"\n },\n table: { block: \"table\" },\n thead: { ignore: true },\n tbody: { ignore: true },\n tr: { block: \"table_row\" },\n th: { block: \"table_header\" },\n td: { block: \"table_cell\" }\n};\n\nconst md = markdownIt({ html: false })\n .use(markdownItTaskLists)\n .use(markdownItMark)\n .use(markdownItIns);\n\n// Unwrap images from paragraphs so they can be parsed as block nodes by ProseMirror\nmd.core.ruler.after(\"inline\", \"image-to-block\", (state: any) => {\n const tokens = state.tokens;\n for (let i = tokens.length - 2; i >= 1; i--) {\n if (\n tokens[i - 1] && tokens[i - 1].type === \"paragraph_open\" &&\n tokens[i] && tokens[i].type === \"inline\" &&\n tokens[i + 1] && tokens[i + 1].type === \"paragraph_close\"\n ) {\n const inlineTokens = tokens[i].children || [];\n if (inlineTokens.length === 1 && inlineTokens[0].type === \"image\") {\n state.tokens.splice(i - 1, 3, inlineTokens[0]);\n // No need to adjust index when looping backward!\n }\n }\n }\n});\n\n// Wrap inline tokens inside table cells into paragraphs to satisfy ProseMirror table cell schema (block+)\nmd.core.ruler.after(\"inline\", \"tables-wrap-paragraphs\", (state: any) => {\n const tokens = state.tokens;\n for (let i = tokens.length - 1; i >= 0; i--) {\n if (tokens[i].type === \"td_open\" || tokens[i].type === \"th_open\") {\n let closeIndex = i + 1;\n while (closeIndex < tokens.length && tokens[closeIndex].type !== \"td_close\" && tokens[closeIndex].type !== \"th_close\") {\n closeIndex++;\n }\n if (closeIndex < tokens.length) {\n const pOpen = new state.Token(\"paragraph_open\", \"p\", 1);\n pOpen.block = true;\n const pClose = new state.Token(\"paragraph_close\", \"p\", -1);\n pClose.block = true;\n\n state.tokens.splice(closeIndex, 0, pClose);\n state.tokens.splice(i + 1, 0, pOpen);\n }\n }\n }\n});\n\nexport const markdownParser = new MarkdownParser(schema, md, parserTokens);\n\n\nexport const markdownSerializer = new MarkdownSerializer(\n {\n ...defaultMarkdownSerializer.nodes,\n // Use \"-\" as bullet character to match markdown-it output and prevent\n // serialization round-trip from changing \"- \" to \"* \" and dirtying the form.\n bullet_list(state, node) {\n state.renderList(node, \" \", () => \"- \");\n },\n // Add custom serialization for task lists\n task_list(state, node) {\n state.renderList(node, \" \", () => \"- \");\n },\n task_item(state, node) {\n state.write(`[${node.attrs.checked ? \"x\" : \" \"}] `);\n state.renderContent(node);\n },\n horizontal_rule(state, node) {\n state.write(node.attrs.markup || \"---\");\n state.closeBlock(node);\n },\n image(state, node) {\n const rawSrc = node.attrs.src || \"\";\n const src = rawSrc.replace(/ /g, \"%20\");\n state.write(\"![\" + state.esc(node.attrs.alt || \"\") + \"](\" + src.replace(/[\\(\\)]/g, \"\\\\$&\") +\n (node.attrs.title ? ' \"' + node.attrs.title.replace(/\"/g, '\\\\\"') + '\"' : \"\") + \")\");\n state.closeBlock(node);\n },\n table(state, node) {\n // Access the internal `.out` accumulator with a typed cast (see MarkdownSerializerStateWithOutput).\n const stateInternal = state as unknown as MarkdownSerializerStateWithOutput;\n node.forEach((row, _, i) => {\n row.forEach((cell, _, j) => {\n if (j === 0) state.write(\"| \");\n else state.write(\" \");\n\n // Capture cell content by tracking state.out length.\n // This avoids monkey-patching state.write which loses\n // flushClose/delim handling and can produce \"undefined\" text.\n const startLen = stateInternal.out.length;\n let first = true;\n cell.forEach((block) => {\n if (!first) stateInternal.out += \"<br>\";\n state.renderInline(block);\n first = false;\n });\n const cellContent = stateInternal.out.slice(startLen);\n // Remove the rendered content from state.out; we'll re-add it escaped\n stateInternal.out = stateInternal.out.slice(0, startLen);\n state.write(cellContent.replace(/\\|/g, \"\\\\|\").replace(/\\n/g, \" \"));\n state.write(\" |\");\n });\n state.write(\"\\n\");\n if (i === 0) {\n row.forEach((cell, _, j) => {\n state.write(j === 0 ? \"|---|\" : \"---|\");\n });\n state.write(\"\\n\");\n }\n });\n state.closeBlock(node);\n },\n table_row() {},\n table_cell() {},\n table_header() {}\n },\n {\n ...defaultMarkdownSerializer.marks,\n bold: defaultMarkdownSerializer.marks.strong,\n italic: defaultMarkdownSerializer.marks.em,\n strike: { open: \"~~\",\nclose: \"~~\",\nmixable: true,\nexpelEnclosingWhitespace: true },\n highlight: { open: \"==\",\nclose: \"==\",\nmixable: true,\nexpelEnclosingWhitespace: true },\n underline: { open: \"++\",\nclose: \"++\",\nmixable: true,\nexpelEnclosingWhitespace: true },\n link: {\n ...defaultMarkdownSerializer.marks.link,\n close(state: any, mark, parent, index) {\n const inAutolink = state.inAutolink;\n state.inAutolink = undefined;\n const href = mark.attrs.href.replace(/ /g, \"%20\");\n return inAutolink ? \">\"\n : \"](\" + href.replace(/[\\(\\)\"]/g, \"\\\\$&\") + (mark.attrs.title ? ` \"${mark.attrs.title.replace(/\"/g, '\\\\\"')}\"` : \"\") + \")\";\n }\n },\n // textStyle (colored text from HTML) has no markdown equivalent — emit content as-is\n textStyle: { open: \"\",\nclose: \"\",\nmixable: true,\nexpelEnclosingWhitespace: true }\n }\n);\nexport const parser = markdownParser;\nexport const serializer = markdownSerializer;\n"],"mappings":";;;;;;;;;AAGA,IAAM,QAAqC;CACvC,MAAM;EACF,OAAO;GACH,MAAM,CAAC;GACP,OAAO,EAAE,SAAS,KAAK;GACvB,QAAQ,EAAE,SAAS,SAAS;EAChC;EACA,WAAW;EACX,UAAU,CACN;GACI,KAAK;GACL,SAAS,KAA2B;IAChC,IAAI,OAAO,QAAQ,UAAU,OAAO;IACpC,OAAO;KACH,MAAM,IAAI,aAAa,MAAM;KAC7B,OAAO,IAAI,aAAa,OAAO;KAC/B,QAAQ,IAAI,aAAa,QAAQ,KAAK;IAC1C;GACJ;EACJ,CACJ;EACA,MAAM,MAAM;GACR,MAAM,EACF,MACA,OACA,WACA,KAAK;GACT,OAAO;IAAC;IAAK;KACT;KACA;KACA;KACA,OAAO;IACX;IAAG;GAAC;EACR;CACJ;CACA,MAAM;EACF,UAAU;GACN,EAAE,KAAK,SAAS;GAChB;IACI,KAAK;IACL,WAAW,SAA+B,OAAO,SAAS,YAAY,KAAK,MAAM,eAAe,YAAY;GAChH;GACA;IACI,OAAO;IACP,YAAW,MAAK,EAAE,KAAK,SAAS;GACpC;GACA;IACI,OAAO;IACP,WAAW,UAAgC,OAAO,UAAU,YAAY,4BAA4B,KAAK,KAAK,KAAK;GACvH;EACJ;EACA,QAAQ;GACJ,OAAO,CAAC,UAAU,CAAC;EACvB;CACJ;CACA,QAAQ;EACJ,UAAU;GAAC,EAAE,KAAK,IAAI;GAAG,EAAE,KAAK,KAAK;GAAG,EAAE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AM,KAAK,KAAK,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,QAAQ,MAAM,MAAK,EAAE,KAAK,MAAM;EAC9H;CACJ;CAEA,WAAW;EAAE,MAAM;EAC3B,OAAO;EACP,SAAS;EACT,0BAA0B;CAAK;AAC3B,CACJ;AACA,IAAa,SAAS;AACtB,IAAa,aAAa"}
@@ -3,7 +3,7 @@ import React, { Suspense, createContext, createElement, forwardRef, lazy, memo,
3
3
  import { deepEqual } from "fast-equals";
4
4
  import { Alert, AlertCircleIcon, AlertTriangleIcon, AlignLeftIcon, ArrowLeftIcon, ArrowRightToLineIcon, Badge, BooleanSwitchWithLabel, Button, CHIP_COLORS, CalendarIcon, Card, CardView, CenteredView, CheckCircleIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, Chip, CircleIcon, CircularProgress, CircularProgressCenter, CodeIcon, Collapse, ColumnsIcon, CopyIcon, DateTimeField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, ExpandablePanel, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, FileUpload, FilterChip, FilterIcon, FilterXIcon, FlagIcon, FolderUpIcon, FunctionSquareIcon, GlobeIcon, HandleIcon, HashIcon, HistoryIcon, IconButton, ImageOffIcon, KanbanIcon, KanbanView, KeyRoundIcon, Label, LayoutGridIcon, Link2Icon, LinkIcon, ListIcon, ListOrderedIcon, ListView, LoaderIcon, LoadingButton, MailIcon, Markdown, Maximize2Icon, Menu, MenuItem, MinusIcon, MoreVerticalIcon, MultiSelect, MultiSelectItem, PencilIcon, PlusIcon, Popover, PopoverPrimitive, Portal, QuoteIcon, RadioGroup, RadioGroupItem, RefreshCwIcon, RepeatIcon, ResizablePanels, Rows3Icon, SearchBar, SearchIcon, Select, SelectItem, Separator, SettingsIcon, Sheet, Skeleton, Tab, Table, TableBody, TableCell, TableHeader, TableIcon, TableRow, TableView, Tabs, TextField, TextIcon, TextareaAutosize, ToggleButtonGroup, Tooltip, Trash2Icon, Typography, Unlink2Icon, UploadIcon, UserIcon, VirtualTableDateField, VirtualTableInput, VirtualTableInput as VirtualTableInput$1, VirtualTableNumberInput, VirtualTableSwitch, VoteIcon, XCircleIcon, XIcon, cls, coolIconKeys, createVirtualTableSelectionStore, debounce, defaultBorderMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, fieldBackgroundInvisibleMixin, fieldBackgroundMixin, focusedDisabled, getColorSchemeForSeed, iconSize, lucideIcons, paperMixin, useDebouncedCallback, useInjectStyles, useOutsideAlerter } from "@rebasepro/ui";
5
5
  import { CollectionRegistry, DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE, canReadCollection, enumToObjectEntries, getArrayResolvedProperties, getDefaultValueFor, getDefaultValueFortype, getDefaultValuesFor, getEntityChildViews, getLabelOrConfigFrom, getReferenceFrom, getRelationFrom, getSubcollections, getTableName, isPropertyBuilder, normalizeToEntityRelation, resolveArrayProperties, resolveEnumValues, resolveProperty, resolveRelationProperty, resolveStorageFilenameString, resolveStoragePathString, resolveStorageSource } from "@rebasepro/common";
6
- import { ADDITIONAL_TAB_WIDTH, CONTAINER_FULL_WIDTH, CollectionScopeProvider, DEFAULT_PAGE_SIZE, ErrorTooltip, ErrorView, FORM_CONTAINER_WIDTH, IconForView, PluginProviderStack, StorageSourceContext, UnsavedChangesDialog, UserDisplay, addInitialSlash, buildEnumLabel, createFormexStub, deleteEntityWithCallbacks, flattenKeys, getAdminEntityChildViews, getCollectionBySlugWithin, getCollectionPathsCombinations, getColorScheme, getColumnKeysForProperty, getEntityFromCache, getEntityFromMemoryCache, getEntityImagePreviewPropertyKey, getFormFieldKeys, getIcon, getLastSegment as getLastSegment$1, getLocalChangesBackup, getNavigationEntriesFromPath, getParentReferencesFromPath, getRelationIncludeParams, getRowHeight, getTitlePropertyCandidates, getTitlePropertyKey, getTitlePropertyKeyForValues, iconsSearch, isFilterableRelation, isHidden, isReadOnly, looksLikeIdentifierValue, removeEntityFromCache, removeEntityFromMemoryCache, removeInitialAndTrailingSlashes, removeInitialAndTrailingSlashes as removeInitialAndTrailingSlashes$1, removeInitialSlash, removeTrailingSlash, removeTrailingSlash as removeTrailingSlash$1, resolveCollectionPathIds, resolveCollectionPathIds as resolveCollectionPathIds$1, resolveComponentRef, resolveDefaultSelectedView, resolveFilterOperators, saveEntityToCache, saveEntityToMemoryCache, saveEntityWithCallbacks, useAnalyticsController, useApiConfig, useAuthController, useCollectionScope, useColumnIds, useComponentOverride, useCustomizationController, useData, useDataTableController, useFetch, useLargeLayout, useModeController, useNavigationBlocker, usePermissions, useRebaseClient, useRebaseContext, useRelationSelector, useResolvedComponent, useScrollRestoration, useSlot, useSnackbarController, useStorageSource, useStorageSources, useStorageUploadController, useTranslation, useUnsavedChangesDialog, useUserConfigurationPersistence } from "@rebasepro/app";
6
+ import { ADDITIONAL_TAB_WIDTH, CONTAINER_FULL_WIDTH, CollectionScopeProvider, DEFAULT_PAGE_SIZE, ErrorTooltip, ErrorView, FORM_CONTAINER_WIDTH, IconForView, PluginProviderStack, StorageSourceContext, UnsavedChangesDialog, UserDisplay, addInitialSlash, apiBaseOf, buildEnumLabel, createFormexStub, deleteEntityWithCallbacks, flattenKeys, getAdminEntityChildViews, getCollectionBySlugWithin, getCollectionPathsCombinations, getColorScheme, getColumnKeysForProperty, getEntityFromCache, getEntityFromMemoryCache, getEntityImagePreviewPropertyKey, getFormFieldKeys, getIcon, getLastSegment as getLastSegment$1, getLocalChangesBackup, getNavigationEntriesFromPath, getParentReferencesFromPath, getRelationIncludeParams, getRowHeight, getTitlePropertyCandidates, getTitlePropertyKey, getTitlePropertyKeyForValues, iconsSearch, isFilterableRelation, isHidden, isReadOnly, looksLikeIdentifierValue, removeEntityFromCache, removeEntityFromMemoryCache, removeInitialAndTrailingSlashes, removeInitialAndTrailingSlashes as removeInitialAndTrailingSlashes$1, removeInitialSlash, removeTrailingSlash, removeTrailingSlash as removeTrailingSlash$1, resolveCollectionPathIds, resolveCollectionPathIds as resolveCollectionPathIds$1, resolveComponentRef, resolveDefaultSelectedView, resolveFilterOperators, saveEntityToCache, saveEntityToMemoryCache, saveEntityWithCallbacks, useAnalyticsController, useApiBase, useApiConfig, useAuthController, useCollectionScope, useColumnIds, useComponentOverride, useCustomizationController, useData, useDataTableController, useFetch, useLargeLayout, useModeController, useNavigationBlocker, usePermissions, useRebaseClient, useRebaseContext, useRelationSelector, useResolvedComponent, useScrollRestoration, useSlot, useSnackbarController, useStorageSource, useStorageSources, useStorageUploadController, useTranslation, useUnsavedChangesDialog, useUserConfigurationPersistence } from "@rebasepro/app";
7
7
  import { Field, Formex, getIn, setIn, useCreateFormex, useFormex } from "@rebasepro/forms";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { defaultDateFormat, getHashValue, getValueInPath, hydrateRegExp, isObject, mergeDeep, randomString, toArray } from "@rebasepro/utils";
@@ -14,7 +14,7 @@ import { useDropzone } from "react-dropzone";
14
14
  import { EntityReference, EntityRelation, GeoPoint, Vector, getCollectionDataPath, getDataSourceCapabilities, isRelationalCollectionConfig } from "@rebasepro/types";
15
15
  import { z } from "zod";
16
16
  import useMeasure from "react-use-measure";
17
- import { useLocation, useNavigate, useSearchParams } from "react-router-dom";
17
+ import { useLocation, useNavigate, useSearchParams } from "react-router";
18
18
  import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
19
19
  import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
20
20
  import { SortableContext, horizontalListSortingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
@@ -1696,11 +1696,11 @@ function getCache(baseUrl) {
1696
1696
  }
1697
1697
  return cache;
1698
1698
  }
1699
- async function fetchUsers(baseUrl, ids, token) {
1699
+ async function fetchUsers(apiBase, ids, token) {
1700
1700
  const resolved = /* @__PURE__ */ new Map();
1701
1701
  for (const id of ids) resolved.set(id, null);
1702
1702
  const params = new URLSearchParams({ ids: ids.join(",") });
1703
- const response = await fetch(`${baseUrl}/api/users?${params}`, { headers: token ? { Authorization: `Bearer ${token}` } : {} });
1703
+ const response = await fetch(`${apiBase}/users?${params}`, { headers: token ? { Authorization: `Bearer ${token}` } : {} });
1704
1704
  if (!response.ok) return resolved;
1705
1705
  const data = await response.json();
1706
1706
  const rows = data.users ?? data.data ?? [];
@@ -1753,7 +1753,7 @@ function requestUser(baseUrl, uid, getAuthToken) {
1753
1753
  function useResolvedUser(uid) {
1754
1754
  const client = useRebaseClient();
1755
1755
  const { getAuthToken } = useAuthController();
1756
- const baseUrl = client?.baseUrl;
1756
+ const baseUrl = apiBaseOf(client);
1757
1757
  const [user, setUser] = useState(() => baseUrl && uid ? getCache(baseUrl).users.get(uid) ?? null : null);
1758
1758
  useEffect(() => {
1759
1759
  if (!baseUrl || !uid) {
@@ -2265,8 +2265,10 @@ function VirtualTableSelect(props) {
2265
2265
  if (ref.current && focused) ref.current?.focus({ preventScroll: true });
2266
2266
  }, [focused, ref]);
2267
2267
  const onChange = useCallback((updatedValue) => {
2268
- if (valueType === "number") if (multiple) updateValue(updatedValue.map((v) => parseFloat(v)));
2269
- else updateValue(parseFloat(updatedValue));
2268
+ if (valueType === "number") if (multiple) {
2269
+ const newValue = updatedValue.map((v) => parseFloat(v));
2270
+ updateValue(newValue);
2271
+ } else updateValue(parseFloat(updatedValue));
2270
2272
  else if (valueType === "string") if (!updatedValue) updateValue(null);
2271
2273
  else updateValue(updatedValue);
2272
2274
  else throw Error("Missing mapping in TableSelect");
@@ -2344,7 +2346,8 @@ function useUserSelector({ pageSize = DEFAULT_PAGE_SIZE$2 } = {}) {
2344
2346
  const offsetRef = useRef(0);
2345
2347
  const userCacheRef = useRef(/* @__PURE__ */ new Map());
2346
2348
  const fetchUsers = useCallback(async (searchStr, offset, append) => {
2347
- if (!client?.baseUrl) return;
2349
+ const apiBase = apiBaseOf(client);
2350
+ if (!apiBase) return;
2348
2351
  setIsLoading(true);
2349
2352
  try {
2350
2353
  const token = await getAuthToken?.();
@@ -2353,7 +2356,7 @@ function useUserSelector({ pageSize = DEFAULT_PAGE_SIZE$2 } = {}) {
2353
2356
  offset: String(offset)
2354
2357
  });
2355
2358
  if (searchStr) params.set("search", searchStr);
2356
- const response = await fetch(`${client.baseUrl}/api/users?${params}`, { headers: token ? { Authorization: `Bearer ${token}` } : {} });
2359
+ const response = await fetch(`${apiBase}/users?${params}`, { headers: token ? { Authorization: `Bearer ${token}` } : {} });
2357
2360
  if (!response.ok) throw new Error("Failed to fetch users");
2358
2361
  const data = await response.json();
2359
2362
  const newItems = (data.data ?? data.users ?? []).map((r) => {
@@ -2383,6 +2386,7 @@ function useUserSelector({ pageSize = DEFAULT_PAGE_SIZE$2 } = {}) {
2383
2386
  }
2384
2387
  }, [
2385
2388
  client?.baseUrl,
2389
+ client?.apiPath,
2386
2390
  getAuthToken,
2387
2391
  pageSize
2388
2392
  ]);
@@ -4974,7 +4978,8 @@ function StringNumberFilterField({ name, value, setValue, type, isArray, enumVal
4974
4978
  disabled: isNullOperation,
4975
4979
  placeholder: isNullOperation ? "null" : void 0,
4976
4980
  onChange: (evt) => {
4977
- updateFilter(operation, type === "number" ? parseFloat(evt.target.value) : evt.target.value);
4981
+ const val = type === "number" ? parseFloat(evt.target.value) : evt.target.value;
4982
+ updateFilter(operation, val);
4978
4983
  },
4979
4984
  endAdornment: internalValue !== void 0 && internalValue != null && /* @__PURE__ */ jsx(IconButton, {
4980
4985
  onClick: (e) => updateFilter(operation, void 0),
@@ -5842,6 +5847,13 @@ var CollectionTableBinding = function CollectionTableBinding({ className, style,
5842
5847
  }), {}) : entity;
5843
5848
  const Builder = additionalField.Builder;
5844
5849
  if (!Builder && !additionalField.value) throw new Error("When using additional fields you need to provide a Builder or a value");
5850
+ const child = Builder ? /* @__PURE__ */ jsx(Builder, {
5851
+ entity,
5852
+ context
5853
+ }) : /* @__PURE__ */ jsx(Fragment, { children: additionalField.value?.({
5854
+ entity,
5855
+ context
5856
+ })?.toString() });
5845
5857
  return /* @__PURE__ */ jsx(EntityTableCell, {
5846
5858
  width,
5847
5859
  size,
@@ -5858,13 +5870,7 @@ var CollectionTableBinding = function CollectionTableBinding({ className, style,
5858
5870
  isDragging,
5859
5871
  isDraggable,
5860
5872
  frozen,
5861
- children: /* @__PURE__ */ jsx(ErrorBoundary, { children: Builder ? /* @__PURE__ */ jsx(Builder, {
5862
- entity,
5863
- context
5864
- }) : /* @__PURE__ */ jsx(Fragment, { children: additionalField.value?.({
5865
- entity,
5866
- context
5867
- })?.toString() }) })
5873
+ children: /* @__PURE__ */ jsx(ErrorBoundary, { children: child })
5868
5874
  }, `additional_table_cell_${entity.id}_${column.key}`);
5869
5875
  }, [size]);
5870
5876
  const engine = useCollectionScope()?.engine;
@@ -6315,7 +6321,10 @@ function SearchIconsView({ selectedIcon = "", onIconSelected }) {
6315
6321
  const [query, setQuery] = React.useState("");
6316
6322
  const updateSearchResults = React.useMemo(() => debounce((value) => {
6317
6323
  if (!value || value === "") setKeys(null);
6318
- else setKeys(iconsSearch.search(value).slice(0, 50).map((e) => e.item.key));
6324
+ else {
6325
+ const limited = iconsSearch.search(value).slice(0, 50);
6326
+ setKeys(limited.map((e) => e.item.key));
6327
+ }
6319
6328
  }, UPDATE_SEARCH_INDEX_WAIT_MS), []);
6320
6329
  React.useEffect(() => {
6321
6330
  updateSearchResults(query);
@@ -6516,15 +6525,18 @@ function ArrayContainer({ droppableId, addLabel, value, disabled = false, buildE
6516
6525
  }, []);
6517
6526
  const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }), useSensor(KeyboardSensor, {}));
6518
6527
  useEffect(() => {
6519
- if (hasValue && value && value.length !== internalIds.length) setInternalIds(value.map((v, index) => {
6520
- const hashValue = (getHashValue(v) ?? String(index)) + index;
6521
- if (hashValue in internalIdsRef.current) return internalIdsRef.current[hashValue];
6522
- else {
6523
- const newInternalId = getRandomId$1();
6524
- internalIdsRef.current[hashValue] = newInternalId;
6525
- return newInternalId;
6526
- }
6527
- }));
6528
+ if (hasValue && value && value.length !== internalIds.length) {
6529
+ const newInternalIds = value.map((v, index) => {
6530
+ const hashValue = (getHashValue(v) ?? String(index)) + index;
6531
+ if (hashValue in internalIdsRef.current) return internalIdsRef.current[hashValue];
6532
+ else {
6533
+ const newInternalId = getRandomId$1();
6534
+ internalIdsRef.current[hashValue] = newInternalId;
6535
+ return newInternalId;
6536
+ }
6537
+ });
6538
+ setInternalIds(newInternalIds);
6539
+ }
6528
6540
  }, [
6529
6541
  hasValue,
6530
6542
  internalIds.length,
@@ -6585,7 +6597,8 @@ function ArrayContainer({ droppableId, addLabel, value, disabled = false, buildE
6585
6597
  const oldIndex = internalIds.indexOf(active.id);
6586
6598
  const newIndex = internalIds.indexOf(over.id);
6587
6599
  if (oldIndex === -1 || newIndex === -1) return;
6588
- setInternalIds(arrayMove$1(internalIds, oldIndex, newIndex));
6600
+ const newIds = arrayMove$1(internalIds, oldIndex, newIndex);
6601
+ setInternalIds(newIds);
6589
6602
  onValueChange(arrayMove$1(value ?? [], oldIndex, newIndex));
6590
6603
  };
6591
6604
  return sortable ? /* @__PURE__ */ jsx(DndContext, {
@@ -7308,8 +7321,9 @@ var ConfigControllerProvider = React.memo(function ConfigControllerProvider({ ch
7308
7321
  editedCollectionId
7309
7322
  });
7310
7323
  const namespace = propertyKey && propertyKey.includes(".") ? propertyKey.substring(0, propertyKey.lastIndexOf(".")) : void 0;
7324
+ const propertyKeyWithoutNamespace = propertyKey && propertyKey.includes(".") ? propertyKey.substring(propertyKey.lastIndexOf(".") + 1) : propertyKey;
7311
7325
  setCurrentPropertyDialog({
7312
- propertyKey: propertyKey && propertyKey.includes(".") ? propertyKey.substring(propertyKey.lastIndexOf(".") + 1) : propertyKey,
7326
+ propertyKey: propertyKeyWithoutNamespace,
7313
7327
  property,
7314
7328
  namespace,
7315
7329
  currentPropertiesOrder,
@@ -7365,7 +7379,10 @@ var ConfigControllerProvider = React.memo(function ConfigControllerProvider({ ch
7365
7379
  onFetchTableMetadata,
7366
7380
  handleClose: (collection) => {
7367
7381
  if (currentDialog?.redirect) {
7368
- if (collection && currentDialog?.isNewCollection && !currentDialog.parentCollectionSlugs.length) navigate(urlController.buildUrlCollectionPath(collection.slug));
7382
+ if (collection && currentDialog?.isNewCollection && !currentDialog.parentCollectionSlugs.length) {
7383
+ const url = urlController.buildUrlCollectionPath(collection.slug);
7384
+ navigate(url);
7385
+ }
7369
7386
  }
7370
7387
  setCurrentDialog(void 0);
7371
7388
  }
@@ -7532,8 +7549,8 @@ function EditorCollectionAction({ path, parentCollectionSlugs, parentEntityIds,
7532
7549
  }
7533
7550
  //#endregion
7534
7551
  //#region src/components/CollectionViewBinding/CollectionViewActions.tsx
7535
- var ImportCollectionAction = lazy(() => import("./import-BjUG-cIY.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
7536
- var ExportCollectionAction = lazy(() => import("./export-BzIpUdSK.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
7552
+ var ImportCollectionAction = lazy(() => import("./import-AFJRUo99.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
7553
+ var ExportCollectionAction = lazy(() => import("./export-BZZfQkT5.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
7537
7554
  function CollectionViewActions({ collection, relativePath, parentCollectionSlugs, parentEntityIds, onNewClick, onAddExistingClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, compact, children, openNewDocument }) {
7538
7555
  const context = useAdminContext();
7539
7556
  const { canCreate, canDelete } = usePermissions();
@@ -7723,7 +7740,7 @@ function resolveCollectionSlotKeys(collection, authController, propertyConfigs)
7723
7740
  if (!hasExplicitOrder) {
7724
7741
  for (const [key, prop] of Object.entries(collection.properties)) if (prop.type === "relation") relationKeys.push(key);
7725
7742
  }
7726
- const excludeKeys = new Set([
7743
+ const excludeKeys = /* @__PURE__ */ new Set([
7727
7744
  titleKey,
7728
7745
  imageKey,
7729
7746
  statusKey,
@@ -8356,7 +8373,7 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
8356
8373
  const showStatus = statusPropertyKey && size !== "xs" && size !== "s";
8357
8374
  const subtitleKey = previewKeys.length > 0 ? previewKeys[0] : void 0;
8358
8375
  const allKeys = resolvedCollection.propertiesOrder || Object.keys(resolvedCollection.properties);
8359
- const usedKeys = new Set([
8376
+ const usedKeys = /* @__PURE__ */ new Set([
8360
8377
  titlePropertyKey,
8361
8378
  imagePropertyKey,
8362
8379
  statusPropertyKey,
@@ -9026,7 +9043,7 @@ var MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
9026
9043
  var JSON_TAB_VALUE = "__json";
9027
9044
  //#endregion
9028
9045
  //#region src/components/DetailViewBinding.tsx
9029
- var EntityHistoryView$1 = lazy(() => import("./history-g9688IaK.js").then((m) => ({ default: m.EntityHistoryView })));
9046
+ var EntityHistoryView$1 = lazy(() => import("./history-Ao1HBAK3.js").then((m) => ({ default: m.EntityHistoryView })));
9030
9047
  function DetailViewBinding({ entityId, ...props }) {
9031
9048
  const { entity, dataLoading, dataLoadingError } = useFetch({
9032
9049
  path: props.path,
@@ -9096,7 +9113,7 @@ function DetailViewBindingInner({ path, entityId, selectedTab: selectedTabProp,
9096
9113
  const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0 || includeJsonView || includeHistoryView;
9097
9114
  const { resolvedEntityViews } = resolvedSelectedEntityView(customViews, customizationController, void 0, canEdit);
9098
9115
  const activeTab = useMemo(() => {
9099
- return new Set([
9116
+ return /* @__PURE__ */ new Set([
9100
9117
  "__main_##Q$SC^#S6",
9101
9118
  ...includeJsonView ? ["__json"] : [],
9102
9119
  ...includeHistoryView ? ["__rebase_history"] : [],
@@ -9321,7 +9338,8 @@ function DetailViewBindingInner({ path, entityId, selectedTab: selectedTabProp,
9321
9338
  children: /* @__PURE__ */ jsx(IconButton, {
9322
9339
  size: "small",
9323
9340
  onClick: () => {
9324
- navigate(`${urlController.buildUrlCollectionPath(`${path}/${entityId}`)}#full`);
9341
+ const entityUrl = urlController.buildUrlCollectionPath(`${path}/${entityId}`);
9342
+ navigate(`${entityUrl}#full`);
9325
9343
  },
9326
9344
  children: /* @__PURE__ */ jsx(Maximize2Icon, { size: iconSize.smallest })
9327
9345
  })
@@ -10203,7 +10221,8 @@ function useBoardDataController({ fullPath, collection, columnProperty, columns,
10203
10221
  const timeoutId = setTimeout(() => {
10204
10222
  if (isCleaningUpRef.current) return;
10205
10223
  currentColumns.forEach((column) => {
10206
- subscribeToColumn(column, currentColumnItemCounts[column] ?? pageSize);
10224
+ const itemCount = currentColumnItemCounts[column] ?? pageSize;
10225
+ subscribeToColumn(column, itemCount);
10207
10226
  if (isColumnExcludedByFilter(column, currentFilterValues, currentColumnProperty)) return;
10208
10227
  const accessor = currentDataClient.collection(currentResolvedPath);
10209
10228
  if (accessor.count) {
@@ -11472,9 +11491,9 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
11472
11491
  setLoading(true);
11473
11492
  setError(null);
11474
11493
  try {
11475
- const baseUrl = client?.baseUrl || "";
11494
+ const apiBase = apiBaseOf(client) ?? "";
11476
11495
  const token = await getAuthToken?.();
11477
- const response = await fetch(`${baseUrl}/api/admin/users/${user.uid}/reset-password`, {
11496
+ const response = await fetch(`${apiBase}/admin/users/${user.uid}/reset-password`, {
11478
11497
  method: "POST",
11479
11498
  headers: {
11480
11499
  "Content-Type": "application/json",
@@ -11786,7 +11805,8 @@ function PopupFormFieldInternal({ tableKey, entityId, customFieldValidator, prop
11786
11805
  const updatePopupLocation = useCallback((newPositionCandidate) => {
11787
11806
  const draggableBoundingRect = draggableRef.current?.getBoundingClientRect();
11788
11807
  if (!cellRect || !draggableBoundingRect || draggableBoundingRect.width === 0 || draggableBoundingRect.height === 0) return;
11789
- const newNormalizedPosition = normalizePosition(newPositionCandidate ?? getInitialLocation(), draggableBoundingRect, windowSize);
11808
+ const basePosition = newPositionCandidate ?? getInitialLocation();
11809
+ const newNormalizedPosition = normalizePosition(basePosition, draggableBoundingRect, windowSize);
11790
11810
  if (!popupLocation || newNormalizedPosition.x !== popupLocation.x || newNormalizedPosition.y !== popupLocation.y) setPopupLocation(newNormalizedPosition);
11791
11811
  }, [
11792
11812
  cellRect,
@@ -12587,7 +12607,10 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
12587
12607
  }, [defaultViewMode, setSearchParams]);
12588
12608
  useEffect(() => {
12589
12609
  if (urlView) setViewModeState(urlView);
12590
- else setViewModeState(getSavedView() ?? defaultViewMode);
12610
+ else {
12611
+ const savedView = getSavedView();
12612
+ setViewModeState(savedView ?? defaultViewMode);
12613
+ }
12591
12614
  }, [
12592
12615
  urlView,
12593
12616
  getSavedView,
@@ -12619,9 +12642,10 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
12619
12642
  entityId: clickedEntity.id
12620
12643
  });
12621
12644
  if (collection) addRecentId(collection.slug, clickedEntity.id);
12645
+ const entityPath = path ?? clickedEntity.path;
12622
12646
  navigateToEntity({
12623
12647
  navigation: urlController,
12624
- path: path ?? clickedEntity.path,
12648
+ path: entityPath,
12625
12649
  sidePanelController,
12626
12650
  openEntityMode,
12627
12651
  collection,
@@ -12765,7 +12789,8 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
12765
12789
  const onColumnResize = useCallback(({ width, key }) => {
12766
12790
  const collection = collectionRef.current;
12767
12791
  if (!getPropertyInPath(collection.properties, key)) return;
12768
- onCollectionModifiedForUser(path, buildPropertyWidthOverwrite(key, width));
12792
+ const localCollection = buildPropertyWidthOverwrite(key, width);
12793
+ onCollectionModifiedForUser(path, localCollection);
12769
12794
  }, [onCollectionModifiedForUser, path]);
12770
12795
  const onListSizeChanged = useCallback((size) => {
12771
12796
  setListSize(size);
@@ -12947,21 +12972,24 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
12947
12972
  return (largeLayout ? 80 + actionsWidth : 70 + actionsWidth) + (collapsedActions.length > 0 ? largeLayout ? 40 : 30 : 0);
12948
12973
  }, [getActionsForEntity, largeLayout]);
12949
12974
  const tableRowActionsBuilder = useCallback(({ entity, size, width, frozen }) => {
12975
+ const isSelected = Boolean(usedSelectionController.selectedEntities.find((e) => e.id == entity.id && e.path == entity.path));
12976
+ const customEntityActions = (collection.entityActions ?? EMPTY_ARRAY).map((action) => resolveEntityAction(action, customizationController.entityActions)).filter(Boolean);
12977
+ const actions = getActionsForEntity({
12978
+ entity,
12979
+ customEntityActions
12980
+ });
12950
12981
  return /* @__PURE__ */ jsx(CollectionRowActions, {
12951
12982
  entity,
12952
12983
  width,
12953
12984
  frozen,
12954
- isSelected: Boolean(usedSelectionController.selectedEntities.find((e) => e.id == entity.id && e.path == entity.path)),
12985
+ isSelected,
12955
12986
  selectionEnabled: activeSelectionEnabled,
12956
12987
  size,
12957
12988
  highlightEntity: setHighlightedEntity,
12958
12989
  unhighlightEntity: unselectNavigatedEntity,
12959
12990
  collection,
12960
12991
  path,
12961
- actions: getActionsForEntity({
12962
- entity,
12963
- customEntityActions: (collection.entityActions ?? EMPTY_ARRAY).map((action) => resolveEntityAction(action, customizationController.entityActions)).filter(Boolean)
12964
- }),
12992
+ actions,
12965
12993
  hideId: collection?.hideIdFromCollection,
12966
12994
  onCollectionChange: updateLastDeleteTimestamp,
12967
12995
  selectionController: usedSelectionController,
@@ -12983,12 +13011,13 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
12983
13011
  const { resolvedSlots } = customizationController;
12984
13012
  const headerActionContributions = useMemo(() => resolvedSlots.filter((s) => s.slot === "collection.header.action").sort((a, b) => (a.order ?? 50) - (b.order ?? 50)), [resolvedSlots]);
12985
13013
  const buildAdditionalHeaderWidget = useCallback(({ property, propertyKey, onHover }) => {
13014
+ const collection = collectionRef.current;
12986
13015
  const headerSlotProps = {
12987
13016
  property,
12988
13017
  propertyKey,
12989
13018
  onHover,
12990
13019
  path,
12991
- collection: collectionRef.current,
13020
+ collection,
12992
13021
  tableController,
12993
13022
  parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
12994
13023
  parentEntityIds: parentEntityIds ?? EMPTY_ARRAY
@@ -13729,7 +13758,7 @@ function EntityActionButton({ action, enabled, props }) {
13729
13758
  }
13730
13759
  //#endregion
13731
13760
  //#region src/components/EditViewBinding.tsx
13732
- var EntityHistoryView = lazy(() => import("./history-g9688IaK.js").then((m) => ({ default: m.EntityHistoryView })));
13761
+ var EntityHistoryView = lazy(() => import("./history-Ao1HBAK3.js").then((m) => ({ default: m.EntityHistoryView })));
13733
13762
  /**
13734
13763
  * This is the default view that is used as the content of a side panel when
13735
13764
  * a record is opened.
@@ -13843,7 +13872,7 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
13843
13872
  const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0 || includeJsonView || includeHistoryView;
13844
13873
  const { resolvedEntityViews } = resolvedSelectedEntityView(customViews, customizationController, void 0, canEdit);
13845
13874
  const activeTab = useMemo(() => {
13846
- return new Set([
13875
+ return /* @__PURE__ */ new Set([
13847
13876
  "__main_##Q$SC^#S6",
13848
13877
  ...includeJsonView ? ["__json"] : [],
13849
13878
  ...includeHistoryView ? ["__rebase_history"] : [],
@@ -14107,7 +14136,8 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
14107
14136
  size: "small",
14108
14137
  onClick: () => {
14109
14138
  const editSuffix = collection.defaultEntityAction === "view" ? "/edit" : "";
14110
- navigate(`${urlController.buildUrlCollectionPath(`${path}/${entityId}${editSuffix}`)}#full`);
14139
+ const entityUrl = urlController.buildUrlCollectionPath(`${path}/${entityId}${editSuffix}`);
14140
+ navigate(`${entityUrl}#full`);
14111
14141
  },
14112
14142
  children: /* @__PURE__ */ jsx(Maximize2Icon, { size: iconSize.smallest })
14113
14143
  })
@@ -14408,7 +14438,10 @@ function SidePanelBinding(props) {
14408
14438
  className: "self-center",
14409
14439
  size: "small",
14410
14440
  onClick: () => {
14411
- if (entityId) navigate(urlController.buildUrlCollectionPath(`${path}/${entityId}`), { state: null });
14441
+ if (entityId) {
14442
+ const fullScreenUrl = urlController.buildUrlCollectionPath(`${path}/${entityId}`);
14443
+ navigate(fullScreenUrl, { state: null });
14444
+ }
14412
14445
  },
14413
14446
  children: /* @__PURE__ */ jsx(Maximize2Icon, {})
14414
14447
  })]
@@ -14446,8 +14479,13 @@ function SidePanelBinding(props) {
14446
14479
  saveEntityToMemoryCache(status === "new" || status === "copy" ? path + "#new" : path + "/" + entityId, values);
14447
14480
  setBlocked(false);
14448
14481
  setBlockedNavigationMessage(void 0);
14449
- if (entityId) navigate(urlController.buildUrlCollectionPath(`${path}/${entityId}`), { state: null });
14450
- else navigate(urlController.buildUrlCollectionPath(path) + "#new", { state: null });
14482
+ if (entityId) {
14483
+ const fullScreenUrl = urlController.buildUrlCollectionPath(`${path}/${entityId}`);
14484
+ navigate(fullScreenUrl, { state: null });
14485
+ } else {
14486
+ const fullScreenUrl = urlController.buildUrlCollectionPath(path);
14487
+ navigate(fullScreenUrl + "#new", { state: null });
14488
+ }
14451
14489
  },
14452
14490
  children: /* @__PURE__ */ jsx(Maximize2Icon, {})
14453
14491
  })]
@@ -14761,6 +14799,7 @@ function useResolvedNavigationFrom({ path }) {
14761
14799
  function useHistory(params) {
14762
14800
  const { slug, entityId, enabled = true, pageSize = 10 } = params;
14763
14801
  const apiConfig = useApiConfig();
14802
+ const apiBase = useApiBase();
14764
14803
  const [entries, setEntries] = useState([]);
14765
14804
  const [total, setTotal] = useState(0);
14766
14805
  const [isLoading, setIsLoading] = useState(false);
@@ -14777,7 +14816,7 @@ function useHistory(params) {
14777
14816
  const token = await apiConfig.getAuthToken?.();
14778
14817
  const headers = { "Content-Type": "application/json" };
14779
14818
  if (token) headers["Authorization"] = `Bearer ${token}`;
14780
- const url = `${apiConfig.apiUrl}/api/data/${slug}/${entityId}/history?limit=${pageSize}&offset=${currentOffset}`;
14819
+ const url = `${apiBase}/data/${slug}/${entityId}/history?limit=${pageSize}&offset=${currentOffset}`;
14781
14820
  const response = await fetch(url, {
14782
14821
  headers,
14783
14822
  signal
@@ -14802,6 +14841,7 @@ function useHistory(params) {
14802
14841
  }
14803
14842
  }, [
14804
14843
  apiConfig,
14844
+ apiBase,
14805
14845
  slug,
14806
14846
  entityId,
14807
14847
  enabled,
@@ -14846,7 +14886,7 @@ function useHistory(params) {
14846
14886
  const token = await apiConfig.getAuthToken?.();
14847
14887
  const headers = { "Content-Type": "application/json" };
14848
14888
  if (token) headers["Authorization"] = `Bearer ${token}`;
14849
- const url = `${apiConfig.apiUrl}/api/data/${slug}/${entityId}/history/${historyId}/revert`;
14889
+ const url = `${apiBase}/data/${slug}/${entityId}/history/${historyId}/revert`;
14850
14890
  const response = await fetch(url, {
14851
14891
  method: "POST",
14852
14892
  headers
@@ -14861,6 +14901,7 @@ function useHistory(params) {
14861
14901
  return result.data;
14862
14902
  }, [
14863
14903
  apiConfig,
14904
+ apiBase,
14864
14905
  slug,
14865
14906
  entityId
14866
14907
  ]);
@@ -17143,11 +17184,12 @@ function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showErro
17143
17184
  });
17144
17185
  const validValue = !!value && Array.isArray(value);
17145
17186
  const renderValue = useCallback((enumKey, list) => {
17187
+ const enumValue = enumKey !== void 0 ? getLabelOrConfigFrom(enumValues, enumKey) : void 0;
17146
17188
  return /* @__PURE__ */ jsxs(EnumValuesChip, {
17147
17189
  enumKey,
17148
17190
  enumValues,
17149
17191
  size: "medium",
17150
- children: [(enumKey !== void 0 ? getLabelOrConfigFrom(enumValues, enumKey) : void 0)?.label ?? enumKey, !list && /* @__PURE__ */ jsx("button", {
17192
+ children: [enumValue?.label ?? enumKey, !list && /* @__PURE__ */ jsx("button", {
17151
17193
  className: "ml-1 ring-offset-background rounded-full outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
17152
17194
  onMouseDown: (e) => {
17153
17195
  e.preventDefault();
@@ -19520,7 +19562,7 @@ function getChanges(source, comparison) {
19520
19562
  const changes = {};
19521
19563
  if (!source) return {};
19522
19564
  if (!comparison) return source;
19523
- const allKeys = Array.from(new Set([...Object.keys(source), ...Object.keys(comparison)]));
19565
+ const allKeys = Array.from(/* @__PURE__ */ new Set([...Object.keys(source), ...Object.keys(comparison)]));
19524
19566
  for (const key of allKeys) {
19525
19567
  const sourceValue = source[key];
19526
19568
  const comparisonValue = comparison[key];
@@ -21100,4 +21142,4 @@ function getFullIdPath(propertyKey, propertyNamespace) {
21100
21142
  //#endregion
21101
21143
  export { useBuildCollectionRegistryController as $, StorageThumbnailInternal as $n, CollectionTableBinding as $t, getFieldId as A, ArrayOfReferencesPreview as An, convertFileToJson as At, MapFieldBinding as B, getBracketNotation as Bn, getCollectionBySlugWithin as Bt, removeEmptyContainers as C, MapPropertyPreview as Cn, convertDataToEntity as Ct, getDefaultFieldConfig as D, ArrayEnumPreview as Dn, useImportConfig as Dt, DEFAULT_FIELD_CONFIGS as E, ArrayPropertyEnumPreview as En, getInferenceType as Et, SelectFieldBinding as F, CollectionRegistryContext as Fn, FieldCaption as Ft, useSelectionDialog as G, getPropertyInPath as Gn, removeTrailingSlash$1 as Gt, DateTimeFieldBinding as H, getIconForProperty as Hn, getLastSegment$1 as Ht, RepeatFieldBinding as I, useCollectionRegistryController as In, useBreadcrumbsController as It, useBuildUrlController as J, isRelationProperty as Jn, resolveViewMode as Jt, SelectionTableBinding as K, getResolvedPropertyInPath as Kn, resolveCollectionPathIds$1 as Kt, ReferenceFieldBinding as L, getEntityPreviewKeys as Ln, BreadcrumbsProvider as Lt, TextFieldBinding as M, EntityPreviewBinding as Mn, ArrayContainer as Mt, SwitchFieldBinding as N, SidePanelControllerContext as Nn, PropertyConfigBadge as Nt, getDefaultFieldId as O, ArrayOfStorageComponentsPreview as On, ImportSaveInProgress as Ot, StorageUploadFieldBinding as P, useSidePanel as Pn, SearchIconsView as Pt, useResolvedCollections as Q, StorageThumbnail as Qn, VirtualTableInput$1 as Qt, MultiSelectFieldBinding as R, getEntityTitlePropertyKey as Rn, mergeEntityActions as Rt, getInitialEntityValues as S, KeyValuePreview as Sn, DataNewPropertiesMapping as St, PropertyFieldBinding as T, ArrayOfStringsPreview as Tn, processValueMapping as Tt, BlockFieldBinding as U, getIconForWidget as Un, removeInitialAndTrailingSlashes$1 as Ut, KeyValueFieldBinding as V, getDefaultPropertiesOrder as Vn, getCollectionPathsCombinations as Vt, ArrayOfReferencesFieldBinding as W, getPropertiesWithPropertiesOrder as Wn, removeInitialSlash as Wt, useTopLevelNavigation as X, StringPropertyPreview as Xn, resolveEntityView as Xt, useBuildNavigationStateController as Y, ArrayPropertyPreview as Yn, resolveEntityAction as Yt, useResolvedViews as Z, EnumValuesChip as Zn, useSelectionController as Zt, useCollectionsConfigController as _, getUserLabel as _n, CollectionViewActions as _t, namespaceToPropertiesPath as a, NavigationStateContext as an, UrlComponentPreview as ar, useBuildSidePanel as at, extractTouchedValues as b, BooleanPreview as bn, useCollectionEditorDialogsState as bt, buildCollectionGenerationCallback as c, SideDialogsControllerContext as cn, EmptyValue as cr, copyEntityAction as ct, fromSerializableCollectionConfigs as d, useClearRestoreValue as dn, LabelWithIcon as dr, resetPasswordAction as dt, SelectableTable as en, SkeletonPropertyComponent as er, useHistory as et, fromSerializableProperties as f, ReadOnlyFieldBinding as fn, FormLayout as fr, CreationResultDialog as ft, toSerializableProperty as g, UserPreview as gn, EntityCardBinding as gt, toSerializableProperties as h, PropertyPreview as hn, CollectionCardViewBinding as ht, namespaceToPropertiesOrderPath as i, useUrlController as in, renderSkeletonText as ir, getEntityViewWidth as it, VectorFieldBinding as j, ReferencePreview as jn, unflattenObject as jt, getFieldConfig as k, RelationPreview as kn, ImportFileUpload as kt, validateCollectionJson as l, SelectableTableContext as ln, LabelWithIconAndTooltip as lr, deleteEntityAction as lt, toSerializableCollectionConfig as m, ArrayOfMapsPreview as mn, EntityViewBinding as mt, getFullIdPath as n, useAdminContext as nn, renderSkeletonIcon as nr, useResolvedNavigationFrom as nt, CollectionGenerationApiError as o, useNavigationStateController as on, ImagePreview as or, EditViewBinding as ot, fromSerializableProperty as p, FieldHelperText as pn, FormEntry as pr, DetailViewBinding as pt, SideDialogs as q, isReferenceProperty as qn, resolveOpenEntityMode as qt, idToPropertiesPath as r, UrlContext as rn, renderSkeletonImageThumbnail as rr, buildSidePanelsFromUrl as rt, DEFAULT_COLLECTION_GENERATION_ENDPOINT as s, useSideDialogsController as sn, sanitizeUrl as sr, CollectionViewBinding as st, getFullId as t, CollectionRowActions as tn, renderSkeletonCaptionText as tr, resolveNavigationFrom as tt, fromSerializableCollectionConfig as u, ArrayCustomShapedFieldBinding as un, PropertyIdCopyTooltip as ur, editEntityAction as ut, EntityFormBinding as v, useResolvedUser as vn, useCollectionEditorController as vt, zodToFormErrors as w, ArrayOneOfPreview as wn, flattenEntry as wt, getChanges as x, DatePreview as xn, ImportNewPropertyFieldPreview as xt, EntityForm as y, NumberPropertyPreview as yn, ConfigControllerProvider as yt, MarkdownEditorFieldBinding as z, getEntityTitlePropertyKeyForEntity as zn, addInitialSlash as zt };
21102
21144
 
21103
- //# sourceMappingURL=util-B5fJm1FA.js.map
21145
+ //# sourceMappingURL=util-ByPlsapJ.js.map