@baseplate-dev/project-builder-web 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{-constants-BYERQCO8.js → -constants-CBBXnsgS.js} +2 -2
- package/dist/assets/{-constants-BYERQCO8.js.map → -constants-CBBXnsgS.js.map} +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-Db9HEBw5.js.map +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-fZlnH9Ds.js.map +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-CoxJjxbV.js.map +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/utils-Bhl1WBIT.js.map +1 -1
- package/dist/assets/__federation_shared_@tanstack/react-router-JHHIpdEJ.js.map +1 -1
- package/dist/assets/__federation_shared_react-WURrSs1p.js.map +1 -1
- package/dist/assets/__federation_shared_react-dom-CWagDEjd.js.map +1 -1
- package/dist/assets/__federation_shared_zod-CBKZOTZP.js.map +1 -1
- package/dist/assets/_virtual___federation_fn_import-D3sI42Ph.js.map +1 -1
- package/dist/assets/{admin-Dy1xMuLp.js → admin-BmEAbqDf.js} +2 -2
- package/dist/assets/{admin-Dy1xMuLp.js.map → admin-BmEAbqDf.js.map} +1 -1
- package/dist/assets/{backend-SevlkhOM.js → backend-3ZlC6POv.js} +2 -2
- package/dist/assets/{backend-SevlkhOM.js.map → backend-3ZlC6POv.js.map} +1 -1
- package/dist/assets/badge-with-type-label-CThmzNSh.js.map +1 -1
- package/dist/assets/capitalize-gOJXDbsR.js.map +1 -1
- package/dist/assets/{edit._key-BgnflZIL.js → edit._key-D-7xw9rv.js} +2 -2
- package/dist/assets/{edit._key-BgnflZIL.js.map → edit._key-D-7xw9rv.js.map} +1 -1
- package/dist/assets/{edit._sectionKey-D4mTSUhO.js → edit._sectionKey-CZgof0ob.js} +3 -3
- package/dist/assets/edit._sectionKey-CZgof0ob.js.map +1 -0
- package/dist/assets/enum-info-form-3ykREN-o.js.map +1 -1
- package/dist/assets/{graphql-C37jbnTG.js → graphql-DFecTG83.js} +2 -2
- package/dist/assets/{graphql-C37jbnTG.js.map → graphql-DFecTG83.js.map} +1 -1
- package/dist/assets/{hierarchy-CNBHjTAJ.js → hierarchy-jFN5DTrv.js} +2 -2
- package/dist/assets/{hierarchy-CNBHjTAJ.js.map → hierarchy-jFN5DTrv.js.map} +1 -1
- package/dist/assets/immer-B7fdkLVi.js.map +1 -1
- package/dist/assets/{index-CFlVUowS.js → index-B4AqRYYd.js} +2 -2
- package/dist/assets/{index-CFlVUowS.js.map → index-B4AqRYYd.js.map} +1 -1
- package/dist/assets/{index-B3A5IWAQ.js → index-BJlq0bmu.js} +2 -2
- package/dist/assets/{index-B3A5IWAQ.js.map → index-BJlq0bmu.js.map} +1 -1
- package/dist/assets/{index-CDx3IfgN.js → index-BPRSO52F.js} +2 -2
- package/dist/assets/{index-CDx3IfgN.js.map → index-BPRSO52F.js.map} +1 -1
- package/dist/assets/{index-CAFf3K5-.js → index-BWWBFiT1.js} +2 -2
- package/dist/assets/{index-CAFf3K5-.js.map → index-BWWBFiT1.js.map} +1 -1
- package/dist/assets/{index-Ckh17o1U.js → index-BZ4uW6kN.js} +2 -2
- package/dist/assets/{index-Ckh17o1U.js.map → index-BZ4uW6kN.js.map} +1 -1
- package/dist/assets/{index-D48MR3bL.js → index-BpFwTs3X.js} +2 -2
- package/dist/assets/{index-D48MR3bL.js.map → index-BpFwTs3X.js.map} +1 -1
- package/dist/assets/{index-mFxKl9yz.js → index-CbnCfDth.js} +2 -2
- package/dist/assets/{index-mFxKl9yz.js.map → index-CbnCfDth.js.map} +1 -1
- package/dist/assets/{index-DEKFCy0H.js → index-Cd_baD6T.js} +4 -4
- package/dist/assets/index-Cd_baD6T.js.map +1 -0
- package/dist/assets/index-D5UX5AHP.js.map +1 -1
- package/dist/assets/index-DRRJXHq_.js.map +1 -1
- package/dist/assets/{index-2EwzbJik.js → index-DhfdQsvQ.js} +2 -2
- package/dist/assets/{index-2EwzbJik.js.map → index-DhfdQsvQ.js.map} +1 -1
- package/dist/assets/index-DqHVrEeL.js.map +1 -1
- package/dist/assets/index-Dqph-b0R.css +1 -0
- package/dist/assets/{index-B2l1e3vi.js → index-UtPzkFI2.js} +2 -2
- package/dist/assets/{index-B2l1e3vi.js.map → index-UtPzkFI2.js.map} +1 -1
- package/dist/assets/index-c0qeY2gs.js.map +1 -1
- package/dist/assets/index-tHURiz2C.js.map +1 -1
- package/dist/assets/index-tflukq04.js.map +1 -1
- package/dist/assets/index.esm-CdP29Ssb.js.map +1 -1
- package/dist/assets/inflection-C1nKqrJS.js.map +1 -1
- package/dist/assets/isEqual-C420KeG-.js.map +1 -1
- package/dist/assets/jsx-runtime-D_zvdyIk.js.map +1 -1
- package/dist/assets/model-info-form-koY65NLs.js.map +1 -1
- package/dist/assets/model-merger-D1L5cIAo.js.map +1 -1
- package/dist/assets/{new-admin-section-dialog-4X2fxo7a.js → new-admin-section-dialog-DFpUuP_Z.js} +2 -2
- package/dist/assets/{new-admin-section-dialog-4X2fxo7a.js.map → new-admin-section-dialog-DFpUuP_Z.js.map} +1 -1
- package/dist/assets/{new-app-dialog-CCI4q4Mt.js → new-app-dialog-Cnp9A5Cx.js} +2 -2
- package/dist/assets/{new-app-dialog-CCI4q4Mt.js.map → new-app-dialog-Cnp9A5Cx.js.map} +1 -1
- package/dist/assets/{new-enum-dialog-B5zvBxhT.js → new-enum-dialog-CE3pNVPW.js} +2 -2
- package/dist/assets/{new-enum-dialog-B5zvBxhT.js.map → new-enum-dialog-CE3pNVPW.js.map} +1 -1
- package/dist/assets/{new-model-dialog-CiwTpKcZ.js → new-model-dialog-BUqUnu3F.js} +2 -2
- package/dist/assets/{new-model-dialog-CiwTpKcZ.js.map → new-model-dialog-BUqUnu3F.js.map} +1 -1
- package/dist/assets/{route-PmxQsBVj.js → route-BMREAhaC.js} +2 -2
- package/dist/assets/{route-PmxQsBVj.js.map → route-BMREAhaC.js.map} +1 -1
- package/dist/assets/{route-CZgTuGeJ.js → route-B_y_fjG1.js} +2 -2
- package/dist/assets/{route-CZgTuGeJ.js.map → route-B_y_fjG1.js.map} +1 -1
- package/dist/assets/{route-DluQ5e3_.js → route-CM78Qts_.js} +2 -2
- package/dist/assets/{route-DluQ5e3_.js.map → route-CM78Qts_.js.map} +1 -1
- package/dist/assets/{route-6ErXC2Qt.js → route-D-8r4X0U.js} +2 -2
- package/dist/assets/{route-6ErXC2Qt.js.map → route-D-8r4X0U.js.map} +1 -1
- package/dist/assets/{route-gzD4oiAl.js → route-D7DRL965.js} +2 -2
- package/dist/assets/{route-gzD4oiAl.js.map → route-D7DRL965.js.map} +1 -1
- package/dist/assets/{route-C6wCPwVj.js → route-DGnyRZBc.js} +2 -2
- package/dist/assets/{route-C6wCPwVj.js.map → route-DGnyRZBc.js.map} +1 -1
- package/dist/assets/route-Dm8VYkZY.js +2 -0
- package/dist/assets/{route-DLz_DL5S.js.map → route-Dm8VYkZY.js.map} +1 -1
- package/dist/assets/{route-C3eBLQEr.js → route-Dpt-JNZC.js} +2 -2
- package/dist/assets/{route-C3eBLQEr.js.map → route-Dpt-JNZC.js.map} +1 -1
- package/dist/assets/{route-DzYT3FNA.js → route-pfSpaHo3.js} +2 -2
- package/dist/assets/{route-DzYT3FNA.js.map → route-pfSpaHo3.js.map} +1 -1
- package/dist/assets/{route-gYB7kkkm.js → route-x978fCyu.js} +2 -2
- package/dist/assets/{route-gYB7kkkm.js.map → route-x978fCyu.js.map} +1 -1
- package/dist/assets/{service--2LVz4Ht.js → service-BSH0RhEL.js} +2 -2
- package/dist/assets/{service--2LVz4Ht.js.map → service-BSH0RhEL.js.map} +1 -1
- package/dist/assets/sortBy-C9bvycg5.js.map +1 -1
- package/dist/assets/{template-extractor-D33LuEZ8.js → template-extractor-Dzitw66S.js} +2 -2
- package/dist/assets/{template-extractor-D33LuEZ8.js.map → template-extractor-Dzitw66S.js.map} +1 -1
- package/dist/assets/{theme-builder-CWetoMuo.js → theme-builder-00-pJhvO.js} +2 -2
- package/dist/assets/{theme-builder-CWetoMuo.js.map → theme-builder-00-pJhvO.js.map} +1 -1
- package/dist/assets/use-definition-schema-BuO4pbji.js.map +1 -1
- package/dist/assets/{use-enum-form-BRBAlWJc.js → use-enum-form-CiJfrBqR.js} +2 -2
- package/dist/assets/{use-enum-form-BRBAlWJc.js.map → use-enum-form-CiJfrBqR.js.map} +1 -1
- package/dist/assets/{use-model-form-psj-JlE9.js → use-model-form-AKI1Wi68.js} +2 -2
- package/dist/assets/{use-model-form-psj-JlE9.js.map → use-model-form-AKI1Wi68.js.map} +1 -1
- package/dist/index.html +2 -2
- package/package.json +11 -11
- package/dist/assets/edit._sectionKey-D4mTSUhO.js.map +0 -1
- package/dist/assets/index-DEKFCy0H.js.map +0 -1
- package/dist/assets/index-DPK1IfNZ.css +0 -1
- package/dist/assets/route-DLz_DL5S.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_virtual___federation_fn_import-D3sI42Ph.js","sources":["../../../../node_modules/.pnpm/@originjs+vite-plugin-federation@1.3.6/node_modules/@originjs/vite-plugin-federation/dist/satisfy.mjs"],"sourcesContent":["const buildIdentifier = \"[0-9A-Za-z-]+\";\nconst build = `(?:\\\\+(${buildIdentifier}(?:\\\\.${buildIdentifier})*))`;\nconst numericIdentifier = \"0|[1-9]\\\\d*\";\nconst numericIdentifierLoose = \"[0-9]+\";\nconst nonNumericIdentifier = \"\\\\d*[a-zA-Z-][a-zA-Z0-9-]*\";\nconst preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;\nconst preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\\\.${preReleaseIdentifierLoose})*))`;\nconst preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`;\nconst preRelease = `(?:-(${preReleaseIdentifier}(?:\\\\.${preReleaseIdentifier})*))`;\nconst xRangeIdentifier = `${numericIdentifier}|x|X|\\\\*`;\nconst xRangePlain = `[v=\\\\s]*(${xRangeIdentifier})(?:\\\\.(${xRangeIdentifier})(?:\\\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;\nconst hyphenRange = `^\\\\s*(${xRangePlain})\\\\s+-\\\\s+(${xRangePlain})\\\\s*$`;\nconst mainVersionLoose = `(${numericIdentifierLoose})\\\\.(${numericIdentifierLoose})\\\\.(${numericIdentifierLoose})`;\nconst loosePlain = `[v=\\\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`;\nconst gtlt = \"((?:<|>)?=?)\";\nconst comparatorTrim = `(\\\\s*)${gtlt}\\\\s*(${loosePlain}|${xRangePlain})`;\nconst loneTilde = \"(?:~>?)\";\nconst tildeTrim = `(\\\\s*)${loneTilde}\\\\s+`;\nconst loneCaret = \"(?:\\\\^)\";\nconst caretTrim = `(\\\\s*)${loneCaret}\\\\s+`;\nconst star = \"(<|>)?=?\\\\s*\\\\*\";\nconst caret = `^${loneCaret}${xRangePlain}$`;\nconst mainVersion = `(${numericIdentifier})\\\\.(${numericIdentifier})\\\\.(${numericIdentifier})`;\nconst fullPlain = `v?${mainVersion}${preRelease}?${build}?`;\nconst tilde = `^${loneTilde}${xRangePlain}$`;\nconst xRange = `^${gtlt}\\\\s*${xRangePlain}$`;\nconst comparator = `^${gtlt}\\\\s*(${fullPlain})$|^$`;\nconst gte0 = \"^\\\\s*>=\\\\s*0.0.0\\\\s*$\";\nfunction parseRegex(source) {\n return new RegExp(source);\n}\nfunction isXVersion(version) {\n return !version || version.toLowerCase() === \"x\" || version === \"*\";\n}\nfunction pipe(...fns) {\n return (x) => {\n return fns.reduce((v, f) => f(v), x);\n };\n}\nfunction extractComparator(comparatorString) {\n return comparatorString.match(parseRegex(comparator));\n}\nfunction combineVersion(major, minor, patch, preRelease2) {\n const mainVersion2 = `${major}.${minor}.${patch}`;\n if (preRelease2) {\n return `${mainVersion2}-${preRelease2}`;\n }\n return mainVersion2;\n}\nfunction parseHyphen(range) {\n return range.replace(\n parseRegex(hyphenRange),\n (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease) => {\n if (isXVersion(fromMajor)) {\n from = \"\";\n } else if (isXVersion(fromMinor)) {\n from = `>=${fromMajor}.0.0`;\n } else if (isXVersion(fromPatch)) {\n from = `>=${fromMajor}.${fromMinor}.0`;\n } else {\n from = `>=${from}`;\n }\n if (isXVersion(toMajor)) {\n to = \"\";\n } else if (isXVersion(toMinor)) {\n to = `<${+toMajor + 1}.0.0-0`;\n } else if (isXVersion(toPatch)) {\n to = `<${toMajor}.${+toMinor + 1}.0-0`;\n } else if (toPreRelease) {\n to = `<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`;\n } else {\n to = `<=${to}`;\n }\n return `${from} ${to}`.trim();\n }\n );\n}\nfunction parseComparatorTrim(range) {\n return range.replace(parseRegex(comparatorTrim), \"$1$2$3\");\n}\nfunction parseTildeTrim(range) {\n return range.replace(parseRegex(tildeTrim), \"$1~\");\n}\nfunction parseCaretTrim(range) {\n return range.replace(parseRegex(caretTrim), \"$1^\");\n}\nfunction parseCarets(range) {\n return range.trim().split(/\\s+/).map((rangeVersion) => {\n return rangeVersion.replace(\n parseRegex(caret),\n (_, major, minor, patch, preRelease2) => {\n if (isXVersion(major)) {\n return \"\";\n } else if (isXVersion(minor)) {\n return `>=${major}.0.0 <${+major + 1}.0.0-0`;\n } else if (isXVersion(patch)) {\n if (major === \"0\") {\n return `>=${major}.${minor}.0 <${major}.${+minor + 1}.0-0`;\n } else {\n return `>=${major}.${minor}.0 <${+major + 1}.0.0-0`;\n }\n } else if (preRelease2) {\n if (major === \"0\") {\n if (minor === \"0\") {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${minor}.${+patch + 1}-0`;\n } else {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${+minor + 1}.0-0`;\n }\n } else {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${+major + 1}.0.0-0`;\n }\n } else {\n if (major === \"0\") {\n if (minor === \"0\") {\n return `>=${major}.${minor}.${patch} <${major}.${minor}.${+patch + 1}-0`;\n } else {\n return `>=${major}.${minor}.${patch} <${major}.${+minor + 1}.0-0`;\n }\n }\n return `>=${major}.${minor}.${patch} <${+major + 1}.0.0-0`;\n }\n }\n );\n }).join(\" \");\n}\nfunction parseTildes(range) {\n return range.trim().split(/\\s+/).map((rangeVersion) => {\n return rangeVersion.replace(\n parseRegex(tilde),\n (_, major, minor, patch, preRelease2) => {\n if (isXVersion(major)) {\n return \"\";\n } else if (isXVersion(minor)) {\n return `>=${major}.0.0 <${+major + 1}.0.0-0`;\n } else if (isXVersion(patch)) {\n return `>=${major}.${minor}.0 <${major}.${+minor + 1}.0-0`;\n } else if (preRelease2) {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${+minor + 1}.0-0`;\n }\n return `>=${major}.${minor}.${patch} <${major}.${+minor + 1}.0-0`;\n }\n );\n }).join(\" \");\n}\nfunction parseXRanges(range) {\n return range.split(/\\s+/).map((rangeVersion) => {\n return rangeVersion.trim().replace(\n parseRegex(xRange),\n (ret, gtlt2, major, minor, patch, preRelease2) => {\n const isXMajor = isXVersion(major);\n const isXMinor = isXMajor || isXVersion(minor);\n const isXPatch = isXMinor || isXVersion(patch);\n if (gtlt2 === \"=\" && isXPatch) {\n gtlt2 = \"\";\n }\n preRelease2 = \"\";\n if (isXMajor) {\n if (gtlt2 === \">\" || gtlt2 === \"<\") {\n return \"<0.0.0-0\";\n } else {\n return \"*\";\n }\n } else if (gtlt2 && isXPatch) {\n if (isXMinor) {\n minor = 0;\n }\n patch = 0;\n if (gtlt2 === \">\") {\n gtlt2 = \">=\";\n if (isXMinor) {\n major = +major + 1;\n minor = 0;\n patch = 0;\n } else {\n minor = +minor + 1;\n patch = 0;\n }\n } else if (gtlt2 === \"<=\") {\n gtlt2 = \"<\";\n if (isXMinor) {\n major = +major + 1;\n } else {\n minor = +minor + 1;\n }\n }\n if (gtlt2 === \"<\") {\n preRelease2 = \"-0\";\n }\n return `${gtlt2 + major}.${minor}.${patch}${preRelease2}`;\n } else if (isXMinor) {\n return `>=${major}.0.0${preRelease2} <${+major + 1}.0.0-0`;\n } else if (isXPatch) {\n return `>=${major}.${minor}.0${preRelease2} <${major}.${+minor + 1}.0-0`;\n }\n return ret;\n }\n );\n }).join(\" \");\n}\nfunction parseStar(range) {\n return range.trim().replace(parseRegex(star), \"\");\n}\nfunction parseGTE0(comparatorString) {\n return comparatorString.trim().replace(parseRegex(gte0), \"\");\n}\nfunction compareAtom(rangeAtom, versionAtom) {\n rangeAtom = +rangeAtom || rangeAtom;\n versionAtom = +versionAtom || versionAtom;\n if (rangeAtom > versionAtom) {\n return 1;\n }\n if (rangeAtom === versionAtom) {\n return 0;\n }\n return -1;\n}\nfunction comparePreRelease(rangeAtom, versionAtom) {\n const { preRelease: rangePreRelease } = rangeAtom;\n const { preRelease: versionPreRelease } = versionAtom;\n if (rangePreRelease === void 0 && !!versionPreRelease) {\n return 1;\n }\n if (!!rangePreRelease && versionPreRelease === void 0) {\n return -1;\n }\n if (rangePreRelease === void 0 && versionPreRelease === void 0) {\n return 0;\n }\n for (let i = 0, n = rangePreRelease.length; i <= n; i++) {\n const rangeElement = rangePreRelease[i];\n const versionElement = versionPreRelease[i];\n if (rangeElement === versionElement) {\n continue;\n }\n if (rangeElement === void 0 && versionElement === void 0) {\n return 0;\n }\n if (!rangeElement) {\n return 1;\n }\n if (!versionElement) {\n return -1;\n }\n return compareAtom(rangeElement, versionElement);\n }\n return 0;\n}\nfunction compareVersion(rangeAtom, versionAtom) {\n return compareAtom(rangeAtom.major, versionAtom.major) || compareAtom(rangeAtom.minor, versionAtom.minor) || compareAtom(rangeAtom.patch, versionAtom.patch) || comparePreRelease(rangeAtom, versionAtom);\n}\nfunction eq(rangeAtom, versionAtom) {\n return rangeAtom.version === versionAtom.version;\n}\nfunction compare(rangeAtom, versionAtom) {\n switch (rangeAtom.operator) {\n case \"\":\n case \"=\":\n return eq(rangeAtom, versionAtom);\n case \">\":\n return compareVersion(rangeAtom, versionAtom) < 0;\n case \">=\":\n return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) < 0;\n case \"<\":\n return compareVersion(rangeAtom, versionAtom) > 0;\n case \"<=\":\n return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) > 0;\n case void 0: {\n return true;\n }\n default:\n return false;\n }\n}\nfunction parseComparatorString(range) {\n return pipe(\n parseCarets,\n parseTildes,\n parseXRanges,\n parseStar\n )(range);\n}\nfunction parseRange(range) {\n return pipe(\n parseHyphen,\n parseComparatorTrim,\n parseTildeTrim,\n parseCaretTrim\n )(range.trim()).split(/\\s+/).join(\" \");\n}\nfunction satisfy(version, range) {\n if (!version) {\n return false;\n }\n const parsedRange = parseRange(range);\n const parsedComparator = parsedRange.split(\" \").map((rangeVersion) => parseComparatorString(rangeVersion)).join(\" \");\n const comparators = parsedComparator.split(/\\s+/).map((comparator2) => parseGTE0(comparator2));\n const extractedVersion = extractComparator(version);\n if (!extractedVersion) {\n return false;\n }\n const [\n ,\n versionOperator,\n ,\n versionMajor,\n versionMinor,\n versionPatch,\n versionPreRelease\n ] = extractedVersion;\n const versionAtom = {\n operator: versionOperator,\n version: combineVersion(\n versionMajor,\n versionMinor,\n versionPatch,\n versionPreRelease\n ),\n major: versionMajor,\n minor: versionMinor,\n patch: versionPatch,\n preRelease: versionPreRelease == null ? void 0 : versionPreRelease.split(\".\")\n };\n for (const comparator2 of comparators) {\n const extractedComparator = extractComparator(comparator2);\n if (!extractedComparator) {\n return false;\n }\n const [\n ,\n rangeOperator,\n ,\n rangeMajor,\n rangeMinor,\n rangePatch,\n rangePreRelease\n ] = extractedComparator;\n const rangeAtom = {\n operator: rangeOperator,\n version: combineVersion(\n rangeMajor,\n rangeMinor,\n rangePatch,\n rangePreRelease\n ),\n major: rangeMajor,\n minor: rangeMinor,\n patch: rangePatch,\n preRelease: rangePreRelease == null ? void 0 : rangePreRelease.split(\".\")\n };\n if (!compare(rangeAtom, versionAtom)) {\n return false;\n }\n }\n return true;\n}\nexport {\n satisfy\n};\n"],"names":["buildIdentifier","build","numericIdentifier","numericIdentifierLoose","nonNumericIdentifier","preReleaseIdentifierLoose","preReleaseLoose","preReleaseIdentifier","preRelease","xRangeIdentifier","xRangePlain","hyphenRange","mainVersionLoose","loosePlain","gtlt","comparatorTrim","loneTilde","tildeTrim","loneCaret","caretTrim","star","caret","mainVersion","fullPlain","tilde","xRange","comparator","gte0","parseRegex","source","isXVersion","version","pipe","fns","x","v","f","extractComparator","comparatorString","combineVersion","major","minor","patch","preRelease2","mainVersion2","parseHyphen","range","_range","from","fromMajor","fromMinor","fromPatch","_fromPreRelease","_fromBuild","to","toMajor","toMinor","toPatch","toPreRelease","parseComparatorTrim","parseTildeTrim","parseCaretTrim","parseCarets","rangeVersion","_","parseTildes","parseXRanges","ret","gtlt2","isXMajor","isXMinor","isXPatch","parseStar","parseGTE0","compareAtom","rangeAtom","versionAtom","comparePreRelease","rangePreRelease","versionPreRelease","i","n","rangeElement","versionElement","compareVersion","eq","compare","parseComparatorString","parseRange","satisfy","comparators","comparator2","extractedVersion","versionOperator","versionMajor","versionMinor","versionPatch","extractedComparator","rangeOperator","rangeMajor","rangeMinor","rangePatch"],"mappings":"AAAA,MAAMA,EAAkB,gBAClBC,EAAQ,UAAUD,CAAe,SAASA,CAAe,OACzDE,EAAoB,cACpBC,EAAyB,SACzBC,EAAuB,6BACvBC,EAA4B,MAAMF,CAAsB,IAAIC,CAAoB,IAChFE,EAAkB,SAASD,CAAyB,SAASA,CAAyB,OACtFE,EAAuB,MAAML,CAAiB,IAAIE,CAAoB,IACtEI,EAAa,QAAQD,CAAoB,SAASA,CAAoB,OACtEE,EAAmB,GAAGP,CAAiB,WACvCQ,EAAc,YAAYD,CAAgB,WAAWA,CAAgB,WAAWA,CAAgB,OAAOD,CAAU,KAAKP,CAAK,QAC3HU,EAAc,SA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ACAG,GACAC,GACAM,EACD,EAAC1B,CAAK,CACT,CACA,SAAS0C,GAAW1C,EAAO,CACzB,OAAOd,EACLa,GACAc,GACAC,GACAC,EACJ,EAAIf,EAAM,MAAM,EAAE,MAAM,KAAK,EAAE,KAAK,GAAG,CACvC,CACA,SAAS2C,GAAQ1D,EAASe,EAAO,CAC/B,GAAI,CAACf,EACH,MAAO,GAIT,MAAM2D,EAFcF,GAAW1C,CAAK,EACC,MAAM,GAAG,EAAE,IAAKiB,GAAiBwB,GAAsBxB,CAAY,CAAC,EAAE,KAAK,GAAG,EAC9E,MAAM,KAAK,EAAE,IAAK4B,GAAgBlB,GAAUkB,CAAW,CAAC,EACvFC,EAAmBvD,EAAkBN,CAAO,EAClD,GAAI,CAAC6D,EACH,MAAO,GAET,KAAM,CACR,CACIC,EACJ,CACIC,EACAC,EACAC,EACAjB,CACJ,EAAMa,EACEhB,EAAc,CAElB,QAASrC,EACPuD,EACAC,EACAC,EACAjB,CACD,EACD,MAAOe,EACP,MAAOC,EACP,MAAOC,EACP,WAAiDjB,GAAkB,MAAM,GAAG,CAC7E,EACD,UAAWY,KAAeD,EAAa,CACrC,MAAMO,EAAsB5D,EAAkBsD,CAAW,EACzD,GAAI,CAACM,EACH,MAAO,GAET,KAAM,CACV,CACMC,EACN,CACMC,EACAC,EACAC,EACAvB,CACN,EAAQmB,EACEtB,EAAY,CAChB,SAAUuB,EACV,QAAS3D,EACP4D,EACAC,EACAC,EACAvB,CACD,EACD,MAAOqB,EACP,MAAOC,EACP,MAAOC,EACP,WAA+CvB,GAAgB,MAAM,GAAG,CACzE,EACD,GAAI,CAACQ,GAAQX,EAAWC,CAAW,EACjC,MAAO,EAEb,CACE,MAAO,EACT","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"_virtual___federation_fn_import-D3sI42Ph.js","sources":["../../../../node_modules/.pnpm/@originjs+vite-plugin-federation@1.3.6/node_modules/@originjs/vite-plugin-federation/dist/satisfy.mjs"],"sourcesContent":["const buildIdentifier = \"[0-9A-Za-z-]+\";\nconst build = `(?:\\\\+(${buildIdentifier}(?:\\\\.${buildIdentifier})*))`;\nconst numericIdentifier = \"0|[1-9]\\\\d*\";\nconst numericIdentifierLoose = \"[0-9]+\";\nconst nonNumericIdentifier = \"\\\\d*[a-zA-Z-][a-zA-Z0-9-]*\";\nconst preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`;\nconst preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\\\.${preReleaseIdentifierLoose})*))`;\nconst preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`;\nconst preRelease = `(?:-(${preReleaseIdentifier}(?:\\\\.${preReleaseIdentifier})*))`;\nconst xRangeIdentifier = `${numericIdentifier}|x|X|\\\\*`;\nconst xRangePlain = `[v=\\\\s]*(${xRangeIdentifier})(?:\\\\.(${xRangeIdentifier})(?:\\\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`;\nconst hyphenRange = `^\\\\s*(${xRangePlain})\\\\s+-\\\\s+(${xRangePlain})\\\\s*$`;\nconst mainVersionLoose = `(${numericIdentifierLoose})\\\\.(${numericIdentifierLoose})\\\\.(${numericIdentifierLoose})`;\nconst loosePlain = `[v=\\\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`;\nconst gtlt = \"((?:<|>)?=?)\";\nconst comparatorTrim = `(\\\\s*)${gtlt}\\\\s*(${loosePlain}|${xRangePlain})`;\nconst loneTilde = \"(?:~>?)\";\nconst tildeTrim = `(\\\\s*)${loneTilde}\\\\s+`;\nconst loneCaret = \"(?:\\\\^)\";\nconst caretTrim = `(\\\\s*)${loneCaret}\\\\s+`;\nconst star = \"(<|>)?=?\\\\s*\\\\*\";\nconst caret = `^${loneCaret}${xRangePlain}$`;\nconst mainVersion = `(${numericIdentifier})\\\\.(${numericIdentifier})\\\\.(${numericIdentifier})`;\nconst fullPlain = `v?${mainVersion}${preRelease}?${build}?`;\nconst tilde = `^${loneTilde}${xRangePlain}$`;\nconst xRange = `^${gtlt}\\\\s*${xRangePlain}$`;\nconst comparator = `^${gtlt}\\\\s*(${fullPlain})$|^$`;\nconst gte0 = \"^\\\\s*>=\\\\s*0.0.0\\\\s*$\";\nfunction parseRegex(source) {\n return new RegExp(source);\n}\nfunction isXVersion(version) {\n return !version || version.toLowerCase() === \"x\" || version === \"*\";\n}\nfunction pipe(...fns) {\n return (x) => {\n return fns.reduce((v, f) => f(v), x);\n };\n}\nfunction extractComparator(comparatorString) {\n return comparatorString.match(parseRegex(comparator));\n}\nfunction combineVersion(major, minor, patch, preRelease2) {\n const mainVersion2 = `${major}.${minor}.${patch}`;\n if (preRelease2) {\n return `${mainVersion2}-${preRelease2}`;\n }\n return mainVersion2;\n}\nfunction parseHyphen(range) {\n return range.replace(\n parseRegex(hyphenRange),\n (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease) => {\n if (isXVersion(fromMajor)) {\n from = \"\";\n } else if (isXVersion(fromMinor)) {\n from = `>=${fromMajor}.0.0`;\n } else if (isXVersion(fromPatch)) {\n from = `>=${fromMajor}.${fromMinor}.0`;\n } else {\n from = `>=${from}`;\n }\n if (isXVersion(toMajor)) {\n to = \"\";\n } else if (isXVersion(toMinor)) {\n to = `<${+toMajor + 1}.0.0-0`;\n } else if (isXVersion(toPatch)) {\n to = `<${toMajor}.${+toMinor + 1}.0-0`;\n } else if (toPreRelease) {\n to = `<=${toMajor}.${toMinor}.${toPatch}-${toPreRelease}`;\n } else {\n to = `<=${to}`;\n }\n return `${from} ${to}`.trim();\n }\n );\n}\nfunction parseComparatorTrim(range) {\n return range.replace(parseRegex(comparatorTrim), \"$1$2$3\");\n}\nfunction parseTildeTrim(range) {\n return range.replace(parseRegex(tildeTrim), \"$1~\");\n}\nfunction parseCaretTrim(range) {\n return range.replace(parseRegex(caretTrim), \"$1^\");\n}\nfunction parseCarets(range) {\n return range.trim().split(/\\s+/).map((rangeVersion) => {\n return rangeVersion.replace(\n parseRegex(caret),\n (_, major, minor, patch, preRelease2) => {\n if (isXVersion(major)) {\n return \"\";\n } else if (isXVersion(minor)) {\n return `>=${major}.0.0 <${+major + 1}.0.0-0`;\n } else if (isXVersion(patch)) {\n if (major === \"0\") {\n return `>=${major}.${minor}.0 <${major}.${+minor + 1}.0-0`;\n } else {\n return `>=${major}.${minor}.0 <${+major + 1}.0.0-0`;\n }\n } else if (preRelease2) {\n if (major === \"0\") {\n if (minor === \"0\") {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${minor}.${+patch + 1}-0`;\n } else {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${+minor + 1}.0-0`;\n }\n } else {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${+major + 1}.0.0-0`;\n }\n } else {\n if (major === \"0\") {\n if (minor === \"0\") {\n return `>=${major}.${minor}.${patch} <${major}.${minor}.${+patch + 1}-0`;\n } else {\n return `>=${major}.${minor}.${patch} <${major}.${+minor + 1}.0-0`;\n }\n }\n return `>=${major}.${minor}.${patch} <${+major + 1}.0.0-0`;\n }\n }\n );\n }).join(\" \");\n}\nfunction parseTildes(range) {\n return range.trim().split(/\\s+/).map((rangeVersion) => {\n return rangeVersion.replace(\n parseRegex(tilde),\n (_, major, minor, patch, preRelease2) => {\n if (isXVersion(major)) {\n return \"\";\n } else if (isXVersion(minor)) {\n return `>=${major}.0.0 <${+major + 1}.0.0-0`;\n } else if (isXVersion(patch)) {\n return `>=${major}.${minor}.0 <${major}.${+minor + 1}.0-0`;\n } else if (preRelease2) {\n return `>=${major}.${minor}.${patch}-${preRelease2} <${major}.${+minor + 1}.0-0`;\n }\n return `>=${major}.${minor}.${patch} <${major}.${+minor + 1}.0-0`;\n }\n );\n }).join(\" \");\n}\nfunction parseXRanges(range) {\n return range.split(/\\s+/).map((rangeVersion) => {\n return rangeVersion.trim().replace(\n parseRegex(xRange),\n (ret, gtlt2, major, minor, patch, preRelease2) => {\n const isXMajor = isXVersion(major);\n const isXMinor = isXMajor || isXVersion(minor);\n const isXPatch = isXMinor || isXVersion(patch);\n if (gtlt2 === \"=\" && isXPatch) {\n gtlt2 = \"\";\n }\n preRelease2 = \"\";\n if (isXMajor) {\n if (gtlt2 === \">\" || gtlt2 === \"<\") {\n return \"<0.0.0-0\";\n } else {\n return \"*\";\n }\n } else if (gtlt2 && isXPatch) {\n if (isXMinor) {\n minor = 0;\n }\n patch = 0;\n if (gtlt2 === \">\") {\n gtlt2 = \">=\";\n if (isXMinor) {\n major = +major + 1;\n minor = 0;\n patch = 0;\n } else {\n minor = +minor + 1;\n patch = 0;\n }\n } else if (gtlt2 === \"<=\") {\n gtlt2 = \"<\";\n if (isXMinor) {\n major = +major + 1;\n } else {\n minor = +minor + 1;\n }\n }\n if (gtlt2 === \"<\") {\n preRelease2 = \"-0\";\n }\n return `${gtlt2 + major}.${minor}.${patch}${preRelease2}`;\n } else if (isXMinor) {\n return `>=${major}.0.0${preRelease2} <${+major + 1}.0.0-0`;\n } else if (isXPatch) {\n return `>=${major}.${minor}.0${preRelease2} <${major}.${+minor + 1}.0-0`;\n }\n return ret;\n }\n );\n }).join(\" \");\n}\nfunction parseStar(range) {\n return range.trim().replace(parseRegex(star), \"\");\n}\nfunction parseGTE0(comparatorString) {\n return comparatorString.trim().replace(parseRegex(gte0), \"\");\n}\nfunction compareAtom(rangeAtom, versionAtom) {\n rangeAtom = +rangeAtom || rangeAtom;\n versionAtom = +versionAtom || versionAtom;\n if (rangeAtom > versionAtom) {\n return 1;\n }\n if (rangeAtom === versionAtom) {\n return 0;\n }\n return -1;\n}\nfunction comparePreRelease(rangeAtom, versionAtom) {\n const { preRelease: rangePreRelease } = rangeAtom;\n const { preRelease: versionPreRelease } = versionAtom;\n if (rangePreRelease === void 0 && !!versionPreRelease) {\n return 1;\n }\n if (!!rangePreRelease && versionPreRelease === void 0) {\n return -1;\n }\n if (rangePreRelease === void 0 && versionPreRelease === void 0) {\n return 0;\n }\n for (let i = 0, n = rangePreRelease.length; i <= n; i++) {\n const rangeElement = rangePreRelease[i];\n const versionElement = versionPreRelease[i];\n if (rangeElement === versionElement) {\n continue;\n }\n if (rangeElement === void 0 && versionElement === void 0) {\n return 0;\n }\n if (!rangeElement) {\n return 1;\n }\n if (!versionElement) {\n return -1;\n }\n return compareAtom(rangeElement, versionElement);\n }\n return 0;\n}\nfunction compareVersion(rangeAtom, versionAtom) {\n return compareAtom(rangeAtom.major, versionAtom.major) || compareAtom(rangeAtom.minor, versionAtom.minor) || compareAtom(rangeAtom.patch, versionAtom.patch) || comparePreRelease(rangeAtom, versionAtom);\n}\nfunction eq(rangeAtom, versionAtom) {\n return rangeAtom.version === versionAtom.version;\n}\nfunction compare(rangeAtom, versionAtom) {\n switch (rangeAtom.operator) {\n case \"\":\n case \"=\":\n return eq(rangeAtom, versionAtom);\n case \">\":\n return compareVersion(rangeAtom, versionAtom) < 0;\n case \">=\":\n return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) < 0;\n case \"<\":\n return compareVersion(rangeAtom, versionAtom) > 0;\n case \"<=\":\n return eq(rangeAtom, versionAtom) || compareVersion(rangeAtom, versionAtom) > 0;\n case void 0: {\n return true;\n }\n default:\n return false;\n }\n}\nfunction parseComparatorString(range) {\n return pipe(\n parseCarets,\n parseTildes,\n parseXRanges,\n parseStar\n )(range);\n}\nfunction parseRange(range) {\n return pipe(\n parseHyphen,\n parseComparatorTrim,\n parseTildeTrim,\n parseCaretTrim\n )(range.trim()).split(/\\s+/).join(\" \");\n}\nfunction satisfy(version, range) {\n if (!version) {\n return false;\n }\n const parsedRange = parseRange(range);\n const parsedComparator = parsedRange.split(\" \").map((rangeVersion) => parseComparatorString(rangeVersion)).join(\" \");\n const comparators = parsedComparator.split(/\\s+/).map((comparator2) => parseGTE0(comparator2));\n const extractedVersion = extractComparator(version);\n if (!extractedVersion) {\n return false;\n }\n const [\n ,\n versionOperator,\n ,\n versionMajor,\n versionMinor,\n versionPatch,\n versionPreRelease\n ] = extractedVersion;\n const versionAtom = {\n operator: versionOperator,\n version: combineVersion(\n versionMajor,\n versionMinor,\n versionPatch,\n versionPreRelease\n ),\n major: versionMajor,\n minor: versionMinor,\n patch: versionPatch,\n preRelease: versionPreRelease == null ? void 0 : versionPreRelease.split(\".\")\n };\n for (const comparator2 of comparators) {\n const extractedComparator = extractComparator(comparator2);\n if (!extractedComparator) {\n return false;\n }\n const [\n ,\n rangeOperator,\n ,\n rangeMajor,\n rangeMinor,\n rangePatch,\n rangePreRelease\n ] = extractedComparator;\n const rangeAtom = {\n operator: rangeOperator,\n version: combineVersion(\n rangeMajor,\n rangeMinor,\n rangePatch,\n rangePreRelease\n ),\n major: rangeMajor,\n minor: rangeMinor,\n patch: rangePatch,\n preRelease: rangePreRelease == null ? void 0 : rangePreRelease.split(\".\")\n };\n if (!compare(rangeAtom, versionAtom)) {\n return false;\n }\n }\n return true;\n}\nexport {\n satisfy\n};\n"],"names":["buildIdentifier","build","numericIdentifier","numericIdentifierLoose","nonNumericIdentifier","preReleaseIdentifierLoose","preReleaseLoose","preReleaseIdentifier","preRelease","xRangeIdentifier","xRangePlain","hyphenRange","mainVersionLoose","loosePlain","gtlt","comparatorTrim","loneTilde","tildeTrim","loneCaret","caretTrim","star","caret","mainVersion","fullPlain","tilde","xRange","comparator","gte0","parseRegex","source","isXVersion","version","pipe","fns","x","v","f","extractComparator","comparatorString","combineVersion","major","minor","patch","preRelease2","mainVersion2","parseHyphen","range","_range","from","fromMajor","fromMinor","fromPatch","_fromPreRelease","_fromBuild","to","toMajor","toMinor","toPatch","toPreRelease","parseComparatorTrim","parseTildeTrim","parseCaretTrim","parseCarets","rangeVersion","_","parseTildes","parseXRanges","ret","gtlt2","isXMajor","isXMinor","isXPatch","parseStar","parseGTE0","compareAtom","rangeAtom","versionAtom","comparePreRelease","rangePreRelease","versionPreRelease","i","n","rangeElement","versionElement","compareVersion","eq","compare","parseComparatorString","parseRange","satisfy","comparators","comparator2","extractedVersion","versionOperator","versionMajor","versionMinor","versionPatch","extractedComparator","rangeOperator","rangeMajor","rangeMinor","rangePatch"],"mappings":"AAAA,MAAMA,EAAkB,gBAClBC,EAAQ,UAAUD,CAAe,SAASA,CAAe,OACzDE,EAAoB,cACpBC,EAAyB,SACzBC,EAAuB,6BACvBC,EAA4B,MAAMF,CAAsB,IAAIC,CAAoB,IAChFE,EAAkB,SAASD,CAAyB,SAASA,CAAyB,OACtFE,EAAuB,MAAML,CAAiB,IAAIE,CAAoB,IACtEI,EAAa,QAAQD,CAAoB,SAASA,CAAoB,OACtEE,EAAmB,GAAGP,CAAiB,WACvCQ,EAAc,YAAYD,CAAgB,WAAWA,CAAgB,WAAWA,CAAgB,OAAOD,CAAU,KAAKP,CAAK,QAC3HU,EAAc,SAASD,CAAW,cAAcA,CAAW,SAC3DE,EAAmB,IAAIT,CAAsB,QAAQA,CAAsB,QAAQA,CAAsB,IACzGU,EAAa,WAAWD,CAAgB,GAAGN,CAAe,IAAIL,CAAK,IACnEa,EAAO,eACPC,EAAiB,SAASD,CAAI,QAAQD,CAAU,IAAIH,CAAW,IAC/DM,EAAY,UACZC,EAAY,SAASD,CAAS,OAC9BE,EAAY,UACZC,EAAY,SAASD,CAAS,OAC9BE,EAAO,kBACPC,GAAQ,IAAIH,CAAS,GAAGR,CAAW,IACnCY,GAAc,IAAIpB,CAAiB,QAAQA,CAAiB,QAAQA,CAAiB,IACrFqB,GAAY,KAAKD,EAAW,GAAGd,CAAU,IAAIP,CAAK,IAClDuB,GAAQ,IAAIR,CAAS,GAAGN,CAAW,IACnCe,GAAS,IAAIX,CAAI,OAAOJ,CAAW,IACnCgB,GAAa,IAAIZ,CAAI,QAAQS,EAAS,QACtCI,GAAO,wBACb,SAASC,EAAWC,EAAQ,CAC1B,OAAO,IAAI,OAAOA,CAAM,CAC1B,CACA,SAASC,EAAWC,EAAS,CAC3B,MAAO,CAACA,GAAWA,EAAQ,YAAW,IAAO,KAAOA,IAAY,GAClE,CACA,SAASC,KAAQ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AI,CAACM,EACH,MAAO,GAET,KAAM,CACV,CACMC,EACN,CACMC,EACAC,EACAC,EACAvB,CACN,EAAQmB,EACEtB,EAAY,CAChB,SAAUuB,EACV,QAAS3D,EACP4D,EACAC,EACAC,EACAvB,CACR,EACM,MAAOqB,EACP,MAAOC,EACP,MAAOC,EACP,WAA+CvB,GAAgB,MAAM,GAAG,CAC9E,EACI,GAAI,CAACQ,GAAQX,EAAWC,CAAW,EACjC,MAAO,EAEX,CACA,MAAO,EACT","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as t}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{z as v,s as y}from"./index-
|
|
2
|
-
//# sourceMappingURL=admin-
|
|
1
|
+
import{i as t}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{z as v,s as y}from"./index-Cd_baD6T.js";import{K as R}from"./index-tflukq04.js";import{u as F}from"./use-definition-schema-BuO4pbji.js";const{appEntityType:L,authConfigSpec:P,createWebAppSchema:D}=await t("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:k,useProjectDefinition:E,useResettableForm:M}=await t("@baseplate-dev/project-builder-lib/web"),{Button:W,FormActionBar:B,InputFieldController:K,MultiComboboxFieldController:N,SectionList:U,SectionListSection:p,SectionListSectionContent:m,SectionListSectionDescription:u,SectionListSectionHeader:h,SectionListSectionTitle:x,SwitchFieldController:I}=await t("@baseplate-dev/ui-components"),{Link:O}=await t("@tanstack/react-router"),J=function(){const{webDefinition:o}=v.useRouteContext(),{definition:b,saveDefinitionWithFeedback:f,pluginContainer:j}=E(),S=F(D),a=M({resolver:y(S),values:o}),{control:i,handleSubmit:A,reset:g,watch:w}=a,s=A(n=>f(l=>{l.apps=l.apps.map(d=>d.id===o.id?n:d)}));k({control:i,reset:g,onSubmit:s});const r=j.getPluginSpecOptional(P)?.getAuthRoles(b).map(n=>({label:n.name,value:n.id})),c=w("adminApp.enabled"),C=L.keyFromId(o.id);return e.jsxs("form",{className:"w-full max-w-7xl space-y-4 p-4",onSubmit:s,children:[e.jsxs(U,{children:[e.jsxs(p,{children:[e.jsxs(h,{children:[e.jsx(x,{children:"Admin Configuration"}),e.jsx(u,{children:"Configure administrative features for your web application."})]}),e.jsxs(m,{className:"space-y-6",children:[e.jsx(I,{label:"Enable Admin Panel",description:"Add administrative interface to your web application",control:i,name:"adminApp.enabled"}),c&&e.jsxs(e.Fragment,{children:[e.jsx(K,{label:"Admin Path Prefix",placeholder:"/admin",description:"URL prefix for admin routes (e.g. /admin)",control:i,name:"adminApp.pathPrefix"}),r&&e.jsx(N,{label:"Admin Access Roles",description:"Which roles can access the admin panel",control:i,options:r,name:"adminApp.allowedRoles"})]})]})]}),c&&e.jsxs(p,{children:[e.jsxs(h,{children:[e.jsx(x,{children:"Admin Sections"}),e.jsx(u,{children:"Manage CRUD interfaces for your data models."})]}),e.jsx(m,{children:e.jsx(W,{variant:"secondary",asChild:!0,children:e.jsxs(O,{to:"/admin-sections/$appKey",params:{appKey:C},children:[e.jsx(R,{}),"Manage Admin Sections"]})})})]})]}),e.jsx(B,{form:a})]})};export{J as component};
|
|
2
|
+
//# sourceMappingURL=admin-BmEAbqDf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-
|
|
1
|
+
{"version":3,"file":"admin-BmEAbqDf.js","sources":["../../src/routes/apps/edit.$key/web/admin.tsx?tsr-split=component"],"sourcesContent":["import type React from 'react';\n\nimport {\n appEntityType,\n authConfigSpec,\n createWebAppSchema,\n} from '@baseplate-dev/project-builder-lib';\nimport {\n useBlockUnsavedChangesNavigate,\n useProjectDefinition,\n useResettableForm,\n} from '@baseplate-dev/project-builder-lib/web';\nimport {\n Button,\n FormActionBar,\n InputFieldController,\n MultiComboboxFieldController,\n SectionList,\n SectionListSection,\n SectionListSectionContent,\n SectionListSectionDescription,\n SectionListSectionHeader,\n SectionListSectionTitle,\n SwitchFieldController,\n} from '@baseplate-dev/ui-components';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { createFileRoute, Link } from '@tanstack/react-router';\nimport { MdSettings } from 'react-icons/md';\n\nimport { useDefinitionSchema } from '#src/hooks/use-definition-schema.js';\n\nexport const Route = createFileRoute('/apps/edit/$key/web/admin')({\n component: WebAdminPage,\n});\n\nfunction WebAdminPage(): React.JSX.Element {\n const { webDefinition } = Route.useRouteContext();\n const { definition, saveDefinitionWithFeedback, pluginContainer } =\n useProjectDefinition();\n const webAppSchema = useDefinitionSchema(createWebAppSchema);\n\n const formProps = useResettableForm({\n resolver: zodResolver(webAppSchema),\n values: webDefinition,\n });\n const { control, handleSubmit, reset, watch } = formProps;\n\n const onSubmit = handleSubmit((data) =>\n saveDefinitionWithFeedback((draftConfig) => {\n draftConfig.apps = draftConfig.apps.map((app) =>\n app.id === webDefinition.id ? data : app,\n );\n }),\n );\n\n useBlockUnsavedChangesNavigate({ control, reset, onSubmit });\n\n const roleOptions = pluginContainer\n .getPluginSpecOptional(authConfigSpec)\n ?.getAuthRoles(definition)\n .map((role) => ({\n label: role.name,\n value: role.id,\n }));\n\n const adminEnabled = watch('adminApp.enabled');\n\n // Get the app key for navigation\n const appKey = appEntityType.keyFromId(webDefinition.id);\n\n return (\n <form className=\"w-full max-w-7xl space-y-4 p-4\" onSubmit={onSubmit}>\n <SectionList>\n <SectionListSection>\n <SectionListSectionHeader>\n <SectionListSectionTitle>\n Admin Configuration\n </SectionListSectionTitle>\n <SectionListSectionDescription>\n Configure administrative features for your web application.\n </SectionListSectionDescription>\n </SectionListSectionHeader>\n <SectionListSectionContent className=\"space-y-6\">\n <SwitchFieldController\n label=\"Enable Admin Panel\"\n description=\"Add administrative interface to your web application\"\n control={control}\n name=\"adminApp.enabled\"\n />\n\n {adminEnabled && (\n <>\n <InputFieldController\n label=\"Admin Path Prefix\"\n placeholder=\"/admin\"\n description=\"URL prefix for admin routes (e.g. /admin)\"\n control={control}\n name=\"adminApp.pathPrefix\"\n />\n\n {roleOptions && (\n <MultiComboboxFieldController\n label=\"Admin Access Roles\"\n description=\"Which roles can access the admin panel\"\n control={control}\n options={roleOptions}\n name=\"adminApp.allowedRoles\"\n />\n )}\n </>\n )}\n </SectionListSectionContent>\n </SectionListSection>\n\n {adminEnabled && (\n <SectionListSection>\n <SectionListSectionHeader>\n <SectionListSectionTitle>Admin Sections</SectionListSectionTitle>\n <SectionListSectionDescription>\n Manage CRUD interfaces for your data models.\n </SectionListSectionDescription>\n </SectionListSectionHeader>\n <SectionListSectionContent>\n <Button variant=\"secondary\" asChild>\n <Link to=\"/admin-sections/$appKey\" params={{ appKey }}>\n <MdSettings />\n Manage Admin Sections\n </Link>\n </Button>\n </SectionListSectionContent>\n </SectionListSection>\n )}\n </SectionList>\n <FormActionBar form={formProps} />\n </form>\n );\n}\n"],"names":["appEntityType","authConfigSpec","createWebAppSchema","importShared","useBlockUnsavedChangesNavigate","useProjectDefinition","useResettableForm","Button","FormActionBar","InputFieldController","MultiComboboxFieldController","SectionList","SectionListSection","SectionListSectionContent","SectionListSectionDescription","SectionListSectionHeader","SectionListSectionTitle","SwitchFieldController","Link","SplitComponent","webDefinition","Route","useRouteContext","definition","saveDefinitionWithFeedback","pluginContainer","webAppSchema","useDefinitionSchema","formProps","resolver","zodResolver","values","control","handleSubmit","reset","watch","onSubmit","data","draftConfig","apps","map","app","id","roleOptions","getPluginSpecOptional","getAuthRoles","role","label","name","value","adminEnabled","appKey","keyFromId","jsxs","jsx","Fragment","MdSettings"],"mappings":"+PAEA,KAAA,CAAA,cAAAA,EAAA,eAAAC,EAAA,mBAAAC,CAAA,EAAA,MAAAC,EAAA,oCAAA,EAKA,CAAA,+BAAAC,EAAA,qBAAAC,EAAA,kBAAAC,CAAA,EAAA,MAAAH,EAAA,wCAAA,EAKA,CAAA,OAAAI,EAAA,cAAAC,EAAA,qBAAAC,EAAA,6BAAAC,EAAA,YAAAC,EAAA,mBAAAC,EA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A,EACF,EACAuC,EAAAA,KAACxC,EAAA,CAA0B,UAAU,YACnC,SAAA,CAAAyC,MAACrC,GACC,MAAM,qBACN,YAAY,uDACZ,QAAAe,EACA,KAAK,mBAAkB,EAGxBkB,GACCG,EAAAA,KAAAE,WAAA,CACE,SAAA,CAAAD,EAAAA,IAAC7C,EAAA,CACC,MAAM,oBACN,YAAY,SACZ,YAAY,4CACZ,QAAAuB,EACA,KAAK,qBAAA,CAAqB,EAG3BW,GACCW,EAAAA,IAAC5C,EAAA,CACC,MAAM,qBACN,YAAY,yCACZ,QAAAsB,EACA,QAASW,EACT,KAAK,uBAAA,CAAuB,CAAA,CAAA,CAGlC,CAAA,CAAA,CAEJ,CAAA,EACF,EAECO,UACEtC,EAAA,CACC,SAAA,CAAAyC,OAACtC,EAAA,CACC,SAAA,CAAAuC,EAAAA,IAACtC,GAAwB,SAAA,gBAAA,CAAc,EACvCsC,EAAAA,IAACxC,GAA6B,SAAA,8CAAA,CAE9B,CAAA,EACF,EACAwC,EAAAA,IAACzC,EAAA,CACC,SAAAyC,EAAAA,IAAC/C,EAAA,CAAO,QAAQ,YAAY,QAAO,GACjC,SAAA8C,OAACnC,EAAA,CAAK,GAAG,0BAA0B,OAAQ,CAAEiC,OAAAA,CAAAA,EAC3C,SAAA,CAAAG,EAAAA,IAACE,EAAA,EAAU,EAAA,uBAAA,CAAA,CAEb,EACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EAEJ,EACAF,EAAAA,IAAC9C,EAAA,CAAc,KAAMoB,CAAAA,CAAU,CAAA,EACjC,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as s}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{g as k,s as g}from"./index-
|
|
2
|
-
//# sourceMappingURL=backend-
|
|
1
|
+
import{i as s}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{g as k,s as g}from"./index-Cd_baD6T.js";import{u as v}from"./use-definition-schema-BuO4pbji.js";const{createBackendAppSchema:L}=await s("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:E,useProjectDefinition:B,useResettableForm:P}=await s("@baseplate-dev/project-builder-lib/web"),{FormActionBar:w,InputFieldController:l,SectionList:y,SectionListSection:p,SectionListSectionContent:d,SectionListSectionDescription:b,SectionListSectionHeader:m,SectionListSectionTitle:u,SwitchFieldController:i}=await s("@baseplate-dev/ui-components"),N=function(){const{saveDefinitionWithFeedback:x}=B(),{backendDefinition:n}=k.useLoaderData(),j=v(L),o=P({resolver:g(j),values:n}),{control:a,handleSubmit:h,reset:S}=o,t=h(f=>x(r=>{r.apps=r.apps.map(c=>c.id===n.id?f:c)}));return E({control:a,reset:S,onSubmit:t}),e.jsxs("form",{className:"w-full max-w-7xl space-y-4 px-4",onSubmit:t,children:[e.jsxs(y,{children:[e.jsxs(p,{children:[e.jsxs(m,{children:[e.jsx(u,{children:"General"}),e.jsx(b,{children:"Basic configuration for your backend application."})]}),e.jsxs(d,{className:"space-y-6",children:[e.jsx(l,{label:"Name",control:a,name:"name"}),e.jsx(l,{label:"Package Location (optional)",placeholder:"e.g. packages/backend",control:a,name:"packageLocation"})]})]}),e.jsxs(p,{children:[e.jsxs(m,{children:[e.jsx(u,{children:"Configuration"}),e.jsx(b,{children:"Enable or disable external services and features for your backend application."})]}),e.jsx(d,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(i,{control:a,name:"enableStripe",label:"Stripe",description:"Enable Stripe for payment processing"}),e.jsx(i,{control:a,name:"enablePostmark",label:"Postmark",description:"Enable Postmark for email delivery"}),e.jsx(i,{control:a,name:"enableRedis",label:"Redis",description:"Enable Redis for caching and session storage"}),e.jsx(i,{control:a,name:"enableBullQueue",label:"Bull Queue",description:"Enable Bull Queue for background job processing"}),e.jsx(i,{control:a,name:"enableSubscriptions",label:"GraphQL Subscriptions",description:"Enable GraphQL Subscriptions for real-time updates"}),e.jsx(i,{control:a,name:"enableAxios",label:"Axios",description:"Enable Axios for HTTP requests"})]})})]})]}),e.jsx(w,{form:o})]})};export{N as component};
|
|
2
|
+
//# sourceMappingURL=backend-3ZlC6POv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend-
|
|
1
|
+
{"version":3,"file":"backend-3ZlC6POv.js","sources":["../../src/routes/apps/edit.$key/backend.tsx?tsr-split=component"],"sourcesContent":["import type React from 'react';\n\nimport { createBackendAppSchema } from '@baseplate-dev/project-builder-lib';\nimport {\n useBlockUnsavedChangesNavigate,\n useProjectDefinition,\n useResettableForm,\n} from '@baseplate-dev/project-builder-lib/web';\nimport {\n FormActionBar,\n InputFieldController,\n SectionList,\n SectionListSection,\n SectionListSectionContent,\n SectionListSectionDescription,\n SectionListSectionHeader,\n SectionListSectionTitle,\n SwitchFieldController,\n} from '@baseplate-dev/ui-components';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { createFileRoute, notFound, redirect } from '@tanstack/react-router';\n\nimport { useDefinitionSchema } from '#src/hooks/use-definition-schema.js';\n\nexport const Route = createFileRoute('/apps/edit/$key/backend')({\n component: BackendAppEditPage,\n loader: ({ context: { app }, params: { key } }) => {\n if (!app) throw notFound();\n if (app.type !== 'backend') {\n throw redirect({ to: '/apps/edit/$key', params: { key } });\n }\n return {\n backendDefinition: app,\n };\n },\n});\n\nfunction BackendAppEditPage(): React.JSX.Element {\n const { saveDefinitionWithFeedback } = useProjectDefinition();\n const { backendDefinition } = Route.useLoaderData();\n\n const backendAppSchema = useDefinitionSchema(createBackendAppSchema);\n const formProps = useResettableForm({\n resolver: zodResolver(backendAppSchema),\n values: backendDefinition,\n });\n const { control, handleSubmit, reset } = formProps;\n\n const onSubmit = handleSubmit((data) =>\n saveDefinitionWithFeedback((draftConfig) => {\n draftConfig.apps = draftConfig.apps.map((app) =>\n app.id === backendDefinition.id ? data : app,\n );\n }),\n );\n\n useBlockUnsavedChangesNavigate({ control, reset, onSubmit });\n\n return (\n <form className=\"w-full max-w-7xl space-y-4 px-4\" onSubmit={onSubmit}>\n <SectionList>\n <SectionListSection>\n <SectionListSectionHeader>\n <SectionListSectionTitle>General</SectionListSectionTitle>\n <SectionListSectionDescription>\n Basic configuration for your backend application.\n </SectionListSectionDescription>\n </SectionListSectionHeader>\n <SectionListSectionContent className=\"space-y-6\">\n <InputFieldController label=\"Name\" control={control} name=\"name\" />\n <InputFieldController\n label=\"Package Location (optional)\"\n placeholder=\"e.g. packages/backend\"\n control={control}\n name=\"packageLocation\"\n />\n </SectionListSectionContent>\n </SectionListSection>\n\n <SectionListSection>\n <SectionListSectionHeader>\n <SectionListSectionTitle>Configuration</SectionListSectionTitle>\n <SectionListSectionDescription>\n Enable or disable external services and features for your backend\n application.\n </SectionListSectionDescription>\n </SectionListSectionHeader>\n <SectionListSectionContent>\n <div className=\"space-y-4\">\n <SwitchFieldController\n control={control}\n name=\"enableStripe\"\n label=\"Stripe\"\n description=\"Enable Stripe for payment processing\"\n />\n <SwitchFieldController\n control={control}\n name=\"enablePostmark\"\n label=\"Postmark\"\n description=\"Enable Postmark for email delivery\"\n />\n <SwitchFieldController\n control={control}\n name=\"enableRedis\"\n label=\"Redis\"\n description=\"Enable Redis for caching and session storage\"\n />\n <SwitchFieldController\n control={control}\n name=\"enableBullQueue\"\n label=\"Bull Queue\"\n description=\"Enable Bull Queue for background job processing\"\n />\n <SwitchFieldController\n control={control}\n name=\"enableSubscriptions\"\n label=\"GraphQL Subscriptions\"\n description=\"Enable GraphQL Subscriptions for real-time updates\"\n />\n <SwitchFieldController\n control={control}\n name=\"enableAxios\"\n label=\"Axios\"\n description=\"Enable Axios for HTTP requests\"\n />\n </div>\n </SectionListSectionContent>\n </SectionListSection>\n </SectionList>\n <FormActionBar form={formProps} />\n </form>\n );\n}\n"],"names":["createBackendAppSchema","importShared","useBlockUnsavedChangesNavigate","useProjectDefinition","useResettableForm","FormActionBar","InputFieldController","SectionList","SectionListSection","SectionListSectionContent","SectionListSectionDescription","SectionListSectionHeader","SectionListSectionTitle","SwitchFieldController","SplitComponent","saveDefinitionWithFeedback","backendDefinition","Route","useLoaderData","backendAppSchema","useDefinitionSchema","formProps","resolver","zodResolver","values","control","handleSubmit","reset","onSubmit","data","draftConfig","apps","map","app","id","jsxs","jsx"],"mappings":"uNAEA,KAAA,CAAA,uBAAAA,CAAA,EAAA,MAAAC,EAAA,oCAAA,EACA,CAAA,+BAAAC,EAAA,qBAAAC,EAAA,kBAAAC,CAAA,EAAA,MAAAH,EAAA,wCAAA,EAKA,CAAA,cAAAI,EAAA,qBAAAC,EAAA,YAAAC,EAAA,mBAAAC,EAAA,0BAAAC,EAAA,8BAAAC,EAAA,yBAAAC,EAAA,wBAAAC,EAAA,sBAAAC,CAAA,EAAA,MAAAZ,EAAA,8BAAA,EAc0Ea,EAAA,UAezB,CAC/C,KAAM,CAAEC,2BAAAA,CAAAA,EAA+BZ,EAAAA,EACjC,CAAEa,kBAAAA,CAAAA,EAAsBC,EAAMC,cAAAA,EAE9BC,EAAmBC,EAAoBpB,CAAsB,EAC7DqB,EAAYjB,EAAkB,CAClCkB,SAAUC,EAAYJ,CAAgB,EACtCK,OAAQR,CAAAA,CACT,EACK,CAAES,QAAAA,EAASC,aAAAA,EAAcC,MAAAA,CAAAA,EAAUN,EAEnCO,EAAWF,EAAcG,GAC7Bd,EAA4Be,GAAgB,CAC1CA,EAAYC,KAAOD,EAAYC,KAAKC,IAAKC,GACvCA,EAAIC,KAAOlB,EAAkBkB,GAAKL,EAAOI,CAC3C,CACF,CAAC,CACH,EAEA/B,OAAAA,EAA+B,CAAEuB,QAAAA,EAASE,MAAAA,EAAOC,SAAAA,CAAAA,CAAU,EAGzDO,EAAAA,KAAC,OAAA,CAAK,UAAU,kCAAkC,SAAAP,EAChD,SAAA,CAAAO,OAAC5B,EAAA,CACC,SAAA,CAAA4B,OAAC3B,EAAA,CACC,SAAA,CAAA2B,OAACxB,EAAA,CACC,SAAA,CAAAyB,EAAAA,IAACxB,GAAwB,SAAA,SAAA,CAAO,EAChCwB,EAAAA,IAAC1B,GAA6B,SAAA,mDAAA,CAE9B,CAAA,EACF,EACAyB,EAAAA,KAAC1B,EAAA,CAA0B,UAAU,YACnC,SAAA,CAAA2B,EAAAA,IAAC9B,EAAA,CAAqB,MAAM,OAAO,QAAAmB,EAAkB,KAAK,OAAM,EAChEW,MAAC9B,GACC,MAAM,8BACN,YAAY,wBACZ,QAAAmB,EACA,KAAK,iBAAA,CAAiB,CAAA,CAAA,CAE1B,CAAA,EACF,SAECjB,EAAA,CACC,SAAA,CAAA2B,OAACxB,EAAA,CACC,SAAA,CAAAyB,EAAAA,IAACxB,GAAwB,SAAA,eAAA,CAAa,EACtCwB,EAAAA,IAAC1B,GAA6B,SAAA,gFAAA,CAG9B,CAAA,EACF,EACA0B,MAAC3B,EAAA,CACC,SAAA0B,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAC,MAACvB,GACC,QAAAY,EACA,KAAK,eACL,MAAM,SACN,YAAY,uCAAsC,EAEpDW,MAACvB,GACC,QAAAY,EACA,KAAK,iBACL,MAAM,WACN,YAAY,qCAAoC,EAElDW,MAACvB,GACC,QAAAY,EACA,KAAK,cACL,MAAM,QACN,YAAY,+CAA8C,EAE5DW,MAACvB,GACC,QAAAY,EACA,KAAK,kBACL,MAAM,aACN,YAAY,kDAAiD,EAE/DW,MAACvB,GACC,QAAAY,EACA,KAAK,sBACL,MAAM,wBACN,YAAY,qDAAoD,EAElEW,MAACvB,GACC,QAAAY,EACA,KAAK,cACL,MAAM,QACN,YAAY,gCAAA,CAAgC,CAAA,CAAA,CAEhD,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACF,EACAW,EAAAA,IAAC/B,EAAA,CAAc,KAAMgB,CAAAA,CAAU,CAAA,EACjC,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge-with-type-label-CThmzNSh.js","sources":["../../src/utils/string.ts","../../src/routes/data/models/edit.$key/-components/badge-with-type-label.tsx"],"sourcesContent":["// Split the string into words and separators, preserving original form\nfunction splitIntoTokens(str: string): string[] {\n const regex = /([_\\s-]*[A-Z]+(?![^\\s\\-_A-Z])|[_\\s-]*[A-Z]*[^\\s\\-_A-Z]+)/g;\n return str.match(regex) ?? [];\n}\n\n/**\n * Truncates a string and appends an ellipsis ('...') if it exceeds the specified maximum length.\n *\n * @param str - The string to be truncated.\n * @param maxLength - The maximum allowed length of the string including the ellipsis.\n * @returns The truncated string with an ellipsis if it exceeds the maximum length, otherwise the original string.\n */\nfunction ellipsisString(str: string, maxLength: number): string {\n return str.length <= maxLength\n ? str\n : `${str.slice(0, Math.max(0, maxLength - 3))}...`;\n}\n\n/**\n * Truncates a string from the middle and adds an ellipsis ('...') if it exceeds the specified maximum length.\n *\n * @param str - The input string to be truncated.\n * @param maxLength - The maximum allowed length of the truncated string including the ellipsis, defaults to 20.\n * @returns The truncated string with an ellipsis in the middle if it exceeds the maximum length.\n *\n * The function works as follows:\n * - If the input string length is less than or equal to the maximum length, it returns the original string.\n * - If the input string length is less than or equal to 3, it returns '...'.\n * - It splits the string into tokens and checks if the first and last tokens together exceed the maximum length.\n * - If they do, it truncates the string using an ellipsis.\n * - Otherwise, it reconstructs the string by adding tokens until the length exceeds the maximum length, then adds an ellipsis and the last token.\n */\nexport function ellipsisStringFromMiddle(str: string, maxLength = 20): string {\n if (str.length <= maxLength) {\n return str;\n }\n\n if (str.length <= 3) {\n return '...';\n }\n\n const tokens = splitIntoTokens(str);\n\n if (tokens.length === 1) {\n return ellipsisString(str, maxLength);\n }\n\n // Check if first and last tokens exceed maxLength\n const firstToken = tokens[0];\n const lastToken = (tokens.at(-1) ?? '').replace(/^[_\\s-]+/, '');\n const lastTokenLength = lastToken.length;\n if (firstToken.length + lastTokenLength + 3 > maxLength) {\n return ellipsisString(str, maxLength);\n }\n\n let reconstructed = firstToken;\n\n // Keep adding tokens until the length exceeds maxLength\n for (let i = 1; i < tokens.length - 1; i++) {\n const nextTokenLength = tokens[i].length;\n if (\n reconstructed.length + nextTokenLength + lastTokenLength + 3 >\n maxLength\n ) {\n break;\n }\n reconstructed += tokens[i];\n }\n\n // trim any separators from the end of the last token\n return `${reconstructed}...${lastToken}`;\n}\n","import type React from 'react';\n\nimport { Badge } from '@baseplate-dev/ui-components';\nimport { clsx } from 'clsx';\n\nimport { ellipsisStringFromMiddle } from '#src/utils/string.js';\n\ninterface BadgeWithTypeLabelProps {\n className?: string;\n children: React.ReactNode;\n type: string;\n}\n\nexport function BadgeWithTypeLabel({\n className,\n children,\n type,\n}: BadgeWithTypeLabelProps): React.JSX.Element {\n return (\n <div\n className={clsx(\n 'flex h-8 w-full items-center justify-between gap-4 rounded-md border bg-muted px-3 text-sm',\n className,\n )}\n >\n <div>{children}</div>\n <Badge variant=\"outline\" className=\"text-muted-foreground\">\n {ellipsisStringFromMiddle(type, 20)}\n </Badge>\n </div>\n );\n}\n"],"names":["splitIntoTokens","str","regex","ellipsisString","maxLength","ellipsisStringFromMiddle","tokens","firstToken","lastToken","lastTokenLength","reconstructed","i","nextTokenLength","Badge","importShared","BadgeWithTypeLabel","className","children","type","jsxs","clsx","jsx"],"mappings":"wJACA,SAASA,EAAgBC,EAAuB,CAC9C,MAAMC,EAAQ,4DACd,OAAOD,EAAI,MAAMC,CAAK,GAAK,
|
|
1
|
+
{"version":3,"file":"badge-with-type-label-CThmzNSh.js","sources":["../../src/utils/string.ts","../../src/routes/data/models/edit.$key/-components/badge-with-type-label.tsx"],"sourcesContent":["// Split the string into words and separators, preserving original form\nfunction splitIntoTokens(str: string): string[] {\n const regex = /([_\\s-]*[A-Z]+(?![^\\s\\-_A-Z])|[_\\s-]*[A-Z]*[^\\s\\-_A-Z]+)/g;\n return str.match(regex) ?? [];\n}\n\n/**\n * Truncates a string and appends an ellipsis ('...') if it exceeds the specified maximum length.\n *\n * @param str - The string to be truncated.\n * @param maxLength - The maximum allowed length of the string including the ellipsis.\n * @returns The truncated string with an ellipsis if it exceeds the maximum length, otherwise the original string.\n */\nfunction ellipsisString(str: string, maxLength: number): string {\n return str.length <= maxLength\n ? str\n : `${str.slice(0, Math.max(0, maxLength - 3))}...`;\n}\n\n/**\n * Truncates a string from the middle and adds an ellipsis ('...') if it exceeds the specified maximum length.\n *\n * @param str - The input string to be truncated.\n * @param maxLength - The maximum allowed length of the truncated string including the ellipsis, defaults to 20.\n * @returns The truncated string with an ellipsis in the middle if it exceeds the maximum length.\n *\n * The function works as follows:\n * - If the input string length is less than or equal to the maximum length, it returns the original string.\n * - If the input string length is less than or equal to 3, it returns '...'.\n * - It splits the string into tokens and checks if the first and last tokens together exceed the maximum length.\n * - If they do, it truncates the string using an ellipsis.\n * - Otherwise, it reconstructs the string by adding tokens until the length exceeds the maximum length, then adds an ellipsis and the last token.\n */\nexport function ellipsisStringFromMiddle(str: string, maxLength = 20): string {\n if (str.length <= maxLength) {\n return str;\n }\n\n if (str.length <= 3) {\n return '...';\n }\n\n const tokens = splitIntoTokens(str);\n\n if (tokens.length === 1) {\n return ellipsisString(str, maxLength);\n }\n\n // Check if first and last tokens exceed maxLength\n const firstToken = tokens[0];\n const lastToken = (tokens.at(-1) ?? '').replace(/^[_\\s-]+/, '');\n const lastTokenLength = lastToken.length;\n if (firstToken.length + lastTokenLength + 3 > maxLength) {\n return ellipsisString(str, maxLength);\n }\n\n let reconstructed = firstToken;\n\n // Keep adding tokens until the length exceeds maxLength\n for (let i = 1; i < tokens.length - 1; i++) {\n const nextTokenLength = tokens[i].length;\n if (\n reconstructed.length + nextTokenLength + lastTokenLength + 3 >\n maxLength\n ) {\n break;\n }\n reconstructed += tokens[i];\n }\n\n // trim any separators from the end of the last token\n return `${reconstructed}...${lastToken}`;\n}\n","import type React from 'react';\n\nimport { Badge } from '@baseplate-dev/ui-components';\nimport { clsx } from 'clsx';\n\nimport { ellipsisStringFromMiddle } from '#src/utils/string.js';\n\ninterface BadgeWithTypeLabelProps {\n className?: string;\n children: React.ReactNode;\n type: string;\n}\n\nexport function BadgeWithTypeLabel({\n className,\n children,\n type,\n}: BadgeWithTypeLabelProps): React.JSX.Element {\n return (\n <div\n className={clsx(\n 'flex h-8 w-full items-center justify-between gap-4 rounded-md border bg-muted px-3 text-sm',\n className,\n )}\n >\n <div>{children}</div>\n <Badge variant=\"outline\" className=\"text-muted-foreground\">\n {ellipsisStringFromMiddle(type, 20)}\n </Badge>\n </div>\n );\n}\n"],"names":["splitIntoTokens","str","regex","ellipsisString","maxLength","ellipsisStringFromMiddle","tokens","firstToken","lastToken","lastTokenLength","reconstructed","i","nextTokenLength","Badge","importShared","BadgeWithTypeLabel","className","children","type","jsxs","clsx","jsx"],"mappings":"wJACA,SAASA,EAAgBC,EAAuB,CAC9C,MAAMC,EAAQ,4DACd,OAAOD,EAAI,MAAMC,CAAK,GAAK,CAAA,CAC7B,CASA,SAASC,EAAeF,EAAaG,EAA2B,CAC9D,OAAOH,EAAI,QAAUG,EACjBH,EACA,GAAGA,EAAI,MAAM,EAAG,KAAK,IAAI,EAAGG,EAAY,CAAC,CAAC,CAAC,KACjD,CAgBO,SAASC,EAAyBJ,EAAaG,EAAY,GAAY,CAC5E,GAAIH,EAAI,QAAUG,EAChB,OAAOH,EAGT,GAAIA,EAAI,QAAU,EAChB,MAAO,MAGT,MAAMK,EAASN,EAAgBC,CAAG,EAElC,GAAIK,EAAO,SAAW,EACpB,OAAOH,EAAeF,EAAKG,CAAS,EAItC,MAAMG,EAAaD,EAAO,CAAC,EACrBE,GAAaF,EAAO,GAAG,EAAE,GAAK,IAAI,QAAQ,WAAY,EAAE,EACxDG,EAAkBD,EAAU,OAClC,GAAID,EAAW,OAASE,EAAkB,EAAIL,EAC5C,OAAOD,EAAeF,EAAKG,CAAS,EAGtC,IAAIM,EAAgBH,EAGpB,QAASI,EAAI,EAAGA,EAAIL,EAAO,OAAS,EAAGK,IAAK,CAC1C,MAAMC,EAAkBN,EAAOK,CAAC,EAAE,OAClC,GACED,EAAc,OAASE,EAAkBH,EAAkB,EAC3DL,EAEA,MAEFM,GAAiBJ,EAAOK,CAAC,CAC3B,CAGA,MAAO,GAAGD,CAAa,MAAMF,CAAS,EACxC,CCtEA,KAAA,CAAA,MAAAK,CAAA,EAAA,MAAAC,EAAA,8BAAA,EAWO,SAASC,EAAmB,CACjC,UAAAC,EACA,SAAAC,EACA,KAAAC,CACF,EAA+C,CAC7C,OACEC,EAAAA,KAAC,MAAA,CACC,UAAWC,EACT,6FACAJ,CAAA,EAGF,SAAA,CAAAK,MAAC,OAAK,SAAAJ,EAAS,EACfI,EAAAA,IAACR,GAAM,QAAQ,UAAU,UAAU,wBAChC,SAAAR,EAAyBa,EAAM,EAAE,CAAA,CACpC,CAAA,CAAA,CAAA,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capitalize-gOJXDbsR.js","sources":["../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/string/capitalize.mjs"],"sourcesContent":["function capitalize(str) {\n return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase());\n}\n\nexport { capitalize };\n"],"names":["capitalize","str"],"mappings":"AAAA,SAASA,EAAWC,EAAK,CACrB,OAAQA,EAAI,OAAO,CAAC,EAAE,cAAgBA,EAAI,MAAM,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"capitalize-gOJXDbsR.js","sources":["../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/string/capitalize.mjs"],"sourcesContent":["function capitalize(str) {\n return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase());\n}\n\nexport { capitalize };\n"],"names":["capitalize","str"],"mappings":"AAAA,SAASA,EAAWC,EAAK,CACrB,OAAQA,EAAI,OAAO,CAAC,EAAE,cAAgBA,EAAI,MAAM,CAAC,EAAE,YAAW,CAClE","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as t}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{d as l,N as j,e as P,l as g}from"./index-
|
|
2
|
-
//# sourceMappingURL=edit._key-
|
|
1
|
+
import{i as t}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{d as l,N as j,e as P,l as g}from"./index-Cd_baD6T.js";const{createPluginImplementationStoreWithNewPlugins:D,PluginUtils:f,webConfigSpec:m}=await t("@baseplate-dev/project-builder-lib"),{useProjectDefinition:v}=await t("@baseplate-dev/project-builder-lib/web"),{Button:S,DropdownMenu:y,DropdownMenuContent:N,DropdownMenuGroup:M,DropdownMenuItem:k,DropdownMenuTrigger:W,useConfirmDialog:A}=await t("@baseplate-dev/ui-components"),{useNavigate:F}=await t("@tanstack/react-router"),{useMemo:E}=await t("react"),B=function(){const{definitionContainer:o,pluginContainer:r,schemaParserContext:a,saveDefinitionWithFeedbackSync:x,isSavingDefinition:b}=v(),{key:i}=l.useParams(),{requestConfirm:h}=A(),c=F({from:l.fullPath}),{pluginMetadata:n}=l.useLoaderData(),s=f.byKey(o.definition,i),u=E(()=>{if(!i)return;const p=r.getPluginSpec(m).getWebConfigComponent(i);return p||D(a.pluginStore,[n],o.definition).getPluginSpec(m).getWebConfigComponent(i)},[i,a,o,r,n]);if(!u)return e.jsx(j,{});function C(){x(d=>{f.disablePlugin(d,n.key,a)},{successMessage:`Disabled ${n.displayName}!`,onSuccess:()=>{c({to:"/plugins"}).catch(g)}})}function w(){s||c({to:"/plugins"}).catch(g)}return e.jsx("div",{className:"relative flex h-full flex-1 flex-col gap-4 overflow-hidden",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h1",{children:[n.displayName," Plugin"]}),s&&e.jsxs(y,{children:[e.jsx(W,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"icon",children:e.jsx(P,{"aria-label":"More Actions"})})}),e.jsx(N,{children:e.jsx(M,{children:e.jsx(k,{disabled:b,onSelect:()=>{h({title:"Disable Plugin",content:`Are you sure you want to disable the ${n.displayName} plugin?`,onConfirm:C})},children:"Disable Plugin"})})})]})]}),e.jsx(u,{definition:s,metadata:n,onSave:w})]})})};export{B as component};
|
|
2
|
+
//# sourceMappingURL=edit._key-D-7xw9rv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit._key-
|
|
1
|
+
{"version":3,"file":"edit._key-D-7xw9rv.js","sources":["../../src/routes/plugins/edit.$key.tsx?tsr-split=component"],"sourcesContent":["import type React from 'react';\n\nimport {\n createPluginImplementationStoreWithNewPlugins,\n getPluginMetadataByKey,\n PluginUtils,\n webConfigSpec,\n} from '@baseplate-dev/project-builder-lib';\nimport { useProjectDefinition } from '@baseplate-dev/project-builder-lib/web';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n useConfirmDialog,\n} from '@baseplate-dev/ui-components';\nimport { createFileRoute, notFound, useNavigate } from '@tanstack/react-router';\nimport { useMemo } from 'react';\nimport { HiDotsVertical } from 'react-icons/hi';\n\nimport { NotFoundCard } from '#src/components/index.js';\nimport { logAndFormatError } from '#src/services/error-formatter.js';\n\nexport const Route = createFileRoute('/plugins/edit/$key')({\n component: PluginConfigPage,\n beforeLoad: ({ params: { key }, context: { schemaParserContext } }) => {\n const pluginMetadata = getPluginMetadataByKey(\n schemaParserContext.pluginStore,\n key,\n );\n if (!pluginMetadata) return {};\n return {\n getTitle: () => pluginMetadata.displayName,\n pluginMetadata,\n };\n },\n loader: ({ context: { pluginMetadata } }) => {\n if (!pluginMetadata) throw notFound();\n return { pluginMetadata };\n },\n});\n\nfunction PluginConfigPage(): React.JSX.Element {\n const {\n definitionContainer,\n pluginContainer,\n schemaParserContext,\n saveDefinitionWithFeedbackSync,\n isSavingDefinition,\n } = useProjectDefinition();\n const { key } = Route.useParams();\n const { requestConfirm } = useConfirmDialog();\n const navigate = useNavigate({ from: Route.fullPath });\n const { pluginMetadata } = Route.useLoaderData();\n\n const pluginDefinition = PluginUtils.byKey(\n definitionContainer.definition,\n key,\n );\n\n const Container = useMemo(() => {\n if (!key) {\n return;\n }\n\n const pluginSpec = pluginContainer.getPluginSpec(webConfigSpec);\n const webConfigComponent = pluginSpec.getWebConfigComponent(key);\n if (webConfigComponent) {\n return webConfigComponent;\n }\n const newPluginContainer = createPluginImplementationStoreWithNewPlugins(\n schemaParserContext.pluginStore,\n [pluginMetadata],\n definitionContainer.definition,\n );\n\n return newPluginContainer\n .getPluginSpec(webConfigSpec)\n .getWebConfigComponent(key);\n }, [\n key,\n schemaParserContext,\n definitionContainer,\n pluginContainer,\n pluginMetadata,\n ]);\n\n if (!Container) {\n return <NotFoundCard />;\n }\n\n function onDisablePlugin(): void {\n saveDefinitionWithFeedbackSync(\n (draft) => {\n PluginUtils.disablePlugin(\n draft,\n pluginMetadata.key,\n schemaParserContext,\n );\n },\n {\n successMessage: `Disabled ${pluginMetadata.displayName}!`,\n onSuccess: () => {\n navigate({ to: '/plugins' }).catch(logAndFormatError);\n },\n },\n );\n }\n\n function onSave(): void {\n if (!pluginDefinition) {\n navigate({ to: '/plugins' }).catch(logAndFormatError);\n }\n }\n\n return (\n <div className=\"relative flex h-full flex-1 flex-col gap-4 overflow-hidden\">\n <div className=\"flex flex-1 flex-col gap-4 overflow-y-auto p-4\">\n <div className=\"flex items-center justify-between\">\n <h1>{pluginMetadata.displayName} Plugin</h1>\n {pluginDefinition && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\">\n <HiDotsVertical aria-label=\"More Actions\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuGroup>\n <DropdownMenuItem\n disabled={isSavingDefinition}\n onSelect={() => {\n requestConfirm({\n title: 'Disable Plugin',\n content: `Are you sure you want to disable the ${pluginMetadata.displayName} plugin?`,\n onConfirm: onDisablePlugin,\n });\n }}\n >\n Disable Plugin\n </DropdownMenuItem>\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n <Container\n definition={pluginDefinition}\n metadata={pluginMetadata}\n onSave={onSave}\n />\n </div>\n </div>\n );\n}\n"],"names":["createPluginImplementationStoreWithNewPlugins","PluginUtils","webConfigSpec","importShared","useProjectDefinition","Button","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuTrigger","useConfirmDialog","useNavigate","useMemo","SplitComponent","definitionContainer","pluginContainer","schemaParserContext","saveDefinitionWithFeedbackSync","isSavingDefinition","key","Route","useParams","requestConfirm","navigate","from","fullPath","pluginMetadata","useLoaderData","pluginDefinition","byKey","definition","Container","webConfigComponent","getPluginSpec","getWebConfigComponent","pluginStore","NotFoundCard","onDisablePlugin","draft","disablePlugin","successMessage","displayName","onSuccess","to","catch","logAndFormatError","onSave","jsxs","jsx","HiDotsVertical","title","content","onConfirm"],"mappings":"6KAEA,KAAA,CAAA,8CAAAA,EAAA,YAAAC,EAAA,cAAAC,CAAA,EAAA,MAAAC,EAAA,oCAAA,EAMA,CAAA,qBAAAC,CAAA,EAAA,MAAAD,EAAA,wCAAA,EACA,CAAA,OAAAE,EAAA,aAAAC,EAAA,oBAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,oBAAAC,EAAA,iBAAAC,CAAA,EAAA,MAAAR,EAAA,8BAAA,EASA,CAAA,YAAAS,CAAA,EAAA,MAAAT,EAAA,wBAAA,EACA,CAAA,QAAAU,CAAA,EAAA,MAAAV,EAAA,OAAA,EAIqEW,EAAA,UAqBtB,CAC7C,KAAM,CACJC,oBAAAA,EACAC,gBAAAA,EACAC,oBAAAA,EACAC,+BAAAA,EACAC,mBAAAA,CAAAA,EACEf,EAAAA,EACE,CAAEgB,IAAAA,CAAAA,EAAQC,EAAMC,UAAAA,EAChB,CAAEC,eAAAA,CAAAA,EAAmBZ,EAAAA,EACrBa,EAAWZ,EAAY,CAAEa,K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,SAAA0C,EAAAA,IAACzC,EAAA,CACC,eAACC,EAAA,CACC,SAAUU,EACV,SAAU,IAAM,CACdI,EAAe,CACb4B,MAAO,iBACPC,QAAS,wCAAwCzB,EAAee,WAAW,WAC3EW,UAAWf,CAAAA,CACZ,CACH,EAAE,SAAA,gBAAA,CAGJ,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EAEJ,QACCN,EAAA,CACC,WAAYH,EACZ,SAAUF,EACV,OAAAoB,CAAA,CAAe,CAAA,CAAA,CAEnB,CAAA,CACF,CAEJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{i as c}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{s as N,S as q,l as je,h as Fe,_ as L,i as M}from"./index-DEKFCy0H.js";import{u as De}from"./use-definition-schema-BuO4pbji.js";import{g as ee,s as te,b as V,e as I,f as Y}from"./index.esm-CdP29Ssb.js";import{H as J,L as Q,c as X,A as Z}from"./index-tflukq04.js";var Ie=class S{constructor(t,i,n){this.control=t,this.path=i,this.cache=n}static create(t,i){return new S(t,"",i)}focus(t){var i,n,l,s,a,u;const d=t.toString(),p=this.path?`${this.path}.${d}`:d,b=(i=this.cache)==null?void 0:i.get(p,this.reflectedKey);if(b)return b;if(Array.isArray(this.override)){const[h]=this.override,f=new S(this.control,p,this.cache);return f.isArrayItemReflection=!0,f.override=h,(n=this.cache)==null||n.set(f,p),f}else if(this.override){const h=ee(this.override,d);if(!h){const f=new S(this.control,p,this.cache);return(l=this.cache)==null||l.set(f,p),f}if(this.isArrayItemReflection){const f=`${this.path}.${h.path}`,x=new S(this.control,f,this.cache);return(s=this.cache)==null||s.set(x,f),x}else return(a=this.cache)==null||a.set(h,p),h}const j=new S(this.control,p,this.cache);return(u=this.cache)==null||u.set(j,p),j}reflect(t){var i,n,l;const s=(i=this.cache)==null?void 0:i.get(this.path,t);if(s)return s;const a=new S(this.control,this.path,this.cache),u=new Proxy({},{get:(p,b)=>typeof b=="string"?a.focus(b):p}),d=t(u,a);if(Array.isArray(d)){const p=new S(this.control,this.path,this.cache);return a.path="",p.override=t(u,a),p.reflectedKey=t,(n=this.cache)==null||n.set(p,this.path,t),p}else return a.override=d,a.path=this.path,a.reflectedKey=t,(l=this.cache)==null||l.set(a,this.path,t),a}map(t,i){return t.map((n,l,s)=>{const a=this.focus(l.toString());return i(n,a,l,s,this)})}interop(t){var i;return t?t(this.control,this.path):((i=this.interopCache)!=null||(this.interopCache={control:this.control,name:this.path||void 0,...this.override?{getTransformer:this.getTransformer.bind(this),setTransformer:this.setTransformer.bind(this)}:{}}),this.interopCache)}narrow(){return this}assert(){return this}defined(){return this}cast(){return this}getTransformer(t){const[i]=Array.isArray(this.override)?this.override:[this.override];if(!t||!i)return t;const n={};return Object.entries(i).forEach(([l,s])=>{const a=s;if(!a)return;const u=ee(t,a.path);te(n,l,u)}),n}setTransformer(t){const[i]=Array.isArray(this.override)?this.override:[this.override];if(!t||!i)return t;const n={};return Object.entries(t).forEach(([l,s])=>{const a=i[l];a&&te(n,a.path,s)}),n}},Se=class{constructor(o){this.cache=new Map,o._subscribe({formState:{values:!0},exact:!0,callback:()=>{o._names.unMount.forEach(t=>{this.delete(t)})}})}get(o,t){const i=this.cache.get(o);if(i)return t?i.complex.get(t):i.plain}set(o,t,i){let n=this.cache.get(t);n||(n={complex:new WeakMap},this.cache.set(t,n)),i?n.complex.set(i,o):n.plain=o}has(o,t){var i,n;return t?(n=(i=this.cache.get(o))==null?void 0:i.complex.has(t))!=null?n:!1:this.cache.has(o)}delete(o){for(const t of this.cache.keys())t.startsWith(o)&&this.cache.delete(t)}clear(){this.cache.clear()}};const{useMemo:Ae}=await c("react");function Ce(o,t=[]){return Ae(()=>{const i=new Se(o.control);return Ie.create(o.control,i)},[o.control,...t])}const{ModelUtils:$e}=await c("@baseplate-dev/project-builder-lib"),{createAdminCrudInputWebConfig:Te,useProjectDefinition:Ee}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ne}=await c("@baseplate-dev/ui-components");function Re({formProps:o,name:t,model:i,embeddedFormOptions:n}){const{definition:l}=Ee(),s=$e.getRelationsToModel(l,i.id).map(d=>({label:`${d.relation.foreignRelationName} (${d.model.name})`,value:d.relation.foreignId})),a=t,u=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(ne,{label:"Relation Name",control:u,name:`${a}.modelRelationRef`,options:s}),e.jsx(ne,{label:"Embedded Form",control:u,name:`${a}.embeddedFormRef`,options:n})]})}const Ne=Te({name:"embedded",pluginKey:void 0,label:"Embedded",getNewInput:()=>({label:"",type:"embedded",modelRelationRef:"",embeddedFormRef:""}),Form:Re}),{createAdminCrudInputWebConfig:Le,useProjectDefinition:_e}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ie}=await c("@baseplate-dev/ui-components");function We({formProps:o,name:t,model:i,embeddedFormOptions:n}){const{definitionContainer:l}=_e(),s=i.model.relations?.map(d=>({label:`${d.name} (${l.nameFromId(d.modelRef)})`,value:d.id}))??[],a=t,u=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Relation Name",control:u,name:`${a}.localRelationRef`,options:s}),e.jsx(ie,{label:"Embedded Form",control:u,name:`${a}.embeddedFormRef`,options:n})]})}const Pe=Le({name:"embeddedLocal",pluginKey:void 0,label:"Embedded Local",getNewInput:()=>({label:"",type:"embeddedLocal",embeddedFormRef:"",localRelationRef:""}),Form:We}),{createAdminCrudInputWebConfig:Ve}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:Me}=await c("@baseplate-dev/ui-components");function Oe({formProps:o,name:t,model:i}){const n=i.model.fields.filter(a=>a.type==="enum").map(a=>({label:a.name,value:a.id})),l=t,s=o.control;return e.jsx(Me,{label:"Enum Field",control:s,name:`${l}.modelFieldRef`,options:n})}const ke=Ve({name:"enum",pluginKey:void 0,label:"Enum",getNewInput:()=>({label:"",type:"enum",modelFieldRef:""}),Form:Oe}),{createAdminCrudInputWebConfig:Ue,useProjectDefinition:Be}=await c("@baseplate-dev/project-builder-lib/web"),{InputFieldController:_,SelectFieldController:Ke}=await c("@baseplate-dev/ui-components");function ze({formProps:o,name:t,model:i}){const{definitionContainer:n}=Be(),l=i.model.relations?.map(u=>({label:`${u.name} (${n.nameFromId(u.modelRef)})`,value:u.id}))??[],s=t,a=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(Ke,{label:"Local Relation Name",control:a,name:`${s}.localRelationRef`,options:l}),e.jsx(_,{label:"Label Expression (e.g. name)",control:a,name:`${s}.labelExpression`}),e.jsx(_,{label:"Value Expression (e.g. id)",control:a,name:`${s}.valueExpression`}),e.jsx(_,{label:"Default Label (optional)",control:a,name:`${s}.defaultLabel`}),e.jsx(_,{label:"Empty Label (optional) - only if field is nullable",control:a,name:`${s}.nullLabel`})]})}const He=Ue({name:"foreign",pluginKey:void 0,label:"Foreign",getNewInput:()=>({label:"",type:"foreign",localRelationRef:"",labelExpression:"",valueExpression:"",defaultLabel:"",nullLabel:""}),Form:ze}),{createAdminCrudInputWebConfig:Ge}=await c("@baseplate-dev/project-builder-lib/web"),{InputFieldController:qe,SelectFieldController:Ye}=await c("@baseplate-dev/ui-components");function Je({formProps:o,name:t,model:i}){const n=i.model.fields.map(a=>({label:a.name,value:a.id})),l=t,s=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(Ye,{label:"Field",control:s,name:`${l}.modelFieldRef`,options:n}),e.jsx(qe,{label:"Validation (zod), e.g. z.string().min(1) (optional)",control:s,name:`${l}.validation`})]})}const Qe=Ge({name:"text",pluginKey:void 0,label:"Text",getNewInput:()=>({label:"",type:"text",modelFieldRef:""}),Form:Je}),oe=[Ne,Pe,ke,He,Qe],{createAdminCrudInputSchema:Xe,ModelUtils:Ze}=await c("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:et,useDefinitionSchema:tt,useProjectDefinition:nt}=await c("@baseplate-dev/project-builder-lib/web"),{Button:le,Dialog:it,DialogContent:ot,DialogDescription:lt,DialogFooter:st,DialogHeader:at,DialogTitle:rt,InputFieldController:ct,SelectFieldController:dt}=await c("@baseplate-dev/ui-components"),{useEffect:mt,useId:ut}=await c("react");function pt({open:o,onOpenChange:t,field:i,modelRef:n,embeddedFormOptions:l,isNew:s=!1,onSave:a}){const{definition:u,pluginContainer:d}=nt(),p=tt(Xe),b=n?Ze.byIdOrThrow(u,n):void 0,j=d.getPluginSpec(et),h=j.getInputWebConfigs(oe).map(C=>({label:C.label,value:C.name})),f=V({resolver:N(p),values:i??{type:"text",label:""}}),{control:x,handleSubmit:F,formState:{isDirty:w},reset:g}=f;mt(()=>{o&&!i&&g({type:"text",label:""})},[o,i,g]);const v=I({control:x,name:"type"}),y=v?j.getInputWebConfig(v,oe):void 0,D=y?.Form,m=F(C=>{a(C),t(!1)}),r=ut();return e.jsx(it,{open:o,onOpenChange:t,children:e.jsx(ot,{className:"sm:max-w-[500px]",children:e.jsxs("form",{id:r,onSubmit:C=>(C.stopPropagation(),m(C)),children:[e.jsxs(at,{children:[e.jsx(rt,{children:s?"Add Field":"Edit Field"}),e.jsx(lt,{children:s?"Configure the new form field settings.":"Update the field settings below."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(dt,{label:"Type",control:x,options:h,name:"type"}),e.jsx(ct,{label:"Label",control:x,name:"label",placeholder:"Enter field label"}),D&&b&&e.jsx(D,{formProps:f,name:"",model:b,embeddedFormOptions:l,pluginKey:y.pluginKey})]}),e.jsxs(st,{children:[e.jsx(le,{type:"button",variant:"outline",onClick:()=>{t(!1)},children:"Cancel"}),e.jsxs(le,{form:r,type:"submit",disabled:!w,children:[s?"Add":"Update"," Field"]})]})]})})})}const{Button:O,RecordView:ft,RecordViewActions:bt,RecordViewItem:se,RecordViewItemList:ht,useConfirmDialog:xt}=await c("@baseplate-dev/ui-components"),{useState:k}=await c("react");function ge({className:o,formProps:t,embeddedFormOptions:i}){const{control:n}=t,{requestConfirm:l}=xt(),{fields:s,append:a,remove:u,update:d,move:p}=Y({control:n,name:"form.fields"}),[b,j]=k(void 0),[h,f]=k(!1),[x,F]=k(!1),w=I({control:n,name:"form.fields"});function g(r){const C=w[r];l({title:"Delete Field",content:`Are you sure you want to delete the field "${C.label||"Untitled"}"?`,onConfirm:()=>{u(r)}})}function v(r){j(w[r]),f(!0)}function y(){j(void 0),F(!0)}function D(r){if(b){const C=w.findIndex(we=>we.id===b.id);C!==-1&&d(C,r)}else a(r)}const m=s.map((r,C)=>({id:r.id,element:e.jsxs(ft,{children:[e.jsxs(ht,{children:[e.jsx(se,{title:"Label",children:e.jsx("div",{className:"flex items-center gap-2",children:r.label})}),e.jsx(se,{title:"Type",children:r.type})]}),e.jsxs(bt,{children:[e.jsx(O,{variant:"ghost",size:"icon",title:"Edit","aria-label":"Edit field",onClick:()=>{v(C)},children:e.jsx(J,{})}),e.jsx(O,{variant:"ghostDestructive",size:"icon",title:"Delete","aria-label":"Delete field",onClick:()=>{g(C)},children:e.jsx(Q,{})})]})]},r.id)}));return e.jsxs("div",{className:X("space-y-4",o),children:[s.length===0?e.jsx("p",{className:"pt-4 text-style-muted",children:"No fields configured. Add fields to create your form."}):e.jsx("div",{className:"flex w-full flex-col gap-2",children:e.jsx(q,{listItems:m,sortItems:p})}),e.jsx(pt,{open:h||x,onOpenChange:r=>{r||(f(!1),F(!1),j(void 0))},field:b,modelRef:I({control:n,name:"modelRef"})||"",embeddedFormOptions:i,isNew:x,onSave:D}),e.jsxs(O,{variant:"secondary",size:"sm",onClick:y,children:[e.jsx(Z,{}),"Add Field"]})]})}const{useMemo:jt}=await c("react");function Ct(o){const t=Y(o);return{fields:jt(()=>o.getTransformer?t.fields.map(o.getTransformer):t.fields,[t.fields,o.getTransformer]),move:t.move,remove:t.remove,swap:t.swap,prepend:(n,l)=>{if(!o.setTransformer)return t.prepend(n,l);const s=Array.isArray(n)?n.map(o.setTransformer):o.setTransformer(n);t.prepend(s,l)},append:(n,l)=>{if(!o.setTransformer)return t.append(n,l);const s=Array.isArray(n)?n.map(o.setTransformer):o.setTransformer(n);t.append(s,l)},insert:(n,l,s)=>{if(!o.setTransformer)return t.insert(n,l,s);const a=Array.isArray(l)?l.map(o.setTransformer):o.setTransformer(l);t.insert(n,a,s)},update:(n,l)=>{if(!o.setTransformer)return t.update(n,l);const s=o.setTransformer(l);t.update(n,s)},replace:n=>{if(!o.setTransformer)return t.replace(n);const l=o.setTransformer(n);t.replace(l)}}}const{adminCrudColumnEntityType:gt}=await c("@baseplate-dev/project-builder-lib"),{createAdminCrudColumnWebConfig:vt,useProjectDefinition:yt}=await c("@baseplate-dev/project-builder-lib/web"),{InputFieldController:ae,SelectFieldController:wt}=await c("@baseplate-dev/ui-components");function Ft({formProps:o,model:t}){const{control:i}=o,{definitionContainer:n}=yt(),l=t.model.relations?.map(s=>({label:`${s.name} (${n.nameFromId(s.modelRef)})`,value:s.id}))??[];return e.jsxs(e.Fragment,{children:[e.jsx(wt,{label:"Local Relation",control:i,name:"localRelationRef",options:l,placeholder:"Select a relation"}),e.jsx(ae,{label:"Label Expression",control:i,name:"labelExpression",placeholder:"e.g. name",description:"Field to display from the related model"}),e.jsx(ae,{label:"Value Expression",control:i,name:"valueExpression",placeholder:"e.g. id",description:"Field to use for matching the relation"})]})}const Dt=vt({name:"foreign",pluginKey:void 0,label:"Foreign Column",isAvailableForModel:(o,t)=>(o.models.find(n=>n.id===t)?.model.relations?.length??0)>0,Form:Ft,getNewColumn:()=>({id:gt.generateNewId(),type:"foreign",label:"",localRelationRef:"",labelExpression:"",valueExpression:""})}),{adminCrudColumnEntityType:It}=await c("@baseplate-dev/project-builder-lib"),{createAdminCrudColumnWebConfig:St}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:At}=await c("@baseplate-dev/ui-components");function $t({formProps:o,model:t}){const{control:i}=o,n=t.model.fields.map(l=>({label:l.name,value:l.id}));return e.jsx(At,{label:"Field",control:i,name:"modelFieldRef",options:n,placeholder:"Select a field"})}const Tt=St({name:"text",pluginKey:void 0,label:"Text Column",Form:$t,isAvailableForModel:()=>!0,getNewColumn:()=>({id:It.generateNewId(),type:"text",label:"",modelFieldRef:""})}),re=[Dt,Tt],{createAdminCrudColumnSchema:Et,ModelUtils:Rt}=await c("@baseplate-dev/project-builder-lib"),{adminCrudColumnWebSpec:Nt,useDefinitionSchema:Lt,useProjectDefinition:_t}=await c("@baseplate-dev/project-builder-lib/web"),{Button:ce,Dialog:Wt,DialogContent:Pt,DialogDescription:Vt,DialogFooter:Mt,DialogHeader:Ot,DialogTitle:kt,InputFieldController:Ut,SelectFieldController:Bt}=await c("@baseplate-dev/ui-components"),{useEffect:Kt,useId:zt}=await c("react");function Ht({open:o,onOpenChange:t,column:i,modelRef:n,isNew:l=!1,onSave:s}){const{definition:a,pluginContainer:u}=_t(),d=Lt(Et),p=n?Rt.byIdOrThrow(a,n):void 0,b=u.getPluginSpec(Nt),j=b.getColumnWebConfigs(re).filter(r=>n&&r.isAvailableForModel(a,n)).map(r=>({label:r.label,value:r.name})),h=V({resolver:N(d),values:i??{type:"text",label:""}}),{control:f,handleSubmit:x,formState:{isDirty:F},reset:w}=h;Kt(()=>{o&&!i&&w({type:"text",label:""})},[o,i,w]);const g=I({control:f,name:"type"}),v=g?b.getColumnWebConfig(g,re):void 0,y=v?.Form,D=x(r=>{s(r),t(!1)}),m=zt();return e.jsx(Wt,{open:o,onOpenChange:t,children:e.jsx(Pt,{className:"sm:max-w-[425px]",children:e.jsxs("form",{id:m,onSubmit:r=>(r.stopPropagation(),D(r)),children:[e.jsxs(Ot,{children:[e.jsx(kt,{children:l?"Add Column":"Edit Column"}),e.jsx(Vt,{children:l?"Configure the new table column settings.":"Update the column settings below."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(Bt,{label:"Type",control:f,options:j,name:"type"}),e.jsx(Ut,{label:"Label",control:f,name:"label",placeholder:"Enter column label"}),y&&p&&e.jsx(y,{formProps:h,model:p,pluginKey:v.pluginKey})]}),e.jsxs(Mt,{children:[e.jsx(ce,{type:"button",variant:"outline",onClick:()=>{t(!1)},children:"Cancel"}),e.jsxs(ce,{form:m,type:"submit",disabled:!F,children:[l?"Add":"Update"," Column"]})]})]})})})}const{Button:U,RecordView:Gt,RecordViewActions:qt,RecordViewItem:de,RecordViewItemList:Yt,useConfirmDialog:Jt}=await c("@baseplate-dev/ui-components"),{useState:B}=await c("react");function ve({className:o,lens:t,modelRef:i}){const{requestConfirm:n}=Jt(),{fields:l,append:s,remove:a,update:u,move:d}=Ct(t.interop()),[p,b]=B(void 0),[j,h]=B(!1),[f,x]=B(!1);function F(m){const r=l[m];n({title:"Delete Column",content:`Are you sure you want to delete the column "${r.label||"Untitled"}"?`,onConfirm:()=>{a(m)}})}const w=I(t.interop());function g(m){b(w[m]),h(!0)}function v(){b(void 0),x(!0)}function y(m){if(p){const r=w.findIndex(C=>C.id===p.id);r!==-1&&u(r,m)}else s(m)}const D=l.map((m,r)=>({id:m.id,element:e.jsxs(Gt,{children:[e.jsxs(Yt,{children:[e.jsx(de,{title:"Label",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{children:m.label||e.jsx("span",{className:"text-muted-foreground",children:"Untitled Column"})})})}),e.jsx(de,{title:"Type",children:m.type})]}),e.jsxs(qt,{children:[e.jsx(U,{variant:"ghost",size:"icon",title:"Edit","aria-label":"Edit column",onClick:()=>{g(r)},children:e.jsx(J,{})}),e.jsx(U,{variant:"ghostDestructive",size:"icon",title:"Delete","aria-label":"Delete column",onClick:()=>{F(r)},children:e.jsx(Q,{})})]})]},m.id)}));return e.jsxs("div",{className:X("space-y-4",o),children:[l.length===0?e.jsx("p",{className:"pt-4 text-style-muted",children:"No columns configured. Add columns to display data in your table."}):e.jsx("div",{className:"flex w-full flex-col gap-2",children:e.jsx(q,{listItems:D,sortItems:d})}),e.jsx(Ht,{open:j||f,onOpenChange:m=>{m||(h(!1),x(!1),b(void 0))},column:p,modelRef:i,isNew:f,onSave:y}),e.jsxs(U,{variant:"secondary",size:"sm",onClick:v,children:[e.jsx(Z,{}),"Add Column"]})]})}const{createAdminCrudEmbeddedFormSchema:Qt}=await c("@baseplate-dev/project-builder-lib"),{useDefinitionSchema:Xt,useProjectDefinition:ye}=await c("@baseplate-dev/project-builder-lib/web"),{Button:G,CheckboxFieldController:Zt,InputFieldController:en,SelectFieldController:me,Table:tn,TableBody:nn,TableCell:W,TableHead:P,TableHeader:on,TableRow:ue,toast:ln}=await c("@baseplate-dev/ui-components"),{useId:sn}=await c("react");function an({items:o,edit:t,remove:i}){const{definitionContainer:n}=ye();return e.jsxs(tn,{className:"max-w-6xl",children:[e.jsx(on,{children:e.jsxs(ue,{children:[e.jsx(P,{children:"Form Name"}),e.jsx(P,{children:"Model Name"}),e.jsx(P,{children:"Type"}),e.jsx(P,{children:"Actions"})]})}),e.jsx(nn,{children:o.map((l,s)=>e.jsxs(ue,{children:[e.jsx(W,{children:l.name}),e.jsx(W,{children:n.nameFromId(l.modelRef)}),e.jsx(W,{children:l.type}),e.jsxs(W,{className:"space-x-4",children:[e.jsx(G,{variant:"link",size:"none",onClick:()=>{t(s)},children:"Edit"}),e.jsx(G,{variant:"linkDestructive",size:"none",onClick:()=>{i(s)},children:"Remove"})]})]},l.id))})]})}const rn=[{label:"Object",value:"object"},{label:"List",value:"list"}];function cn({initialData:o,onSubmit:t,embeddedFormOptions:i}){const{definition:n}=ye(),l=Xt(Qt),s=V({resolver:N(l),defaultValues:o}),{handleSubmit:a,control:u,watch:d}=s,p=n.models.map(x=>({label:x.name,value:x.id})),b=d("type"),j=d("modelRef"),h=Ce({control:u}),f=sn();return e.jsxs("form",{onSubmit:x=>{x.stopPropagation(),a(t)(x).catch(F=>{ln.error(je(F))})},id:f,className:"space-y-4",children:[e.jsx(en,{label:"Name",control:u,name:"name"}),e.jsx(me,{label:"Type",control:u,name:"type",options:rn}),e.jsx(Zt,{label:"Include ID Field? (useful for list types)",control:u,name:"includeIdField"}),e.jsx(me,{label:"Model",control:u,options:p,name:"modelRef"}),b==="list"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Table"}),e.jsx(ve,{lens:h.focus("table.columns"),modelRef:j})]}),e.jsx("h2",{children:"Form"}),e.jsx(ge,{formProps:s,embeddedFormOptions:i}),e.jsx(G,{type:"submit",form:f,children:"Save"})]})}const{createAdminCrudActionWebConfig:dn}=await c("@baseplate-dev/project-builder-lib/web"),mn=dn({name:"delete",pluginKey:void 0,label:"Delete",isAvailableForModel:()=>!0,getNewAction:()=>({type:"delete",position:"dropdown"})}),{createAdminCrudActionWebConfig:un}=await c("@baseplate-dev/project-builder-lib/web"),pn=un({name:"edit",pluginKey:void 0,label:"Edit",isAvailableForModel:()=>!0,getNewAction:()=>({type:"edit",position:"inline"})}),pe=[pn,mn],{createAdminCrudActionSchema:fn,ModelUtils:bn}=await c("@baseplate-dev/project-builder-lib"),{adminCrudActionWebSpec:hn,useDefinitionSchema:xn,useProjectDefinition:jn}=await c("@baseplate-dev/project-builder-lib/web"),{Button:fe,Dialog:Cn,DialogContent:gn,DialogDescription:vn,DialogFooter:yn,DialogHeader:wn,DialogTitle:Fn,SelectFieldController:be}=await c("@baseplate-dev/ui-components"),{useEffect:Dn,useId:In}=await c("react");function Sn({open:o,onOpenChange:t,action:i,modelRef:n,isNew:l=!1,onSave:s}){const{definition:a,pluginContainer:u}=jn(),d=xn(fn),p=n?bn.byIdOrThrow(a,n):void 0,b=u.getPluginSpec(hn),j=b.getActionWebConfigs(pe).filter(r=>n&&r.isAvailableForModel(a,n)).map(r=>({label:r.label,value:r.name})),h=V({resolver:N(d),values:i??{type:"edit",position:"inline"}}),{control:f,handleSubmit:x,formState:{isDirty:F},reset:w}=h;Dn(()=>{o&&!i&&w({type:"edit",position:"inline"})},[o,i,w]);const g=I({control:f,name:"type"}),v=g?b.getActionWebConfig(g,pe):void 0,y=v?.Form,D=x(r=>{s(r),t(!1)}),m=In();return e.jsx(Cn,{open:o,onOpenChange:t,children:e.jsx(gn,{className:"sm:max-w-[500px]",children:e.jsxs("form",{id:m,onSubmit:r=>(r.stopPropagation(),D(r)),children:[e.jsxs(wn,{children:[e.jsx(Fn,{children:l?"Add Action":"Edit Action"}),e.jsx(vn,{children:l?"Configure the new table action settings.":"Update the action settings below."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(be,{label:"Type",control:f,options:j,name:"type"}),e.jsx(be,{label:"Position",control:f,options:[{label:"Inline",value:"inline"},{label:"Dropdown",value:"dropdown"}],name:"position"}),y&&p&&e.jsx(y,{formProps:h,model:p,pluginKey:v.pluginKey})]}),e.jsxs(yn,{children:[e.jsx(fe,{type:"button",variant:"outline",onClick:()=>{t(!1)},children:"Cancel"}),e.jsxs(fe,{form:m,type:"submit",disabled:!F,children:[l?"Add":"Update"," Action"]})]})]})})})}const{Button:K,RecordView:An,RecordViewActions:$n,RecordViewItem:he,RecordViewItemList:Tn,useConfirmDialog:En}=await c("@baseplate-dev/ui-components"),{useState:z}=await c("react");function Rn({className:o,control:t,modelRef:i}){const{requestConfirm:n}=En(),{fields:l,append:s,remove:a,update:u,move:d}=Y({control:t,name:"table.actions"}),[p,b]=z(void 0),[j,h]=z(!1),[f,x]=z(!1);function F(m){const r=l[m];n({title:"Delete Action",content:`Are you sure you want to delete the "${r.type}" action?`,onConfirm:()=>{a(m)}})}const w=I({control:t,name:"table.actions"});function g(m){b(w?.[m]),h(!0)}function v(){b(void 0),x(!0)}function y(m){if(p){const r=(w??[]).findIndex(C=>C.id===p.id);r!==-1&&u(r,m)}else s(m)}const D=l.map((m,r)=>({id:m.id,element:e.jsxs(An,{children:[e.jsxs(Tn,{children:[e.jsx(he,{title:"Type",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"capitalize",children:m.type})})}),e.jsx(he,{title:"Position",children:m.position})]}),e.jsxs($n,{children:[e.jsx(K,{variant:"ghost",size:"icon",title:"Edit","aria-label":"Edit action",onClick:()=>{g(r)},children:e.jsx(J,{})}),e.jsx(K,{variant:"ghostDestructive",size:"icon",title:"Delete","aria-label":"Delete action",onClick:()=>{F(r)},children:e.jsx(Q,{})})]})]},m.id)}));return e.jsxs("div",{className:X("space-y-4",o),children:[l.length===0?e.jsx("p",{className:"pt-4 text-style-muted",children:"No actions configured. Add actions to enable row operations."}):e.jsx("div",{className:"flex w-full flex-col gap-2",children:e.jsx(q,{listItems:D,sortItems:d})}),e.jsx(Sn,{open:j||f,onOpenChange:m=>{m||(h(!1),x(!1),b(void 0))},action:p,modelRef:i??"",isNew:f,onSave:y}),e.jsxs(K,{variant:"secondary",size:"sm",onClick:v,children:[e.jsx(Z,{}),"Add Action"]})]})}const{useProjectDefinition:Nn}=await c("@baseplate-dev/project-builder-lib/web"),{CheckboxFieldController:Ln,ComboboxFieldController:xe,SectionListSection:A,SectionListSectionContent:$,SectionListSectionDescription:T,SectionListSectionHeader:E,SectionListSectionTitle:R}=await c("@baseplate-dev/ui-components");function _n({formProps:o}){const{control:t}=o,{definition:i}=Nn(),n=Ce({control:t}),l=i.models.map(d=>({label:d.name,value:d.id})),s=I({control:t,name:"modelRef"}),a=i.models.find(d=>d.id===s)?.model.fields.map(d=>({label:d.name,value:d.id}))??[],u=I({control:t,name:"embeddedForms"})?.map(d=>({label:d.name,value:d.id}))??[];return e.jsxs(e.Fragment,{children:[e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Model Configuration"}),e.jsx(T,{children:"Configure the data model and basic settings for this CRUD section."})]}),e.jsxs($,{className:"space-y-6",children:[e.jsx(xe,{label:"Model",control:t,options:l,name:"modelRef"}),e.jsx(xe,{label:"Name Field",control:t,options:a,description:"The field to use as the name of the record (used in breadcrumbs/title of edit page)",name:"nameFieldRef"}),e.jsx(Ln,{label:"Disable Create?",control:t,name:"disableCreate"})]})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Table Configuration"}),e.jsx(T,{children:"Configure which columns to display in the data table."})]}),e.jsx($,{children:e.jsx(ve,{lens:n.focus("table.columns"),modelRef:s})})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Table Actions"}),e.jsx(T,{children:"Configure actions available for each row in the table. Drag to reorder."})]}),e.jsx($,{children:e.jsx(Rn,{control:t,modelRef:s})})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Form Configuration"}),e.jsx(T,{children:"Configure the form fields for creating and editing records."})]}),e.jsx($,{children:e.jsx(ge,{formProps:o,embeddedFormOptions:u})})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Embedded Forms"}),e.jsx(T,{children:"Configure embedded forms for related data objects."})]}),e.jsx($,{children:e.jsx(Fe.LabelledController,{control:t,name:"embeddedForms",renderForm:d=>e.jsx(cn,{...d,embeddedFormOptions:u}),renderTable:d=>e.jsx(an,{...d}),defaultValue:{type:"object"}})})]})]})}const{AsyncComboboxField:Wn,useControllerMerged:Pn}=await c("@baseplate-dev/ui-components");async function Vn(){const o=await L(()=>import("./index-DEKFCy0H.js").then(s=>s.A),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),t=await L(()=>import("./index-BPClqgn_.js"),__vite__mapDeps([11,6,1])),i=await L(()=>import("./index-tflukq04.js").then(s=>s.R),__vite__mapDeps([6,1])),n=await L(()=>import("./index-tHURiz2C.js"),__vite__mapDeps([12,6,1]));return[o,t,i,n].map(s=>Object.entries(s).filter(([,a])=>typeof a=="function").map(([a,u])=>({label:a,value:a,icon:u}))).flat()}function Mn({...o}){return e.jsx(Wn,{placeholder:"Select an icon",...o,loadOptions:t=>Vn().then(i=>i.filter(n=>!t||n.label.toLowerCase().includes(t.toLowerCase())).sort((n,l)=>n.label.localeCompare(l.label)).slice(0,20)),renderItemLabel:t=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:"size-4"}),t.label]})})}function On({name:o,control:t,...i}){const{field:n,fieldState:{error:l}}=Pn({name:o,control:t},i),s=i;return e.jsx(Mn,{error:l?.message,...s,...n,value:n.value??null})}const{adminSectionEntityType:kn,createWebAdminSectionSchema:Un}=await c("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:Bn,useProjectDefinition:Kn,useResettableForm:zn}=await c("@baseplate-dev/project-builder-lib/web"),{Button:H,ComboboxFieldController:Hn,Dialog:Gn,DialogClose:qn,DialogContent:Yn,DialogDescription:Jn,DialogFooter:Qn,DialogHeader:Xn,DialogTitle:Zn,DialogTrigger:ei,FormActionBar:ti,InputFieldController:ni,SectionList:ii,SectionListSection:oi,SectionListSectionContent:li,SectionListSectionDescription:si,SectionListSectionHeader:ai,SectionListSectionTitle:ri}=await c("@baseplate-dev/ui-components"),{useNavigate:ci}=await c("@tanstack/react-router"),hi=function(){const{app:t,section:i}=M.useLoaderData(),{appKey:n,sectionKey:l}=M.useParams(),s=ci({from:M.fullPath}),{definition:a,saveDefinitionWithFeedback:u,isSavingDefinition:d}=Kn(),p=De(Un),b=a.features.map(g=>({label:g.name,value:g.id})),j=zn({resolver:N(p),values:i,defaultValues:{type:"crud"}}),{control:h,handleSubmit:f,reset:x}=j,F=f(g=>{const{id:v,...y}=g;return u(D=>{const m=D.apps.find(C=>C.id===t.id);if(m?.type!=="web"||!m.adminApp)return;const r=m.adminApp.sections?.findIndex(C=>C.id===kn.idFromKey(l));r!==void 0&&r>=0&&m.adminApp.sections&&(m.adminApp.sections[r]={...y,id:i.id})})}),w=()=>{u(g=>{const v=g.apps.find(y=>y.id===t.id);v?.type!=="web"||!v.adminApp||(v.adminApp.sections=v.adminApp.sections?.filter(y=>y.id!==i.id))},{successMessage:`Successfully deleted section "${i.name}"!`,onSuccess:()=>{s({to:"/admin-sections/$appKey",params:{appKey:n}}).catch(je)}})};return Bn({control:h,reset:x,onSubmit:F}),e.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"max-w-7xl space-y-4 border-b p-4",children:e.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[e.jsxs("div",{children:[e.jsx("h2",{children:i.name}),e.jsxs("p",{className:"text-base text-muted-foreground",children:[i.type," section"]})]}),e.jsxs(Gn,{children:[e.jsx(ei,{asChild:!0,children:e.jsx(H,{variant:"secondary",children:"Delete"})}),e.jsxs(Yn,{children:[e.jsxs(Xn,{children:[e.jsxs(Zn,{children:["Delete ",i.name]}),e.jsxs(Jn,{className:"sr-only",children:["Are you sure you want to delete"," ",e.jsx("strong",{children:i.name}),"?"]})]}),e.jsxs("p",{children:["Are you sure you want to delete ",e.jsx("strong",{children:i.name}),"?"]}),e.jsx("p",{className:"text-style-muted",children:"This action will permanently remove the admin section from your application. This cannot be undone."}),e.jsxs(Qn,{children:[e.jsx(qn,{asChild:!0,children:e.jsx(H,{variant:"secondary",children:"Cancel"})}),e.jsx(H,{variant:"destructive",onClick:w,disabled:d,children:"Delete Section"})]})]})]})]})}),e.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:e.jsxs("form",{onSubmit:F,className:"w-full max-w-7xl space-y-4 p-4",children:[e.jsxs(ii,{children:[e.jsxs(oi,{children:[e.jsxs(ai,{children:[e.jsx(ri,{children:"General"}),e.jsx(si,{children:"Basic configuration for your admin section."})]}),e.jsxs(li,{className:"space-y-6",children:[e.jsx(ni,{label:"Name",control:h,name:"name",autoComplete:"off"}),e.jsx(Hn,{label:"Feature",control:h,options:b,name:"featureRef"}),e.jsx(On,{label:"Icon",control:h,name:"icon",description:"Choose an icon to represent this section"})]})]}),e.jsx(_n,{formProps:j})]}),e.jsx(ti,{form:j})]})})]},i.id)};export{hi as component};
|
|
3
|
-
//# sourceMappingURL=edit._sectionKey-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cd_baD6T.js","assets/_virtual___federation_fn_import-D3sI42Ph.js","assets/jsx-runtime-D_zvdyIk.js","assets/index-c0qeY2gs.js","assets/index-DqHVrEeL.js","assets/_commonjsHelpers-CqkleIqs.js","assets/index-tflukq04.js","assets/index.esm-CdP29Ssb.js","assets/sortBy-C9bvycg5.js","assets/immer-B7fdkLVi.js","assets/index-Dqph-b0R.css","assets/index-BPClqgn_.js","assets/index-tHURiz2C.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as c}from"./_virtual___federation_fn_import-D3sI42Ph.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{s as N,S as q,l as je,h as Fe,_ as L,i as M}from"./index-Cd_baD6T.js";import{u as De}from"./use-definition-schema-BuO4pbji.js";import{g as ee,s as te,b as V,e as I,f as Y}from"./index.esm-CdP29Ssb.js";import{H as J,L as Q,c as X,A as Z}from"./index-tflukq04.js";var Ie=class S{constructor(t,i,n){this.control=t,this.path=i,this.cache=n}static create(t,i){return new S(t,"",i)}focus(t){var i,n,l,s,a,u;const d=t.toString(),p=this.path?`${this.path}.${d}`:d,b=(i=this.cache)==null?void 0:i.get(p,this.reflectedKey);if(b)return b;if(Array.isArray(this.override)){const[h]=this.override,f=new S(this.control,p,this.cache);return f.isArrayItemReflection=!0,f.override=h,(n=this.cache)==null||n.set(f,p),f}else if(this.override){const h=ee(this.override,d);if(!h){const f=new S(this.control,p,this.cache);return(l=this.cache)==null||l.set(f,p),f}if(this.isArrayItemReflection){const f=`${this.path}.${h.path}`,x=new S(this.control,f,this.cache);return(s=this.cache)==null||s.set(x,f),x}else return(a=this.cache)==null||a.set(h,p),h}const j=new S(this.control,p,this.cache);return(u=this.cache)==null||u.set(j,p),j}reflect(t){var i,n,l;const s=(i=this.cache)==null?void 0:i.get(this.path,t);if(s)return s;const a=new S(this.control,this.path,this.cache),u=new Proxy({},{get:(p,b)=>typeof b=="string"?a.focus(b):p}),d=t(u,a);if(Array.isArray(d)){const p=new S(this.control,this.path,this.cache);return a.path="",p.override=t(u,a),p.reflectedKey=t,(n=this.cache)==null||n.set(p,this.path,t),p}else return a.override=d,a.path=this.path,a.reflectedKey=t,(l=this.cache)==null||l.set(a,this.path,t),a}map(t,i){return t.map((n,l,s)=>{const a=this.focus(l.toString());return i(n,a,l,s,this)})}interop(t){var i;return t?t(this.control,this.path):((i=this.interopCache)!=null||(this.interopCache={control:this.control,name:this.path||void 0,...this.override?{getTransformer:this.getTransformer.bind(this),setTransformer:this.setTransformer.bind(this)}:{}}),this.interopCache)}narrow(){return this}assert(){return this}defined(){return this}cast(){return this}getTransformer(t){const[i]=Array.isArray(this.override)?this.override:[this.override];if(!t||!i)return t;const n={};return Object.entries(i).forEach(([l,s])=>{const a=s;if(!a)return;const u=ee(t,a.path);te(n,l,u)}),n}setTransformer(t){const[i]=Array.isArray(this.override)?this.override:[this.override];if(!t||!i)return t;const n={};return Object.entries(t).forEach(([l,s])=>{const a=i[l];a&&te(n,a.path,s)}),n}},Se=class{constructor(o){this.cache=new Map,o._subscribe({formState:{values:!0},exact:!0,callback:()=>{o._names.unMount.forEach(t=>{this.delete(t)})}})}get(o,t){const i=this.cache.get(o);if(i)return t?i.complex.get(t):i.plain}set(o,t,i){let n=this.cache.get(t);n||(n={complex:new WeakMap},this.cache.set(t,n)),i?n.complex.set(i,o):n.plain=o}has(o,t){var i,n;return t?(n=(i=this.cache.get(o))==null?void 0:i.complex.has(t))!=null?n:!1:this.cache.has(o)}delete(o){for(const t of this.cache.keys())t.startsWith(o)&&this.cache.delete(t)}clear(){this.cache.clear()}};const{useMemo:Ae}=await c("react");function Ce(o,t=[]){return Ae(()=>{const i=new Se(o.control);return Ie.create(o.control,i)},[o.control,...t])}const{ModelUtils:$e}=await c("@baseplate-dev/project-builder-lib"),{createAdminCrudInputWebConfig:Te,useProjectDefinition:Ee}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ne}=await c("@baseplate-dev/ui-components");function Re({formProps:o,name:t,model:i,embeddedFormOptions:n}){const{definition:l}=Ee(),s=$e.getRelationsToModel(l,i.id).map(d=>({label:`${d.relation.foreignRelationName} (${d.model.name})`,value:d.relation.foreignId})),a=t,u=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(ne,{label:"Relation Name",control:u,name:`${a}.modelRelationRef`,options:s}),e.jsx(ne,{label:"Embedded Form",control:u,name:`${a}.embeddedFormRef`,options:n})]})}const Ne=Te({name:"embedded",pluginKey:void 0,label:"Embedded",getNewInput:()=>({label:"",type:"embedded",modelRelationRef:"",embeddedFormRef:""}),Form:Re}),{createAdminCrudInputWebConfig:Le,useProjectDefinition:_e}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ie}=await c("@baseplate-dev/ui-components");function We({formProps:o,name:t,model:i,embeddedFormOptions:n}){const{definitionContainer:l}=_e(),s=i.model.relations?.map(d=>({label:`${d.name} (${l.nameFromId(d.modelRef)})`,value:d.id}))??[],a=t,u=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Relation Name",control:u,name:`${a}.localRelationRef`,options:s}),e.jsx(ie,{label:"Embedded Form",control:u,name:`${a}.embeddedFormRef`,options:n})]})}const Pe=Le({name:"embeddedLocal",pluginKey:void 0,label:"Embedded Local",getNewInput:()=>({label:"",type:"embeddedLocal",embeddedFormRef:"",localRelationRef:""}),Form:We}),{createAdminCrudInputWebConfig:Ve}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:Me}=await c("@baseplate-dev/ui-components");function Oe({formProps:o,name:t,model:i}){const n=i.model.fields.filter(a=>a.type==="enum").map(a=>({label:a.name,value:a.id})),l=t,s=o.control;return e.jsx(Me,{label:"Enum Field",control:s,name:`${l}.modelFieldRef`,options:n})}const ke=Ve({name:"enum",pluginKey:void 0,label:"Enum",getNewInput:()=>({label:"",type:"enum",modelFieldRef:""}),Form:Oe}),{createAdminCrudInputWebConfig:Ue,useProjectDefinition:Be}=await c("@baseplate-dev/project-builder-lib/web"),{InputFieldController:_,SelectFieldController:Ke}=await c("@baseplate-dev/ui-components");function ze({formProps:o,name:t,model:i}){const{definitionContainer:n}=Be(),l=i.model.relations?.map(u=>({label:`${u.name} (${n.nameFromId(u.modelRef)})`,value:u.id}))??[],s=t,a=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(Ke,{label:"Local Relation Name",control:a,name:`${s}.localRelationRef`,options:l}),e.jsx(_,{label:"Label Expression (e.g. name)",control:a,name:`${s}.labelExpression`}),e.jsx(_,{label:"Value Expression (e.g. id)",control:a,name:`${s}.valueExpression`}),e.jsx(_,{label:"Default Label (optional)",control:a,name:`${s}.defaultLabel`}),e.jsx(_,{label:"Empty Label (optional) - only if field is nullable",control:a,name:`${s}.nullLabel`})]})}const He=Ue({name:"foreign",pluginKey:void 0,label:"Foreign",getNewInput:()=>({label:"",type:"foreign",localRelationRef:"",labelExpression:"",valueExpression:"",defaultLabel:"",nullLabel:""}),Form:ze}),{createAdminCrudInputWebConfig:Ge}=await c("@baseplate-dev/project-builder-lib/web"),{InputFieldController:qe,SelectFieldController:Ye}=await c("@baseplate-dev/ui-components");function Je({formProps:o,name:t,model:i}){const n=i.model.fields.map(a=>({label:a.name,value:a.id})),l=t,s=o.control;return e.jsxs(e.Fragment,{children:[e.jsx(Ye,{label:"Field",control:s,name:`${l}.modelFieldRef`,options:n}),e.jsx(qe,{label:"Validation (zod), e.g. z.string().min(1) (optional)",control:s,name:`${l}.validation`})]})}const Qe=Ge({name:"text",pluginKey:void 0,label:"Text",getNewInput:()=>({label:"",type:"text",modelFieldRef:""}),Form:Je}),oe=[Ne,Pe,ke,He,Qe],{createAdminCrudInputSchema:Xe,ModelUtils:Ze}=await c("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:et,useDefinitionSchema:tt,useProjectDefinition:nt}=await c("@baseplate-dev/project-builder-lib/web"),{Button:le,Dialog:it,DialogContent:ot,DialogDescription:lt,DialogFooter:st,DialogHeader:at,DialogTitle:rt,InputFieldController:ct,SelectFieldController:dt}=await c("@baseplate-dev/ui-components"),{useEffect:mt,useId:ut}=await c("react");function pt({open:o,onOpenChange:t,field:i,modelRef:n,embeddedFormOptions:l,isNew:s=!1,onSave:a}){const{definition:u,pluginContainer:d}=nt(),p=tt(Xe),b=n?Ze.byIdOrThrow(u,n):void 0,j=d.getPluginSpec(et),h=j.getInputWebConfigs(oe).map(C=>({label:C.label,value:C.name})),f=V({resolver:N(p),values:i??{type:"text",label:""}}),{control:x,handleSubmit:F,formState:{isDirty:w},reset:g}=f;mt(()=>{o&&!i&&g({type:"text",label:""})},[o,i,g]);const v=I({control:x,name:"type"}),y=v?j.getInputWebConfig(v,oe):void 0,D=y?.Form,m=F(C=>{a(C),t(!1)}),r=ut();return e.jsx(it,{open:o,onOpenChange:t,children:e.jsx(ot,{className:"sm:max-w-[500px]",children:e.jsxs("form",{id:r,onSubmit:C=>(C.stopPropagation(),m(C)),children:[e.jsxs(at,{children:[e.jsx(rt,{children:s?"Add Field":"Edit Field"}),e.jsx(lt,{children:s?"Configure the new form field settings.":"Update the field settings below."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(dt,{label:"Type",control:x,options:h,name:"type"}),e.jsx(ct,{label:"Label",control:x,name:"label",placeholder:"Enter field label"}),D&&b&&e.jsx(D,{formProps:f,name:"",model:b,embeddedFormOptions:l,pluginKey:y.pluginKey})]}),e.jsxs(st,{children:[e.jsx(le,{type:"button",variant:"outline",onClick:()=>{t(!1)},children:"Cancel"}),e.jsxs(le,{form:r,type:"submit",disabled:!w,children:[s?"Add":"Update"," Field"]})]})]})})})}const{Button:O,RecordView:ft,RecordViewActions:bt,RecordViewItem:se,RecordViewItemList:ht,useConfirmDialog:xt}=await c("@baseplate-dev/ui-components"),{useState:k}=await c("react");function ge({className:o,formProps:t,embeddedFormOptions:i}){const{control:n}=t,{requestConfirm:l}=xt(),{fields:s,append:a,remove:u,update:d,move:p}=Y({control:n,name:"form.fields"}),[b,j]=k(void 0),[h,f]=k(!1),[x,F]=k(!1),w=I({control:n,name:"form.fields"});function g(r){const C=w[r];l({title:"Delete Field",content:`Are you sure you want to delete the field "${C.label||"Untitled"}"?`,onConfirm:()=>{u(r)}})}function v(r){j(w[r]),f(!0)}function y(){j(void 0),F(!0)}function D(r){if(b){const C=w.findIndex(we=>we.id===b.id);C!==-1&&d(C,r)}else a(r)}const m=s.map((r,C)=>({id:r.id,element:e.jsxs(ft,{children:[e.jsxs(ht,{children:[e.jsx(se,{title:"Label",children:e.jsx("div",{className:"flex items-center gap-2",children:r.label})}),e.jsx(se,{title:"Type",children:r.type})]}),e.jsxs(bt,{children:[e.jsx(O,{variant:"ghost",size:"icon",title:"Edit","aria-label":"Edit field",onClick:()=>{v(C)},children:e.jsx(J,{})}),e.jsx(O,{variant:"ghostDestructive",size:"icon",title:"Delete","aria-label":"Delete field",onClick:()=>{g(C)},children:e.jsx(Q,{})})]})]},r.id)}));return e.jsxs("div",{className:X("space-y-4",o),children:[s.length===0?e.jsx("p",{className:"pt-4 text-style-muted",children:"No fields configured. Add fields to create your form."}):e.jsx("div",{className:"flex w-full flex-col gap-2",children:e.jsx(q,{listItems:m,sortItems:p})}),e.jsx(pt,{open:h||x,onOpenChange:r=>{r||(f(!1),F(!1),j(void 0))},field:b,modelRef:I({control:n,name:"modelRef"})||"",embeddedFormOptions:i,isNew:x,onSave:D}),e.jsxs(O,{variant:"secondary",size:"sm",onClick:y,children:[e.jsx(Z,{}),"Add Field"]})]})}const{useMemo:jt}=await c("react");function Ct(o){const t=Y(o);return{fields:jt(()=>o.getTransformer?t.fields.map(o.getTransformer):t.fields,[t.fields,o.getTransformer]),move:t.move,remove:t.remove,swap:t.swap,prepend:(n,l)=>{if(!o.setTransformer)return t.prepend(n,l);const s=Array.isArray(n)?n.map(o.setTransformer):o.setTransformer(n);t.prepend(s,l)},append:(n,l)=>{if(!o.setTransformer)return t.append(n,l);const s=Array.isArray(n)?n.map(o.setTransformer):o.setTransformer(n);t.append(s,l)},insert:(n,l,s)=>{if(!o.setTransformer)return t.insert(n,l,s);const a=Array.isArray(l)?l.map(o.setTransformer):o.setTransformer(l);t.insert(n,a,s)},update:(n,l)=>{if(!o.setTransformer)return t.update(n,l);const s=o.setTransformer(l);t.update(n,s)},replace:n=>{if(!o.setTransformer)return t.replace(n);const l=o.setTransformer(n);t.replace(l)}}}const{adminCrudColumnEntityType:gt}=await c("@baseplate-dev/project-builder-lib"),{createAdminCrudColumnWebConfig:vt,useProjectDefinition:yt}=await c("@baseplate-dev/project-builder-lib/web"),{InputFieldController:ae,SelectFieldController:wt}=await c("@baseplate-dev/ui-components");function Ft({formProps:o,model:t}){const{control:i}=o,{definitionContainer:n}=yt(),l=t.model.relations?.map(s=>({label:`${s.name} (${n.nameFromId(s.modelRef)})`,value:s.id}))??[];return e.jsxs(e.Fragment,{children:[e.jsx(wt,{label:"Local Relation",control:i,name:"localRelationRef",options:l,placeholder:"Select a relation"}),e.jsx(ae,{label:"Label Expression",control:i,name:"labelExpression",placeholder:"e.g. name",description:"Field to display from the related model"}),e.jsx(ae,{label:"Value Expression",control:i,name:"valueExpression",placeholder:"e.g. id",description:"Field to use for matching the relation"})]})}const Dt=vt({name:"foreign",pluginKey:void 0,label:"Foreign Column",isAvailableForModel:(o,t)=>(o.models.find(n=>n.id===t)?.model.relations?.length??0)>0,Form:Ft,getNewColumn:()=>({id:gt.generateNewId(),type:"foreign",label:"",localRelationRef:"",labelExpression:"",valueExpression:""})}),{adminCrudColumnEntityType:It}=await c("@baseplate-dev/project-builder-lib"),{createAdminCrudColumnWebConfig:St}=await c("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:At}=await c("@baseplate-dev/ui-components");function $t({formProps:o,model:t}){const{control:i}=o,n=t.model.fields.map(l=>({label:l.name,value:l.id}));return e.jsx(At,{label:"Field",control:i,name:"modelFieldRef",options:n,placeholder:"Select a field"})}const Tt=St({name:"text",pluginKey:void 0,label:"Text Column",Form:$t,isAvailableForModel:()=>!0,getNewColumn:()=>({id:It.generateNewId(),type:"text",label:"",modelFieldRef:""})}),re=[Dt,Tt],{createAdminCrudColumnSchema:Et,ModelUtils:Rt}=await c("@baseplate-dev/project-builder-lib"),{adminCrudColumnWebSpec:Nt,useDefinitionSchema:Lt,useProjectDefinition:_t}=await c("@baseplate-dev/project-builder-lib/web"),{Button:ce,Dialog:Wt,DialogContent:Pt,DialogDescription:Vt,DialogFooter:Mt,DialogHeader:Ot,DialogTitle:kt,InputFieldController:Ut,SelectFieldController:Bt}=await c("@baseplate-dev/ui-components"),{useEffect:Kt,useId:zt}=await c("react");function Ht({open:o,onOpenChange:t,column:i,modelRef:n,isNew:l=!1,onSave:s}){const{definition:a,pluginContainer:u}=_t(),d=Lt(Et),p=n?Rt.byIdOrThrow(a,n):void 0,b=u.getPluginSpec(Nt),j=b.getColumnWebConfigs(re).filter(r=>n&&r.isAvailableForModel(a,n)).map(r=>({label:r.label,value:r.name})),h=V({resolver:N(d),values:i??{type:"text",label:""}}),{control:f,handleSubmit:x,formState:{isDirty:F},reset:w}=h;Kt(()=>{o&&!i&&w({type:"text",label:""})},[o,i,w]);const g=I({control:f,name:"type"}),v=g?b.getColumnWebConfig(g,re):void 0,y=v?.Form,D=x(r=>{s(r),t(!1)}),m=zt();return e.jsx(Wt,{open:o,onOpenChange:t,children:e.jsx(Pt,{className:"sm:max-w-[425px]",children:e.jsxs("form",{id:m,onSubmit:r=>(r.stopPropagation(),D(r)),children:[e.jsxs(Ot,{children:[e.jsx(kt,{children:l?"Add Column":"Edit Column"}),e.jsx(Vt,{children:l?"Configure the new table column settings.":"Update the column settings below."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(Bt,{label:"Type",control:f,options:j,name:"type"}),e.jsx(Ut,{label:"Label",control:f,name:"label",placeholder:"Enter column label"}),y&&p&&e.jsx(y,{formProps:h,model:p,pluginKey:v.pluginKey})]}),e.jsxs(Mt,{children:[e.jsx(ce,{type:"button",variant:"outline",onClick:()=>{t(!1)},children:"Cancel"}),e.jsxs(ce,{form:m,type:"submit",disabled:!F,children:[l?"Add":"Update"," Column"]})]})]})})})}const{Button:U,RecordView:Gt,RecordViewActions:qt,RecordViewItem:de,RecordViewItemList:Yt,useConfirmDialog:Jt}=await c("@baseplate-dev/ui-components"),{useState:B}=await c("react");function ve({className:o,lens:t,modelRef:i}){const{requestConfirm:n}=Jt(),{fields:l,append:s,remove:a,update:u,move:d}=Ct(t.interop()),[p,b]=B(void 0),[j,h]=B(!1),[f,x]=B(!1);function F(m){const r=l[m];n({title:"Delete Column",content:`Are you sure you want to delete the column "${r.label||"Untitled"}"?`,onConfirm:()=>{a(m)}})}const w=I(t.interop());function g(m){b(w[m]),h(!0)}function v(){b(void 0),x(!0)}function y(m){if(p){const r=w.findIndex(C=>C.id===p.id);r!==-1&&u(r,m)}else s(m)}const D=l.map((m,r)=>({id:m.id,element:e.jsxs(Gt,{children:[e.jsxs(Yt,{children:[e.jsx(de,{title:"Label",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{children:m.label||e.jsx("span",{className:"text-muted-foreground",children:"Untitled Column"})})})}),e.jsx(de,{title:"Type",children:m.type})]}),e.jsxs(qt,{children:[e.jsx(U,{variant:"ghost",size:"icon",title:"Edit","aria-label":"Edit column",onClick:()=>{g(r)},children:e.jsx(J,{})}),e.jsx(U,{variant:"ghostDestructive",size:"icon",title:"Delete","aria-label":"Delete column",onClick:()=>{F(r)},children:e.jsx(Q,{})})]})]},m.id)}));return e.jsxs("div",{className:X("space-y-4",o),children:[l.length===0?e.jsx("p",{className:"pt-4 text-style-muted",children:"No columns configured. Add columns to display data in your table."}):e.jsx("div",{className:"flex w-full flex-col gap-2",children:e.jsx(q,{listItems:D,sortItems:d})}),e.jsx(Ht,{open:j||f,onOpenChange:m=>{m||(h(!1),x(!1),b(void 0))},column:p,modelRef:i,isNew:f,onSave:y}),e.jsxs(U,{variant:"secondary",size:"sm",onClick:v,children:[e.jsx(Z,{}),"Add Column"]})]})}const{createAdminCrudEmbeddedFormSchema:Qt}=await c("@baseplate-dev/project-builder-lib"),{useDefinitionSchema:Xt,useProjectDefinition:ye}=await c("@baseplate-dev/project-builder-lib/web"),{Button:G,CheckboxFieldController:Zt,InputFieldController:en,SelectFieldController:me,Table:tn,TableBody:nn,TableCell:W,TableHead:P,TableHeader:on,TableRow:ue,toast:ln}=await c("@baseplate-dev/ui-components"),{useId:sn}=await c("react");function an({items:o,edit:t,remove:i}){const{definitionContainer:n}=ye();return e.jsxs(tn,{className:"max-w-6xl",children:[e.jsx(on,{children:e.jsxs(ue,{children:[e.jsx(P,{children:"Form Name"}),e.jsx(P,{children:"Model Name"}),e.jsx(P,{children:"Type"}),e.jsx(P,{children:"Actions"})]})}),e.jsx(nn,{children:o.map((l,s)=>e.jsxs(ue,{children:[e.jsx(W,{children:l.name}),e.jsx(W,{children:n.nameFromId(l.modelRef)}),e.jsx(W,{children:l.type}),e.jsxs(W,{className:"space-x-4",children:[e.jsx(G,{variant:"link",size:"none",onClick:()=>{t(s)},children:"Edit"}),e.jsx(G,{variant:"linkDestructive",size:"none",onClick:()=>{i(s)},children:"Remove"})]})]},l.id))})]})}const rn=[{label:"Object",value:"object"},{label:"List",value:"list"}];function cn({initialData:o,onSubmit:t,embeddedFormOptions:i}){const{definition:n}=ye(),l=Xt(Qt),s=V({resolver:N(l),defaultValues:o}),{handleSubmit:a,control:u,watch:d}=s,p=n.models.map(x=>({label:x.name,value:x.id})),b=d("type"),j=d("modelRef"),h=Ce({control:u}),f=sn();return e.jsxs("form",{onSubmit:x=>{x.stopPropagation(),a(t)(x).catch(F=>{ln.error(je(F))})},id:f,className:"space-y-4",children:[e.jsx(en,{label:"Name",control:u,name:"name"}),e.jsx(me,{label:"Type",control:u,name:"type",options:rn}),e.jsx(Zt,{label:"Include ID Field? (useful for list types)",control:u,name:"includeIdField"}),e.jsx(me,{label:"Model",control:u,options:p,name:"modelRef"}),b==="list"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Table"}),e.jsx(ve,{lens:h.focus("table.columns"),modelRef:j})]}),e.jsx("h2",{children:"Form"}),e.jsx(ge,{formProps:s,embeddedFormOptions:i}),e.jsx(G,{type:"submit",form:f,children:"Save"})]})}const{createAdminCrudActionWebConfig:dn}=await c("@baseplate-dev/project-builder-lib/web"),mn=dn({name:"delete",pluginKey:void 0,label:"Delete",isAvailableForModel:()=>!0,getNewAction:()=>({type:"delete",position:"dropdown"})}),{createAdminCrudActionWebConfig:un}=await c("@baseplate-dev/project-builder-lib/web"),pn=un({name:"edit",pluginKey:void 0,label:"Edit",isAvailableForModel:()=>!0,getNewAction:()=>({type:"edit",position:"inline"})}),pe=[pn,mn],{createAdminCrudActionSchema:fn,ModelUtils:bn}=await c("@baseplate-dev/project-builder-lib"),{adminCrudActionWebSpec:hn,useDefinitionSchema:xn,useProjectDefinition:jn}=await c("@baseplate-dev/project-builder-lib/web"),{Button:fe,Dialog:Cn,DialogContent:gn,DialogDescription:vn,DialogFooter:yn,DialogHeader:wn,DialogTitle:Fn,SelectFieldController:be}=await c("@baseplate-dev/ui-components"),{useEffect:Dn,useId:In}=await c("react");function Sn({open:o,onOpenChange:t,action:i,modelRef:n,isNew:l=!1,onSave:s}){const{definition:a,pluginContainer:u}=jn(),d=xn(fn),p=n?bn.byIdOrThrow(a,n):void 0,b=u.getPluginSpec(hn),j=b.getActionWebConfigs(pe).filter(r=>n&&r.isAvailableForModel(a,n)).map(r=>({label:r.label,value:r.name})),h=V({resolver:N(d),values:i??{type:"edit",position:"inline"}}),{control:f,handleSubmit:x,formState:{isDirty:F},reset:w}=h;Dn(()=>{o&&!i&&w({type:"edit",position:"inline"})},[o,i,w]);const g=I({control:f,name:"type"}),v=g?b.getActionWebConfig(g,pe):void 0,y=v?.Form,D=x(r=>{s(r),t(!1)}),m=In();return e.jsx(Cn,{open:o,onOpenChange:t,children:e.jsx(gn,{className:"sm:max-w-[500px]",children:e.jsxs("form",{id:m,onSubmit:r=>(r.stopPropagation(),D(r)),children:[e.jsxs(wn,{children:[e.jsx(Fn,{children:l?"Add Action":"Edit Action"}),e.jsx(vn,{children:l?"Configure the new table action settings.":"Update the action settings below."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(be,{label:"Type",control:f,options:j,name:"type"}),e.jsx(be,{label:"Position",control:f,options:[{label:"Inline",value:"inline"},{label:"Dropdown",value:"dropdown"}],name:"position"}),y&&p&&e.jsx(y,{formProps:h,model:p,pluginKey:v.pluginKey})]}),e.jsxs(yn,{children:[e.jsx(fe,{type:"button",variant:"outline",onClick:()=>{t(!1)},children:"Cancel"}),e.jsxs(fe,{form:m,type:"submit",disabled:!F,children:[l?"Add":"Update"," Action"]})]})]})})})}const{Button:K,RecordView:An,RecordViewActions:$n,RecordViewItem:he,RecordViewItemList:Tn,useConfirmDialog:En}=await c("@baseplate-dev/ui-components"),{useState:z}=await c("react");function Rn({className:o,control:t,modelRef:i}){const{requestConfirm:n}=En(),{fields:l,append:s,remove:a,update:u,move:d}=Y({control:t,name:"table.actions"}),[p,b]=z(void 0),[j,h]=z(!1),[f,x]=z(!1);function F(m){const r=l[m];n({title:"Delete Action",content:`Are you sure you want to delete the "${r.type}" action?`,onConfirm:()=>{a(m)}})}const w=I({control:t,name:"table.actions"});function g(m){b(w?.[m]),h(!0)}function v(){b(void 0),x(!0)}function y(m){if(p){const r=(w??[]).findIndex(C=>C.id===p.id);r!==-1&&u(r,m)}else s(m)}const D=l.map((m,r)=>({id:m.id,element:e.jsxs(An,{children:[e.jsxs(Tn,{children:[e.jsx(he,{title:"Type",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"capitalize",children:m.type})})}),e.jsx(he,{title:"Position",children:m.position})]}),e.jsxs($n,{children:[e.jsx(K,{variant:"ghost",size:"icon",title:"Edit","aria-label":"Edit action",onClick:()=>{g(r)},children:e.jsx(J,{})}),e.jsx(K,{variant:"ghostDestructive",size:"icon",title:"Delete","aria-label":"Delete action",onClick:()=>{F(r)},children:e.jsx(Q,{})})]})]},m.id)}));return e.jsxs("div",{className:X("space-y-4",o),children:[l.length===0?e.jsx("p",{className:"pt-4 text-style-muted",children:"No actions configured. Add actions to enable row operations."}):e.jsx("div",{className:"flex w-full flex-col gap-2",children:e.jsx(q,{listItems:D,sortItems:d})}),e.jsx(Sn,{open:j||f,onOpenChange:m=>{m||(h(!1),x(!1),b(void 0))},action:p,modelRef:i??"",isNew:f,onSave:y}),e.jsxs(K,{variant:"secondary",size:"sm",onClick:v,children:[e.jsx(Z,{}),"Add Action"]})]})}const{useProjectDefinition:Nn}=await c("@baseplate-dev/project-builder-lib/web"),{CheckboxFieldController:Ln,ComboboxFieldController:xe,SectionListSection:A,SectionListSectionContent:$,SectionListSectionDescription:T,SectionListSectionHeader:E,SectionListSectionTitle:R}=await c("@baseplate-dev/ui-components");function _n({formProps:o}){const{control:t}=o,{definition:i}=Nn(),n=Ce({control:t}),l=i.models.map(d=>({label:d.name,value:d.id})),s=I({control:t,name:"modelRef"}),a=i.models.find(d=>d.id===s)?.model.fields.map(d=>({label:d.name,value:d.id}))??[],u=I({control:t,name:"embeddedForms"})?.map(d=>({label:d.name,value:d.id}))??[];return e.jsxs(e.Fragment,{children:[e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Model Configuration"}),e.jsx(T,{children:"Configure the data model and basic settings for this CRUD section."})]}),e.jsxs($,{className:"space-y-6",children:[e.jsx(xe,{label:"Model",control:t,options:l,name:"modelRef"}),e.jsx(xe,{label:"Name Field",control:t,options:a,description:"The field to use as the name of the record (used in breadcrumbs/title of edit page)",name:"nameFieldRef"}),e.jsx(Ln,{label:"Disable Create?",control:t,name:"disableCreate"})]})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Table Configuration"}),e.jsx(T,{children:"Configure which columns to display in the data table."})]}),e.jsx($,{children:e.jsx(ve,{lens:n.focus("table.columns"),modelRef:s})})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Table Actions"}),e.jsx(T,{children:"Configure actions available for each row in the table. Drag to reorder."})]}),e.jsx($,{children:e.jsx(Rn,{control:t,modelRef:s})})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Form Configuration"}),e.jsx(T,{children:"Configure the form fields for creating and editing records."})]}),e.jsx($,{children:e.jsx(ge,{formProps:o,embeddedFormOptions:u})})]}),e.jsxs(A,{children:[e.jsxs(E,{children:[e.jsx(R,{children:"Embedded Forms"}),e.jsx(T,{children:"Configure embedded forms for related data objects."})]}),e.jsx($,{children:e.jsx(Fe.LabelledController,{control:t,name:"embeddedForms",renderForm:d=>e.jsx(cn,{...d,embeddedFormOptions:u}),renderTable:d=>e.jsx(an,{...d}),defaultValue:{type:"object"}})})]})]})}const{AsyncComboboxField:Wn,useControllerMerged:Pn}=await c("@baseplate-dev/ui-components");async function Vn(){const o=await L(()=>import("./index-Cd_baD6T.js").then(s=>s.A),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),t=await L(()=>import("./index-BPClqgn_.js"),__vite__mapDeps([11,6,1])),i=await L(()=>import("./index-tflukq04.js").then(s=>s.R),__vite__mapDeps([6,1])),n=await L(()=>import("./index-tHURiz2C.js"),__vite__mapDeps([12,6,1]));return[o,t,i,n].map(s=>Object.entries(s).filter(([,a])=>typeof a=="function").map(([a,u])=>({label:a,value:a,icon:u}))).flat()}function Mn({...o}){return e.jsx(Wn,{placeholder:"Select an icon",...o,loadOptions:t=>Vn().then(i=>i.filter(n=>!t||n.label.toLowerCase().includes(t.toLowerCase())).sort((n,l)=>n.label.localeCompare(l.label)).slice(0,20)),renderItemLabel:t=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:"size-4"}),t.label]})})}function On({name:o,control:t,...i}){const{field:n,fieldState:{error:l}}=Pn({name:o,control:t},i),s=i;return e.jsx(Mn,{error:l?.message,...s,...n,value:n.value??null})}const{adminSectionEntityType:kn,createWebAdminSectionSchema:Un}=await c("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:Bn,useProjectDefinition:Kn,useResettableForm:zn}=await c("@baseplate-dev/project-builder-lib/web"),{Button:H,ComboboxFieldController:Hn,Dialog:Gn,DialogClose:qn,DialogContent:Yn,DialogDescription:Jn,DialogFooter:Qn,DialogHeader:Xn,DialogTitle:Zn,DialogTrigger:ei,FormActionBar:ti,InputFieldController:ni,SectionList:ii,SectionListSection:oi,SectionListSectionContent:li,SectionListSectionDescription:si,SectionListSectionHeader:ai,SectionListSectionTitle:ri}=await c("@baseplate-dev/ui-components"),{useNavigate:ci}=await c("@tanstack/react-router"),hi=function(){const{app:t,section:i}=M.useLoaderData(),{appKey:n,sectionKey:l}=M.useParams(),s=ci({from:M.fullPath}),{definition:a,saveDefinitionWithFeedback:u,isSavingDefinition:d}=Kn(),p=De(Un),b=a.features.map(g=>({label:g.name,value:g.id})),j=zn({resolver:N(p),values:i}),{control:h,handleSubmit:f,reset:x}=j,F=f(g=>{const{id:v,...y}=g;return u(D=>{const m=D.apps.find(C=>C.id===t.id);if(m?.type!=="web"||!m.adminApp)return;const r=m.adminApp.sections?.findIndex(C=>C.id===kn.idFromKey(l));r!==void 0&&r>=0&&m.adminApp.sections&&(m.adminApp.sections[r]={...y,id:i.id})})}),w=()=>{u(g=>{const v=g.apps.find(y=>y.id===t.id);v?.type!=="web"||!v.adminApp||(v.adminApp.sections=v.adminApp.sections?.filter(y=>y.id!==i.id))},{successMessage:`Successfully deleted section "${i.name}"!`,onSuccess:()=>{s({to:"/admin-sections/$appKey",params:{appKey:n}}).catch(je)}})};return Bn({control:h,reset:x,onSubmit:F}),e.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"max-w-7xl space-y-4 border-b p-4",children:e.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[e.jsxs("div",{children:[e.jsx("h2",{children:i.name}),e.jsxs("p",{className:"text-base text-muted-foreground",children:[i.type," section"]})]}),e.jsxs(Gn,{children:[e.jsx(ei,{asChild:!0,children:e.jsx(H,{variant:"secondary",children:"Delete"})}),e.jsxs(Yn,{children:[e.jsxs(Xn,{children:[e.jsxs(Zn,{children:["Delete ",i.name]}),e.jsxs(Jn,{className:"sr-only",children:["Are you sure you want to delete"," ",e.jsx("strong",{children:i.name}),"?"]})]}),e.jsxs("p",{children:["Are you sure you want to delete ",e.jsx("strong",{children:i.name}),"?"]}),e.jsx("p",{className:"text-style-muted",children:"This action will permanently remove the admin section from your application. This cannot be undone."}),e.jsxs(Qn,{children:[e.jsx(qn,{asChild:!0,children:e.jsx(H,{variant:"secondary",children:"Cancel"})}),e.jsx(H,{variant:"destructive",onClick:w,disabled:d,children:"Delete Section"})]})]})]})]})}),e.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:e.jsxs("form",{onSubmit:F,className:"w-full max-w-7xl space-y-4 p-4",children:[e.jsxs(ii,{children:[e.jsxs(oi,{children:[e.jsxs(ai,{children:[e.jsx(ri,{children:"General"}),e.jsx(si,{children:"Basic configuration for your admin section."})]}),e.jsxs(li,{className:"space-y-6",children:[e.jsx(ni,{label:"Name",control:h,name:"name",autoComplete:"off"}),e.jsx(Hn,{label:"Feature",control:h,options:b,name:"featureRef"}),e.jsx(On,{label:"Icon",control:h,name:"icon",description:"Choose an icon to represent this section"})]})]}),e.jsx(_n,{formProps:j})]}),e.jsx(ti,{form:j})]})})]},i.id)};export{hi as component};
|
|
3
|
+
//# sourceMappingURL=edit._sectionKey-CZgof0ob.js.map
|