@mulmoclaude/collection-plugin 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue.js CHANGED
@@ -2,7 +2,7 @@ import { MINUTES_PER_DAY, TOOL_DEFINITION, actionVisible, assignLanes, boolSortV
2
2
  import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, effectScope, mergeModels, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useModel, vModelCheckbox, vModelDynamic, vModelSelect, vModelText, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
3
3
  import { createI18n } from "vue-i18n";
4
4
  import draggable from "vuedraggable";
5
- import { REMOTE_VIEW_MAX_BYTES, handleRemoteViewMessage, pageFromItems } from "@mulmoclaude/core/remote-view";
5
+ import { REMOTE_VIEW_MAX_BYTES, handleRemoteViewMessage } from "@mulmoclaude/core/remote-view";
6
6
  import { createTranslationCache } from "@mulmoclaude/core/translation/client";
7
7
  //#region src/vue/uiContext.ts
8
8
  var current = null;
@@ -2889,9 +2889,7 @@ var CollectionRemoteViewPreview_default = /*#__PURE__*/ _plugin_vue_export_helpe
2889
2889
  __name: "CollectionRemoteViewPreview",
2890
2890
  props: {
2891
2891
  slug: {},
2892
- view: {},
2893
- schema: {},
2894
- items: {}
2892
+ view: {}
2895
2893
  },
2896
2894
  emits: ["startChat"],
2897
2895
  setup(__props, { emit: __emit }) {
@@ -2903,7 +2901,13 @@ var CollectionRemoteViewPreview_default = /*#__PURE__*/ _plugin_vue_export_helpe
2903
2901
  const srcdoc = ref(null);
2904
2902
  const bytes = ref(0);
2905
2903
  const iframeEl = ref(null);
2906
- const sizeCaption = computed(() => `${Math.max(1, Math.round(bytes.value / 1024))} KB / ${Math.round(REMOTE_VIEW_MAX_BYTES / 1024)} KB`);
2904
+ const imageStats = ref(null);
2905
+ const sizeCaption = computed(() => {
2906
+ const base = `${Math.max(1, Math.round(bytes.value / 1024))} KB / ${Math.round(REMOTE_VIEW_MAX_BYTES / 1024)} KB`;
2907
+ const stats = imageStats.value;
2908
+ if (!stats || stats.inlined === 0 && stats.omitted === 0) return base;
2909
+ return stats.omitted > 0 ? `${base} · ${stats.inlined} images (${stats.omitted} over budget)` : `${base} · ${stats.inlined} images`;
2910
+ });
2907
2911
  let loadSeq = 0;
2908
2912
  async function load() {
2909
2913
  const seq = ++loadSeq;
@@ -2936,9 +2940,16 @@ var CollectionRemoteViewPreview_default = /*#__PURE__*/ _plugin_vue_export_helpe
2936
2940
  () => props.view.id,
2937
2941
  () => collectionUi().localeTag()
2938
2942
  ], () => void load(), { immediate: true });
2939
- function getPage(request) {
2940
- const derived = props.items.map((item) => deriveAll(props.schema, item, {}));
2941
- return JSON.parse(JSON.stringify(pageFromItems(derived, request, props.schema.primaryKey)));
2943
+ async function getPage(request) {
2944
+ const binding = collectionUi();
2945
+ if (!binding.fetchRemoteViewItems) throw new Error("fetchRemoteViewItems is not wired on this host");
2946
+ const resp = await binding.fetchRemoteViewItems(props.slug, props.view.id, request);
2947
+ if (!resp.ok) throw new Error(resp.error);
2948
+ imageStats.value = {
2949
+ inlined: resp.data.inlined,
2950
+ omitted: resp.data.omitted
2951
+ };
2952
+ return resp.data.page;
2942
2953
  }
2943
2954
  async function onMutate(request) {
2944
2955
  const binding = collectionUi();
@@ -2975,7 +2986,7 @@ var CollectionRemoteViewPreview_default = /*#__PURE__*/ _plugin_vue_export_helpe
2975
2986
  }, null, 8, _hoisted_5$6))]), createElementVNode("div", _hoisted_6$5, toDisplayString(sizeCaption.value), 1)], 64)) : createCommentVNode("", true)]);
2976
2987
  };
2977
2988
  }
2978
- }), [["__scopeId", "data-v-b200884d"]]);
2989
+ }), [["__scopeId", "data-v-cd23d935"]]);
2979
2990
  //#endregion
2980
2991
  //#region src/vue/useCollectionRendering.ts
2981
2992
  function stepForFieldType(type) {
@@ -3976,10 +3987,7 @@ var CollectionView_default = /* @__PURE__ */ defineComponent({
3976
3987
  dataIssues.value = result.data.issues ?? [];
3977
3988
  enumOriginallyEmpty.value = snapshotEmptyEnums(result.data.collection.schema, result.data.items);
3978
3989
  await render.loadLinkedCollections(result.data.collection.schema, slug);
3979
- if (collection.value?.slug === slug) {
3980
- syncViewToSelected();
3981
- maybeOpenCalendarForSelected();
3982
- }
3990
+ if (collection.value?.slug === slug) syncViewToSelected();
3983
3991
  maybeAutoRefreshFeed(slug);
3984
3992
  }
3985
3993
  /** Refresh records + schema IN PLACE for a live (pub/sub-driven) update,
@@ -4559,17 +4567,6 @@ var CollectionView_default = /* @__PURE__ */ defineComponent({
4559
4567
  if (editing.value) closeEditor();
4560
4568
  closeView();
4561
4569
  }
4562
- /** Deep-link entry: a `?selected=<id>` link to a calendar-capable collection
4563
- * opens in calendar view with the popup focused on the record's day. Runs
4564
- * on load / slug change only (not on in-app selection), so table users
4565
- * aren't forced into the calendar. */
4566
- function maybeOpenCalendarForSelected() {
4567
- if (embedded.value || !hasCalendar.value || !viewing.value) return;
4568
- const day = dayOfItem(viewing.value);
4569
- if (!day) return;
4570
- view.value = "calendar";
4571
- openDay.value = day;
4572
- }
4573
4570
  /** Kanban card dropped in a column → set the record's group field to the
4574
4571
  * column value (the empty string clears it for the Uncategorized column).
4575
4572
  * Reuses the inline-edit path (optimistic write + PUT + rollback). */
@@ -4962,15 +4959,8 @@ var CollectionView_default = /* @__PURE__ */ defineComponent({
4962
4959
  key: 0,
4963
4960
  slug: collection.value.slug,
4964
4961
  view: activeCustomView.value,
4965
- schema: collection.value.schema,
4966
- items: items.value,
4967
4962
  onStartChat: onCustomViewStartChat
4968
- }, null, 8, [
4969
- "slug",
4970
- "view",
4971
- "schema",
4972
- "items"
4973
- ])) : (openBlock(), createBlock(CollectionCustomView_default, {
4963
+ }, null, 8, ["slug", "view"])) : (openBlock(), createBlock(CollectionCustomView_default, {
4974
4964
  key: 1,
4975
4965
  slug: collection.value.slug,
4976
4966
  view: activeCustomView.value,