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,12 @@
|
|
|
1
|
+
import { isDefined as o } from "twenty-shared/utils";
|
|
2
|
+
import { frontComponentHostCommunicationApi as r } from "../globals/frontComponentHostCommunicationApi.js";
|
|
3
|
+
const i = (e) => {
|
|
4
|
+
const n = r.enqueueSnackbar;
|
|
5
|
+
if (!o(n))
|
|
6
|
+
throw new Error("enqueueSnackbarFunction is not set");
|
|
7
|
+
return n(e);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
i as enqueueSnackbar
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=enqueueSnackbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enqueueSnackbar.js","sources":["../../../../src/sdk/front-component-api/functions/enqueueSnackbar.ts"],"sourcesContent":["import { type EnqueueSnackbarParams } from 'twenty-shared/types';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport {\n frontComponentHostCommunicationApi,\n type EnqueueSnackbarFunction,\n} from '../globals/frontComponentHostCommunicationApi';\n\nexport const enqueueSnackbar: EnqueueSnackbarFunction = (\n params: EnqueueSnackbarParams,\n) => {\n const enqueueSnackbarFunction =\n frontComponentHostCommunicationApi.enqueueSnackbar;\n\n if (!isDefined(enqueueSnackbarFunction)) {\n throw new Error('enqueueSnackbarFunction is not set');\n }\n\n return enqueueSnackbarFunction(params);\n};\n"],"names":["enqueueSnackbar","params","enqueueSnackbarFunction","frontComponentHostCommunicationApi","isDefined"],"mappings":";;AAQO,MAAMA,IAA2C,CACtDC,MACG;AACH,QAAMC,IACJC,EAAmC;AAErC,MAAI,CAACC,EAAUF,CAAuB;AACpC,UAAM,IAAI,MAAM,oCAAoC;AAGtD,SAAOA,EAAwBD,CAAM;AACvC;"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type NavigateFunction = (to: AppPath, params?: Record<string, string | null>, queryParams?: Record<string, unknown>, options?: NavigateOptions) => Promise<void>;
|
|
3
|
-
export declare const setNavigate: (fn: NavigateFunction) => void;
|
|
1
|
+
import { type NavigateFunction } from '../globals/frontComponentHostCommunicationApi';
|
|
4
2
|
export declare const navigate: NavigateFunction;
|
|
5
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isDefined as e } from "twenty-shared/utils";
|
|
2
|
+
import { frontComponentHostCommunicationApi as a } from "../globals/frontComponentHostCommunicationApi.js";
|
|
3
|
+
const c = (t, o, i, r) => {
|
|
4
|
+
const n = a.navigate;
|
|
5
|
+
if (!e(n))
|
|
6
|
+
throw new Error("navigateFunction is not set");
|
|
7
|
+
return n(t, o, i, r);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
c as navigate
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=navigate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigate.js","sources":["../../../../src/sdk/front-component-api/functions/navigate.ts"],"sourcesContent":["import { isDefined } from 'twenty-shared/utils';\n\nimport {\n frontComponentHostCommunicationApi,\n type NavigateFunction,\n} from '../globals/frontComponentHostCommunicationApi';\n\nexport const navigate: NavigateFunction = (\n to,\n params,\n queryParams,\n options,\n) => {\n const navigateFunction = frontComponentHostCommunicationApi.navigate;\n\n if (!isDefined(navigateFunction)) {\n throw new Error('navigateFunction is not set');\n }\n\n return navigateFunction(to, params, queryParams, options);\n};\n"],"names":["navigate","to","params","queryParams","options","navigateFunction","frontComponentHostCommunicationApi","isDefined"],"mappings":";;AAOO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,GACAC,MACG;AACH,QAAMC,IAAmBC,EAAmC;AAE5D,MAAI,CAACC,EAAUF,CAAgB;AAC7B,UAAM,IAAI,MAAM,6BAA6B;AAG/C,SAAOA,EAAiBJ,GAAIC,GAAQC,GAAaC,CAAO;AAC1D;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isDefined as o } from "twenty-shared/utils";
|
|
2
|
+
import { frontComponentHostCommunicationApi as i } from "../globals/frontComponentHostCommunicationApi.js";
|
|
3
|
+
const a = (n) => {
|
|
4
|
+
const e = i.openSidePanelPage;
|
|
5
|
+
if (!o(e))
|
|
6
|
+
throw new Error("openSidePanelPageFunction is not set");
|
|
7
|
+
return e(n);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
a as openSidePanelPage
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=openSidePanelPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openSidePanelPage.js","sources":["../../../../src/sdk/front-component-api/functions/openSidePanelPage.ts"],"sourcesContent":["import { isDefined } from 'twenty-shared/utils';\n\nimport {\n frontComponentHostCommunicationApi,\n type OpenSidePanelPageFunction,\n} from '../globals/frontComponentHostCommunicationApi';\n\nexport const openSidePanelPage: OpenSidePanelPageFunction = (params) => {\n const openSidePanelPageFunction =\n frontComponentHostCommunicationApi.openSidePanelPage;\n\n if (!isDefined(openSidePanelPageFunction)) {\n throw new Error('openSidePanelPageFunction is not set');\n }\n\n return openSidePanelPageFunction(params);\n};\n"],"names":["openSidePanelPage","params","openSidePanelPageFunction","frontComponentHostCommunicationApi","isDefined"],"mappings":";;AAOO,MAAMA,IAA+C,CAACC,MAAW;AACtE,QAAMC,IACJC,EAAmC;AAErC,MAAI,CAACC,EAAUF,CAAyB;AACtC,UAAM,IAAI,MAAM,sCAAsC;AAGxD,SAAOA,EAA0BD,CAAM;AACzC;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isDefined as o } from "twenty-shared/utils";
|
|
2
|
+
import { frontComponentHostCommunicationApi as t } from "../globals/frontComponentHostCommunicationApi.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const n = t.unmountFrontComponent;
|
|
5
|
+
if (!o(n))
|
|
6
|
+
throw new Error("unmountFrontComponentFunction is not set");
|
|
7
|
+
return n();
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
u as unmountFrontComponent
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=unmountFrontComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unmountFrontComponent.js","sources":["../../../../src/sdk/front-component-api/functions/unmountFrontComponent.ts"],"sourcesContent":["import { isDefined } from 'twenty-shared/utils';\n\nimport {\n frontComponentHostCommunicationApi,\n type UnmountFrontComponentFunction,\n} from '../globals/frontComponentHostCommunicationApi';\n\nexport const unmountFrontComponent: UnmountFrontComponentFunction = () => {\n const unmountFrontComponentFunction =\n frontComponentHostCommunicationApi.unmountFrontComponent;\n\n if (!isDefined(unmountFrontComponentFunction)) {\n throw new Error('unmountFrontComponentFunction is not set');\n }\n\n return unmountFrontComponentFunction();\n};\n"],"names":["unmountFrontComponent","unmountFrontComponentFunction","frontComponentHostCommunicationApi","isDefined"],"mappings":";;AAOO,MAAMA,IAAuD,MAAM;AACxE,QAAMC,IACJC,EAAmC;AAErC,MAAI,CAACC,EAAUF,CAA6B;AAC1C,UAAM,IAAI,MAAM,0CAA0C;AAG5D,SAAOA,EAAA;AACT;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AppPath, type CommandMenuPages, type EnqueueSnackbarParams, type NavigateOptions } from 'twenty-shared/types';
|
|
2
|
+
import { type getAppPath } from 'twenty-shared/utils';
|
|
3
|
+
export type NavigateFunction = <T extends AppPath>(to: T, params?: Parameters<typeof getAppPath<T>>[1], queryParams?: Record<string, any>, options?: NavigateOptions) => Promise<void>;
|
|
4
|
+
export type OpenSidePanelPageFunction = (params: {
|
|
5
|
+
page: CommandMenuPages;
|
|
6
|
+
pageTitle: string;
|
|
7
|
+
pageIcon?: string;
|
|
8
|
+
shouldResetSearchState?: boolean;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
export type UnmountFrontComponentFunction = () => Promise<void>;
|
|
11
|
+
export type EnqueueSnackbarFunction = (params: EnqueueSnackbarParams) => Promise<void>;
|
|
12
|
+
export type CloseSidePanelFunction = () => Promise<void>;
|
|
13
|
+
export type FrontComponentHostCommunicationApiStore = {
|
|
14
|
+
navigate?: NavigateFunction;
|
|
15
|
+
openSidePanelPage?: OpenSidePanelPageFunction;
|
|
16
|
+
unmountFrontComponent?: UnmountFrontComponentFunction;
|
|
17
|
+
enqueueSnackbar?: EnqueueSnackbarFunction;
|
|
18
|
+
closeSidePanel?: CloseSidePanelFunction;
|
|
19
|
+
};
|
|
20
|
+
declare global {
|
|
21
|
+
var frontComponentHostCommunicationApi: FrontComponentHostCommunicationApiStore;
|
|
22
|
+
}
|
|
23
|
+
export declare const frontComponentHostCommunicationApi: FrontComponentHostCommunicationApiStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontComponentHostCommunicationApi.js","sources":["../../../../src/sdk/front-component-api/globals/frontComponentHostCommunicationApi.ts"],"sourcesContent":["import {\n type AppPath,\n type CommandMenuPages,\n type EnqueueSnackbarParams,\n type NavigateOptions,\n} from 'twenty-shared/types';\nimport { type getAppPath } from 'twenty-shared/utils';\n\nexport type NavigateFunction = <T extends AppPath>(\n to: T,\n params?: Parameters<typeof getAppPath<T>>[1],\n queryParams?: Record<string, any>,\n options?: NavigateOptions,\n) => Promise<void>;\n\nexport type OpenSidePanelPageFunction = (params: {\n page: CommandMenuPages;\n pageTitle: string;\n pageIcon?: string;\n shouldResetSearchState?: boolean;\n}) => Promise<void>;\n\nexport type UnmountFrontComponentFunction = () => Promise<void>;\n\nexport type EnqueueSnackbarFunction = (\n params: EnqueueSnackbarParams,\n) => Promise<void>;\n\nexport type CloseSidePanelFunction = () => Promise<void>;\n\nexport type FrontComponentHostCommunicationApiStore = {\n navigate?: NavigateFunction;\n openSidePanelPage?: OpenSidePanelPageFunction;\n unmountFrontComponent?: UnmountFrontComponentFunction;\n enqueueSnackbar?: EnqueueSnackbarFunction;\n closeSidePanel?: CloseSidePanelFunction;\n};\n\ndeclare global {\n var frontComponentHostCommunicationApi: FrontComponentHostCommunicationApiStore;\n}\n\nglobalThis.frontComponentHostCommunicationApi ??= {};\n\nexport const frontComponentHostCommunicationApi =\n globalThis.frontComponentHostCommunicationApi;\n"],"names":["frontComponentHostCommunicationApi"],"mappings":"AA0CA,WAAW,uCAAuC,CAAA;AAE3C,MAAMA,IACX,WAAW;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';
|
|
2
|
-
export declare const useFrontComponentExecutionContext: <T>(selector: (context: FrontComponentExecutionContext
|
|
1
|
+
import { type FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';
|
|
2
|
+
export declare const useFrontComponentExecutionContext: <T>(selector: (context: FrontComponentExecutionContext) => T) => T;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useState as s, useRef as C, useEffect as a } from "react";
|
|
2
|
+
import { getFrontComponentExecutionContext as r, subscribeToFrontComponentExecutionContext as i, unsubscribeFromFrontComponentExecutionContext as l } from "../context/frontComponentContext.js";
|
|
3
|
+
const p = (e) => {
|
|
4
|
+
const [o, c] = s(
|
|
5
|
+
() => e(r())
|
|
6
|
+
), u = C(o);
|
|
7
|
+
return a(() => {
|
|
8
|
+
const t = () => {
|
|
9
|
+
const n = e(r());
|
|
10
|
+
n !== u.current && (u.current = n, c(n));
|
|
11
|
+
};
|
|
12
|
+
return i(t), t(), () => l(t);
|
|
13
|
+
}, [e]), o;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
p as useFrontComponentExecutionContext
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useFrontComponentExecutionContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrontComponentExecutionContext.js","sources":["../../../../src/sdk/front-component-api/hooks/useFrontComponentExecutionContext.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport {\n getFrontComponentExecutionContext,\n subscribeToFrontComponentExecutionContext,\n unsubscribeFromFrontComponentExecutionContext,\n} from '../context/frontComponentContext';\nimport { type FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';\n\nexport const useFrontComponentExecutionContext = <T>(\n selector: (context: FrontComponentExecutionContext) => T,\n): T => {\n const [currentSelectedValue, setCurrentSelectedValue] = useState(() =>\n selector(getFrontComponentExecutionContext()),\n );\n\n const previousSelectedValueRef = useRef(currentSelectedValue);\n\n useEffect(() => {\n const onContextChange = () => {\n const newSelectedValue = selector(getFrontComponentExecutionContext());\n\n const hasSelectedValueChanged =\n newSelectedValue !== previousSelectedValueRef.current;\n\n if (hasSelectedValueChanged) {\n previousSelectedValueRef.current = newSelectedValue;\n setCurrentSelectedValue(newSelectedValue);\n }\n };\n\n subscribeToFrontComponentExecutionContext(onContextChange);\n\n onContextChange();\n\n return () => unsubscribeFromFrontComponentExecutionContext(onContextChange);\n }, [selector]);\n\n return currentSelectedValue;\n};\n"],"names":["useFrontComponentExecutionContext","selector","currentSelectedValue","setCurrentSelectedValue","useState","getFrontComponentExecutionContext","previousSelectedValueRef","useRef","useEffect","onContextChange","newSelectedValue","subscribeToFrontComponentExecutionContext","unsubscribeFromFrontComponentExecutionContext"],"mappings":";;AAQO,MAAMA,IAAoC,CAC/CC,MACM;AACN,QAAM,CAACC,GAAsBC,CAAuB,IAAIC;AAAA,IAAS,MAC/DH,EAASI,EAAA,CAAmC;AAAA,EAAA,GAGxCC,IAA2BC,EAAOL,CAAoB;AAE5D,SAAAM,EAAU,MAAM;AACd,UAAMC,IAAkB,MAAM;AAC5B,YAAMC,IAAmBT,EAASI,GAAmC;AAKrE,MAFEK,MAAqBJ,EAAyB,YAG9CA,EAAyB,UAAUI,GACnCP,EAAwBO,CAAgB;AAAA,IAE5C;AAEA,WAAAC,EAA0CF,CAAe,GAEzDA,EAAA,GAEO,MAAMG,EAA8CH,CAAe;AAAA,EAC5E,GAAG,CAACR,CAAQ,CAAC,GAENC;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFrontComponentId: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrontComponentId.js","sources":["../../../../src/sdk/front-component-api/hooks/useFrontComponentId.ts"],"sourcesContent":["import { type FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';\nimport { useFrontComponentExecutionContext } from './useFrontComponentExecutionContext';\n\nconst selectFrontComponentId = (\n context: FrontComponentExecutionContext,\n): string => context.frontComponentId;\n\nexport const useFrontComponentId = (): string => {\n return useFrontComponentExecutionContext(selectFrontComponentId);\n};\n"],"names":["selectFrontComponentId","context","useFrontComponentId","useFrontComponentExecutionContext"],"mappings":";AAGA,MAAMA,IAAyB,CAC7BC,MACWA,EAAQ,kBAERC,IAAsB,MAC1BC,EAAkCH,CAAsB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useUserId: () => string | null
|
|
1
|
+
export declare const useUserId: () => string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUserId.js","sources":["../../../../src/sdk/front-component-api/hooks/useUserId.ts"],"sourcesContent":["import { type FrontComponentExecutionContext } from '../types/FrontComponentExecutionContext';\nimport { useFrontComponentExecutionContext } from './useFrontComponentExecutionContext';\n\nconst selectUserId = (context: FrontComponentExecutionContext): string | null =>\n context.userId;\n\nexport const useUserId = (): string | null => {\n return useFrontComponentExecutionContext(selectUserId);\n};\n"],"names":["selectUserId","context","useUserId","useFrontComponentExecutionContext"],"mappings":";AAGA,MAAMA,IAAe,CAACC,MACpBA,EAAQ,QAEGC,IAAY,MAChBC,EAAkCH,CAAY;"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export { setFrontComponentExecutionContext } from './context/frontComponentContext';
|
|
2
|
-
export {
|
|
2
|
+
export { closeSidePanel } from './functions/closeSidePanel';
|
|
3
|
+
export { enqueueSnackbar } from './functions/enqueueSnackbar';
|
|
4
|
+
export { navigate } from './functions/navigate';
|
|
5
|
+
export { openSidePanelPage } from './functions/openSidePanelPage';
|
|
6
|
+
export { unmountFrontComponent } from './functions/unmountFrontComponent';
|
|
3
7
|
export { useFrontComponentExecutionContext } from './hooks/useFrontComponentExecutionContext';
|
|
8
|
+
export { useFrontComponentId } from './hooks/useFrontComponentId';
|
|
4
9
|
export { useUserId } from './hooks/useUserId';
|
|
5
10
|
export type { FrontComponentExecutionContext } from './types/FrontComponentExecutionContext';
|
|
11
|
+
export { getFrontComponentActionErrorDedupeKey } from './utils/getFrontComponentActionErrorDedupeKey';
|
|
12
|
+
export { ALLOWED_HTML_ELEMENTS } from './constants/AllowedHtmlElements';
|
|
13
|
+
export type { AllowedHtmlElement } from './constants/AllowedHtmlElements';
|
|
14
|
+
export { COMMON_HTML_EVENTS } from './constants/CommonHtmlEvents';
|
|
15
|
+
export { EVENT_TO_REACT } from './constants/EventToReact';
|
|
16
|
+
export { HTML_COMMON_PROPERTIES } from './constants/HtmlCommonProperties';
|
|
17
|
+
export { HTML_TAG_TO_REMOTE_COMPONENT } from './constants/HtmlTagToRemoteComponent';
|
|
18
|
+
export type { SerializedEventData } from './constants/SerializedEventData';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getFrontComponentActionErrorDedupeKey: (frontComponentId: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFrontComponentActionErrorDedupeKey.js","sources":["../../../../src/sdk/front-component-api/utils/getFrontComponentActionErrorDedupeKey.ts"],"sourcesContent":["export const getFrontComponentActionErrorDedupeKey = (\n frontComponentId: string,\n): string => `${frontComponentId}-action-error`;\n"],"names":["getFrontComponentActionErrorDedupeKey","frontComponentId"],"mappings":"AAAO,MAAMA,IAAwC,CACnDC,MACW,GAAGA,CAAgB;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FrontComponentManifest } from 'twenty-shared/application';
|
|
1
|
+
import { type FrontComponentCommandManifest, type FrontComponentManifest } from 'twenty-shared/application';
|
|
2
2
|
export type FrontComponentType = React.ComponentType<any>;
|
|
3
|
+
export type FrontComponentCommandConfig = FrontComponentCommandManifest;
|
|
3
4
|
export type FrontComponentConfig = Omit<FrontComponentManifest, 'sourceComponentPath' | 'builtComponentPath' | 'builtComponentChecksum' | 'componentName'> & {
|
|
4
5
|
component: FrontComponentType;
|
|
5
6
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class n {
|
|
2
|
+
constructor(s) {
|
|
3
|
+
this.cssText = s;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
class i extends Array {
|
|
7
|
+
item(s) {
|
|
8
|
+
return this[s] ?? null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class l {
|
|
12
|
+
constructor(s) {
|
|
13
|
+
this.cssRules = new i(), this.onChange = s;
|
|
14
|
+
}
|
|
15
|
+
insertRule(s, t) {
|
|
16
|
+
const c = t ?? this.cssRules.length;
|
|
17
|
+
return this.cssRules.splice(c, 0, new n(s)), this.notify(), c;
|
|
18
|
+
}
|
|
19
|
+
deleteRule(s) {
|
|
20
|
+
this.cssRules.splice(s, 1), this.notify();
|
|
21
|
+
}
|
|
22
|
+
notify() {
|
|
23
|
+
const s = this.cssRules.map((t) => t.cssText).join(`
|
|
24
|
+
`);
|
|
25
|
+
this.onChange(s);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
l as MockCSSStyleSheet
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=MockCSSStyleSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockCSSStyleSheet.js","sources":["../../../../src/front-component-renderer/polyfills/MockCSSStyleSheet.ts"],"sourcesContent":["type OnChangeCallback = (cssText: string) => void;\n\nclass MockCSSRule {\n cssText: string;\n\n constructor(cssText: string) {\n this.cssText = cssText;\n }\n}\n\nclass MockCSSRuleList extends Array<MockCSSRule> {\n item(index: number): MockCSSRule | null {\n return this[index] ?? null;\n }\n}\n\nexport class MockCSSStyleSheet {\n cssRules = new MockCSSRuleList();\n private onChange: OnChangeCallback;\n\n constructor(onChange: OnChangeCallback) {\n this.onChange = onChange;\n }\n\n insertRule(rule: string, index?: number): number {\n const insertAt = index ?? this.cssRules.length;\n this.cssRules.splice(insertAt, 0, new MockCSSRule(rule));\n this.notify();\n return insertAt;\n }\n\n deleteRule(index: number): void {\n this.cssRules.splice(index, 1);\n this.notify();\n }\n\n private notify(): void {\n const cssText = this.cssRules.map((rule) => rule.cssText).join('\\n');\n this.onChange(cssText);\n }\n}\n"],"names":["MockCSSRule","cssText","MockCSSRuleList","index","MockCSSStyleSheet","onChange","rule","insertAt"],"mappings":"AAEA,MAAMA,EAAY;AAAA,EAGhB,YAAYC,GAAiB;AAC3B,SAAK,UAAUA;AAAA,EACjB;AACF;AAEA,MAAMC,UAAwB,MAAmB;AAAA,EAC/C,KAAKC,GAAmC;AACtC,WAAO,KAAKA,CAAK,KAAK;AAAA,EACxB;AACF;AAEO,MAAMC,EAAkB;AAAA,EAI7B,YAAYC,GAA4B;AAHxC,SAAA,WAAW,IAAIH,EAAA,GAIb,KAAK,WAAWG;AAAA,EAClB;AAAA,EAEA,WAAWC,GAAcH,GAAwB;AAC/C,UAAMI,IAAWJ,KAAS,KAAK,SAAS;AACxC,gBAAK,SAAS,OAAOI,GAAU,GAAG,IAAIP,EAAYM,CAAI,CAAC,GACvD,KAAK,OAAA,GACEC;AAAA,EACT;AAAA,EAEA,WAAWJ,GAAqB;AAC9B,SAAK,SAAS,OAAOA,GAAO,CAAC,GAC7B,KAAK,OAAA;AAAA,EACP;AAAA,EAEQ,SAAe;AACrB,UAAMF,IAAU,KAAK,SAAS,IAAI,CAACK,MAASA,EAAK,OAAO,EAAE,KAAK;AAAA,CAAI;AACnE,SAAK,SAASL,CAAO;AAAA,EACvB;AACF;"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { MockCSSStyleSheet as k } from "./MockCSSStyleSheet.js";
|
|
2
|
+
const w = (a) => {
|
|
3
|
+
const p = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), s = (t) => {
|
|
4
|
+
if (p.has(t))
|
|
5
|
+
return;
|
|
6
|
+
const e = document.createElement(
|
|
7
|
+
"remote-style"
|
|
8
|
+
);
|
|
9
|
+
p.set(t, e);
|
|
10
|
+
const g = (t.getAttributeNames?.() ?? []).filter((n) => n.startsWith("data-")).map(
|
|
11
|
+
(n) => `${n}=${t.getAttribute(n) ?? ""}`
|
|
12
|
+
).join(";");
|
|
13
|
+
g.length > 0 && (e.styleKey = g);
|
|
14
|
+
const f = () => {
|
|
15
|
+
e.cssText = t.textContent ?? "";
|
|
16
|
+
}, j = new k((n) => {
|
|
17
|
+
e.cssText = n;
|
|
18
|
+
});
|
|
19
|
+
try {
|
|
20
|
+
Object.defineProperty(t, "sheet", {
|
|
21
|
+
get: () => j,
|
|
22
|
+
configurable: !0
|
|
23
|
+
});
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
const l = Object.getPrototypeOf(t), u = Object.getOwnPropertyDescriptor(t, "textContent") ?? Object.getOwnPropertyDescriptor(l, "textContent") ?? Object.getOwnPropertyDescriptor(
|
|
27
|
+
Object.getPrototypeOf(l),
|
|
28
|
+
"textContent"
|
|
29
|
+
);
|
|
30
|
+
if (u?.set) {
|
|
31
|
+
const n = u.set;
|
|
32
|
+
try {
|
|
33
|
+
Object.defineProperty(t, "textContent", {
|
|
34
|
+
get: u.get,
|
|
35
|
+
set(i) {
|
|
36
|
+
n.call(this, i), e.cssText = i ?? "";
|
|
37
|
+
},
|
|
38
|
+
configurable: !0
|
|
39
|
+
});
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const P = t.appendChild.bind(t);
|
|
44
|
+
try {
|
|
45
|
+
t.appendChild = (n) => {
|
|
46
|
+
const i = P(n);
|
|
47
|
+
return f(), i;
|
|
48
|
+
};
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
const A = t.insertBefore.bind(t);
|
|
52
|
+
try {
|
|
53
|
+
t.insertBefore = (n, i) => {
|
|
54
|
+
const M = A(n, i);
|
|
55
|
+
return f(), M;
|
|
56
|
+
};
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
const B = t.removeChild.bind(t);
|
|
60
|
+
try {
|
|
61
|
+
t.removeChild = (n) => {
|
|
62
|
+
const i = B(n);
|
|
63
|
+
return f(), i;
|
|
64
|
+
};
|
|
65
|
+
} catch {
|
|
66
|
+
}
|
|
67
|
+
if (typeof MutationObserver == "function")
|
|
68
|
+
try {
|
|
69
|
+
const n = new MutationObserver(() => {
|
|
70
|
+
f();
|
|
71
|
+
});
|
|
72
|
+
typeof n.observe == "function" && (n.observe(t, {
|
|
73
|
+
subtree: !0,
|
|
74
|
+
childList: !0,
|
|
75
|
+
characterData: !0
|
|
76
|
+
}), d.set(t, n));
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
const h = t.textContent;
|
|
80
|
+
h && (e.cssText = h), a.appendChild(e);
|
|
81
|
+
}, b = (t) => {
|
|
82
|
+
const e = d.get(t);
|
|
83
|
+
e && (e.disconnect(), d.delete(t));
|
|
84
|
+
const o = p.get(t);
|
|
85
|
+
o && o.parentNode && (o.parentNode.removeChild(o), p.delete(t));
|
|
86
|
+
}, r = document.head, C = r.appendChild.bind(r), y = r.insertBefore.bind(r), O = r.append.bind(r), S = r.prepend.bind(r), x = r.replaceChild.bind(r), v = r.removeChild.bind(r);
|
|
87
|
+
r.appendChild = (t) => {
|
|
88
|
+
const e = C(t);
|
|
89
|
+
return c(t) && s(t), e;
|
|
90
|
+
}, r.insertBefore = (t, e) => {
|
|
91
|
+
const o = y(t, e);
|
|
92
|
+
return c(t) && s(t), o;
|
|
93
|
+
}, r.append = (...t) => {
|
|
94
|
+
O(...t);
|
|
95
|
+
for (const e of t)
|
|
96
|
+
c(e) && s(e);
|
|
97
|
+
}, r.prepend = (...t) => {
|
|
98
|
+
S(...t);
|
|
99
|
+
for (const e of t)
|
|
100
|
+
c(e) && s(e);
|
|
101
|
+
}, r.replaceChild = (t, e) => {
|
|
102
|
+
const o = x(t, e);
|
|
103
|
+
return c(e) && b(e), c(t) && s(t), o;
|
|
104
|
+
}, r.removeChild = (t) => {
|
|
105
|
+
const e = v(t);
|
|
106
|
+
return c(t) && b(t), e;
|
|
107
|
+
};
|
|
108
|
+
const m = Array.from(
|
|
109
|
+
r.querySelectorAll("style")
|
|
110
|
+
);
|
|
111
|
+
for (const t of m)
|
|
112
|
+
s(t);
|
|
113
|
+
Object.defineProperty(document, "styleSheets", {
|
|
114
|
+
get: () => [],
|
|
115
|
+
configurable: !0
|
|
116
|
+
});
|
|
117
|
+
}, c = (a) => typeof a != "string" && "localName" in a && a.localName === "style";
|
|
118
|
+
export {
|
|
119
|
+
w as installStyleBridge
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=installStyleBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installStyleBridge.js","sources":["../../../../src/front-component-renderer/polyfills/installStyleBridge.ts"],"sourcesContent":["import { type RemoteRootElement } from '@remote-dom/core/elements';\n\nimport { type RemoteStyleProperties } from '@/front-component-renderer/remote/generated/remote-elements';\nimport { MockCSSStyleSheet } from './MockCSSStyleSheet';\n\nexport const installStyleBridge = (remoteRoot: RemoteRootElement): void => {\n const styleElementMap = new WeakMap<\n Element,\n Element & RemoteStyleProperties\n >();\n const styleObserverMap = new WeakMap<Element, { disconnect: () => void }>();\n\n const trackStyleElement = (styleElement: Element): void => {\n if (styleElementMap.has(styleElement)) {\n return;\n }\n\n const remoteStyleElement = document.createElement(\n 'remote-style',\n ) as Element & RemoteStyleProperties;\n\n styleElementMap.set(styleElement, remoteStyleElement);\n\n const attributeNames = styleElement.getAttributeNames?.() ?? [];\n const dataAttributes = attributeNames\n .filter((attributeName: string) => attributeName.startsWith('data-'))\n .map(\n (attributeName: string) =>\n `${attributeName}=${styleElement.getAttribute(attributeName) ?? ''}`,\n )\n .join(';');\n\n if (dataAttributes.length > 0) {\n remoteStyleElement.styleKey = dataAttributes;\n }\n\n const syncCssFromStyleElement = () => {\n remoteStyleElement.cssText = styleElement.textContent ?? '';\n };\n\n const mockSheet = new MockCSSStyleSheet((cssText: string) => {\n remoteStyleElement.cssText = cssText;\n });\n\n try {\n Object.defineProperty(styleElement, 'sheet', {\n get: () => mockSheet,\n configurable: true,\n });\n } catch {\n void 0;\n }\n\n const prototypeChain = Object.getPrototypeOf(styleElement);\n const textContentDescriptor =\n Object.getOwnPropertyDescriptor(styleElement, 'textContent') ??\n Object.getOwnPropertyDescriptor(prototypeChain, 'textContent') ??\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(prototypeChain),\n 'textContent',\n );\n\n if (textContentDescriptor?.set) {\n const originalTextContentSet = textContentDescriptor.set;\n try {\n Object.defineProperty(styleElement, 'textContent', {\n get: textContentDescriptor.get,\n set(value: string) {\n originalTextContentSet.call(this, value);\n remoteStyleElement.cssText = value ?? '';\n },\n configurable: true,\n });\n } catch {\n void 0;\n }\n }\n\n const originalAppendChild = styleElement.appendChild.bind(styleElement);\n try {\n (\n styleElement as Element & { appendChild: typeof originalAppendChild }\n ).appendChild = (child: Node) => {\n const result = originalAppendChild(child);\n syncCssFromStyleElement();\n return result;\n };\n } catch {\n void 0;\n }\n\n const originalInsertBeforeOnStyle =\n styleElement.insertBefore.bind(styleElement);\n try {\n (\n styleElement as Element & {\n insertBefore: typeof originalInsertBeforeOnStyle;\n }\n ).insertBefore = <T extends Node>(child: T, ref: Node | null): T => {\n const result = originalInsertBeforeOnStyle(child, ref);\n syncCssFromStyleElement();\n return result;\n };\n } catch {\n void 0;\n }\n\n const originalRemoveChildOnStyle =\n styleElement.removeChild.bind(styleElement);\n try {\n (\n styleElement as Element & {\n removeChild: typeof originalRemoveChildOnStyle;\n }\n ).removeChild = <T extends Node>(child: T): T => {\n const result = originalRemoveChildOnStyle(child);\n syncCssFromStyleElement();\n return result;\n };\n } catch {\n void 0;\n }\n\n if (typeof MutationObserver === 'function') {\n try {\n const styleObserver = new MutationObserver(() => {\n syncCssFromStyleElement();\n });\n\n if (typeof styleObserver.observe === 'function') {\n styleObserver.observe(styleElement, {\n subtree: true,\n childList: true,\n characterData: true,\n });\n styleObserverMap.set(styleElement, styleObserver);\n }\n } catch {\n void 0;\n }\n }\n\n const existingContent = styleElement.textContent;\n if (existingContent) {\n remoteStyleElement.cssText = existingContent;\n }\n\n remoteRoot.appendChild(remoteStyleElement);\n };\n\n const untrackStyleElement = (styleElement: Element): void => {\n const styleObserver = styleObserverMap.get(styleElement);\n if (styleObserver) {\n styleObserver.disconnect();\n styleObserverMap.delete(styleElement);\n }\n\n const remoteStyleElement = styleElementMap.get(styleElement);\n\n if (remoteStyleElement && remoteStyleElement.parentNode) {\n remoteStyleElement.parentNode.removeChild(remoteStyleElement);\n styleElementMap.delete(styleElement);\n }\n };\n\n const headElement = document.head;\n const originalAppendChild = headElement.appendChild.bind(headElement);\n const originalInsertBefore = headElement.insertBefore.bind(headElement);\n const originalAppend = headElement.append.bind(headElement);\n const originalPrepend = headElement.prepend.bind(headElement);\n const originalReplaceChild = headElement.replaceChild.bind(headElement);\n const originalRemoveChild = headElement.removeChild.bind(headElement);\n\n headElement.appendChild = <T extends Node>(child: T): T => {\n const result = originalAppendChild(child);\n if (isStyleElement(child)) {\n trackStyleElement(child as unknown as Element);\n }\n return result;\n };\n\n headElement.insertBefore = <T extends Node>(\n child: T,\n ref: Node | null,\n ): T => {\n const result = originalInsertBefore(child, ref);\n if (isStyleElement(child)) {\n trackStyleElement(child as unknown as Element);\n }\n return result;\n };\n\n headElement.append = (...nodes: (Node | string)[]) => {\n originalAppend(...nodes);\n for (const node of nodes) {\n if (isStyleElement(node)) {\n trackStyleElement(node as Element);\n }\n }\n };\n\n headElement.prepend = (...nodes: (Node | string)[]) => {\n originalPrepend(...nodes);\n for (const node of nodes) {\n if (isStyleElement(node)) {\n trackStyleElement(node as Element);\n }\n }\n };\n\n headElement.replaceChild = <T extends Node>(\n newChild: Node,\n oldChild: T,\n ): T => {\n const result = originalReplaceChild(newChild, oldChild);\n if (isStyleElement(oldChild)) {\n untrackStyleElement(oldChild as unknown as Element);\n }\n if (isStyleElement(newChild)) {\n trackStyleElement(newChild as unknown as Element);\n }\n return result;\n };\n\n headElement.removeChild = <T extends Node>(child: T): T => {\n const result = originalRemoveChild(child);\n if (isStyleElement(child)) {\n untrackStyleElement(child as unknown as Element);\n }\n return result;\n };\n\n const existingStyleElements = Array.from(\n headElement.querySelectorAll('style'),\n );\n for (const styleElement of existingStyleElements) {\n trackStyleElement(styleElement);\n }\n\n Object.defineProperty(document, 'styleSheets', {\n get: () => [],\n configurable: true,\n });\n};\n\nconst isStyleElement = (node: Node | string): node is Element => {\n return (\n typeof node !== 'string' &&\n 'localName' in node &&\n node.localName === 'style'\n );\n};\n"],"names":["installStyleBridge","remoteRoot","styleElementMap","styleObserverMap","trackStyleElement","styleElement","remoteStyleElement","dataAttributes","attributeName","syncCssFromStyleElement","mockSheet","MockCSSStyleSheet","cssText","prototypeChain","textContentDescriptor","originalTextContentSet","value","originalAppendChild","child","result","originalInsertBeforeOnStyle","ref","originalRemoveChildOnStyle","styleObserver","existingContent","untrackStyleElement","headElement","originalInsertBefore","originalAppend","originalPrepend","originalReplaceChild","originalRemoveChild","isStyleElement","nodes","node","newChild","oldChild","existingStyleElements"],"mappings":";AAKO,MAAMA,IAAqB,CAACC,MAAwC;AACzE,QAAMC,wBAAsB,QAAA,GAItBC,wBAAuB,QAAA,GAEvBC,IAAoB,CAACC,MAAgC;AACzD,QAAIH,EAAgB,IAAIG,CAAY;AAClC;AAGF,UAAMC,IAAqB,SAAS;AAAA,MAClC;AAAA,IAAA;AAGF,IAAAJ,EAAgB,IAAIG,GAAcC,CAAkB;AAGpD,UAAMC,KADiBF,EAAa,oBAAA,KAAyB,CAAA,GAE1D,OAAO,CAACG,MAA0BA,EAAc,WAAW,OAAO,CAAC,EACnE;AAAA,MACC,CAACA,MACC,GAAGA,CAAa,IAAIH,EAAa,aAAaG,CAAa,KAAK,EAAE;AAAA,IAAA,EAErE,KAAK,GAAG;AAEX,IAAID,EAAe,SAAS,MAC1BD,EAAmB,WAAWC;AAGhC,UAAME,IAA0B,MAAM;AACpC,MAAAH,EAAmB,UAAUD,EAAa,eAAe;AAAA,IAC3D,GAEMK,IAAY,IAAIC,EAAkB,CAACC,MAAoB;AAC3D,MAAAN,EAAmB,UAAUM;AAAA,IAC/B,CAAC;AAED,QAAI;AACF,aAAO,eAAeP,GAAc,SAAS;AAAA,QAC3C,KAAK,MAAMK;AAAA,QACX,cAAc;AAAA,MAAA,CACf;AAAA,IACH,QAAQ;AAAA,IAER;AAEA,UAAMG,IAAiB,OAAO,eAAeR,CAAY,GACnDS,IACJ,OAAO,yBAAyBT,GAAc,aAAa,KAC3D,OAAO,yBAAyBQ,GAAgB,aAAa,KAC7D,OAAO;AAAA,MACL,OAAO,eAAeA,CAAc;AAAA,MACpC;AAAA,IAAA;AAGJ,QAAIC,GAAuB,KAAK;AAC9B,YAAMC,IAAyBD,EAAsB;AACrD,UAAI;AACF,eAAO,eAAeT,GAAc,eAAe;AAAA,UACjD,KAAKS,EAAsB;AAAA,UAC3B,IAAIE,GAAe;AACjB,YAAAD,EAAuB,KAAK,MAAMC,CAAK,GACvCV,EAAmB,UAAUU,KAAS;AAAA,UACxC;AAAA,UACA,cAAc;AAAA,QAAA,CACf;AAAA,MACH,QAAQ;AAAA,MAER;AAAA,IACF;AAEA,UAAMC,IAAsBZ,EAAa,YAAY,KAAKA,CAAY;AACtE,QAAI;AAEA,MAAAA,EACA,cAAc,CAACa,MAAgB;AAC/B,cAAMC,IAASF,EAAoBC,CAAK;AACxC,eAAAT,EAAA,GACOU;AAAA,MACT;AAAA,IACF,QAAQ;AAAA,IAER;AAEA,UAAMC,IACJf,EAAa,aAAa,KAAKA,CAAY;AAC7C,QAAI;AAEA,MAAAA,EAGA,eAAe,CAAiBa,GAAUG,MAAwB;AAClE,cAAMF,IAASC,EAA4BF,GAAOG,CAAG;AACrD,eAAAZ,EAAA,GACOU;AAAA,MACT;AAAA,IACF,QAAQ;AAAA,IAER;AAEA,UAAMG,IACJjB,EAAa,YAAY,KAAKA,CAAY;AAC5C,QAAI;AAEA,MAAAA,EAGA,cAAc,CAAiBa,MAAgB;AAC/C,cAAMC,IAASG,EAA2BJ,CAAK;AAC/C,eAAAT,EAAA,GACOU;AAAA,MACT;AAAA,IACF,QAAQ;AAAA,IAER;AAEA,QAAI,OAAO,oBAAqB;AAC9B,UAAI;AACF,cAAMI,IAAgB,IAAI,iBAAiB,MAAM;AAC/C,UAAAd,EAAA;AAAA,QACF,CAAC;AAED,QAAI,OAAOc,EAAc,WAAY,eACnCA,EAAc,QAAQlB,GAAc;AAAA,UAClC,SAAS;AAAA,UACT,WAAW;AAAA,UACX,eAAe;AAAA,QAAA,CAChB,GACDF,EAAiB,IAAIE,GAAckB,CAAa;AAAA,MAEpD,QAAQ;AAAA,MAER;AAGF,UAAMC,IAAkBnB,EAAa;AACrC,IAAImB,MACFlB,EAAmB,UAAUkB,IAG/BvB,EAAW,YAAYK,CAAkB;AAAA,EAC3C,GAEMmB,IAAsB,CAACpB,MAAgC;AAC3D,UAAMkB,IAAgBpB,EAAiB,IAAIE,CAAY;AACvD,IAAIkB,MACFA,EAAc,WAAA,GACdpB,EAAiB,OAAOE,CAAY;AAGtC,UAAMC,IAAqBJ,EAAgB,IAAIG,CAAY;AAE3D,IAAIC,KAAsBA,EAAmB,eAC3CA,EAAmB,WAAW,YAAYA,CAAkB,GAC5DJ,EAAgB,OAAOG,CAAY;AAAA,EAEvC,GAEMqB,IAAc,SAAS,MACvBT,IAAsBS,EAAY,YAAY,KAAKA,CAAW,GAC9DC,IAAuBD,EAAY,aAAa,KAAKA,CAAW,GAChEE,IAAiBF,EAAY,OAAO,KAAKA,CAAW,GACpDG,IAAkBH,EAAY,QAAQ,KAAKA,CAAW,GACtDI,IAAuBJ,EAAY,aAAa,KAAKA,CAAW,GAChEK,IAAsBL,EAAY,YAAY,KAAKA,CAAW;AAEpE,EAAAA,EAAY,cAAc,CAAiBR,MAAgB;AACzD,UAAMC,IAASF,EAAoBC,CAAK;AACxC,WAAIc,EAAed,CAAK,KACtBd,EAAkBc,CAA2B,GAExCC;AAAA,EACT,GAEAO,EAAY,eAAe,CACzBR,GACAG,MACM;AACN,UAAMF,IAASQ,EAAqBT,GAAOG,CAAG;AAC9C,WAAIW,EAAed,CAAK,KACtBd,EAAkBc,CAA2B,GAExCC;AAAA,EACT,GAEAO,EAAY,SAAS,IAAIO,MAA6B;AACpD,IAAAL,EAAe,GAAGK,CAAK;AACvB,eAAWC,KAAQD;AACjB,MAAID,EAAeE,CAAI,KACrB9B,EAAkB8B,CAAe;AAAA,EAGvC,GAEAR,EAAY,UAAU,IAAIO,MAA6B;AACrD,IAAAJ,EAAgB,GAAGI,CAAK;AACxB,eAAWC,KAAQD;AACjB,MAAID,EAAeE,CAAI,KACrB9B,EAAkB8B,CAAe;AAAA,EAGvC,GAEAR,EAAY,eAAe,CACzBS,GACAC,MACM;AACN,UAAMjB,IAASW,EAAqBK,GAAUC,CAAQ;AACtD,WAAIJ,EAAeI,CAAQ,KACzBX,EAAoBW,CAA8B,GAEhDJ,EAAeG,CAAQ,KACzB/B,EAAkB+B,CAA8B,GAE3ChB;AAAA,EACT,GAEAO,EAAY,cAAc,CAAiBR,MAAgB;AACzD,UAAMC,IAASY,EAAoBb,CAAK;AACxC,WAAIc,EAAed,CAAK,KACtBO,EAAoBP,CAA2B,GAE1CC;AAAA,EACT;AAEA,QAAMkB,IAAwB,MAAM;AAAA,IAClCX,EAAY,iBAAiB,OAAO;AAAA,EAAA;AAEtC,aAAWrB,KAAgBgC;AACzB,IAAAjC,EAAkBC,CAAY;AAGhC,SAAO,eAAe,UAAU,eAAe;AAAA,IAC7C,KAAK,MAAM,CAAA;AAAA,IACX,cAAc;AAAA,EAAA,CACf;AACH,GAEM2B,IAAiB,CAACE,MAEpB,OAAOA,KAAS,YAChB,eAAeA,KACfA,EAAK,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exposeGlobals.js","sources":["../../../../../src/front-component-renderer/remote/utils/exposeGlobals.ts"],"sourcesContent":["export const exposeGlobals = (globals: Record<string, unknown>): void => {\n for (const [key, value] of Object.entries(globals)) {\n (globalThis as Record<string, unknown>)[key] = value;\n }\n};\n"],"names":["exposeGlobals","globals","key","value"],"mappings":"AAAO,MAAMA,IAAgB,CAACC,MAA2C;AACvE,aAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQF,CAAO;AAC9C,eAAuCC,CAAG,IAAIC;AAEnD;"}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ApplicationConfig } from './application/application-config';
|
|
2
2
|
export { defineApplication } from './application/define-application';
|
|
3
|
-
export type {
|
|
3
|
+
export type { DefinableEntity, DefineEntity, ValidationResult, } from './common/types/define-entity.type';
|
|
4
4
|
export type { SyncableEntityOptions } from './common/types/syncable-entity-options.type';
|
|
5
5
|
export { createValidationResult } from './common/utils/create-validation-result';
|
|
6
6
|
export { defineFrontComponent } from './define-front-component';
|
|
@@ -10,23 +10,36 @@ export { FieldType } from './fields/field-type';
|
|
|
10
10
|
export { OnDeleteAction } from './fields/on-delete-action';
|
|
11
11
|
export { RelationType } from './fields/relation-type';
|
|
12
12
|
export { validateFields } from './fields/validate-fields';
|
|
13
|
-
export type {
|
|
13
|
+
export type { FrontComponentCommandConfig, FrontComponentConfig, FrontComponentType, } from './front-component-config';
|
|
14
14
|
export { defineLogicFunction } from './logic-functions/define-logic-function';
|
|
15
|
-
export type {
|
|
15
|
+
export type { LogicFunctionConfig, LogicFunctionHandler, } from './logic-functions/logic-function-config';
|
|
16
16
|
export type { CronPayload } from './logic-functions/triggers/cron-payload-type';
|
|
17
|
-
export type { DatabaseEventPayload,
|
|
17
|
+
export type { DatabaseEventPayload, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, } from './logic-functions/triggers/database-event-payload-type';
|
|
18
18
|
export type { RoutePayload } from './logic-functions/triggers/route-payload-type';
|
|
19
|
+
export { defineNavigationMenuItem } from './navigation-menu-items/define-navigation-menu-item';
|
|
19
20
|
export { defineObject } from './objects/define-object';
|
|
20
21
|
export { STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS } from './objects/standard-object-ids';
|
|
22
|
+
export { STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS as STANDARD_OBJECT } from './objects/standard-object-ids';
|
|
23
|
+
export { definePageLayout } from './page-layouts/define-page-layout';
|
|
24
|
+
export type { PageLayoutConfig } from './page-layouts/page-layout-config';
|
|
25
|
+
export { AggregateOperations, ObjectRecordGroupByDateGranularity, PageLayoutTabLayoutMode, } from 'twenty-shared/types';
|
|
26
|
+
export type { PageLayoutWidgetUniversalConfiguration } from 'twenty-shared/types';
|
|
21
27
|
export { defineRole } from './roles/define-role';
|
|
22
28
|
export { PermissionFlag } from './roles/permission-flag-type';
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
29
|
+
export { defineSkill } from './skills/define-skill';
|
|
30
|
+
export { defineView } from './views/define-view';
|
|
31
|
+
export type { ViewConfig } from './views/view-config';
|
|
32
|
+
export { Action } from './action';
|
|
33
|
+
export type { ActionProps } from './action';
|
|
34
|
+
export { ActionLink } from './action';
|
|
35
|
+
export type { ActionLinkProps } from './action';
|
|
36
|
+
export { ActionOpenSidePanelPage } from './action';
|
|
37
|
+
export type { ActionOpenSidePanelPageProps } from './action';
|
|
38
|
+
export { enqueueSnackbar, getFrontComponentActionErrorDedupeKey, closeSidePanel, navigate, openSidePanelPage, unmountFrontComponent, useFrontComponentExecutionContext, useFrontComponentId, useUserId, } from './front-component-api';
|
|
26
39
|
export type { FrontComponentExecutionContext } from './front-component-api';
|
|
27
|
-
export
|
|
28
|
-
export {
|
|
29
|
-
export { COMMON_HTML_EVENTS } from './front-component-
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
40
|
+
export { AppPath, CommandMenuPages } from 'twenty-shared/types';
|
|
41
|
+
export type { EnqueueSnackbarParams, SnackBarVariant, } from 'twenty-shared/types';
|
|
42
|
+
export { ALLOWED_HTML_ELEMENTS, COMMON_HTML_EVENTS, EVENT_TO_REACT, HTML_COMMON_PROPERTIES, HTML_TAG_TO_REMOTE_COMPONENT, } from './front-component-api';
|
|
43
|
+
export type { AllowedHtmlElement } from './front-component-api';
|
|
44
|
+
export { installStyleBridge } from '../front-component-renderer/polyfills/installStyleBridge';
|
|
45
|
+
export { exposeGlobals } from '../front-component-renderer/remote/utils/exposeGlobals';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineApplication as r } from "./application/define-application.js";
|
|
2
|
+
import { createValidationResult as n } from "./common/utils/create-validation-result.js";
|
|
3
|
+
import { defineFrontComponent as i } from "./define-front-component.js";
|
|
4
|
+
import { defineField as m } from "./fields/define-field.js";
|
|
5
|
+
import { AggregateOperations as x, AppPath as T, CommandMenuPages as d, FieldMetadataType as l, ObjectRecordGroupByDateGranularity as E, RelationOnDeleteAction as s, PageLayoutTabLayoutMode as A, RelationType as O } from "twenty-shared/types";
|
|
6
|
+
import { validateFields as _ } from "./fields/validate-fields.js";
|
|
7
|
+
import { defineLogicFunction as c } from "./logic-functions/define-logic-function.js";
|
|
8
|
+
import { defineNavigationMenuItem as C } from "./navigation-menu-items/define-navigation-menu-item.js";
|
|
9
|
+
import { defineObject as R } from "./objects/define-object.js";
|
|
10
|
+
import { STANDARD_OBJECTS as N, STANDARD_OBJECTS as P } from "twenty-shared/metadata";
|
|
11
|
+
import { definePageLayout as L } from "./page-layouts/define-page-layout.js";
|
|
12
|
+
import { defineRole as I } from "./roles/define-role.js";
|
|
13
|
+
import { PermissionFlagType as b } from "twenty-shared/constants";
|
|
14
|
+
import { defineSkill as G } from "./skills/define-skill.js";
|
|
15
|
+
import { defineView as J } from "./views/define-view.js";
|
|
16
|
+
import { Action as v } from "./action/Action.js";
|
|
17
|
+
import { ActionLink as U } from "./action/ActionLink.js";
|
|
18
|
+
import { ActionOpenSidePanelPage as q } from "./action/ActionOpenSidePanelPage.js";
|
|
19
|
+
import { closeSidePanel as K } from "./front-component-api/functions/closeSidePanel.js";
|
|
20
|
+
import { enqueueSnackbar as z } from "./front-component-api/functions/enqueueSnackbar.js";
|
|
21
|
+
import { navigate as X } from "./front-component-api/functions/navigate.js";
|
|
22
|
+
import { openSidePanelPage as Z } from "./front-component-api/functions/openSidePanelPage.js";
|
|
23
|
+
import { unmountFrontComponent as ee } from "./front-component-api/functions/unmountFrontComponent.js";
|
|
24
|
+
import { useFrontComponentExecutionContext as re } from "./front-component-api/hooks/useFrontComponentExecutionContext.js";
|
|
25
|
+
import { useFrontComponentId as ne } from "./front-component-api/hooks/useFrontComponentId.js";
|
|
26
|
+
import { useUserId as ie } from "./front-component-api/hooks/useUserId.js";
|
|
27
|
+
import { getFrontComponentActionErrorDedupeKey as me } from "./front-component-api/utils/getFrontComponentActionErrorDedupeKey.js";
|
|
28
|
+
import { ALLOWED_HTML_ELEMENTS as xe } from "./front-component-api/constants/AllowedHtmlElements.js";
|
|
29
|
+
import { COMMON_HTML_EVENTS as de } from "./front-component-api/constants/CommonHtmlEvents.js";
|
|
30
|
+
import { EVENT_TO_REACT as Ee } from "./front-component-api/constants/EventToReact.js";
|
|
31
|
+
import { HTML_COMMON_PROPERTIES as Ae } from "./front-component-api/constants/HtmlCommonProperties.js";
|
|
32
|
+
import { HTML_TAG_TO_REMOTE_COMPONENT as ue } from "./front-component-api/constants/HtmlTagToRemoteComponent.js";
|
|
33
|
+
import { installStyleBridge as Se } from "./front-component-renderer/polyfills/installStyleBridge.js";
|
|
34
|
+
import { exposeGlobals as ge } from "./front-component-renderer/remote/utils/exposeGlobals.js";
|
|
35
|
+
export {
|
|
36
|
+
xe as ALLOWED_HTML_ELEMENTS,
|
|
37
|
+
v as Action,
|
|
38
|
+
U as ActionLink,
|
|
39
|
+
q as ActionOpenSidePanelPage,
|
|
40
|
+
x as AggregateOperations,
|
|
41
|
+
T as AppPath,
|
|
42
|
+
de as COMMON_HTML_EVENTS,
|
|
43
|
+
d as CommandMenuPages,
|
|
44
|
+
Ee as EVENT_TO_REACT,
|
|
45
|
+
l as FieldType,
|
|
46
|
+
Ae as HTML_COMMON_PROPERTIES,
|
|
47
|
+
ue as HTML_TAG_TO_REMOTE_COMPONENT,
|
|
48
|
+
E as ObjectRecordGroupByDateGranularity,
|
|
49
|
+
s as OnDeleteAction,
|
|
50
|
+
A as PageLayoutTabLayoutMode,
|
|
51
|
+
b as PermissionFlag,
|
|
52
|
+
O as RelationType,
|
|
53
|
+
N as STANDARD_OBJECT,
|
|
54
|
+
P as STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
|
|
55
|
+
K as closeSidePanel,
|
|
56
|
+
n as createValidationResult,
|
|
57
|
+
r as defineApplication,
|
|
58
|
+
m as defineField,
|
|
59
|
+
i as defineFrontComponent,
|
|
60
|
+
c as defineLogicFunction,
|
|
61
|
+
C as defineNavigationMenuItem,
|
|
62
|
+
R as defineObject,
|
|
63
|
+
L as definePageLayout,
|
|
64
|
+
I as defineRole,
|
|
65
|
+
G as defineSkill,
|
|
66
|
+
J as defineView,
|
|
67
|
+
z as enqueueSnackbar,
|
|
68
|
+
ge as exposeGlobals,
|
|
69
|
+
me as getFrontComponentActionErrorDedupeKey,
|
|
70
|
+
Se as installStyleBridge,
|
|
71
|
+
X as navigate,
|
|
72
|
+
Z as openSidePanelPage,
|
|
73
|
+
ee as unmountFrontComponent,
|
|
74
|
+
re as useFrontComponentExecutionContext,
|
|
75
|
+
ne as useFrontComponentId,
|
|
76
|
+
ie as useUserId,
|
|
77
|
+
_ as validateFields
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LogicFunctionConfig } from '
|
|
2
|
-
import { DefineEntity } from '
|
|
1
|
+
import { type LogicFunctionConfig } from '../../sdk/logic-functions/logic-function-config';
|
|
2
|
+
import type { DefineEntity } from '../../sdk/common/types/define-entity.type';
|
|
3
3
|
export declare const defineLogicFunction: DefineEntity<LogicFunctionConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createValidationResult as r } from "../common/utils/create-validation-result.js";
|
|
2
|
+
const a = (t) => {
|
|
3
|
+
const e = [];
|
|
4
|
+
return t.universalIdentifier || e.push("Logic function must have a universalIdentifier"), t.handler || e.push("Logic function must have a handler"), typeof t.handler != "function" && e.push("Logic function handler must be a function"), t.httpRouteTriggerSettings && (t.httpRouteTriggerSettings.path || e.push("Route trigger must have a path"), t.httpRouteTriggerSettings.httpMethod || e.push("Route trigger must have an httpMethod")), t.cronTriggerSettings && (t.cronTriggerSettings.pattern || e.push("Cron trigger must have a pattern")), t.databaseEventTriggerSettings && (t.databaseEventTriggerSettings.eventName || e.push("Database event trigger must have an eventName")), r({
|
|
5
|
+
config: t,
|
|
6
|
+
errors: e
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
a as defineLogicFunction
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=define-logic-function.js.map
|