@harbour-enterprises/superdoc 1.0.0-alpha.56 → 1.0.0-alpha.58

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/style.css CHANGED
@@ -19303,13 +19303,13 @@ span[data-v-36fffb56] {
19303
19303
  padding: 1px;
19304
19304
  }
19305
19305
 
19306
- .image-field[data-v-47d1dee5] {
19306
+ .image-field[data-v-3a10cc41] {
19307
19307
  overflow: hidden;
19308
19308
  display: flex;
19309
19309
  align-items: center;
19310
19310
  margin-top: 2px;
19311
19311
  }
19312
- img[data-v-47d1dee5] {
19312
+ img[data-v-3a10cc41] {
19313
19313
  max-height: 100%;
19314
19314
  }
19315
19315
 
@@ -19325,7 +19325,7 @@ img[data-v-47d1dee5] {
19325
19325
  padding: 1px;
19326
19326
  }
19327
19327
 
19328
- .field-container[data-v-60099bb0] {
19328
+ .field-container[data-v-5a92a39c] {
19329
19329
  border-radius: 2px;
19330
19330
  background-color: #EFD0F0 !important;
19331
19331
  border: 2px solid #B015B3;
@@ -11155,7 +11155,6 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
11155
11155
  return {
11156
11156
  COMMENT_EVENTS,
11157
11157
  hasInitializedComments,
11158
- getConfig,
11159
11158
  activeComment,
11160
11159
  commentDialogs,
11161
11160
  overlappingComments,
@@ -11301,6 +11300,7 @@ function useDocument(params, superdocConfig) {
11301
11300
  const rawFields = ref$1(params.fields || []);
11302
11301
  const fields = ref$1(params.fields?.map((f) => useField(f)) || []);
11303
11302
  const annotations = ref$1(params.annotations || []);
11303
+ const attachments = ref$1(params.attachments || []);
11304
11304
  const conversations = ref$1(initConversations());
11305
11305
  const conversationsBackup = ref$1(conversations.value);
11306
11306
  function initConversations() {
@@ -11327,6 +11327,7 @@ function useDocument(params, superdocConfig) {
11327
11327
  fields,
11328
11328
  annotations,
11329
11329
  conversations,
11330
+ attachments,
11330
11331
  // Actions
11331
11332
  setEditor,
11332
11333
  getEditor,
@@ -11390,6 +11391,9 @@ const useSuperdocStore = /* @__PURE__ */ defineStore("superdoc", () => {
11390
11391
  }
11391
11392
  return true;
11392
11393
  });
11394
+ const getAttachments = computed(() => {
11395
+ return documents.value.map((doc2) => doc2.attachments).flat(1);
11396
+ });
11393
11397
  const getDocument2 = (documentId) => documents.value.find((doc2) => doc2.id === documentId);
11394
11398
  const getPageBounds = (documentId, page) => {
11395
11399
  const matchedPage = pages[documentId];
@@ -11429,6 +11433,7 @@ const useSuperdocStore = /* @__PURE__ */ defineStore("superdoc", () => {
11429
11433
  modules,
11430
11434
  // Getters
11431
11435
  areDocumentsReady,
11436
+ getAttachments,
11432
11437
  // Actions
11433
11438
  init: init2,
11434
11439
  handlePageReady,
@@ -95974,9 +95979,17 @@ const _sfc_main$5 = {
95974
95979
  type: Object,
95975
95980
  required: false,
95976
95981
  default: () => ({})
95982
+ },
95983
+ optionId: {
95984
+ type: String,
95985
+ required: true
95977
95986
  }
95978
95987
  },
95979
95988
  setup(__props) {
95989
+ const superdocStore = useSuperdocStore();
95990
+ const hrbrFieldsStore = useHrbrFieldsStore();
95991
+ const { getAnnotations } = storeToRefs(hrbrFieldsStore);
95992
+ const { getAttachments } = storeToRefs(superdocStore);
95980
95993
  const props = __props;
95981
95994
  const getStyle = computed(() => {
95982
95995
  return {
@@ -95984,6 +95997,15 @@ const _sfc_main$5 = {
95984
95997
  maxWidth: props.styleOverride.coordinates?.minWidth
95985
95998
  };
95986
95999
  });
96000
+ const multipleInputAnnotations = computed(() => {
96001
+ return getAnnotations.value.filter((a) => a.fieldId === props.field.id);
96002
+ });
96003
+ const imageValue = computed(() => {
96004
+ if (typeof props.field.value === "string") return props.field.value;
96005
+ const annotationIndex = multipleInputAnnotations.value.findIndex((annotation) => annotation.originalAnnotationId === props.optionId);
96006
+ const attachment = getAttachments.value.find((a) => a.id === props.field.value[annotationIndex]?.referenceattachmentid || a.id === props.field.value[annotationIndex]?.userattachmentid);
96007
+ return attachment?.base64data || "";
96008
+ });
95987
96009
  return (_ctx, _cache2) => {
95988
96010
  return __props.field.value ? (openBlock(), createElementBlock("div", {
95989
96011
  key: 0,
@@ -95991,7 +96013,7 @@ const _sfc_main$5 = {
95991
96013
  style: normalizeStyle(getStyle.value)
95992
96014
  }, [
95993
96015
  createBaseVNode("img", {
95994
- src: __props.field.value,
96016
+ src: imageValue.value,
95995
96017
  alt: "image",
95996
96018
  style: normalizeStyle(getStyle.value)
95997
96019
  }, null, 12, _hoisted_1$5)
@@ -95999,7 +96021,7 @@ const _sfc_main$5 = {
95999
96021
  };
96000
96022
  }
96001
96023
  };
96002
- const ImageField = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-47d1dee5"]]);
96024
+ const ImageField = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-3a10cc41"]]);
96003
96025
  const _hoisted_1$4 = { class: "checkbox-container" };
96004
96026
  const _sfc_main$4 = {
96005
96027
  __name: "CheckboxField",
@@ -96212,7 +96234,7 @@ const _sfc_main$2 = {
96212
96234
  };
96213
96235
  }
96214
96236
  };
96215
- const HrbrFieldsLayer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-60099bb0"]]);
96237
+ const HrbrFieldsLayer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-5a92a39c"]]);
96216
96238
  const _hoisted_1$1 = { class: "super-editor" };
96217
96239
  const _hoisted_2$1 = ["innerHTML"];
96218
96240
  const _sfc_main$1 = {