twenty-sdk 0.5.2 → 0.6.0
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/README.md +29 -10
- package/dist/{AllIcons-CGPKtPQS-C-ZFgy8B.mjs → AllIcons-CGPKtPQS-CBzLmrUd.mjs} +6666 -6695
- package/dist/{AllIcons-CGPKtPQS-sO2O4z-k.js → AllIcons-CGPKtPQS-CoHKEEHb.js} +3790 -3810
- package/dist/HtmlTagToRemoteComponent-DBOkvIRB.mjs +13283 -0
- package/dist/HtmlTagToRemoteComponent-DzQ2I9Lz.js +29 -0
- package/dist/cli/commands/app/app-dev.d.ts +0 -16
- package/dist/cli/commands/app/app-typecheck.d.ts +6 -0
- package/dist/cli/commands/app/app-uninstall.d.ts +2 -2
- package/dist/cli/commands/app-command.d.ts +1 -1
- package/dist/cli/commands/entity/entity-add.d.ts +3 -0
- package/dist/cli/commands/logic-function/logic-function-execute.d.ts +2 -1
- package/dist/cli/commands/logic-function/logic-function-logs.d.ts +1 -1
- package/dist/cli/utilities/api/api-service.d.ts +37 -9
- package/dist/cli/utilities/build/common/esbuild-result-processor.d.ts +2 -2
- package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +2 -2
- package/dist/cli/utilities/build/common/file-upload-watcher.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/jsx-runtime-remote-wrapper-plugin.d.ts +6 -0
- package/dist/cli/utilities/build/common/front-component-build/jsx-transform-to-remote-dom-worker-format-plugin.d.ts +0 -1
- package/dist/cli/utilities/build/common/front-component-build/preact-alias-plugin.d.ts +2 -0
- package/dist/cli/utilities/build/common/front-component-build/utils/get-front-component-build-plugins.d.ts +5 -1
- package/dist/cli/utilities/build/common/restartable-watcher-interface.d.ts +2 -2
- package/dist/cli/utilities/build/common/tsc-watcher.d.ts +18 -0
- package/dist/cli/utilities/build/common/typecheck-plugin.d.ts +10 -0
- package/dist/cli/utilities/build/manifest/manifest-build.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-extract-config-from-file.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +10 -2
- package/dist/cli/utilities/build/manifest/manifest-reader.d.ts +2 -0
- package/dist/cli/utilities/build/manifest/manifest-update-checksums.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-validate.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/manifest-writer.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/utils/generate-default-field-universal-identifier.d.ts +5 -0
- package/dist/cli/utilities/build/manifest/utils/get-default-fields-in-object-fields.d.ts +6 -0
- package/dist/cli/utilities/build/manifest/utils/get-default-object-fields.d.ts +3 -0
- package/dist/cli/utilities/build/manifest/utils/get-default-relation-object-fields.d.ts +6 -0
- package/dist/cli/utilities/client/client-service.d.ts +5 -3
- package/dist/cli/utilities/config/config-service.d.ts +2 -0
- package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator-state.d.ts +75 -0
- package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +29 -0
- package/dist/cli/utilities/dev/orchestrator/steps/build-manifest-orchestrator-step.d.ts +16 -0
- package/dist/cli/utilities/dev/orchestrator/steps/check-server-orchestrator-step.d.ts +17 -0
- package/dist/cli/utilities/dev/orchestrator/steps/ensure-valid-tokens-orchestrator-step.d.ts +22 -0
- package/dist/cli/utilities/dev/orchestrator/steps/generate-api-client-orchestrator-step.d.ts +18 -0
- package/dist/cli/utilities/dev/orchestrator/steps/resolve-application-orchestrator-step.d.ts +20 -0
- package/dist/cli/utilities/dev/orchestrator/steps/start-watchers-orchestrator-step.d.ts +43 -0
- package/dist/cli/utilities/dev/orchestrator/steps/sync-application-orchestrator-step.d.ts +22 -0
- package/dist/cli/utilities/dev/orchestrator/steps/upload-files-orchestrator-step.d.ts +25 -0
- package/dist/cli/utilities/dev/ui/components/dev-ui-application-panel.d.ts +12 -0
- package/dist/cli/utilities/dev/ui/components/dev-ui-entity-section.d.ts +16 -0
- package/dist/cli/utilities/dev/ui/components/dev-ui-event-log.d.ts +5 -0
- package/dist/cli/utilities/dev/{dev-ui.d.ts → ui/components/dev-ui.d.ts} +1 -1
- package/dist/cli/utilities/dev/ui/dev-ui-constants.d.ts +27 -0
- package/dist/cli/utilities/dev/ui/dev-ui-hooks.d.ts +3 -0
- package/dist/cli/utilities/dev/ui/dev-ui-ink-context.d.ts +10 -0
- package/dist/cli/utilities/dev/ui/dev-ui-state-manager.d.ts +10 -0
- package/dist/cli/utilities/entity/entity-field-template.d.ts +2 -2
- package/dist/cli/utilities/entity/entity-front-component-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-logic-function-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-navigation-menu-item-template.d.ts +5 -0
- package/dist/cli/utilities/entity/entity-object-template.d.ts +2 -1
- package/dist/cli/utilities/entity/entity-page-layout-template.d.ts +3 -0
- package/dist/cli/utilities/entity/entity-role-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-skill-template.d.ts +4 -0
- package/dist/cli/utilities/entity/entity-view-template.d.ts +5 -0
- package/dist/cli/utilities/error/serialize-error.d.ts +1 -0
- package/dist/cli/utilities/file/file-jsonc.d.ts +1 -1
- package/dist/cli/utilities/file/file-path.d.ts +1 -1
- package/dist/cli/utilities/file/file-uploader.d.ts +3 -3
- package/dist/cli/utilities/typescript/typescript-diagnostics.d.ts +1 -1
- package/dist/cli/utilities/typescript/typescript-program.d.ts +1 -1
- package/dist/cli.cjs +356 -85
- package/dist/cli.mjs +5260 -4313
- package/dist/front-component-renderer/host/components/FrontComponentRenderer.d.ts +14 -0
- package/dist/front-component-renderer/host/components/RemoteStyleRenderer.d.ts +6 -0
- package/dist/front-component-renderer/host/utils/createHtmlHostWrapper.d.ts +8 -0
- package/dist/front-component-renderer/index.cjs +25 -0
- package/dist/{front-component → front-component-renderer}/index.d.ts +5 -5
- package/dist/front-component-renderer/index.mjs +11744 -0
- package/dist/front-component-renderer/polyfills/MockCSSStyleSheet.d.ts +17 -0
- package/dist/front-component-renderer/polyfills/installStyleBridge.d.ts +2 -0
- package/dist/front-component-renderer/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +8 -0
- package/dist/front-component-renderer/remote/components/FrontComponentUpdateContextEffect.d.ts +11 -0
- package/dist/{front-component → front-component-renderer}/remote/components/FrontComponentWorkerEffect.d.ts +5 -4
- package/dist/front-component-renderer/remote/generated/remote-components.d.ts +44 -0
- package/dist/front-component-renderer/remote/generated/remote-elements.d.ts +193 -0
- package/dist/front-component-renderer/remote/utils/installStylePropertyOnRemoteElements.d.ts +1 -0
- package/dist/front-component-renderer/remote/utils/patchRemoteElementSetAttribute.d.ts +1 -0
- package/dist/front-component-renderer/remote/worker/remote-worker.d.ts +3 -0
- package/dist/front-component-renderer/remote/worker/utils/setWorkerEnv.d.ts +1 -0
- package/dist/{front-component → front-component-renderer}/types/FrontComponentExecutionContext.d.ts +1 -0
- package/dist/front-component-renderer/types/FrontComponentHostCommunicationApi.d.ts +8 -0
- package/dist/{front-component → front-component-renderer}/types/HostToWorkerRenderContext.d.ts +2 -1
- package/dist/front-component-renderer/types/PropertySchema.d.ts +4 -0
- package/dist/{front-component → front-component-renderer}/types/WorkerExports.d.ts +3 -3
- package/dist/get-function-input-schema-BZ7_XyUh-By3UDh4s.mjs +62 -0
- package/dist/get-function-input-schema-BZ7_XyUh-GxSybvDe.js +1 -0
- package/dist/index-CicdakVv.js +2430 -0
- package/dist/index-DeMzdViF.mjs +33940 -0
- package/dist/index.cjs +2 -5
- package/dist/index.mjs +408 -2493
- package/dist/sdk/action/Action.d.ts +4 -0
- package/dist/sdk/action/Action.js +33 -0
- package/dist/sdk/action/Action.js.map +1 -0
- package/dist/sdk/action/ActionLink.d.ts +10 -0
- package/dist/sdk/action/ActionLink.js +39 -0
- package/dist/sdk/action/ActionLink.js.map +1 -0
- package/dist/sdk/action/ActionOpenSidePanelPage.d.ts +9 -0
- package/dist/sdk/action/ActionOpenSidePanelPage.js +54 -0
- package/dist/sdk/action/ActionOpenSidePanelPage.js.map +1 -0
- package/dist/sdk/action/index.d.ts +6 -0
- package/dist/sdk/application/application-config.d.ts +2 -2
- package/dist/sdk/application/define-application.d.ts +2 -2
- package/dist/sdk/application/define-application.js +12 -0
- package/dist/sdk/application/define-application.js.map +1 -0
- package/dist/sdk/common/types/define-entity.type.d.ts +9 -6
- package/dist/sdk/common/utils/create-validation-result.d.ts +1 -1
- package/dist/sdk/common/utils/create-validation-result.js +12 -0
- package/dist/sdk/common/utils/create-validation-result.js.map +1 -0
- package/dist/sdk/define-front-component.d.ts +2 -2
- package/dist/sdk/define-front-component.js +20 -0
- package/dist/sdk/define-front-component.js.map +1 -0
- package/dist/sdk/fields/define-field.d.ts +2 -2
- package/dist/sdk/fields/define-field.js +15 -0
- package/dist/sdk/fields/define-field.js.map +1 -0
- package/dist/sdk/fields/validate-fields.d.ts +1 -1
- package/dist/sdk/fields/validate-fields.js +16 -0
- package/dist/sdk/fields/validate-fields.js.map +1 -0
- package/dist/{HtmlTagToRemoteComponent-DRdIf3GJ.mjs → sdk/front-component-api/constants/AllowedHtmlElements.js} +4 -14
- package/dist/sdk/front-component-api/constants/AllowedHtmlElements.js.map +1 -0
- package/dist/sdk/front-component-api/constants/CommonHtmlEvents.js +26 -0
- package/dist/sdk/front-component-api/constants/CommonHtmlEvents.js.map +1 -0
- package/dist/sdk/front-component-api/constants/EventToReact.js +26 -0
- package/dist/sdk/front-component-api/constants/EventToReact.js.map +1 -0
- package/dist/sdk/front-component-api/constants/HtmlCommonProperties.d.ts +2 -0
- package/dist/sdk/front-component-api/constants/HtmlCommonProperties.js +15 -0
- package/dist/sdk/front-component-api/constants/HtmlCommonProperties.js.map +1 -0
- package/dist/sdk/front-component-api/constants/HtmlTagToRemoteComponent.d.ts +2 -0
- package/dist/sdk/front-component-api/constants/HtmlTagToRemoteComponent.js +24 -0
- package/dist/sdk/front-component-api/constants/HtmlTagToRemoteComponent.js.map +1 -0
- package/dist/sdk/front-component-api/context/frontComponentContext.d.ts +2 -2
- package/dist/sdk/front-component-api/context/frontComponentContext.js +11 -0
- package/dist/sdk/front-component-api/context/frontComponentContext.js.map +1 -0
- package/dist/sdk/front-component-api/functions/closeSidePanel.d.ts +2 -0
- package/dist/sdk/front-component-api/functions/closeSidePanel.js +12 -0
- package/dist/sdk/front-component-api/functions/closeSidePanel.js.map +1 -0
- package/dist/sdk/front-component-api/functions/enqueueSnackbar.d.ts +2 -0
- package/dist/sdk/front-component-api/functions/enqueueSnackbar.js +12 -0
- package/dist/sdk/front-component-api/functions/enqueueSnackbar.js.map +1 -0
- package/dist/sdk/front-component-api/functions/navigate.d.ts +1 -4
- package/dist/sdk/front-component-api/functions/navigate.js +12 -0
- package/dist/sdk/front-component-api/functions/navigate.js.map +1 -0
- package/dist/sdk/front-component-api/functions/openSidePanelPage.d.ts +2 -0
- package/dist/sdk/front-component-api/functions/openSidePanelPage.js +12 -0
- package/dist/sdk/front-component-api/functions/openSidePanelPage.js.map +1 -0
- package/dist/sdk/front-component-api/functions/unmountFrontComponent.d.ts +2 -0
- package/dist/sdk/front-component-api/functions/unmountFrontComponent.js +12 -0
- package/dist/sdk/front-component-api/functions/unmountFrontComponent.js.map +1 -0
- package/dist/sdk/front-component-api/globals/frontComponentHostCommunicationApi.d.ts +23 -0
- package/dist/sdk/front-component-api/globals/frontComponentHostCommunicationApi.js +6 -0
- package/dist/sdk/front-component-api/globals/frontComponentHostCommunicationApi.js.map +1 -0
- package/dist/sdk/front-component-api/hooks/useFrontComponentExecutionContext.d.ts +2 -2
- package/dist/sdk/front-component-api/hooks/useFrontComponentExecutionContext.js +18 -0
- package/dist/sdk/front-component-api/hooks/useFrontComponentExecutionContext.js.map +1 -0
- package/dist/sdk/front-component-api/hooks/useFrontComponentId.d.ts +1 -0
- package/dist/sdk/front-component-api/hooks/useFrontComponentId.js +6 -0
- package/dist/sdk/front-component-api/hooks/useFrontComponentId.js.map +1 -0
- package/dist/sdk/front-component-api/hooks/useUserId.d.ts +1 -1
- package/dist/sdk/front-component-api/hooks/useUserId.js +6 -0
- package/dist/sdk/front-component-api/hooks/useUserId.js.map +1 -0
- package/dist/sdk/front-component-api/index.d.ts +14 -1
- package/dist/sdk/front-component-api/types/FrontComponentExecutionContext.d.ts +1 -0
- package/dist/sdk/front-component-api/utils/getFrontComponentActionErrorDedupeKey.d.ts +1 -0
- package/dist/sdk/front-component-api/utils/getFrontComponentActionErrorDedupeKey.js +5 -0
- package/dist/sdk/front-component-api/utils/getFrontComponentActionErrorDedupeKey.js.map +1 -0
- package/dist/sdk/front-component-config.d.ts +2 -1
- package/dist/sdk/front-component-renderer/polyfills/MockCSSStyleSheet.js +31 -0
- package/dist/sdk/front-component-renderer/polyfills/MockCSSStyleSheet.js.map +1 -0
- package/dist/sdk/front-component-renderer/polyfills/installStyleBridge.js +121 -0
- package/dist/sdk/front-component-renderer/polyfills/installStyleBridge.js.map +1 -0
- package/dist/sdk/front-component-renderer/remote/utils/exposeGlobals.js +8 -0
- package/dist/sdk/front-component-renderer/remote/utils/exposeGlobals.js.map +1 -0
- package/dist/sdk/index.d.ts +26 -13
- package/dist/sdk/index.js +79 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/logic-functions/define-logic-function.d.ts +2 -2
- package/dist/sdk/logic-functions/define-logic-function.js +12 -0
- package/dist/sdk/logic-functions/define-logic-function.js.map +1 -0
- package/dist/sdk/logic-functions/logic-function-config.d.ts +4 -2
- package/dist/sdk/navigation-menu-items/define-navigation-menu-item.d.ts +3 -0
- package/dist/sdk/navigation-menu-items/define-navigation-menu-item.js +9 -0
- package/dist/sdk/navigation-menu-items/define-navigation-menu-item.js.map +1 -0
- package/dist/sdk/objects/define-object.d.ts +3 -3
- package/dist/sdk/objects/define-object.js +20 -0
- package/dist/sdk/objects/define-object.js.map +1 -0
- package/dist/sdk/objects/object-config.d.ts +4 -0
- package/dist/sdk/page-layouts/define-page-layout.d.ts +3 -0
- package/dist/sdk/page-layouts/define-page-layout.js +15 -0
- package/dist/sdk/page-layouts/define-page-layout.js.map +1 -0
- package/dist/sdk/page-layouts/page-layout-config.d.ts +2 -0
- package/dist/sdk/roles/define-role.d.ts +2 -2
- package/dist/sdk/roles/define-role.js +15 -0
- package/dist/sdk/roles/define-role.js.map +1 -0
- package/dist/sdk/skills/define-skill.d.ts +3 -0
- package/dist/sdk/skills/define-skill.js +9 -0
- package/dist/sdk/skills/define-skill.js.map +1 -0
- package/dist/sdk/views/define-view.d.ts +3 -0
- package/dist/sdk/views/define-view.js +24 -0
- package/dist/sdk/views/define-view.js.map +1 -0
- package/dist/sdk/views/view-config.d.ts +2 -0
- package/dist/ui/index.cjs +1 -47
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.mjs +692 -2401
- package/package.json +47 -12
- package/dist/HtmlTagToRemoteComponent-B6lQe_K8.js +0 -1
- package/dist/IconWorld-DynX4UYH.mjs +0 -3003
- package/dist/IconWorld-JYjJym3l.js +0 -1876
- package/dist/_commonjsHelpers-DKOUU3wS.js +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
- package/dist/cli/commands/app/app-generate.d.ts +0 -4
- package/dist/cli/utilities/build/common/front-component-build/react-globals-plugin.d.ts +0 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-globals-plugin.d.ts +0 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-ui-globals-plugin.d.ts +0 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-shared-globals-plugin.d.ts +0 -1
- package/dist/cli/utilities/build/common/front-component-build/types/ParsedImportSpecifier.d.ts +0 -4
- package/dist/cli/utilities/build/common/front-component-build/utils/collect-named-imports.d.ts +0 -4
- package/dist/cli/utilities/build/common/front-component-build/utils/create-front-component-build-options.d.ts +0 -13
- package/dist/cli/utilities/build/common/front-component-build/utils/create-globals-plugin.d.ts +0 -15
- package/dist/cli/utilities/build/common/front-component-build/utils/extract-names-from-import-specifier.d.ts +0 -2
- package/dist/cli/utilities/build/common/front-component-build/utils/replace-html-tags-with-remote-components.d.ts +0 -1
- package/dist/cli/utilities/dev/dev-mode-orchestrator.d.ts +0 -42
- package/dist/cli/utilities/dev/dev-ui-state-manager.d.ts +0 -31
- package/dist/cli/utilities/dev/dev-ui-state.d.ts +0 -27
- package/dist/front-component/__stories__/FrontComponentRenderer.stories.d.ts +0 -9
- package/dist/front-component/__stories__/mocks/interactive.front-component.d.ts +0 -7
- package/dist/front-component/__stories__/mocks/lifecycle.front-component.d.ts +0 -7
- package/dist/front-component/__stories__/mocks/static.front-component.d.ts +0 -7
- package/dist/front-component/__stories__/utils/buildMockComponents.d.ts +0 -1
- package/dist/front-component/__stories__/utils/loadBuiltComponent.d.ts +0 -1
- package/dist/front-component/host/components/FrontComponentRenderer.d.ts +0 -13
- package/dist/front-component/host/generated/host-index.d.ts +0 -1
- package/dist/front-component/index.cjs +0 -1
- package/dist/front-component/index.mjs +0 -5736
- package/dist/front-component/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +0 -8
- package/dist/front-component/remote/components/FrontComponentUpdateContextEffect.d.ts +0 -10
- package/dist/front-component/remote/generated/remote-components.d.ts +0 -299
- package/dist/front-component/remote/generated/remote-elements.d.ts +0 -3335
- package/dist/front-component/remote/generated/remote-index.d.ts +0 -2
- package/dist/front-component/remote/mock/mock-front-component.d.ts +0 -3
- package/dist/front-component/remote/worker/remote-worker.d.ts +0 -0
- package/dist/front-component/types/FrontComponentHostCommunicationApi.d.ts +0 -4
- package/dist/front-component/types/PropertySchema.d.ts +0 -4
- package/dist/index.d.ts +0 -1
- package/dist/isValidCountryCode-ujmwsK7z-B8kSH7O8.mjs +0 -10248
- package/dist/isValidCountryCode-ujmwsK7z-DwSvvT1u.js +0 -25
- package/dist/navigation-_M4-TT0O.js +0 -503
- package/dist/navigation-udgao_jA.mjs +0 -30041
- package/dist/sdk/front-component-common/HtmlCommonProperties.d.ts +0 -2
- package/dist/sdk/front-component-common/HtmlTagToRemoteComponent.d.ts +0 -1
- package/dist/sdk/front-component-common/index.d.ts +0 -7
- /package/dist/{front-component → front-component-renderer}/host/generated/host-component-registry.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/components/FrontComponentErrorEffect.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/utils/exposeGlobals.d.ts +0 -0
- /package/dist/{front-component/remote/worker → front-component-renderer/remote/worker/utils}/createRemoteWorker.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/AllowedHtmlElements.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/CommonHtmlEvents.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/EventToReact.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/SerializedEventData.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState as a, useEffect as i } from "react";
|
|
2
|
+
import "twenty-shared/utils";
|
|
3
|
+
import "../front-component-api/globals/frontComponentHostCommunicationApi.js";
|
|
4
|
+
import { enqueueSnackbar as m } from "../front-component-api/functions/enqueueSnackbar.js";
|
|
5
|
+
import { unmountFrontComponent as s } from "../front-component-api/functions/unmountFrontComponent.js";
|
|
6
|
+
import { useFrontComponentId as u } from "../front-component-api/hooks/useFrontComponentId.js";
|
|
7
|
+
import { getFrontComponentActionErrorDedupeKey as p } from "../front-component-api/utils/getFrontComponentActionErrorDedupeKey.js";
|
|
8
|
+
import "../front-component-api/constants/HtmlTagToRemoteComponent.js";
|
|
9
|
+
const A = ({ execute: t }) => {
|
|
10
|
+
const [r, n] = a(!1), o = u();
|
|
11
|
+
return i(() => {
|
|
12
|
+
if (r)
|
|
13
|
+
return;
|
|
14
|
+
n(!0), (async () => {
|
|
15
|
+
try {
|
|
16
|
+
await t();
|
|
17
|
+
} catch (e) {
|
|
18
|
+
e instanceof Error && await m({
|
|
19
|
+
message: "Action failed",
|
|
20
|
+
detailedMessage: e.message,
|
|
21
|
+
variant: "error",
|
|
22
|
+
dedupeKey: p(o)
|
|
23
|
+
});
|
|
24
|
+
} finally {
|
|
25
|
+
await s();
|
|
26
|
+
}
|
|
27
|
+
})();
|
|
28
|
+
}, [t, r, o]), null;
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
A as Action
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=Action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../src/sdk/action/Action.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport {\n enqueueSnackbar,\n getFrontComponentActionErrorDedupeKey,\n unmountFrontComponent,\n useFrontComponentId,\n} from '../front-component-api';\n\nexport type ActionProps = {\n execute: () => void | Promise<void>;\n};\n\nexport const Action = ({ execute }: ActionProps) => {\n const [hasExecuted, setHasExecuted] = useState(false);\n\n const frontComponentId = useFrontComponentId();\n\n useEffect(() => {\n if (hasExecuted) {\n return;\n }\n\n setHasExecuted(true);\n\n const run = async () => {\n try {\n await execute();\n } catch (error) {\n if (error instanceof Error) {\n await enqueueSnackbar({\n message: 'Action failed',\n detailedMessage: error.message,\n variant: 'error',\n dedupeKey: getFrontComponentActionErrorDedupeKey(frontComponentId),\n });\n }\n } finally {\n await unmountFrontComponent();\n }\n };\n\n run();\n }, [execute, hasExecuted, frontComponentId]);\n\n return null;\n};\n"],"names":["Action","execute","hasExecuted","setHasExecuted","useState","frontComponentId","useFrontComponentId","useEffect","error","enqueueSnackbar","getFrontComponentActionErrorDedupeKey","unmountFrontComponent"],"mappings":";;;;;;;;AAaO,MAAMA,IAAS,CAAC,EAAE,SAAAC,QAA2B;AAClD,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAAmBC,EAAA;AAEzB,SAAAC,EAAU,MAAM;AACd,QAAIL;AACF;AAGF,IAAAC,EAAe,EAAI,IAEP,YAAY;AACtB,UAAI;AACF,cAAMF,EAAA;AAAA,MACR,SAASO,GAAO;AACd,QAAIA,aAAiB,SACnB,MAAMC,EAAgB;AAAA,UACpB,SAAS;AAAA,UACT,iBAAiBD,EAAM;AAAA,UACvB,SAAS;AAAA,UACT,WAAWE,EAAsCL,CAAgB;AAAA,QAAA,CAClE;AAAA,MAEL,UAAA;AACE,cAAMM,EAAA;AAAA,MACR;AAAA,IACF,GAEA;AAAA,EACF,GAAG,CAACV,GAASC,GAAaG,CAAgB,CAAC,GAEpC;AACT;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type NavigateOptions } from 'react-router-dom';
|
|
2
|
+
import { type AppPath } from 'twenty-shared/types';
|
|
3
|
+
import { type getAppPath } from 'twenty-shared/utils';
|
|
4
|
+
export type ActionLinkProps<T extends AppPath> = {
|
|
5
|
+
to: T;
|
|
6
|
+
params?: Parameters<typeof getAppPath<T>>[1];
|
|
7
|
+
queryParams?: Record<string, any>;
|
|
8
|
+
options?: NavigateOptions;
|
|
9
|
+
};
|
|
10
|
+
export declare const ActionLink: <T extends AppPath>({ to, params, queryParams, options, }: ActionLinkProps<T>) => null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useState as s, useEffect as u } from "react";
|
|
2
|
+
import "twenty-shared/utils";
|
|
3
|
+
import "../front-component-api/globals/frontComponentHostCommunicationApi.js";
|
|
4
|
+
import { enqueueSnackbar as c } from "../front-component-api/functions/enqueueSnackbar.js";
|
|
5
|
+
import { navigate as f } from "../front-component-api/functions/navigate.js";
|
|
6
|
+
import { unmountFrontComponent as p } from "../front-component-api/functions/unmountFrontComponent.js";
|
|
7
|
+
import { useFrontComponentId as d } from "../front-component-api/hooks/useFrontComponentId.js";
|
|
8
|
+
import { getFrontComponentActionErrorDedupeKey as l } from "../front-component-api/utils/getFrontComponentActionErrorDedupeKey.js";
|
|
9
|
+
import "../front-component-api/constants/HtmlTagToRemoteComponent.js";
|
|
10
|
+
const v = ({
|
|
11
|
+
to: t,
|
|
12
|
+
params: e,
|
|
13
|
+
queryParams: r,
|
|
14
|
+
options: o
|
|
15
|
+
}) => {
|
|
16
|
+
const [n, m] = s(!1), i = d();
|
|
17
|
+
return u(() => {
|
|
18
|
+
if (n)
|
|
19
|
+
return;
|
|
20
|
+
m(!0), (async () => {
|
|
21
|
+
try {
|
|
22
|
+
await f(t, e, r, o);
|
|
23
|
+
} catch (a) {
|
|
24
|
+
a instanceof Error && await c({
|
|
25
|
+
message: "Action failed",
|
|
26
|
+
detailedMessage: a.message,
|
|
27
|
+
variant: "error",
|
|
28
|
+
dedupeKey: l(i)
|
|
29
|
+
});
|
|
30
|
+
} finally {
|
|
31
|
+
await p();
|
|
32
|
+
}
|
|
33
|
+
})();
|
|
34
|
+
}, [t, e, r, o, n, i]), null;
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
v as ActionLink
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=ActionLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionLink.js","sources":["../../../src/sdk/action/ActionLink.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { type NavigateOptions } from 'react-router-dom';\nimport { type AppPath } from 'twenty-shared/types';\nimport { type getAppPath } from 'twenty-shared/utils';\nimport {\n enqueueSnackbar,\n getFrontComponentActionErrorDedupeKey,\n navigate,\n unmountFrontComponent,\n useFrontComponentId,\n} from '../front-component-api';\n\nexport type ActionLinkProps<T extends AppPath> = {\n to: T;\n params?: Parameters<typeof getAppPath<T>>[1];\n queryParams?: Record<string, any>;\n options?: NavigateOptions;\n};\n\nexport const ActionLink = <T extends AppPath>({\n to,\n params,\n queryParams,\n options,\n}: ActionLinkProps<T>) => {\n const [hasExecuted, setHasExecuted] = useState(false);\n\n const frontComponentId = useFrontComponentId();\n\n useEffect(() => {\n if (hasExecuted) {\n return;\n }\n\n setHasExecuted(true);\n\n const run = async () => {\n try {\n await navigate(to, params, queryParams, options);\n } catch (error) {\n if (error instanceof Error) {\n await enqueueSnackbar({\n message: 'Action failed',\n detailedMessage: error.message,\n variant: 'error',\n dedupeKey: getFrontComponentActionErrorDedupeKey(frontComponentId),\n });\n }\n } finally {\n await unmountFrontComponent();\n }\n };\n\n run();\n }, [to, params, queryParams, options, hasExecuted, frontComponentId]);\n\n return null;\n};\n"],"names":["ActionLink","to","params","queryParams","options","hasExecuted","setHasExecuted","useState","frontComponentId","useFrontComponentId","useEffect","navigate","error","enqueueSnackbar","getFrontComponentActionErrorDedupeKey","unmountFrontComponent"],"mappings":";;;;;;;;;AAoBO,MAAMA,IAAa,CAAoB;AAAA,EAC5C,IAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AACF,MAA0B;AACxB,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAAmBC,EAAA;AAEzB,SAAAC,EAAU,MAAM;AACd,QAAIL;AACF;AAGF,IAAAC,EAAe,EAAI,IAEP,YAAY;AACtB,UAAI;AACF,cAAMK,EAASV,GAAIC,GAAQC,GAAaC,CAAO;AAAA,MACjD,SAASQ,GAAO;AACd,QAAIA,aAAiB,SACnB,MAAMC,EAAgB;AAAA,UACpB,SAAS;AAAA,UACT,iBAAiBD,EAAM;AAAA,UACvB,SAAS;AAAA,UACT,WAAWE,EAAsCN,CAAgB;AAAA,QAAA,CAClE;AAAA,MAEL,UAAA;AACE,cAAMO,EAAA;AAAA,MACR;AAAA,IACF,GAEA;AAAA,EACF,GAAG,CAACd,GAAIC,GAAQC,GAAaC,GAASC,GAAaG,CAAgB,CAAC,GAE7D;AACT;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CommandMenuPages } from 'twenty-shared/types';
|
|
2
|
+
export type ActionOpenSidePanelPageProps = {
|
|
3
|
+
page: CommandMenuPages;
|
|
4
|
+
pageTitle: string;
|
|
5
|
+
pageIcon: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
shouldResetSearchState?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const ActionOpenSidePanelPage: ({ page, pageTitle, pageIcon, onClick, shouldResetSearchState, }: ActionOpenSidePanelPageProps) => null;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import "twenty-shared/utils";
|
|
2
|
+
import "../front-component-api/globals/frontComponentHostCommunicationApi.js";
|
|
3
|
+
import { enqueueSnackbar as f } from "../front-component-api/functions/enqueueSnackbar.js";
|
|
4
|
+
import { openSidePanelPage as u } from "../front-component-api/functions/openSidePanelPage.js";
|
|
5
|
+
import { unmountFrontComponent as p } from "../front-component-api/functions/unmountFrontComponent.js";
|
|
6
|
+
import { useState as c, useEffect as d } from "react";
|
|
7
|
+
import { useFrontComponentId as l } from "../front-component-api/hooks/useFrontComponentId.js";
|
|
8
|
+
import { getFrontComponentActionErrorDedupeKey as y } from "../front-component-api/utils/getFrontComponentActionErrorDedupeKey.js";
|
|
9
|
+
import "../front-component-api/constants/HtmlTagToRemoteComponent.js";
|
|
10
|
+
const b = ({
|
|
11
|
+
page: e,
|
|
12
|
+
pageTitle: r,
|
|
13
|
+
pageIcon: t,
|
|
14
|
+
onClick: o,
|
|
15
|
+
shouldResetSearchState: n = !1
|
|
16
|
+
}) => {
|
|
17
|
+
const [a, s] = c(!1), i = l();
|
|
18
|
+
return d(() => {
|
|
19
|
+
if (a)
|
|
20
|
+
return;
|
|
21
|
+
s(!0), (async () => {
|
|
22
|
+
o?.();
|
|
23
|
+
try {
|
|
24
|
+
await u({
|
|
25
|
+
page: e,
|
|
26
|
+
pageTitle: r,
|
|
27
|
+
pageIcon: t,
|
|
28
|
+
shouldResetSearchState: n
|
|
29
|
+
});
|
|
30
|
+
} catch (m) {
|
|
31
|
+
m instanceof Error && await f({
|
|
32
|
+
message: "Action failed",
|
|
33
|
+
detailedMessage: m.message,
|
|
34
|
+
variant: "error",
|
|
35
|
+
dedupeKey: y(i)
|
|
36
|
+
});
|
|
37
|
+
} finally {
|
|
38
|
+
await p();
|
|
39
|
+
}
|
|
40
|
+
})();
|
|
41
|
+
}, [
|
|
42
|
+
e,
|
|
43
|
+
r,
|
|
44
|
+
t,
|
|
45
|
+
n,
|
|
46
|
+
o,
|
|
47
|
+
a,
|
|
48
|
+
i
|
|
49
|
+
]), null;
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
b as ActionOpenSidePanelPage
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=ActionOpenSidePanelPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionOpenSidePanelPage.js","sources":["../../../src/sdk/action/ActionOpenSidePanelPage.tsx"],"sourcesContent":["import {\n enqueueSnackbar,\n getFrontComponentActionErrorDedupeKey,\n openSidePanelPage,\n unmountFrontComponent,\n useFrontComponentId,\n} from '@/sdk/front-component-api';\nimport { useEffect, useState } from 'react';\n\nimport { type CommandMenuPages } from 'twenty-shared/types';\n\nexport type ActionOpenSidePanelPageProps = {\n page: CommandMenuPages;\n pageTitle: string;\n pageIcon: string;\n onClick?: () => void;\n shouldResetSearchState?: boolean;\n};\n\nexport const ActionOpenSidePanelPage = ({\n page,\n pageTitle,\n pageIcon,\n onClick,\n shouldResetSearchState = false,\n}: ActionOpenSidePanelPageProps) => {\n const [hasExecuted, setHasExecuted] = useState(false);\n\n const frontComponentId = useFrontComponentId();\n\n useEffect(() => {\n if (hasExecuted) {\n return;\n }\n\n setHasExecuted(true);\n\n const run = async () => {\n onClick?.();\n\n try {\n await openSidePanelPage({\n page,\n pageTitle,\n pageIcon,\n shouldResetSearchState,\n });\n } catch (error) {\n if (error instanceof Error) {\n await enqueueSnackbar({\n message: 'Action failed',\n detailedMessage: error.message,\n variant: 'error',\n dedupeKey: getFrontComponentActionErrorDedupeKey(frontComponentId),\n });\n }\n } finally {\n await unmountFrontComponent();\n }\n };\n\n run();\n }, [\n page,\n pageTitle,\n pageIcon,\n shouldResetSearchState,\n onClick,\n hasExecuted,\n frontComponentId,\n ]);\n\n return null;\n};\n"],"names":["ActionOpenSidePanelPage","page","pageTitle","pageIcon","onClick","shouldResetSearchState","hasExecuted","setHasExecuted","useState","frontComponentId","useFrontComponentId","useEffect","openSidePanelPage","error","enqueueSnackbar","getFrontComponentActionErrorDedupeKey","unmountFrontComponent"],"mappings":";;;;;;;;;AAmBO,MAAMA,IAA0B,CAAC;AAAA,EACtC,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,wBAAAC,IAAyB;AAC3B,MAAoC;AAClC,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAAmBC,EAAA;AAEzB,SAAAC,EAAU,MAAM;AACd,QAAIL;AACF;AAGF,IAAAC,EAAe,EAAI,IAEP,YAAY;AACtB,MAAAH,IAAA;AAEA,UAAI;AACF,cAAMQ,EAAkB;AAAA,UACtB,MAAAX;AAAA,UACA,WAAAC;AAAA,UACA,UAAAC;AAAA,UACA,wBAAAE;AAAA,QAAA,CACD;AAAA,MACH,SAASQ,GAAO;AACd,QAAIA,aAAiB,SACnB,MAAMC,EAAgB;AAAA,UACpB,SAAS;AAAA,UACT,iBAAiBD,EAAM;AAAA,UACvB,SAAS;AAAA,UACT,WAAWE,EAAsCN,CAAgB;AAAA,QAAA,CAClE;AAAA,MAEL,UAAA;AACE,cAAMO,EAAA;AAAA,MACR;AAAA,IACF,GAEA;AAAA,EACF,GAAG;AAAA,IACDf;AAAA,IACAC;AAAA,IACAC;AAAA,IACAE;AAAA,IACAD;AAAA,IACAE;AAAA,IACAG;AAAA,EAAA,CACD,GAEM;AACT;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Action } from './Action';
|
|
2
|
+
export type { ActionProps } from './Action';
|
|
3
|
+
export { ActionLink } from './ActionLink';
|
|
4
|
+
export type { ActionLinkProps } from './ActionLink';
|
|
5
|
+
export { ActionOpenSidePanelPage } from './ActionOpenSidePanelPage';
|
|
6
|
+
export type { ActionOpenSidePanelPageProps } from './ActionOpenSidePanelPage';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ApplicationManifest } from 'twenty-shared/application';
|
|
2
|
-
export type ApplicationConfig = Omit<ApplicationManifest, 'packageJsonChecksum' | 'yarnLockChecksum'>;
|
|
1
|
+
import { type ApplicationManifest } from 'twenty-shared/application';
|
|
2
|
+
export type ApplicationConfig = Omit<ApplicationManifest, 'packageJsonChecksum' | 'yarnLockChecksum' | 'apiClientChecksum'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DefineEntity } from '
|
|
2
|
-
import { ApplicationConfig } from '
|
|
1
|
+
import { type DefineEntity } from '../../sdk/common/types/define-entity.type';
|
|
2
|
+
import { type ApplicationConfig } from '../../sdk/application/application-config';
|
|
3
3
|
export declare const defineApplication: DefineEntity<ApplicationConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createValidationResult as a } from "../common/utils/create-validation-result.js";
|
|
2
|
+
const l = (e) => {
|
|
3
|
+
const i = [];
|
|
4
|
+
return e.universalIdentifier || i.push("Application must have a universalIdentifier"), e.defaultRoleUniversalIdentifier || i.push("Application must have a defaultRoleUniversalIdentifier"), (!e.displayName || e.displayName.length === 0) && i.push("Application must have a non empty display name"), a({
|
|
5
|
+
config: e,
|
|
6
|
+
errors: i
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
l as defineApplication
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=define-application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-application.js","sources":["../../../src/sdk/application/define-application.ts"],"sourcesContent":["import { createValidationResult } from '@/sdk/common/utils/create-validation-result';\nimport { type DefineEntity } from '@/sdk/common/types/define-entity.type';\nimport { type ApplicationConfig } from '@/sdk/application/application-config';\n\nexport const defineApplication: DefineEntity<ApplicationConfig> = (config) => {\n const errors = [];\n\n if (!config.universalIdentifier) {\n errors.push('Application must have a universalIdentifier');\n }\n\n if (!config.defaultRoleUniversalIdentifier) {\n errors.push('Application must have a defaultRoleUniversalIdentifier');\n }\n\n if (!config.displayName || config.displayName.length === 0) {\n errors.push('Application must have a non empty display name');\n }\n\n return createValidationResult({\n config,\n errors,\n });\n};\n"],"names":["defineApplication","config","errors","createValidationResult"],"mappings":";AAIO,MAAMA,IAAqD,CAACC,MAAW;AAC5E,QAAMC,IAAS,CAAA;AAEf,SAAKD,EAAO,uBACVC,EAAO,KAAK,6CAA6C,GAGtDD,EAAO,kCACVC,EAAO,KAAK,wDAAwD,IAGlE,CAACD,EAAO,eAAeA,EAAO,YAAY,WAAW,MACvDC,EAAO,KAAK,gDAAgD,GAGvDC,EAAuB;AAAA,IAC5B,QAAAF;AAAA,IACA,QAAAC;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { ApplicationConfig } from '
|
|
2
|
-
import { FrontComponentConfig } from '
|
|
3
|
-
import { LogicFunctionConfig } from '
|
|
4
|
-
import {
|
|
1
|
+
import { type ApplicationConfig } from '../../../sdk/application/application-config';
|
|
2
|
+
import { type FrontComponentConfig } from '../../../sdk/front-component-config';
|
|
3
|
+
import { type LogicFunctionConfig } from '../../../sdk/logic-functions/logic-function-config';
|
|
4
|
+
import { type ObjectConfig } from '../../../sdk/objects/object-config';
|
|
5
|
+
import { type PageLayoutConfig } from '../../../sdk/page-layouts/page-layout-config';
|
|
6
|
+
import { type ViewConfig } from '../../../sdk/views/view-config';
|
|
7
|
+
import { type FieldManifest, type NavigationMenuItemManifest, type RoleManifest, type SkillManifest } from 'twenty-shared/application';
|
|
5
8
|
export type ValidationResult<T> = {
|
|
6
9
|
success: boolean;
|
|
7
10
|
config: T;
|
|
8
11
|
errors: string[];
|
|
9
12
|
};
|
|
10
|
-
export type DefinableEntity = ApplicationConfig |
|
|
11
|
-
export type DefineEntity<
|
|
13
|
+
export type DefinableEntity = ApplicationConfig | ObjectConfig | FieldManifest | FrontComponentConfig | LogicFunctionConfig | RoleManifest | SkillManifest | ViewConfig | NavigationMenuItemManifest | PageLayoutConfig;
|
|
14
|
+
export type DefineEntity<T extends DefinableEntity = DefinableEntity> = (config: T) => ValidationResult<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-validation-result.js","sources":["../../../../src/sdk/common/utils/create-validation-result.ts"],"sourcesContent":["import { type ValidationResult } from '@/sdk/common/types/define-entity.type';\n\nexport const createValidationResult = <T>({\n config,\n errors = [],\n}: {\n config: T;\n errors: string[];\n}): ValidationResult<T> => ({\n success: errors.length === 0,\n config,\n errors,\n});\n"],"names":["createValidationResult","config","errors"],"mappings":"AAEO,MAAMA,IAAyB,CAAI;AAAA,EACxC,QAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AACX,OAG4B;AAAA,EAC1B,SAASA,EAAO,WAAW;AAAA,EAC3B,QAAAD;AAAA,EACA,QAAAC;AACF;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DefineEntity } from '
|
|
2
|
-
import { FrontComponentConfig } from '
|
|
1
|
+
import type { DefineEntity } from '../sdk/common/types/define-entity.type';
|
|
2
|
+
import { type FrontComponentConfig } from '../sdk/front-component-config';
|
|
3
3
|
export declare const defineFrontComponent: DefineEntity<FrontComponentConfig>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createValidationResult as o } from "./common/utils/create-validation-result.js";
|
|
2
|
+
import "twenty-shared/types";
|
|
3
|
+
import "@sniptt/guards";
|
|
4
|
+
import "twenty-shared/utils";
|
|
5
|
+
import "twenty-shared/metadata";
|
|
6
|
+
import "twenty-shared/constants";
|
|
7
|
+
import "react";
|
|
8
|
+
import "./front-component-api/globals/frontComponentHostCommunicationApi.js";
|
|
9
|
+
import "./front-component-api/constants/HtmlTagToRemoteComponent.js";
|
|
10
|
+
const c = (t) => {
|
|
11
|
+
const e = [];
|
|
12
|
+
return t.universalIdentifier || e.push("Front component must have a universalIdentifier"), t.component || e.push("Front component must have a component"), typeof t.component != "function" && e.push("Front component component must be a React component"), t.command && (t.command.universalIdentifier || e.push("Command must have a universalIdentifier"), t.command.label || e.push("Command must have a label")), o({
|
|
13
|
+
config: t,
|
|
14
|
+
errors: e
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
c as defineFrontComponent
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=define-front-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-front-component.js","sources":["../../src/sdk/define-front-component.ts"],"sourcesContent":["import { createValidationResult } from '@/sdk';\nimport type { DefineEntity } from '@/sdk/common/types/define-entity.type';\nimport { type FrontComponentConfig } from '@/sdk/front-component-config';\n\nexport const defineFrontComponent: DefineEntity<FrontComponentConfig> = (\n config,\n) => {\n const errors = [];\n\n if (!config.universalIdentifier) {\n errors.push('Front component must have a universalIdentifier');\n }\n\n if (!config.component) {\n errors.push('Front component must have a component');\n }\n\n if (typeof config.component !== 'function') {\n errors.push('Front component component must be a React component');\n }\n\n if (config.command) {\n if (!config.command.universalIdentifier) {\n errors.push('Command must have a universalIdentifier');\n }\n\n if (!config.command.label) {\n errors.push('Command must have a label');\n }\n }\n\n return createValidationResult({\n config,\n errors,\n });\n};\n"],"names":["defineFrontComponent","config","errors","createValidationResult"],"mappings":";;;;;;;;;AAIO,MAAMA,IAA2D,CACtEC,MACG;AACH,QAAMC,IAAS,CAAA;AAEf,SAAKD,EAAO,uBACVC,EAAO,KAAK,iDAAiD,GAG1DD,EAAO,aACVC,EAAO,KAAK,uCAAuC,GAGjD,OAAOD,EAAO,aAAc,cAC9BC,EAAO,KAAK,qDAAqD,GAG/DD,EAAO,YACJA,EAAO,QAAQ,uBAClBC,EAAO,KAAK,yCAAyC,GAGlDD,EAAO,QAAQ,SAClBC,EAAO,KAAK,2BAA2B,IAIpCC,EAAuB;AAAA,IAC5B,QAAAF;AAAA,IACA,QAAAC;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FieldManifest } from 'twenty-shared/application';
|
|
2
|
-
import { DefineEntity } from '
|
|
1
|
+
import { type FieldManifest } from 'twenty-shared/application';
|
|
2
|
+
import { type DefineEntity } from '../../sdk/common/types/define-entity.type';
|
|
3
3
|
export declare const defineField: DefineEntity<FieldManifest>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { validateFields as i } from "./validate-fields.js";
|
|
2
|
+
import { createValidationResult as s } from "../common/utils/create-validation-result.js";
|
|
3
|
+
const d = (e) => {
|
|
4
|
+
const r = [];
|
|
5
|
+
e.objectUniversalIdentifier || r.push("Field must have an objectUniversalIdentifier");
|
|
6
|
+
const t = i([e]);
|
|
7
|
+
return r.push(...t), s({
|
|
8
|
+
config: e,
|
|
9
|
+
errors: r
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
d as defineField
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=define-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-field.js","sources":["../../../src/sdk/fields/define-field.ts"],"sourcesContent":["import { type FieldManifest } from 'twenty-shared/application';\nimport { validateFields } from '@/sdk/fields/validate-fields';\n\nimport { type DefineEntity } from '@/sdk/common/types/define-entity.type';\nimport { createValidationResult } from '@/sdk/common/utils/create-validation-result';\n\nexport const defineField: DefineEntity<FieldManifest> = (config) => {\n const errors = [];\n\n if (!config.objectUniversalIdentifier) {\n errors.push('Field must have an objectUniversalIdentifier');\n }\n\n const fieldErrors = validateFields([config]);\n\n errors.push(...fieldErrors);\n\n return createValidationResult({\n config,\n errors,\n });\n};\n"],"names":["defineField","config","errors","fieldErrors","validateFields","createValidationResult"],"mappings":";;AAMO,MAAMA,IAA2C,CAACC,MAAW;AAClE,QAAMC,IAAS,CAAA;AAEf,EAAKD,EAAO,6BACVC,EAAO,KAAK,8CAA8C;AAG5D,QAAMC,IAAcC,EAAe,CAACH,CAAM,CAAC;AAE3C,SAAAC,EAAO,KAAK,GAAGC,CAAW,GAEnBE,EAAuB;AAAA,IAC5B,QAAAJ;AAAA,IACA,QAAAC;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ObjectFieldManifest } from 'twenty-shared/application';
|
|
1
|
+
import { type ObjectFieldManifest } from 'twenty-shared/application';
|
|
2
2
|
export declare const validateFields: (fields: ObjectFieldManifest[] | undefined) => string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldMetadataType as r } from "twenty-shared/types";
|
|
2
|
+
import { isNonEmptyString as t } from "@sniptt/guards";
|
|
3
|
+
const n = (a) => {
|
|
4
|
+
if (!a)
|
|
5
|
+
return [];
|
|
6
|
+
const i = [];
|
|
7
|
+
for (const e of a)
|
|
8
|
+
t(e.label) || i.push("Field must have a label"), t(e.name) || i.push(`Field "${e.label}" must have a name`), t(e.universalIdentifier) || i.push(`Field "${e.label}" must have a universalIdentifier`), (e.type === r.SELECT || e.type === r.MULTI_SELECT) && (!Array.isArray(e.options) || e.options.length === 0) && i.push(
|
|
9
|
+
`Field "${e.label}" is a SELECT/MULTI_SELECT type and must have options`
|
|
10
|
+
);
|
|
11
|
+
return i;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
n as validateFields
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=validate-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-fields.js","sources":["../../../src/sdk/fields/validate-fields.ts"],"sourcesContent":["import { FieldMetadataType } from 'twenty-shared/types';\n\nimport { isNonEmptyString } from '@sniptt/guards';\n\nimport { type ObjectFieldManifest } from 'twenty-shared/application';\n\nexport const validateFields = (\n fields: ObjectFieldManifest[] | undefined,\n): string[] => {\n if (!fields) {\n return [];\n }\n\n const errors: string[] = [];\n\n for (const field of fields) {\n if (!isNonEmptyString(field.label)) {\n errors.push('Field must have a label');\n }\n\n if (!isNonEmptyString(field.name)) {\n errors.push(`Field \"${field.label}\" must have a name`);\n }\n\n if (!isNonEmptyString(field.universalIdentifier)) {\n errors.push(`Field \"${field.label}\" must have a universalIdentifier`);\n }\n\n if (\n (field.type === FieldMetadataType.SELECT ||\n field.type === FieldMetadataType.MULTI_SELECT) &&\n (!Array.isArray(field.options) || field.options.length === 0)\n ) {\n errors.push(\n `Field \"${field.label}\" is a SELECT/MULTI_SELECT type and must have options`,\n );\n }\n }\n\n return errors;\n};\n"],"names":["validateFields","fields","errors","field","isNonEmptyString","FieldMetadataType"],"mappings":";;AAMO,MAAMA,IAAiB,CAC5BC,MACa;AACb,MAAI,CAACA;AACH,WAAO,CAAA;AAGT,QAAMC,IAAmB,CAAA;AAEzB,aAAWC,KAASF;AAClB,IAAKG,EAAiBD,EAAM,KAAK,KAC/BD,EAAO,KAAK,yBAAyB,GAGlCE,EAAiBD,EAAM,IAAI,KAC9BD,EAAO,KAAK,UAAUC,EAAM,KAAK,oBAAoB,GAGlDC,EAAiBD,EAAM,mBAAmB,KAC7CD,EAAO,KAAK,UAAUC,EAAM,KAAK,mCAAmC,IAInEA,EAAM,SAASE,EAAkB,UAChCF,EAAM,SAASE,EAAkB,kBAClC,CAAC,MAAM,QAAQF,EAAM,OAAO,KAAKA,EAAM,QAAQ,WAAW,MAE3DD,EAAO;AAAA,MACL,UAAUC,EAAM,KAAK;AAAA,IAAA;AAK3B,SAAOD;AACT;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var e = /* @__PURE__ */ ((t) => (t.ProfilePicture = "profile-picture", t.WorkspaceLogo = "workspace-logo", t.Attachment = "attachment", t.PersonPicture = "person-picture", t.File = "file", t.AgentChat = "agent-chat", t.BuiltLogicFunction = "built-logic-function", t.BuiltFrontComponent = "built-front-component", t.PublicAsset = "public-asset", t.Source = "source", t.FilesField = "files-field", t.Dependencies = "dependencies", t))(e || {}), o = /* @__PURE__ */ ((t) => (t.CASCADE = "CASCADE", t.RESTRICT = "RESTRICT", t.SET_NULL = "SET_NULL", t.NO_ACTION = "NO_ACTION", t))(o || {}), r = /* @__PURE__ */ ((t) => (t.MANY_TO_ONE = "MANY_TO_ONE", t.ONE_TO_MANY = "ONE_TO_MANY", t))(r || {});
|
|
3
|
-
const l = [
|
|
1
|
+
const t = [
|
|
4
2
|
{ tag: "html-div", name: "HtmlDiv", properties: {} },
|
|
5
3
|
{ tag: "html-span", name: "HtmlSpan", properties: {} },
|
|
6
4
|
{ tag: "html-section", name: "HtmlSection", properties: {} },
|
|
@@ -136,16 +134,8 @@ const l = [
|
|
|
136
134
|
},
|
|
137
135
|
{ tag: "html-br", name: "HtmlBr", properties: {} },
|
|
138
136
|
{ tag: "html-hr", name: "HtmlHr", properties: {} }
|
|
139
|
-
]
|
|
140
|
-
l.map((t) => [
|
|
141
|
-
t.tag.startsWith("html-") ? t.tag.slice(5) : t.tag,
|
|
142
|
-
t.name
|
|
143
|
-
])
|
|
144
|
-
);
|
|
137
|
+
];
|
|
145
138
|
export {
|
|
146
|
-
|
|
147
|
-
o as C,
|
|
148
|
-
a as H,
|
|
149
|
-
e as N,
|
|
150
|
-
r as d
|
|
139
|
+
t as ALLOWED_HTML_ELEMENTS
|
|
151
140
|
};
|
|
141
|
+
//# sourceMappingURL=AllowedHtmlElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllowedHtmlElements.js","sources":["../../../../src/sdk/front-component-api/constants/AllowedHtmlElements.ts"],"sourcesContent":["type PropertySchema = {\n type: 'string' | 'number' | 'boolean';\n optional: boolean;\n};\n\nexport type AllowedHtmlElement = {\n tag: string;\n name: string;\n properties: Record<string, PropertySchema>;\n};\n\nexport const ALLOWED_HTML_ELEMENTS: AllowedHtmlElement[] = [\n { tag: 'html-div', name: 'HtmlDiv', properties: {} },\n { tag: 'html-span', name: 'HtmlSpan', properties: {} },\n { tag: 'html-section', name: 'HtmlSection', properties: {} },\n { tag: 'html-article', name: 'HtmlArticle', properties: {} },\n { tag: 'html-header', name: 'HtmlHeader', properties: {} },\n { tag: 'html-footer', name: 'HtmlFooter', properties: {} },\n { tag: 'html-main', name: 'HtmlMain', properties: {} },\n { tag: 'html-nav', name: 'HtmlNav', properties: {} },\n { tag: 'html-aside', name: 'HtmlAside', properties: {} },\n { tag: 'html-p', name: 'HtmlP', properties: {} },\n { tag: 'html-h1', name: 'HtmlH1', properties: {} },\n { tag: 'html-h2', name: 'HtmlH2', properties: {} },\n { tag: 'html-h3', name: 'HtmlH3', properties: {} },\n { tag: 'html-h4', name: 'HtmlH4', properties: {} },\n { tag: 'html-h5', name: 'HtmlH5', properties: {} },\n { tag: 'html-h6', name: 'HtmlH6', properties: {} },\n { tag: 'html-strong', name: 'HtmlStrong', properties: {} },\n { tag: 'html-em', name: 'HtmlEm', properties: {} },\n { tag: 'html-small', name: 'HtmlSmall', properties: {} },\n { tag: 'html-code', name: 'HtmlCode', properties: {} },\n { tag: 'html-pre', name: 'HtmlPre', properties: {} },\n { tag: 'html-blockquote', name: 'HtmlBlockquote', properties: {} },\n {\n tag: 'html-a',\n name: 'HtmlA',\n properties: {\n href: { type: 'string', optional: true },\n target: { type: 'string', optional: true },\n rel: { type: 'string', optional: true },\n },\n },\n {\n tag: 'html-img',\n name: 'HtmlImg',\n properties: {\n src: { type: 'string', optional: true },\n alt: { type: 'string', optional: true },\n width: { type: 'number', optional: true },\n height: { type: 'number', optional: true },\n },\n },\n { tag: 'html-ul', name: 'HtmlUl', properties: {} },\n { tag: 'html-ol', name: 'HtmlOl', properties: {} },\n { tag: 'html-li', name: 'HtmlLi', properties: {} },\n {\n tag: 'html-form',\n name: 'HtmlForm',\n properties: {\n action: { type: 'string', optional: true },\n method: { type: 'string', optional: true },\n },\n },\n {\n tag: 'html-label',\n name: 'HtmlLabel',\n properties: {\n htmlFor: { type: 'string', optional: true },\n },\n },\n {\n tag: 'html-input',\n name: 'HtmlInput',\n properties: {\n type: { type: 'string', optional: true },\n name: { type: 'string', optional: true },\n value: { type: 'string', optional: true },\n placeholder: { type: 'string', optional: true },\n disabled: { type: 'boolean', optional: true },\n checked: { type: 'boolean', optional: true },\n readOnly: { type: 'boolean', optional: true },\n },\n },\n {\n tag: 'html-textarea',\n name: 'HtmlTextarea',\n properties: {\n name: { type: 'string', optional: true },\n value: { type: 'string', optional: true },\n placeholder: { type: 'string', optional: true },\n disabled: { type: 'boolean', optional: true },\n readOnly: { type: 'boolean', optional: true },\n rows: { type: 'number', optional: true },\n cols: { type: 'number', optional: true },\n },\n },\n {\n tag: 'html-select',\n name: 'HtmlSelect',\n properties: {\n name: { type: 'string', optional: true },\n value: { type: 'string', optional: true },\n disabled: { type: 'boolean', optional: true },\n multiple: { type: 'boolean', optional: true },\n },\n },\n {\n tag: 'html-option',\n name: 'HtmlOption',\n properties: {\n value: { type: 'string', optional: true },\n disabled: { type: 'boolean', optional: true },\n selected: { type: 'boolean', optional: true },\n },\n },\n {\n tag: 'html-button',\n name: 'HtmlButton',\n properties: {\n type: { type: 'string', optional: true },\n disabled: { type: 'boolean', optional: true },\n },\n },\n { tag: 'html-table', name: 'HtmlTable', properties: {} },\n { tag: 'html-thead', name: 'HtmlThead', properties: {} },\n { tag: 'html-tbody', name: 'HtmlTbody', properties: {} },\n { tag: 'html-tfoot', name: 'HtmlTfoot', properties: {} },\n { tag: 'html-tr', name: 'HtmlTr', properties: {} },\n {\n tag: 'html-th',\n name: 'HtmlTh',\n properties: {\n colSpan: { type: 'number', optional: true },\n rowSpan: { type: 'number', optional: true },\n },\n },\n {\n tag: 'html-td',\n name: 'HtmlTd',\n properties: {\n colSpan: { type: 'number', optional: true },\n rowSpan: { type: 'number', optional: true },\n },\n },\n { tag: 'html-br', name: 'HtmlBr', properties: {} },\n { tag: 'html-hr', name: 'HtmlHr', properties: {} },\n];\n"],"names":["ALLOWED_HTML_ELEMENTS"],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
"click",
|
|
3
|
+
"dblclick",
|
|
4
|
+
"mousedown",
|
|
5
|
+
"mouseup",
|
|
6
|
+
"mouseover",
|
|
7
|
+
"mouseout",
|
|
8
|
+
"mouseenter",
|
|
9
|
+
"mouseleave",
|
|
10
|
+
"keydown",
|
|
11
|
+
"keyup",
|
|
12
|
+
"keypress",
|
|
13
|
+
"focus",
|
|
14
|
+
"blur",
|
|
15
|
+
"change",
|
|
16
|
+
"input",
|
|
17
|
+
"submit",
|
|
18
|
+
"scroll",
|
|
19
|
+
"wheel",
|
|
20
|
+
"contextmenu",
|
|
21
|
+
"drag"
|
|
22
|
+
];
|
|
23
|
+
export {
|
|
24
|
+
e as COMMON_HTML_EVENTS
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CommonHtmlEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommonHtmlEvents.js","sources":["../../../../src/sdk/front-component-api/constants/CommonHtmlEvents.ts"],"sourcesContent":["export const COMMON_HTML_EVENTS = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'mouseenter',\n 'mouseleave',\n 'keydown',\n 'keyup',\n 'keypress',\n 'focus',\n 'blur',\n 'change',\n 'input',\n 'submit',\n 'scroll',\n 'wheel',\n 'contextmenu',\n 'drag',\n] as const;\n"],"names":["COMMON_HTML_EVENTS"],"mappings":"AAAO,MAAMA,IAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
click: "onClick",
|
|
3
|
+
dblclick: "onDoubleClick",
|
|
4
|
+
mousedown: "onMouseDown",
|
|
5
|
+
mouseup: "onMouseUp",
|
|
6
|
+
mouseover: "onMouseOver",
|
|
7
|
+
mouseout: "onMouseOut",
|
|
8
|
+
mouseenter: "onMouseEnter",
|
|
9
|
+
mouseleave: "onMouseLeave",
|
|
10
|
+
keydown: "onKeyDown",
|
|
11
|
+
keyup: "onKeyUp",
|
|
12
|
+
keypress: "onKeyPress",
|
|
13
|
+
focus: "onFocus",
|
|
14
|
+
blur: "onBlur",
|
|
15
|
+
change: "onChange",
|
|
16
|
+
input: "onInput",
|
|
17
|
+
submit: "onSubmit",
|
|
18
|
+
scroll: "onScroll",
|
|
19
|
+
wheel: "onWheel",
|
|
20
|
+
contextmenu: "onContextMenu",
|
|
21
|
+
drag: "onDrag"
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
o as EVENT_TO_REACT
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=EventToReact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventToReact.js","sources":["../../../../src/sdk/front-component-api/constants/EventToReact.ts"],"sourcesContent":["export const EVENT_TO_REACT: Record<string, string> = {\n click: 'onClick',\n dblclick: 'onDoubleClick',\n mousedown: 'onMouseDown',\n mouseup: 'onMouseUp',\n mouseover: 'onMouseOver',\n mouseout: 'onMouseOut',\n mouseenter: 'onMouseEnter',\n mouseleave: 'onMouseLeave',\n keydown: 'onKeyDown',\n keyup: 'onKeyUp',\n keypress: 'onKeyPress',\n focus: 'onFocus',\n blur: 'onBlur',\n change: 'onChange',\n input: 'onInput',\n submit: 'onSubmit',\n scroll: 'onScroll',\n wheel: 'onWheel',\n contextmenu: 'onContextMenu',\n drag: 'onDrag',\n};\n"],"names":["EVENT_TO_REACT"],"mappings":"AAAO,MAAMA,IAAyC;AAAA,EACpD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AACR;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
id: { type: "string", optional: !0 },
|
|
3
|
+
className: { type: "string", optional: !0 },
|
|
4
|
+
style: { type: "string", optional: !0 },
|
|
5
|
+
title: { type: "string", optional: !0 },
|
|
6
|
+
tabIndex: { type: "number", optional: !0 },
|
|
7
|
+
role: { type: "string", optional: !0 },
|
|
8
|
+
"aria-label": { type: "string", optional: !0 },
|
|
9
|
+
"aria-hidden": { type: "boolean", optional: !0 },
|
|
10
|
+
"data-testid": { type: "string", optional: !0 }
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
t as HTML_COMMON_PROPERTIES
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=HtmlCommonProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlCommonProperties.js","sources":["../../../../src/sdk/front-component-api/constants/HtmlCommonProperties.ts"],"sourcesContent":["import { type PropertySchema } from '@/front-component-renderer/types/PropertySchema';\n\nexport const HTML_COMMON_PROPERTIES: Record<string, PropertySchema> = {\n id: { type: 'string', optional: true },\n className: { type: 'string', optional: true },\n style: { type: 'string', optional: true },\n title: { type: 'string', optional: true },\n tabIndex: { type: 'number', optional: true },\n role: { type: 'string', optional: true },\n 'aria-label': { type: 'string', optional: true },\n 'aria-hidden': { type: 'boolean', optional: true },\n 'data-testid': { type: 'string', optional: true },\n};\n"],"names":["HTML_COMMON_PROPERTIES"],"mappings":"AAEO,MAAMA,IAAyD;AAAA,EACpE,IAAI,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EAChC,WAAW,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EACvC,OAAO,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EACnC,OAAO,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EACnC,UAAU,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EACtC,MAAM,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EAClC,cAAc,EAAE,MAAM,UAAU,UAAU,GAAA;AAAA,EAC1C,eAAe,EAAE,MAAM,WAAW,UAAU,GAAA;AAAA,EAC5C,eAAe,EAAE,MAAM,UAAU,UAAU,GAAA;AAC7C;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ALLOWED_HTML_ELEMENTS as a } from "./AllowedHtmlElements.js";
|
|
2
|
+
const s = {
|
|
3
|
+
"remote-style": "RemoteStyle"
|
|
4
|
+
}, T = {
|
|
5
|
+
...Object.fromEntries(
|
|
6
|
+
a.map((t) => [
|
|
7
|
+
t.tag.startsWith("html-") ? t.tag.slice(5) : t.tag,
|
|
8
|
+
t.name
|
|
9
|
+
])
|
|
10
|
+
),
|
|
11
|
+
...s
|
|
12
|
+
};
|
|
13
|
+
({
|
|
14
|
+
...Object.fromEntries(
|
|
15
|
+
a.map((t) => [
|
|
16
|
+
t.tag.startsWith("html-") ? t.tag.slice(5) : t.tag,
|
|
17
|
+
t.tag
|
|
18
|
+
])
|
|
19
|
+
)
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
T as HTML_TAG_TO_REMOTE_COMPONENT
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=HtmlTagToRemoteComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlTagToRemoteComponent.js","sources":["../../../../src/sdk/front-component-api/constants/HtmlTagToRemoteComponent.ts"],"sourcesContent":["import { ALLOWED_HTML_ELEMENTS } from './AllowedHtmlElements';\n\nconst UTILITY_TAG_MAPPINGS: Record<string, string> = {\n 'remote-style': 'RemoteStyle',\n};\n\nexport const HTML_TAG_TO_REMOTE_COMPONENT: Record<string, string> = {\n ...Object.fromEntries(\n ALLOWED_HTML_ELEMENTS.map((element) => [\n element.tag.startsWith('html-') ? element.tag.slice(5) : element.tag,\n element.name,\n ]),\n ),\n ...UTILITY_TAG_MAPPINGS,\n};\n\n// Maps standard HTML tag names to their custom element equivalents\n// used by the remote DOM polyfill (e.g. \"div\" → \"html-div\").\n// Consumed by the jsx-runtime wrapper so React creates the correct\n// custom elements instead of standard HTML tags.\nexport const HTML_TAG_TO_CUSTOM_ELEMENT_TAG: Record<string, string> = {\n ...Object.fromEntries(\n ALLOWED_HTML_ELEMENTS.map((element) => [\n element.tag.startsWith('html-') ? element.tag.slice(5) : element.tag,\n element.tag,\n ]),\n ),\n};\n"],"names":["UTILITY_TAG_MAPPINGS","HTML_TAG_TO_REMOTE_COMPONENT","ALLOWED_HTML_ELEMENTS","element"],"mappings":";AAEA,MAAMA,IAA+C;AAAA,EACnD,gBAAgB;AAClB,GAEaC,IAAuD;AAAA,EAClE,GAAG,OAAO;AAAA,IACRC,EAAsB,IAAI,CAACC,MAAY;AAAA,MACrCA,EAAQ,IAAI,WAAW,OAAO,IAAIA,EAAQ,IAAI,MAAM,CAAC,IAAIA,EAAQ;AAAA,MACjEA,EAAQ;AAAA,IAAA,CACT;AAAA,EAAA;AAAA,EAEH,GAAGH;AACL;AAAA,CAMsE;AAAA,EACpE,GAAG,OAAO;AAAA,IACRE,EAAsB,IAAI,CAACC,MAAY;AAAA,MACrCA,EAAQ,IAAI,WAAW,OAAO,IAAIA,EAAQ,IAAI,MAAM,CAAC,IAAIA,EAAQ;AAAA,MACjEA,EAAQ;AAAA,IAAA,CACT;AAAA,EAAA;AAEL;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';
|
|
1
|
+
import { type FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';
|
|
2
2
|
type Listener = () => void;
|
|
3
3
|
export declare const setFrontComponentExecutionContext: (context: FrontComponentExecutionContext) => void;
|
|
4
|
-
export declare const getFrontComponentExecutionContext: () => FrontComponentExecutionContext
|
|
4
|
+
export declare const getFrontComponentExecutionContext: () => FrontComponentExecutionContext;
|
|
5
5
|
export declare const subscribeToFrontComponentExecutionContext: (listener: Listener) => void;
|
|
6
6
|
export declare const unsubscribeFromFrontComponentExecutionContext: (listener: Listener) => void;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const e = "__twentySdkExecutionContext__", n = "__twentySdkContextListeners__", o = () => (globalThis[n] || (globalThis[n] = /* @__PURE__ */ new Set()), globalThis[n]), s = () => globalThis[e], i = (t) => {
|
|
2
|
+
o().add(t);
|
|
3
|
+
}, r = (t) => {
|
|
4
|
+
o().delete(t);
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
s as getFrontComponentExecutionContext,
|
|
8
|
+
i as subscribeToFrontComponentExecutionContext,
|
|
9
|
+
r as unsubscribeFromFrontComponentExecutionContext
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=frontComponentContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontComponentContext.js","sources":["../../../../src/sdk/front-component-api/context/frontComponentContext.ts"],"sourcesContent":["import { type FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';\n\ntype Listener = () => void;\n\nconst CONTEXT_KEY = '__twentySdkExecutionContext__';\nconst LISTENERS_KEY = '__twentySdkContextListeners__';\n\nconst getListeners = (): Set<Listener> => {\n if (!(globalThis as Record<string, unknown>)[LISTENERS_KEY]) {\n (globalThis as Record<string, unknown>)[LISTENERS_KEY] =\n new Set<Listener>();\n }\n\n return (globalThis as Record<string, unknown>)[\n LISTENERS_KEY\n ] as Set<Listener>;\n};\n\nexport const setFrontComponentExecutionContext = (\n context: FrontComponentExecutionContext,\n): void => {\n (globalThis as Record<string, unknown>)[CONTEXT_KEY] = context;\n\n for (const listener of getListeners()) {\n listener();\n }\n};\n\nexport const getFrontComponentExecutionContext =\n (): FrontComponentExecutionContext => {\n return (globalThis as Record<string, unknown>)[\n CONTEXT_KEY\n ] as FrontComponentExecutionContext;\n };\n\nexport const subscribeToFrontComponentExecutionContext = (\n listener: Listener,\n): void => {\n getListeners().add(listener);\n};\n\nexport const unsubscribeFromFrontComponentExecutionContext = (\n listener: Listener,\n): void => {\n getListeners().delete(listener);\n};\n"],"names":["CONTEXT_KEY","LISTENERS_KEY","getListeners","getFrontComponentExecutionContext","subscribeToFrontComponentExecutionContext","listener","unsubscribeFromFrontComponentExecutionContext"],"mappings":"AAIA,MAAMA,IAAc,iCACdC,IAAgB,iCAEhBC,IAAe,OACb,WAAuCD,CAAa,MACvD,WAAuCA,CAAa,IACnD,oBAAI,IAAA,IAGA,WACNA,CACF,IAaWE,IACX,MACU,WACNH,CACF,GAGSI,IAA4C,CACvDC,MACS;AACT,EAAAH,EAAA,EAAe,IAAIG,CAAQ;AAC7B,GAEaC,IAAgD,CAC3DD,MACS;AACT,EAAAH,EAAA,EAAe,OAAOG,CAAQ;AAChC;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isDefined as e } from "twenty-shared/utils";
|
|
2
|
+
import { frontComponentHostCommunicationApi as n } from "../globals/frontComponentHostCommunicationApi.js";
|
|
3
|
+
const r = () => {
|
|
4
|
+
const o = n.closeSidePanel;
|
|
5
|
+
if (!e(o))
|
|
6
|
+
throw new Error("closeSidePanelFunction is not set");
|
|
7
|
+
return o();
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
r as closeSidePanel
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=closeSidePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closeSidePanel.js","sources":["../../../../src/sdk/front-component-api/functions/closeSidePanel.ts"],"sourcesContent":["import { isDefined } from 'twenty-shared/utils';\n\nimport {\n type CloseSidePanelFunction,\n frontComponentHostCommunicationApi,\n} from '../globals/frontComponentHostCommunicationApi';\n\nexport const closeSidePanel: CloseSidePanelFunction = () => {\n const closeSidePanelFunction =\n frontComponentHostCommunicationApi.closeSidePanel;\n\n if (!isDefined(closeSidePanelFunction)) {\n throw new Error('closeSidePanelFunction is not set');\n }\n\n return closeSidePanelFunction();\n};\n"],"names":["closeSidePanel","closeSidePanelFunction","frontComponentHostCommunicationApi","isDefined"],"mappings":";;AAOO,MAAMA,IAAyC,MAAM;AAC1D,QAAMC,IACJC,EAAmC;AAErC,MAAI,CAACC,EAAUF,CAAsB;AACnC,UAAM,IAAI,MAAM,mCAAmC;AAGrD,SAAOA,EAAA;AACT;"}
|