@oneclick.dev/cms-kit 0.0.18 → 0.0.20

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/index.es.js CHANGED
@@ -77599,6 +77599,8 @@ const useModulePermissions = () => getCmsComposable("cms-useModulePermissions");
77599
77599
  const useFirebaseIntegration = () => getCmsComposable("cms-useFirebaseIntegration");
77600
77600
  const useNavigateToModuleRoute = () => getCmsComposable("cms-useNavigateToModuleRoute");
77601
77601
  const useModuleStorage = () => getCmsComposable("cms-useModuleStorage");
77602
+ const useLogs = () => getCmsComposable("cms-useLogs");
77603
+ const useUtilsService = () => getCmsComposable("cms-useUtilsService");
77602
77604
  const _sfc_main$3g = /* @__PURE__ */ defineComponent({
77603
77605
  __name: "InterpolationField",
77604
77606
  props: {
@@ -122180,9 +122182,9 @@ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
122180
122182
  }
122181
122183
  },
122182
122184
  setup(__props) {
122183
- const focusSearch = ref(false);
122184
- const search = inject("search");
122185
- const sort = inject("sort");
122185
+ const focusSearch = ref$1(false);
122186
+ const search = inject$1("search");
122187
+ const sort = inject$1("sort");
122186
122188
  return (_ctx, _cache2) => {
122187
122189
  const _component_Input = resolveComponent("Input");
122188
122190
  const _component_SelectTrigger = resolveComponent("SelectTrigger");
@@ -122213,7 +122215,7 @@ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
122213
122215
  class: normalizeClass(unref(cn$1)(
122214
122216
  "size-4 transition-opacity duration-200 opacity-0",
122215
122217
  unref(search) ? "group-hover:opacity-100 cursor-pointer" : "",
122216
- unref(focusSearch) && unref(search) ? "opacity-100" : ""
122218
+ focusSearch.value && unref(search) ? "opacity-100" : ""
122217
122219
  ))
122218
122220
  }, null, 8, ["class"])
122219
122221
  ])
