@baseplate-dev/plugin-auth 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +390 -0
- package/dist/auth/core/common.d.ts +7 -0
- package/dist/auth/core/common.d.ts.map +1 -0
- package/dist/auth/core/common.js +26 -0
- package/dist/auth/core/common.js.map +1 -0
- package/dist/auth/core/components/auth-definition-editor.d.ts +5 -0
- package/dist/auth/core/components/auth-definition-editor.d.ts.map +1 -0
- package/dist/auth/core/components/auth-definition-editor.js +57 -0
- package/dist/auth/core/components/auth-definition-editor.js.map +1 -0
- package/dist/auth/core/components/role-editor-form.d.ts +10 -0
- package/dist/auth/core/components/role-editor-form.d.ts.map +1 -0
- package/dist/auth/core/components/role-editor-form.js +27 -0
- package/dist/auth/core/components/role-editor-form.js.map +1 -0
- package/dist/auth/core/node.d.ts +5 -0
- package/dist/auth/core/node.d.ts.map +1 -0
- package/dist/auth/core/node.js +58 -0
- package/dist/auth/core/node.js.map +1 -0
- package/dist/auth/core/schema/models.d.ts +9 -0
- package/dist/auth/core/schema/models.d.ts.map +1 -0
- package/dist/auth/core/schema/models.js +187 -0
- package/dist/auth/core/schema/models.js.map +1 -0
- package/dist/auth/core/schema/plugin-definition.d.ts +88 -0
- package/dist/auth/core/schema/plugin-definition.d.ts.map +1 -0
- package/dist/auth/core/schema/plugin-definition.js +29 -0
- package/dist/auth/core/schema/plugin-definition.js.map +1 -0
- package/dist/auth/core/web.d.ts +6 -0
- package/dist/auth/core/web.d.ts.map +1 -0
- package/dist/auth/core/web.js +14 -0
- package/dist/auth/core/web.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts +65 -0
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js +62 -0
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.d.ts +96 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.d.ts.map +1 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js +94 -0
- package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js.map +1 -0
- package/dist/auth/generators/fastify/auth-module/templates/management.ts +22 -0
- package/dist/auth/generators/fastify/auth-module/templates/schema/user-session-payload.object-type.ts +23 -0
- package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.mutations.ts +22 -0
- package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.queries.ts +20 -0
- package/dist/auth/generators/fastify/auth-module/templates/services/user-session.service.ts +251 -0
- package/dist/auth/generators/fastify/auth-module/templates/user-session.constants.ts +19 -0
- package/dist/auth/generators/fastify/auth-module/templates/user-session.service.ts +101 -0
- package/dist/auth/generators/fastify/auth-module/templates/utils/cookie-signer.ts +71 -0
- package/dist/auth/generators/fastify/auth-module/templates/utils/session-cookie.ts +42 -0
- package/dist/auth/generators/fastify/auth-module/templates/utils/verify-request-origin.ts +45 -0
- package/dist/auth/generators/fastify/index.d.ts +2 -0
- package/dist/auth/generators/fastify/index.d.ts.map +1 -0
- package/dist/auth/generators/fastify/index.js +2 -0
- package/dist/auth/generators/fastify/index.js.map +1 -0
- package/dist/auth/generators/index.d.ts +2 -0
- package/dist/auth/generators/index.d.ts.map +1 -0
- package/dist/auth/generators/index.js +2 -0
- package/dist/auth/generators/index.js.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/metadata.json +8 -0
- package/dist/auth/static/icon.svg +1 -0
- package/dist/auth0/constants/packages.d.ts +6 -0
- package/dist/auth0/constants/packages.d.ts.map +1 -0
- package/dist/auth0/constants/packages.js +6 -0
- package/dist/auth0/constants/packages.js.map +1 -0
- package/dist/auth0/core/common.d.ts +7 -0
- package/dist/auth0/core/common.d.ts.map +1 -0
- package/dist/auth0/core/common.js +28 -0
- package/dist/auth0/core/common.js.map +1 -0
- package/dist/auth0/core/components/auth-definition-editor.d.ts +5 -0
- package/dist/auth0/core/components/auth-definition-editor.d.ts.map +1 -0
- package/dist/auth0/core/components/auth-definition-editor.js +57 -0
- package/dist/auth0/core/components/auth-definition-editor.js.map +1 -0
- package/dist/auth0/core/components/role-dialog.d.ts +14 -0
- package/dist/auth0/core/components/role-dialog.d.ts.map +1 -0
- package/dist/auth0/core/components/role-dialog.js +27 -0
- package/dist/auth0/core/components/role-dialog.js.map +1 -0
- package/dist/auth0/core/components/role-editor-form.d.ts +10 -0
- package/dist/auth0/core/components/role-editor-form.d.ts.map +1 -0
- package/dist/auth0/core/components/role-editor-form.js +52 -0
- package/dist/auth0/core/components/role-editor-form.js.map +1 -0
- package/dist/auth0/core/node.d.ts +5 -0
- package/dist/auth0/core/node.d.ts.map +1 -0
- package/dist/auth0/core/node.js +86 -0
- package/dist/auth0/core/node.js.map +1 -0
- package/dist/auth0/core/schema/migrations.d.ts +3 -0
- package/dist/auth0/core/schema/migrations.d.ts.map +1 -0
- package/dist/auth0/core/schema/migrations.js +17 -0
- package/dist/auth0/core/schema/migrations.js.map +1 -0
- package/dist/auth0/core/schema/models.d.ts +6 -0
- package/dist/auth0/core/schema/models.d.ts.map +1 -0
- package/dist/auth0/core/schema/models.js +33 -0
- package/dist/auth0/core/schema/models.js.map +1 -0
- package/dist/auth0/core/schema/plugin-definition.d.ts +73 -0
- package/dist/auth0/core/schema/plugin-definition.d.ts.map +1 -0
- package/dist/auth0/core/schema/plugin-definition.js +17 -0
- package/dist/auth0/core/schema/plugin-definition.js.map +1 -0
- package/dist/auth0/core/web.d.ts +6 -0
- package/dist/auth0/core/web.d.ts.map +1 -0
- package/dist/auth0/core/web.js +14 -0
- package/dist/auth0/core/web.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +67 -0
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +125 -0
- package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts +3 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js +12 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.d.ts +43 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.js +25 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.js.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/templates/management.ts +22 -0
- package/dist/auth0/generators/fastify/auth0-module/templates/user-session.service.ts +101 -0
- package/dist/auth0/generators/fastify/index.d.ts +2 -0
- package/dist/auth0/generators/fastify/index.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/index.js +2 -0
- package/dist/auth0/generators/fastify/index.js.map +1 -0
- package/dist/auth0/generators/index.d.ts +3 -0
- package/dist/auth0/generators/index.d.ts.map +1 -0
- package/dist/auth0/generators/index.js +3 -0
- package/dist/auth0/generators/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts +10 -0
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js +41 -0
- package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js.map +1 -0
- package/dist/auth0/generators/react/auth0-apollo/templates/auth-link.ts +11 -0
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts +61 -0
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js +59 -0
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts +106 -0
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.js +28 -0
- package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-callback/templates/auth0-callback.page.tsx +61 -0
- package/dist/auth0/generators/react/auth0-callback/templates/signup.page.tsx +48 -0
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts +53 -0
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js +44 -0
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts +3 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js +12 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts +45 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js +13 -0
- package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-components/templates/RequireAuth.tsx +22 -0
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +28 -0
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +65 -0
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts +8 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js +12 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts +3 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js +16 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts +33 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js +50 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/templates/useCurrentUser.gql +10 -0
- package/dist/auth0/generators/react/auth0-hooks/templates/useCurrentUser.ts +29 -0
- package/dist/auth0/generators/react/auth0-hooks/templates/useLogOut.ts +14 -0
- package/dist/auth0/generators/react/auth0-hooks/templates/useRequiredUserId.ts +11 -0
- package/dist/auth0/generators/react/auth0-hooks/templates/useSession.ts +23 -0
- package/dist/auth0/generators/react/index.d.ts +6 -0
- package/dist/auth0/generators/react/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/index.js +6 -0
- package/dist/auth0/generators/react/index.js.map +1 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +23 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js +64 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js.map +1 -0
- package/dist/auth0/metadata.json +8 -0
- package/dist/auth0/static/icon.svg +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/roles/constants.d.ts +4 -0
- package/dist/roles/constants.d.ts.map +1 -0
- package/dist/roles/constants.js +25 -0
- package/dist/roles/constants.js.map +1 -0
- package/dist/roles/index.d.ts +3 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/dist/roles/index.js +3 -0
- package/dist/roles/index.js.map +1 -0
- package/dist/roles/schema.d.ts +65 -0
- package/dist/roles/schema.d.ts.map +1 -0
- package/dist/roles/schema.js +43 -0
- package/dist/roles/schema.js.map +1 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +2 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/web/assets/__federation_expose_auth0CoreCommon--n6esVYP.js +54 -0
- package/dist/web/assets/__federation_expose_auth0CoreCommon--n6esVYP.js.map +1 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-Ql6gpX5q.js +377 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-Ql6gpX5q.js.map +1 -0
- package/dist/web/assets/__federation_fn_import-BiwmVFwy.js +421 -0
- package/dist/web/assets/__federation_fn_import-BiwmVFwy.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CY8oz43s.js +330 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CY8oz43s.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B62IPizQ.js +10559 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B62IPizQ.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BU2QTWNs.js +12718 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BU2QTWNs.js.map +1 -0
- package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js +250 -0
- package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js.map +1 -0
- package/dist/web/assets/__federation_shared_react-uocnGSER.js +7 -0
- package/dist/web/assets/__federation_shared_react-uocnGSER.js.map +1 -0
- package/dist/web/assets/__federation_shared_zod-BK7IELHt.js +4380 -0
- package/dist/web/assets/__federation_shared_zod-BK7IELHt.js.map +1 -0
- package/dist/web/assets/index-B1hOKVPw.js +574 -0
- package/dist/web/assets/index-B1hOKVPw.js.map +1 -0
- package/dist/web/assets/index-CgJx-krK.js +95 -0
- package/dist/web/assets/index-CgJx-krK.js.map +1 -0
- package/dist/web/assets/index-l0sNRNKZ.js.map +1 -0
- package/dist/web/assets/index.esm-BcxPd7Ha.js +2584 -0
- package/dist/web/assets/index.esm-BcxPd7Ha.js.map +1 -0
- package/dist/web/assets/model-utils-CbQJy1wE.js +1263 -0
- package/dist/web/assets/model-utils-CbQJy1wE.js.map +1 -0
- package/dist/web/assets/plugin-definition-BQRupXoQ.js +78 -0
- package/dist/web/assets/plugin-definition-BQRupXoQ.js.map +1 -0
- package/dist/web/assets/react-2jQE8aG0.js +47 -0
- package/dist/web/assets/react-2jQE8aG0.js.map +1 -0
- package/dist/web/assets/remoteEntry.js +54 -0
- package/dist/web/assets/remoteEntry.js.map +1 -0
- package/dist/web/assets/style-BdgwWjAf.css +95 -0
- package/dist/web/index.html +24 -0
- package/dist/web-export.d.ts +2 -0
- package/dist/web-export.js +2 -0
- package/dist/web-export.js.map +1 -0
- package/manifest.json +4 -0
- package/package.json +80 -0
package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CY8oz43s.js
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { importShared } from '../../__federation_fn_import-BiwmVFwy.js';
|
|
2
|
+
import { j as jsxRuntimeExports, u as useFormState, a as useForm } from '../../index.esm-BcxPd7Ha.js';
|
|
3
|
+
import { F as FeatureUtils, M as ModelUtils, p as zPluginWrapper, a as isEqual, c as createPluginSpec } from '../../model-utils-CbQJy1wE.js';
|
|
4
|
+
import { c as create } from '../../react-2jQE8aG0.js';
|
|
5
|
+
|
|
6
|
+
const React = await importShared('react');
|
|
7
|
+
|
|
8
|
+
const ProjectDefinitionContext = React.createContext(null);
|
|
9
|
+
function useProjectDefinition() {
|
|
10
|
+
const result = React.useContext(ProjectDefinitionContext);
|
|
11
|
+
if (!result) {
|
|
12
|
+
throw new Error(`useProjectDefinition must be used within a <ProjectDefinitionProvider>`);
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {ComboboxField: ComboboxField$1,useControllerMerged: useControllerMerged$1} = await importShared('@baseplate-dev/ui-components');
|
|
18
|
+
|
|
19
|
+
const {useMemo: useMemo$2,useState: useState$1} = await importShared('react');
|
|
20
|
+
function createCreateOption$1(value) {
|
|
21
|
+
return {
|
|
22
|
+
label: `Create "${value}"`,
|
|
23
|
+
value,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function FeatureComboboxField({ canCreate, value, ...rest }) {
|
|
27
|
+
const { definition } = useProjectDefinition();
|
|
28
|
+
const [searchQuery, setSearchQuery] = useState$1('');
|
|
29
|
+
const featureOptions = useMemo$2(() => {
|
|
30
|
+
const baseFeatures = definition.features.map((feature) => ({
|
|
31
|
+
label: feature.name,
|
|
32
|
+
value: feature.id,
|
|
33
|
+
}));
|
|
34
|
+
if (!canCreate)
|
|
35
|
+
return baseFeatures;
|
|
36
|
+
const newFeatureName = searchQuery ? searchQuery : value;
|
|
37
|
+
const doesNewFeatureExist = !!baseFeatures.some((option) => option.label === newFeatureName || option.value === newFeatureName);
|
|
38
|
+
return !doesNewFeatureExist &&
|
|
39
|
+
newFeatureName &&
|
|
40
|
+
FeatureUtils.validateFeatureName(newFeatureName)
|
|
41
|
+
? [...baseFeatures, createCreateOption$1(newFeatureName)]
|
|
42
|
+
: baseFeatures;
|
|
43
|
+
}, [definition.features, searchQuery, value, canCreate]);
|
|
44
|
+
return (jsxRuntimeExports.jsx(ComboboxField$1, { placeholder: "Select a feature", ...rest, searchQuery: canCreate ? searchQuery : undefined, onSearchQueryChange: setSearchQuery, options: featureOptions, value: value }));
|
|
45
|
+
}
|
|
46
|
+
function FeatureComboboxFieldController({ name, control, ...rest }) {
|
|
47
|
+
const { field, fieldState: { error }, } = useControllerMerged$1({ name, control }, rest);
|
|
48
|
+
const restProps = rest;
|
|
49
|
+
return (jsxRuntimeExports.jsx(FeatureComboboxField, { error: error?.message, ...restProps, ...field, value: field.value ?? null }));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const {ComboboxField,useControllerMerged} = await importShared('@baseplate-dev/ui-components');
|
|
53
|
+
|
|
54
|
+
const {useMemo: useMemo$1,useState} = await importShared('react');
|
|
55
|
+
function createCreateOption(value) {
|
|
56
|
+
return {
|
|
57
|
+
label: `Create "${value}"`,
|
|
58
|
+
value,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function ModelComboboxField({ canCreate, value, ...rest }) {
|
|
62
|
+
const { definition } = useProjectDefinition();
|
|
63
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
64
|
+
const modelOptions = useMemo$1(() => {
|
|
65
|
+
const baseModels = definition.models.map((model) => ({
|
|
66
|
+
label: model.name,
|
|
67
|
+
value: model.id,
|
|
68
|
+
}));
|
|
69
|
+
if (!canCreate)
|
|
70
|
+
return baseModels;
|
|
71
|
+
const newModelName = searchQuery ? searchQuery : value;
|
|
72
|
+
const doesNewModelExist = !!baseModels.some((option) => option.label === newModelName || option.value === newModelName);
|
|
73
|
+
return !doesNewModelExist &&
|
|
74
|
+
newModelName &&
|
|
75
|
+
ModelUtils.validateModelName(newModelName)
|
|
76
|
+
? [...baseModels, createCreateOption(newModelName)]
|
|
77
|
+
: baseModels;
|
|
78
|
+
}, [definition.models, searchQuery, value, canCreate]);
|
|
79
|
+
return (jsxRuntimeExports.jsx(ComboboxField, { placeholder: "Select a model", ...rest, searchQuery: canCreate ? searchQuery : undefined, onSearchQueryChange: setSearchQuery, options: modelOptions, value: value }));
|
|
80
|
+
}
|
|
81
|
+
function ModelComboboxFieldController({ name, control, ...rest }) {
|
|
82
|
+
const { field, fieldState: { error }, } = useControllerMerged({ name, control }, rest);
|
|
83
|
+
const restProps = rest;
|
|
84
|
+
return (jsxRuntimeExports.jsx(ModelComboboxField, { error: error?.message, ...restProps, ...field, value: field.value ?? null }));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const {Alert,AlertDescription,AlertTitle} = await importShared('@baseplate-dev/ui-components');
|
|
88
|
+
|
|
89
|
+
function ModelMergerResultAlert({ pendingModelChanges, }) {
|
|
90
|
+
const changes = Object.values(pendingModelChanges).filter((change) => change !== undefined);
|
|
91
|
+
if (changes.length === 0) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return (jsxRuntimeExports.jsx("div", { className: "space-y-4", children: changes.map((change) => (jsxRuntimeExports.jsxs(Alert, { variant: change.isNewModel ? 'default' : 'warning', children: [jsxRuntimeExports.jsxs(AlertTitle, { children: [change.isNewModel ? 'New Model' : 'Model Changes', ": ", change.name] }), jsxRuntimeExports.jsx(AlertDescription, { children: jsxRuntimeExports.jsxs("div", { className: "mt-2 space-y-2", children: [change.isNewModel ? (jsxRuntimeExports.jsx("p", { children: "This is a new model that will be created with the following configuration:" })) : (jsxRuntimeExports.jsx("p", { children: "The following changes will be applied to the model:" })), jsxRuntimeExports.jsxs("ul", { className: "list-disc pl-4 space-y-1", children: [change.changes['model.fields']?.length ? (jsxRuntimeExports.jsxs("li", { children: [jsxRuntimeExports.jsx("span", { className: "font-medium", children: change.changes['model.fields'].length }), ' ', "field(s) will be", change.isNewModel ? ' created' : ' added or updated'] })) : undefined, change.changes['model.relations']?.length ? (jsxRuntimeExports.jsxs("li", { children: [jsxRuntimeExports.jsx("span", { className: "font-medium", children: change.changes['model.relations'].length }), ' ', "relation(s) will be", change.isNewModel ? ' created' : ' added or updated'] })) : undefined, change.changes['model.uniqueConstraints']?.length ? (jsxRuntimeExports.jsxs("li", { children: [jsxRuntimeExports.jsx("span", { className: "font-medium", children: change.changes['model.uniqueConstraints'].length }), ' ', "unique constraint(s) will be", ' ', change.isNewModel ? 'created' : 'added or updated'] })) : undefined, change.changes['model.primaryKeyFieldRefs']?.length ? (jsxRuntimeExports.jsxs("li", { children: ["Primary key will be ", change.isNewModel ? 'set' : 'updated', ' ', "with", ' ', jsxRuntimeExports.jsx("span", { className: "font-medium", children: change.changes['model.primaryKeyFieldRefs'].length }), ' ', "field(s)"] })) : undefined] })] }) })] }, change.name))) }));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const {createContext} = await importShared('react');
|
|
98
|
+
|
|
99
|
+
const ErrorHandlerContext = createContext(null);
|
|
100
|
+
|
|
101
|
+
const {useEffect: useEffect$2,useId} = await importShared('react');
|
|
102
|
+
const useBlockerDialogState = create((set) => ({
|
|
103
|
+
activeBlockers: [],
|
|
104
|
+
addBlocker: (options) => {
|
|
105
|
+
set((state) => ({
|
|
106
|
+
activeBlockers: [...state.activeBlockers, options],
|
|
107
|
+
}));
|
|
108
|
+
},
|
|
109
|
+
removeBlocker: (id) => {
|
|
110
|
+
set((state) => ({
|
|
111
|
+
activeBlockers: state.activeBlockers.filter((blocker) => blocker.id !== id),
|
|
112
|
+
}));
|
|
113
|
+
},
|
|
114
|
+
requestedBlockers: [],
|
|
115
|
+
requestBlocker(options) {
|
|
116
|
+
set((state) => ({
|
|
117
|
+
requestedBlockers: [...state.requestedBlockers, options],
|
|
118
|
+
}));
|
|
119
|
+
},
|
|
120
|
+
clearRequestedBlockers: () => {
|
|
121
|
+
set(() => ({
|
|
122
|
+
requestedBlockers: [],
|
|
123
|
+
}));
|
|
124
|
+
},
|
|
125
|
+
}));
|
|
126
|
+
function useBlockBeforeContinue() {
|
|
127
|
+
const hasActiveBlockers = useBlockerDialogState((state) => state.activeBlockers.length > 0);
|
|
128
|
+
const clearRequestedBlockers = useBlockerDialogState((state) => state.clearRequestedBlockers);
|
|
129
|
+
// make sure we clear any blocker requests if we navigate away
|
|
130
|
+
useEffect$2(() => () => {
|
|
131
|
+
clearRequestedBlockers();
|
|
132
|
+
}, [clearRequestedBlockers]);
|
|
133
|
+
const requestBlocker = useBlockerDialogState((state) => state.requestBlocker);
|
|
134
|
+
// if no blockers, continue immediately
|
|
135
|
+
if (!hasActiveBlockers) {
|
|
136
|
+
return ({ onContinue }) => {
|
|
137
|
+
onContinue();
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return requestBlocker;
|
|
141
|
+
}
|
|
142
|
+
function useBlockerDialog(options) {
|
|
143
|
+
const id = useId();
|
|
144
|
+
const addBlocker = useBlockerDialogState((state) => state.addBlocker);
|
|
145
|
+
const removeBlocker = useBlockerDialogState((state) => state.removeBlocker);
|
|
146
|
+
useEffect$2(() => {
|
|
147
|
+
if (options.disableBlock) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
addBlocker({
|
|
151
|
+
disableBlock: options.disableBlock,
|
|
152
|
+
title: options.title,
|
|
153
|
+
content: options.content,
|
|
154
|
+
buttonContinueWithoutSaveText: options.buttonContinueWithoutSaveText,
|
|
155
|
+
onContinueWithoutSave: options.onContinueWithoutSave,
|
|
156
|
+
buttonContinueText: options.buttonContinueText,
|
|
157
|
+
onContinue: options.onContinue,
|
|
158
|
+
id,
|
|
159
|
+
});
|
|
160
|
+
return () => {
|
|
161
|
+
removeBlocker(id);
|
|
162
|
+
};
|
|
163
|
+
}, [
|
|
164
|
+
addBlocker,
|
|
165
|
+
removeBlocker,
|
|
166
|
+
options.disableBlock,
|
|
167
|
+
options.buttonContinueWithoutSaveText,
|
|
168
|
+
options.onContinueWithoutSave,
|
|
169
|
+
options.buttonContinueText,
|
|
170
|
+
options.content,
|
|
171
|
+
options.title,
|
|
172
|
+
options.onContinue,
|
|
173
|
+
id,
|
|
174
|
+
]);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function useBlockDirtyFormNavigate(formState, reset) {
|
|
178
|
+
useBlockerDialog({
|
|
179
|
+
disableBlock: !formState.isDirty,
|
|
180
|
+
title: 'Unsaved Changes',
|
|
181
|
+
content: 'You have unsaved changes. Are you sure you want to continue?',
|
|
182
|
+
buttonContinueText: 'Discard Changes',
|
|
183
|
+
onContinue: () => {
|
|
184
|
+
reset();
|
|
185
|
+
return true;
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const {toast: toast$1} = await importShared('@baseplate-dev/ui-components');
|
|
191
|
+
const {useEffect: useEffect$1,useRef: useRef$1} = await importShared('react');
|
|
192
|
+
function useBlockUnsavedChangesNavigate({ control, reset, onSubmit }) {
|
|
193
|
+
const isDirtyRef = useRef$1(false);
|
|
194
|
+
const formState = useFormState({ control });
|
|
195
|
+
isDirtyRef.current = formState.isDirty;
|
|
196
|
+
useBlockerDialog({
|
|
197
|
+
disableBlock: !formState.isDirty,
|
|
198
|
+
title: "Unsaved Changes",
|
|
199
|
+
content: "You have unsaved changes. Do you want to save your changes?",
|
|
200
|
+
buttonContinueWithoutSaveText: "Discard Changes",
|
|
201
|
+
onContinueWithoutSave: () => {
|
|
202
|
+
reset();
|
|
203
|
+
return true;
|
|
204
|
+
},
|
|
205
|
+
buttonContinueText: "Save",
|
|
206
|
+
onContinue: async () => {
|
|
207
|
+
await onSubmit();
|
|
208
|
+
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
209
|
+
return !isDirtyRef.current;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const {useContext} = await importShared('react');
|
|
215
|
+
function useErrorHandler() {
|
|
216
|
+
const context = useContext(ErrorHandlerContext);
|
|
217
|
+
if (!context) {
|
|
218
|
+
throw new Error('useErrorHandler must be used within an ErrorHandlerContext');
|
|
219
|
+
}
|
|
220
|
+
return context;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const {useMemo} = await importShared('react');
|
|
224
|
+
function usePluginEnhancedSchema(schema) {
|
|
225
|
+
const { pluginContainer } = useProjectDefinition();
|
|
226
|
+
return useMemo(() => zPluginWrapper(schema, pluginContainer), [schema, pluginContainer]);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const {toast} = await importShared('@baseplate-dev/ui-components');
|
|
230
|
+
const {useEffect,useRef} = await importShared('react');
|
|
231
|
+
function useResettableForm(props) {
|
|
232
|
+
const formProps = useForm(props);
|
|
233
|
+
const { reset, formState } = formProps;
|
|
234
|
+
const { isDirty } = formState;
|
|
235
|
+
const { updatedExternally } = useProjectDefinition();
|
|
236
|
+
const oldValues = useRef(undefined);
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (oldValues.current &&
|
|
239
|
+
!isEqual(oldValues.current.oldDefaultValues, props?.defaultValues)) {
|
|
240
|
+
reset(props?.defaultValues);
|
|
241
|
+
if (isDirty && updatedExternally) {
|
|
242
|
+
toast.warning('Contents were updated externally so form was reset!');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (!oldValues.current ||
|
|
246
|
+
!isEqual(oldValues.current.oldDefaultValues, props?.defaultValues)) {
|
|
247
|
+
oldValues.current = {
|
|
248
|
+
oldDefaultValues: props?.defaultValues,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}, [props?.defaultValues, reset, updatedExternally, isDirty]);
|
|
252
|
+
return formProps;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function createAdminCrudInputWebConfig(config) {
|
|
256
|
+
return config;
|
|
257
|
+
}
|
|
258
|
+
function createAdminCrudInputWebImplementation() {
|
|
259
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
260
|
+
const inputs = new Map();
|
|
261
|
+
return {
|
|
262
|
+
registerInputWebConfig(input) {
|
|
263
|
+
if (inputs.has(input.name)) {
|
|
264
|
+
throw new Error(`Admin CRUD input with name ${input.name} is already registered`);
|
|
265
|
+
}
|
|
266
|
+
inputs.set(input.name, input);
|
|
267
|
+
},
|
|
268
|
+
getInputWebConfig(name, builtInInputs = []) {
|
|
269
|
+
const builtInInput = builtInInputs.find((b) => b.name === name);
|
|
270
|
+
if (builtInInput) {
|
|
271
|
+
return builtInInput;
|
|
272
|
+
}
|
|
273
|
+
const input = inputs.get(name);
|
|
274
|
+
if (!input) {
|
|
275
|
+
throw new Error(`Unable to find input with name ${name}`);
|
|
276
|
+
}
|
|
277
|
+
return input;
|
|
278
|
+
},
|
|
279
|
+
getInputWebConfigs(builtInInputs = []) {
|
|
280
|
+
return [...builtInInputs, ...inputs.values()];
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Spec for adding config component for plugin
|
|
286
|
+
*/
|
|
287
|
+
const adminCrudInputWebSpec = createPluginSpec('core/admin-crud-input-web', { defaultInitializer: createAdminCrudInputWebImplementation });
|
|
288
|
+
|
|
289
|
+
function createNewModelTransformerWebConfig(config) {
|
|
290
|
+
return config;
|
|
291
|
+
}
|
|
292
|
+
function createModelTransformerWebImplementation() {
|
|
293
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
294
|
+
const transformers = new Map();
|
|
295
|
+
return {
|
|
296
|
+
registerTransformerWebConfig(transformer) {
|
|
297
|
+
if (transformers.has(transformer.name)) {
|
|
298
|
+
throw new Error(`Model transformer with name ${transformer.name} is already registered`);
|
|
299
|
+
}
|
|
300
|
+
transformers.set(transformer.name, transformer);
|
|
301
|
+
},
|
|
302
|
+
getTransformerWebConfig(name, builtInTransformers = []) {
|
|
303
|
+
const builtInTransformer = builtInTransformers.find((b) => b.name === name);
|
|
304
|
+
if (builtInTransformer) {
|
|
305
|
+
return builtInTransformer;
|
|
306
|
+
}
|
|
307
|
+
const transformer = transformers.get(name);
|
|
308
|
+
if (!transformer) {
|
|
309
|
+
throw new Error(`Unable to find transformer with name ${name}`);
|
|
310
|
+
}
|
|
311
|
+
return transformer;
|
|
312
|
+
},
|
|
313
|
+
getTransformerWebConfigs(builtInTransformers = []) {
|
|
314
|
+
return [...builtInTransformers, ...transformers.values()];
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Spec for adding config component for plugin
|
|
320
|
+
*/
|
|
321
|
+
const modelTransformerWebSpec = createPluginSpec('core/model-transformer-web', { defaultInitializer: createModelTransformerWebImplementation });
|
|
322
|
+
|
|
323
|
+
function setUndefinedIfEmpty(value) {
|
|
324
|
+
if (value === '')
|
|
325
|
+
return undefined;
|
|
326
|
+
return value;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export { ErrorHandlerContext, FeatureComboboxField, FeatureComboboxFieldController, ModelComboboxField, ModelComboboxFieldController, ModelMergerResultAlert, ProjectDefinitionContext, adminCrudInputWebSpec, createAdminCrudInputWebConfig, createAdminCrudInputWebImplementation, createModelTransformerWebImplementation, createNewModelTransformerWebConfig, modelTransformerWebSpec, setUndefinedIfEmpty, useBlockBeforeContinue, useBlockDirtyFormNavigate, useBlockUnsavedChangesNavigate, useBlockerDialog, useBlockerDialogState, useErrorHandler, usePluginEnhancedSchema, useProjectDefinition, useResettableForm };
|
|
330
|
+
//# sourceMappingURL=web-CY8oz43s.js.map
|
package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CY8oz43s.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-CY8oz43s.js","sources":["../../../../../../../packages/project-builder-lib/dist/web/hooks/useProjectDefinition.js","../../../../../../../packages/project-builder-lib/dist/web/components/FeatureComboboxField.js","../../../../../../../packages/project-builder-lib/dist/web/components/ModelComboboxField.js","../../../../../../../packages/project-builder-lib/dist/web/components/ModelMergerResultAlert.js","../../../../../../../packages/project-builder-lib/dist/web/contexts/error-handler.js","../../../../../../../packages/project-builder-lib/dist/web/hooks/useBlockerDialog.js","../../../../../../../packages/project-builder-lib/dist/web/hooks/useBlockDirtyFormNavigate.js","../../../../../../../packages/project-builder-lib/dist/web/hooks/useBlockUnsavedChangesNavigate.js","../../../../../../../packages/project-builder-lib/dist/web/hooks/useErrorHandler.js","../../../../../../../packages/project-builder-lib/dist/web/hooks/usePluginEnhancedSchema.js","../../../../../../../packages/project-builder-lib/dist/web/hooks/useResettableForm.js","../../../../../../../packages/project-builder-lib/dist/web/specs/admin-crud-input-web-spec.js","../../../../../../../packages/project-builder-lib/dist/web/specs/model-transformer-web-spec.js","../../../../../../../packages/project-builder-lib/dist/web/utils/form.js"],"sourcesContent":["import React from 'react';\nexport const ProjectDefinitionContext = React.createContext(null);\nexport function useProjectDefinition() {\n const result = React.useContext(ProjectDefinitionContext);\n if (!result) {\n throw new Error(`useProjectDefinition must be used within a <ProjectDefinitionProvider>`);\n }\n return result;\n}\n//# sourceMappingURL=useProjectDefinition.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ComboboxField, useControllerMerged, } from '@baseplate-dev/ui-components';\nimport { useMemo, useState } from 'react';\nimport { FeatureUtils } from '#src/definition/index.js';\nimport { useProjectDefinition } from '../hooks/useProjectDefinition.js';\nfunction createCreateOption(value) {\n return {\n label: `Create \"${value}\"`,\n value,\n };\n}\nfunction FeatureComboboxField({ canCreate, value, ...rest }) {\n const { definition } = useProjectDefinition();\n const [searchQuery, setSearchQuery] = useState('');\n const featureOptions = useMemo(() => {\n const baseFeatures = definition.features.map((feature) => ({\n label: feature.name,\n value: feature.id,\n }));\n if (!canCreate)\n return baseFeatures;\n const newFeatureName = searchQuery ? searchQuery : value;\n const doesNewFeatureExist = !!baseFeatures.some((option) => option.label === newFeatureName || option.value === newFeatureName);\n return !doesNewFeatureExist &&\n newFeatureName &&\n FeatureUtils.validateFeatureName(newFeatureName)\n ? [...baseFeatures, createCreateOption(newFeatureName)]\n : baseFeatures;\n }, [definition.features, searchQuery, value, canCreate]);\n return (_jsx(ComboboxField, { placeholder: \"Select a feature\", ...rest, searchQuery: canCreate ? searchQuery : undefined, onSearchQueryChange: setSearchQuery, options: featureOptions, value: value }));\n}\nfunction FeatureComboboxFieldController({ name, control, ...rest }) {\n const { field, fieldState: { error }, } = useControllerMerged({ name, control }, rest);\n const restProps = rest;\n return (_jsx(FeatureComboboxField, { error: error?.message, ...restProps, ...field, value: field.value ?? null }));\n}\nexport { FeatureComboboxField, FeatureComboboxFieldController };\n//# sourceMappingURL=FeatureComboboxField.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ComboboxField, useControllerMerged, } from '@baseplate-dev/ui-components';\nimport { useMemo, useState } from 'react';\nimport { ModelUtils } from '#src/definition/index.js';\nimport { useProjectDefinition } from '../hooks/useProjectDefinition.js';\nfunction createCreateOption(value) {\n return {\n label: `Create \"${value}\"`,\n value,\n };\n}\nfunction ModelComboboxField({ canCreate, value, ...rest }) {\n const { definition } = useProjectDefinition();\n const [searchQuery, setSearchQuery] = useState('');\n const modelOptions = useMemo(() => {\n const baseModels = definition.models.map((model) => ({\n label: model.name,\n value: model.id,\n }));\n if (!canCreate)\n return baseModels;\n const newModelName = searchQuery ? searchQuery : value;\n const doesNewModelExist = !!baseModels.some((option) => option.label === newModelName || option.value === newModelName);\n return !doesNewModelExist &&\n newModelName &&\n ModelUtils.validateModelName(newModelName)\n ? [...baseModels, createCreateOption(newModelName)]\n : baseModels;\n }, [definition.models, searchQuery, value, canCreate]);\n return (_jsx(ComboboxField, { placeholder: \"Select a model\", ...rest, searchQuery: canCreate ? searchQuery : undefined, onSearchQueryChange: setSearchQuery, options: modelOptions, value: value }));\n}\nfunction ModelComboboxFieldController({ name, control, ...rest }) {\n const { field, fieldState: { error }, } = useControllerMerged({ name, control }, rest);\n const restProps = rest;\n return (_jsx(ModelComboboxField, { error: error?.message, ...restProps, ...field, value: field.value ?? null }));\n}\nexport { ModelComboboxField, ModelComboboxFieldController };\n//# sourceMappingURL=ModelComboboxField.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { Alert, AlertDescription, AlertTitle, } from '@baseplate-dev/ui-components';\nexport function ModelMergerResultAlert({ pendingModelChanges, }) {\n const changes = Object.values(pendingModelChanges).filter((change) => change !== undefined);\n if (changes.length === 0) {\n return null;\n }\n return (_jsx(\"div\", { className: \"space-y-4\", children: changes.map((change) => (_jsxs(Alert, { variant: change.isNewModel ? 'default' : 'warning', children: [_jsxs(AlertTitle, { children: [change.isNewModel ? 'New Model' : 'Model Changes', \": \", change.name] }), _jsx(AlertDescription, { children: _jsxs(\"div\", { className: \"mt-2 space-y-2\", children: [change.isNewModel ? (_jsx(\"p\", { children: \"This is a new model that will be created with the following configuration:\" })) : (_jsx(\"p\", { children: \"The following changes will be applied to the model:\" })), _jsxs(\"ul\", { className: \"list-disc pl-4 space-y-1\", children: [change.changes['model.fields']?.length ? (_jsxs(\"li\", { children: [_jsx(\"span\", { className: \"font-medium\", children: change.changes['model.fields'].length }), ' ', \"field(s) will be\", change.isNewModel ? ' created' : ' added or updated'] })) : undefined, change.changes['model.relations']?.length ? (_jsxs(\"li\", { children: [_jsx(\"span\", { className: \"font-medium\", children: change.changes['model.relations'].length }), ' ', \"relation(s) will be\", change.isNewModel ? ' created' : ' added or updated'] })) : undefined, change.changes['model.uniqueConstraints']?.length ? (_jsxs(\"li\", { children: [_jsx(\"span\", { className: \"font-medium\", children: change.changes['model.uniqueConstraints'].length }), ' ', \"unique constraint(s) will be\", ' ', change.isNewModel ? 'created' : 'added or updated'] })) : undefined, change.changes['model.primaryKeyFieldRefs']?.length ? (_jsxs(\"li\", { children: [\"Primary key will be \", change.isNewModel ? 'set' : 'updated', ' ', \"with\", ' ', _jsx(\"span\", { className: \"font-medium\", children: change.changes['model.primaryKeyFieldRefs'].length }), ' ', \"field(s)\"] })) : undefined] })] }) })] }, change.name))) }));\n}\n//# sourceMappingURL=ModelMergerResultAlert.js.map","import { createContext } from 'react';\nexport const ErrorHandlerContext = createContext(null);\n//# sourceMappingURL=error-handler.js.map","import { useEffect, useId } from 'react';\nimport { create } from 'zustand';\nexport const useBlockerDialogState = create((set) => ({\n activeBlockers: [],\n addBlocker: (options) => {\n set((state) => ({\n activeBlockers: [...state.activeBlockers, options],\n }));\n },\n removeBlocker: (id) => {\n set((state) => ({\n activeBlockers: state.activeBlockers.filter((blocker) => blocker.id !== id),\n }));\n },\n requestedBlockers: [],\n requestBlocker(options) {\n set((state) => ({\n requestedBlockers: [...state.requestedBlockers, options],\n }));\n },\n clearRequestedBlockers: () => {\n set(() => ({\n requestedBlockers: [],\n }));\n },\n}));\nexport function useBlockBeforeContinue() {\n const hasActiveBlockers = useBlockerDialogState((state) => state.activeBlockers.length > 0);\n const clearRequestedBlockers = useBlockerDialogState((state) => state.clearRequestedBlockers);\n // make sure we clear any blocker requests if we navigate away\n useEffect(() => () => {\n clearRequestedBlockers();\n }, [clearRequestedBlockers]);\n const requestBlocker = useBlockerDialogState((state) => state.requestBlocker);\n // if no blockers, continue immediately\n if (!hasActiveBlockers) {\n return ({ onContinue }) => {\n onContinue();\n };\n }\n return requestBlocker;\n}\nexport function useBlockerDialog(options) {\n const id = useId();\n const addBlocker = useBlockerDialogState((state) => state.addBlocker);\n const removeBlocker = useBlockerDialogState((state) => state.removeBlocker);\n useEffect(() => {\n if (options.disableBlock) {\n return;\n }\n addBlocker({\n disableBlock: options.disableBlock,\n title: options.title,\n content: options.content,\n buttonContinueWithoutSaveText: options.buttonContinueWithoutSaveText,\n onContinueWithoutSave: options.onContinueWithoutSave,\n buttonContinueText: options.buttonContinueText,\n onContinue: options.onContinue,\n id,\n });\n return () => {\n removeBlocker(id);\n };\n }, [\n addBlocker,\n removeBlocker,\n options.disableBlock,\n options.buttonContinueWithoutSaveText,\n options.onContinueWithoutSave,\n options.buttonContinueText,\n options.content,\n options.title,\n options.onContinue,\n id,\n ]);\n}\n//# sourceMappingURL=useBlockerDialog.js.map","import { useBlockerDialog } from './useBlockerDialog.js';\nexport function useBlockDirtyFormNavigate(formState, reset) {\n useBlockerDialog({\n disableBlock: !formState.isDirty,\n title: 'Unsaved Changes',\n content: 'You have unsaved changes. Are you sure you want to continue?',\n buttonContinueText: 'Discard Changes',\n onContinue: () => {\n reset();\n return true;\n },\n });\n}\n//# sourceMappingURL=useBlockDirtyFormNavigate.js.map","import { toast } from '@baseplate-dev/ui-components';\nimport { flattenObject } from 'es-toolkit';\nimport { useEffect, useRef } from 'react';\nimport { useFormState } from 'react-hook-form';\nimport { useBlockerDialog } from './useBlockerDialog.js';\nexport function useBlockUnsavedChangesNavigate({ control, reset, onSubmit, }) {\n const isDirtyRef = useRef(false);\n const formState = useFormState({ control });\n isDirtyRef.current = formState.isDirty;\n if (import.meta.env.DEV) {\n // eslint-disable-next-line react-hooks/rules-of-hooks -- only want to run this check in dev mode for performance/usability reasons\n useEffect(() => {\n if (Object.keys(formState.dirtyFields).length === 0 &&\n formState.isDirty) {\n // a bit of a hack to figure out what the issue is but OK since we only do this in dev mode\n const { _formValues, _defaultValues } = control;\n const formValueKeys = Object.keys(flattenObject(_formValues));\n const defaultValueKeys = Object.keys(flattenObject(_defaultValues));\n const missingKeys = formValueKeys.filter((key) => !defaultValueKeys.includes(key));\n toast.error(`Form is dirty but no fields are marked as dirty. This implies that there is likely a field ` +\n `is controlled but not set in defaultValues. This can be fixed by setting the default value to the field. ` +\n `Note: You will only see this error if you are running the app in dev mode. ` +\n `Missing fields: ${missingKeys.join(', ')}`);\n }\n }, [formState.dirtyFields, formState.isDirty, control]);\n }\n useBlockerDialog({\n disableBlock: !formState.isDirty,\n title: 'Unsaved Changes',\n content: 'You have unsaved changes. Do you want to save your changes?',\n buttonContinueWithoutSaveText: 'Discard Changes',\n onContinueWithoutSave: () => {\n reset();\n return true;\n },\n buttonContinueText: 'Save',\n onContinue: async () => {\n await onSubmit();\n // a bit of a hack to make sure we get the latest form state before continuing\n // there's not an easy way of figuring out if the submission was successful or not\n // so we wait for a React re-render and then check if the form is still dirty\n await new Promise((resolve) => setTimeout(resolve, 1));\n return !isDirtyRef.current;\n },\n });\n}\n//# sourceMappingURL=useBlockUnsavedChangesNavigate.js.map","import { useContext } from 'react';\nimport { ErrorHandlerContext } from '../contexts/error-handler.js';\nexport function useErrorHandler() {\n const context = useContext(ErrorHandlerContext);\n if (!context) {\n throw new Error('useErrorHandler must be used within an ErrorHandlerContext');\n }\n return context;\n}\n//# sourceMappingURL=useErrorHandler.js.map","import { useMemo } from 'react';\nimport { zPluginWrapper } from '#src/plugins/index.js';\nimport { useProjectDefinition } from './useProjectDefinition.js';\nexport function usePluginEnhancedSchema(schema) {\n const { pluginContainer } = useProjectDefinition();\n return useMemo(() => zPluginWrapper(schema, pluginContainer), [schema, pluginContainer]);\n}\n//# sourceMappingURL=usePluginEnhancedSchema.js.map","import { toast } from '@baseplate-dev/ui-components';\nimport { isEqual } from 'es-toolkit';\nimport { useEffect, useRef } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useProjectDefinition } from './useProjectDefinition.js';\nexport function useResettableForm(props) {\n const formProps = useForm(props);\n const { reset, formState } = formProps;\n const { isDirty } = formState;\n const { updatedExternally } = useProjectDefinition();\n const oldValues = useRef(undefined);\n useEffect(() => {\n if (oldValues.current &&\n !isEqual(oldValues.current.oldDefaultValues, props?.defaultValues)) {\n reset(props?.defaultValues);\n if (isDirty && updatedExternally) {\n toast.warning('Contents were updated externally so form was reset!');\n }\n }\n if (!oldValues.current ||\n !isEqual(oldValues.current.oldDefaultValues, props?.defaultValues)) {\n oldValues.current = {\n oldDefaultValues: props?.defaultValues,\n };\n }\n }, [props?.defaultValues, reset, updatedExternally, isDirty]);\n return formProps;\n}\n//# sourceMappingURL=useResettableForm.js.map","import { createPluginSpec } from '#src/plugins/spec/types.js';\nexport function createAdminCrudInputWebConfig(config) {\n return config;\n}\nexport function createAdminCrudInputWebImplementation() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputs = new Map();\n return {\n registerInputWebConfig(input) {\n if (inputs.has(input.name)) {\n throw new Error(`Admin CRUD input with name ${input.name} is already registered`);\n }\n inputs.set(input.name, input);\n },\n getInputWebConfig(name, builtInInputs = []) {\n const builtInInput = builtInInputs.find((b) => b.name === name);\n if (builtInInput) {\n return builtInInput;\n }\n const input = inputs.get(name);\n if (!input) {\n throw new Error(`Unable to find input with name ${name}`);\n }\n return input;\n },\n getInputWebConfigs(builtInInputs = []) {\n return [...builtInInputs, ...inputs.values()];\n },\n };\n}\n/**\n * Spec for adding config component for plugin\n */\nexport const adminCrudInputWebSpec = createPluginSpec('core/admin-crud-input-web', { defaultInitializer: createAdminCrudInputWebImplementation });\n//# sourceMappingURL=admin-crud-input-web-spec.js.map","import { createPluginSpec } from '#src/plugins/spec/types.js';\nexport function createNewModelTransformerWebConfig(config) {\n return config;\n}\nexport function createModelTransformerWebImplementation() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transformers = new Map();\n return {\n registerTransformerWebConfig(transformer) {\n if (transformers.has(transformer.name)) {\n throw new Error(`Model transformer with name ${transformer.name} is already registered`);\n }\n transformers.set(transformer.name, transformer);\n },\n getTransformerWebConfig(name, builtInTransformers = []) {\n const builtInTransformer = builtInTransformers.find((b) => b.name === name);\n if (builtInTransformer) {\n return builtInTransformer;\n }\n const transformer = transformers.get(name);\n if (!transformer) {\n throw new Error(`Unable to find transformer with name ${name}`);\n }\n return transformer;\n },\n getTransformerWebConfigs(builtInTransformers = []) {\n return [...builtInTransformers, ...transformers.values()];\n },\n };\n}\n/**\n * Spec for adding config component for plugin\n */\nexport const modelTransformerWebSpec = createPluginSpec('core/model-transformer-web', { defaultInitializer: createModelTransformerWebImplementation });\n//# sourceMappingURL=model-transformer-web-spec.js.map","export function setUndefinedIfEmpty(value) {\n if (value === '')\n return undefined;\n return value;\n}\n//# sourceMappingURL=form.js.map"],"names":["ComboboxField","useControllerMerged","useMemo","useState","createCreateOption","_jsx","_jsxs","useEffect","toast","useRef"],"mappings":";;;;;AAAA,MAAA,KAAA,GAAA,MAAA,YAAA,CAAA,OAAA,CAAA;;AACY,MAAC,wBAAwB,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI;AACzD,SAAS,oBAAoB,GAAG;AACvC,IAAI,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC;AAC7D,IAAI,IAA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