@oneclick.dev/cms-kit 0.0.46 → 0.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cms-kit.js CHANGED
@@ -54303,43 +54303,33 @@ const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
54303
54303
  const _cache = {};
54304
54304
  function getCmsComposable(key) {
54305
54305
  if (_cache[key]) return _cache[key];
54306
- const injectedFn = inject$1(key, null);
54307
- if (!injectedFn) {
54308
- console.warn(`[whitelabel-modules] Missing injected composable: ${key}. Will retry on next call.`);
54309
- const fallback = (...args) => {
54310
- const retryFn = inject$1(key, null);
54311
- if (!retryFn) {
54312
- throw new Error(`[whitelabel-modules] ${key} still not provided.`);
54313
- }
54314
- _cache[key] = retryFn;
54315
- return retryFn(...args);
54316
- };
54317
- _cache[key] = fallback;
54318
- return fallback;
54319
- }
54320
- _cache[key] = injectedFn;
54321
- return injectedFn;
54322
- }
54323
- const useIntegrationActionBuilder = () => getCmsComposable("cms-useIntegrationActionBuilder")();
54324
- const useIntegrations = () => getCmsComposable("cms-useIntegrations")();
54325
- const useIntegrationActions = (integrationId) => getCmsComposable("cms-useIntegrationActions")(integrationId);
54326
- const useMediaLibrary = () => getCmsComposable("cms-useMediaLibrary")();
54327
- const useProjectService = () => getCmsComposable("cms-useProjectService")();
54328
- const useBreadcrumbs = () => getCmsComposable("cms-useBreadcrumbs")();
54329
- const useQueryBuilder = () => getCmsComposable("cms-useQueryBuilder")();
54330
- const useModulePermissions = () => getCmsComposable("cms-useModulePermissions")();
54331
- const useModuleRoute = () => getCmsComposable("cms-useModuleRoute")();
54332
- const useModuleStorage = () => getCmsComposable("cms-useModuleStorage")();
54333
- const useLogs = () => getCmsComposable("cms-useLogs")();
54334
- const useUtilsService = () => getCmsComposable("cms-useUtilsService")();
54335
- const useFormBuilder = () => getCmsComposable("cms-useFormBuilder")();
54336
- const useFlowBuilder = () => getCmsComposable("cms-useFlowBuilder")();
54337
- const useConfirmation = () => getCmsComposable("cms-useConfirmation")();
54338
- const useFirebaseIntegration = (projectId) => getCmsComposable("cms-useFirebaseIntegration")(projectId);
54339
- const useProjectSettings = () => getCmsComposable("cms-useProjectSettings")();
54340
- const useCustomDialog$1 = () => getCmsComposable("cms-useCustomDialog")();
54341
- const useModuleOverlay = () => getCmsComposable("cms-useModuleOverlay")();
54342
- const useOverlayStack = () => getCmsComposable("cms-useOverlayStack")();
54306
+ const composable = useNuxtApp()[key];
54307
+ if (!composable) {
54308
+ throw new Error(`[whitelabel-modules] ${key} not provided in Nuxt app.`);
54309
+ }
54310
+ _cache[key] = composable;
54311
+ return composable;
54312
+ }
54313
+ const useIntegrationActionBuilder = () => getCmsComposable("useIntegrationActionBuilder")();
54314
+ const useIntegrations = () => getCmsComposable("useIntegrations")();
54315
+ const useIntegrationActions = (integrationId) => getCmsComposable("useIntegrationActions")(integrationId);
54316
+ const useMediaLibrary = () => getCmsComposable("useMediaLibrary")();
54317
+ const useProjectService = () => getCmsComposable("useProjectService")();
54318
+ const useBreadcrumbs = () => getCmsComposable("useBreadcrumbs")();
54319
+ const useQueryBuilder = () => getCmsComposable("useQueryBuilder")();
54320
+ const useModulePermissions = () => getCmsComposable("useModulePermissions")();
54321
+ const useModuleRoute = () => getCmsComposable("useModuleRoute")();
54322
+ const useModuleStorage = () => getCmsComposable("useModuleStorage")();
54323
+ const useLogs = () => getCmsComposable("useLogs")();
54324
+ const useUtilsService = () => getCmsComposable("useUtilsService")();
54325
+ const useFormBuilder = () => getCmsComposable("useFormBuilder")();
54326
+ const useFlowBuilder = () => getCmsComposable("useFlowBuilder")();
54327
+ const useConfirmation = () => getCmsComposable("useConfirmation")();
54328
+ const useFirebaseIntegration = (projectId) => getCmsComposable("useFirebaseIntegration")(projectId);
54329
+ const useProjectSettings = () => getCmsComposable("useProjectSettings")();
54330
+ const useCustomDialog$1 = () => getCmsComposable("useCustomDialog")();
54331
+ const useModuleOverlay = () => getCmsComposable("useModuleOverlay")();
54332
+ const useOverlayStack = () => getCmsComposable("useOverlayStack")();
54343
54333
  function tryOnScopeDispose(fn2) {
54344
54334
  if (getCurrentScope()) {
54345
54335
  onScopeDispose(fn2);
@@ -67881,13 +67871,14 @@ const taskHandlers = {
67881
67871
  }
67882
67872
  },
67883
67873
  "integration-action": async (input, { node }) => {
67884
- const app = useNuxtApp();
67885
- console.log(app);
67886
- const { fireAction } = useIntegrationActions(node.data.action.integration);
67874
+ console.log("apppp", useNuxtApp());
67875
+ const { $useIntegrationActions } = useNuxtApp();
67876
+ const { fireAction } = $useIntegrationActions(node.data.action.integration);
67887
67877
  let res = await fireAction(node.data.action, input);
67888
67878
  return { result: res };
67889
67879
  },
67890
67880
  "show-toast": async (input, { node }) => {
67881
+ console.log("Show toast", input, node);
67891
67882
  let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
67892
67883
  let title = interpolateTemplateFromVariableContext(node.data.title, variables);
67893
67884
  let description = interpolateTemplateFromVariableContext(node.data.message, variables);
@@ -67909,7 +67900,8 @@ const taskHandlers = {
67909
67900
  return { confetti: true };
67910
67901
  },
67911
67902
  "confirm": async (input, { node }) => {
67912
- const { confirm } = useConfirmation();
67903
+ const { $useConfirmation } = useNuxtApp();
67904
+ const { confirm } = $useConfirmation();
67913
67905
  if (confirm) {
67914
67906
  let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
67915
67907
  let title = interpolateTemplateFromVariableContext(node.data.title, variables);
@@ -67946,15 +67938,17 @@ const taskHandlers = {
67946
67938
  return { visited: true };
67947
67939
  },
67948
67940
  "show-dialog": async (input, { node }) => {
67949
- const { openCustomDialog } = useCustomDialog$1();
67941
+ const { $useCustomDialog } = useNuxtApp();
67942
+ const { openCustomDialog } = $useCustomDialog();
67950
67943
  let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
67951
67944
  const result = await openCustomDialog(node.data.layout, variables);
67952
67945
  console.log("Dialog result", result);
67953
67946
  return result;
67954
67947
  },
67955
67948
  "show-module": async (input, { node }) => {
67949
+ const { $useModuleOverlay } = useNuxtApp();
67956
67950
  console.log("Show module", input, node);
67957
- const { openInOverlay } = useModuleOverlay();
67951
+ const { openInOverlay } = $useModuleOverlay();
67958
67952
  let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
67959
67953
  const params = {};
67960
67954
  node.data.moduleData?.forEach((d) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneclick.dev/cms-kit",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "type": "module",
5
5
  "main": "./dist/cms-kit.cjs",
6
6
  "module": "./dist/cms-kit.js",