@@ -122343,9 +122345,9 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
122343
122345
  setup(__props, { emit: __emit }) {
122344
122346
  const props = __props;
122345
122347
  const emit = __emit;
122346
- const focus = ref(false);
122348
+ const focus = ref$1(false);
122347
122349
  const { urlToBase64 } = useUtilsService();
122348
- const openImageEditor = inject("openImageEditor");
122350
+ const openImageEditor = inject$1("openImageEditor");
122349
122351
  const editImage = async (url) => {
122350
122352
  let res = await urlToBase64(url);
122351
122353
  openImageEditor(res.base64);
@@ -122353,11 +122355,11 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
122353
122355
  const isImageFile = (contentType) => {
122354
122356
  return contentType && contentType.startsWith("image/") || false;
122355
122357
  };
122356
- const imageFailed = ref(false);
122358
+ const imageFailed = ref$1(false);
122357
122359
  const onImageError = () => {
122358
122360
  imageFailed.value = true;
122359
122361
  };
122360
- const isPending = computed(() => props.file.status === "pending" || props.file.status === "uploading" || props.file.status === "error");
122362
+ const isPending = computed$1(() => props.file.status === "pending" || props.file.status === "uploading" || props.file.status === "error");
122361
122363
  return (_ctx, _cache2) => {
122362
122364
  const _component_ContextMenuTrigger = resolveComponent("ContextMenuTrigger");
122363
122365
  const _component_ContextMenuItem = resolveComponent("ContextMenuItem");
@@ -122369,9 +122371,9 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
122369
122371
  createVNode(_component_ContextMenuTrigger, null, {
122370
122372
  default: withCtx(() => [
122371
122373
  createElementVNode("div", {
122372
- class: normalizeClass(["relative group border rounded-xl p-1 select-none", { "bg-muted": __props.selected, "border-ring": unref(focus) }])
122374
+ class: normalizeClass(["relative group border rounded-xl p-1 select-none", { "bg-muted": __props.selected, "border-ring": focus.value }])
122373
122375
  }, [
122374
- isImageFile(__props.file.contentType) && !unref(imageFailed) ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
122376
+ isImageFile(__props.file.contentType) && !imageFailed.value ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
122375
122377
  createElementVNode("img", {
122376
122378
  src: __props.file.url,
122377
122379
  alt: __props.file.displayName || __props.file.name,
@@ -122384,7 +122386,7 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
122384
122386
  draggable: "false",
122385
122387
  onError: onImageError
122386
122388
  }, null, 42, _hoisted_2$7),
122387
- unref(isPending) ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
122389
+ isPending.value ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
122388
122390
  __props.file.status === "pending" ? (openBlock(), createBlock(unref(Pause), {
122389
122391
  key: 0,
122390
122392
  class: "size-6 text-white"
@@ -122405,7 +122407,7 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
122405
122407
  class: "size-6 text-muted-foreground"
122406
122408
  })) : createCommentVNode("", true)
122407
122409
  ], 2)),
122408
- !unref(isPending) ? (openBlock(), createElementBlock("button", {
122410
+ !isPending.value ? (openBlock(), createElementBlock("button", {
122409
122411
  key: 2,
122410
122412
  onClick: _cache2[0] || (_cache2[0] = ($event) => emit("toggle", __props.file.url)),
122411
122413
  class: "absolute inset-0 flex items-start justify-end bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl cursor-pointer focus-visible:outline-none",
@@ -122417,10 +122419,10 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
122417
122419
  class: "size-6 mt-2 mr-2 drop-shadow-[0_3px_3px_rgba(0,0,0,0.7)] pointer-events-none"
122418
122420
  })) : createCommentVNode("", true)
122419
122421
  ], 32)) : createCommentVNode("", true),
122420
- !unref(isPending) && __props.selected ? (openBlock(), createBlock(unref(SquareCheck), {
122422
+ !isPending.value && __props.selected ? (openBlock(), createBlock(unref(SquareCheck), {
122421
122423
  key: 3,
122422
122424
  class: "absolute top-2 right-2 size-6 drop-shadow-[0_3px_3px_rgba(0,0,0,0.7)] pointer-events-none"
122423
- })) : !unref(isPending) && unref(focus) ? (openBlock(), createBlock(unref(Square), {
122425
+ })) : !isPending.value && focus.value ? (openBlock(), createBlock(unref(Square), {
122424
122426
  key: 4,
122425
122427
  class: "absolute top-2 right-2 size-6 drop-shadow-[0_3px_3px_rgba(0,0,0,0.7)] pointer-events-none"
122426
122428
  })) : createCommentVNode("", true),
@@ -122566,7 +122568,7 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
122566
122568
  return 0;
122567
122569
  });
122568
122570
  });
122569
- watch(() => activeSourceId.value, async () => {
122571
+ watch$1(() => activeSourceId.value, async () => {
122570
122572
  activeSource.value = await getMediaSource(project.value, activeSourceId.value);
122571
122573
  setEffectiveBasePath();
122572
122574
  currentPath.value = activeSource.value.path;
@@ -129246,7 +129248,7 @@ const _sfc_main$1Y = /* @__PURE__ */ defineComponent({
129246
129248
  watch$1(() => props.modelValue, (newVal) => {
129247
129249
  items.value = [...newVal || []];
129248
129250
  }, { deep: true });
129249
- const mediaSources = computed(() => props.sources);
129251
+ const mediaSources = computed$1(() => props.sources);
129250
129252
  provide("media-items", items);
129251
129253
  provide("update-media-items", updateItems);
129252
129254
  provide("sources", mediaSources);
@@ -142314,11 +142316,13 @@ export {
142314
142316
  useIntegrationActions$1 as useIntegrationActions,
142315
142317
  useIntegrations,
142316
142318
  useLayout,
142319
+ useLogs,
142317
142320
  useMediaLibrary$1 as useMediaLibrary,
142318
142321
  useModulePermissions,
142319
142322
  useModuleStorage,
142320
142323
  useNavigateToModuleRoute,
142321
142324
  useProjectService,
142322
142325
  useQueryBuilder,
142323
- useRunProcess
142326
+ useRunProcess,
142327
+ useUtilsService
142324
142328
  };
@@ -35,4 +35,17 @@ type UseModuleStorage = () => {
35
35
  clearModuleData: () => void;
36
36
  };
37
37
  export declare const useModuleStorage: () => UseModuleStorage;
38
+ type UseLogs = () => {
39
+ log: (message: string, data?: any) => void;
40
+ logWarning: (message: string, data?: any) => void;
41
+ logError: (message: string, data?: any) => void;
42
+ };
43
+ export declare const useLogs: () => UseLogs;
44
+ type UseUtilsService = () => {
45
+ urlToBase64: (url: string) => Promise<{
46
+ base64: string;
47
+ contentType: string;
48
+ }>;
49
+ };
50
+ export declare const useUtilsService: () => UseUtilsService;
38
51
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneclick.dev/cms-kit",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",