@bagelink/vue 0.0.869 → 0.0.875

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.cjs CHANGED
@@ -43729,17 +43729,249 @@ function useFormatting(modalInstance) {
43729
43729
  modal = modalInstance;
43730
43730
  return { applyFormatting, clearFormatting };
43731
43731
  }
43732
- const _hoisted_1$o = { class: "flex gap-05" };
43733
- const _hoisted_2$f = ["disabled"];
43734
- const _hoisted_3$c = { key: 1 };
43735
- const _hoisted_4$8 = {
43732
+ const _hoisted_1$o = {
43733
+ class: "toolbar flex gap-025 pb-05 flex-wrap",
43734
+ role: "toolbar"
43735
+ };
43736
+ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
43737
+ __name: "Toolbar",
43738
+ props: {
43739
+ config: {}
43740
+ },
43741
+ emits: ["action"],
43742
+ setup(__props, { emit: __emit }) {
43743
+ const emit2 = __emit;
43744
+ const toolbarOptions = [
43745
+ { name: "formatBlock", label: "h2", icon: "format_h2" },
43746
+ { name: "formatBlock", label: "h3", icon: "format_h3" },
43747
+ { name: "formatBlock", label: "h4", icon: "format_h4" },
43748
+ { name: "formatBlock", label: "h5", icon: "format_h5" },
43749
+ { name: "formatBlock", label: "h6", icon: "format_h6" },
43750
+ { name: "separator" },
43751
+ { name: "bold", label: "Bold", icon: "format_bold" },
43752
+ { name: "italic", label: "Italic", icon: "format_italic" },
43753
+ { name: "underline", label: "Underline", icon: "format_underlined" },
43754
+ { name: "separator" },
43755
+ { name: "orderedList", label: "Ordered List", icon: "format_list_numbered" },
43756
+ { name: "unorderedList", label: "Unordered List", icon: "format_list_bulleted" },
43757
+ { name: "separator" },
43758
+ { name: "link", label: "Link", icon: "add_link" },
43759
+ { name: "image", label: "Image", icon: "add_photo_alternate" },
43760
+ { name: "youtube", label: "YouTube", icon: "youtube_activity" },
43761
+ { name: "separator" },
43762
+ { name: "splitView", label: "Split View", icon: "code" },
43763
+ { name: "clear", label: "Clear Formatting", icon: "format_clear" },
43764
+ { name: "fullScreen", label: "Full Screen", icon: "fullscreen", class: "ms-auto" }
43765
+ ];
43766
+ return (_ctx, _cache) => {
43767
+ const _directive_tooltip = vue.resolveDirective("tooltip");
43768
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
43769
+ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(toolbarOptions, (action, index2) => {
43770
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
43771
+ action.name !== "separator" && _ctx.config.includes(action.name) ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(Btn), {
43772
+ key: 0,
43773
+ icon: action.icon,
43774
+ thin: "",
43775
+ flat: "",
43776
+ "aria-label": action.name,
43777
+ class: vue.normalizeClass([action.class, "radius-05"]),
43778
+ onClick: ($event) => emit2("action", action.name, action.label)
43779
+ }, null, 8, ["icon", "aria-label", "class", "onClick"])), [
43780
+ [_directive_tooltip, action.label]
43781
+ ]) : action.name === "separator" ? (vue.openBlock(), vue.createElementBlock("span", {
43782
+ key: `separator-${index2}`,
43783
+ class: "opacity-2 mb-025"
43784
+ }, "|")) : vue.createCommentVNode("", true)
43785
+ ], 64);
43786
+ }), 64))
43787
+ ]);
43788
+ };
43789
+ }
43790
+ });
43791
+ const _hoisted_1$n = { class: "rich-text-editor rounded pt-05 px-05 pb-1" };
43792
+ const _hoisted_2$f = { class: "editor-container flex flex-stretch gap-1 m_column" };
43793
+ const _hoisted_3$c = { class: "content-area radius-05 p-1 w-100 grid" };
43794
+ const _hoisted_4$8 = ["textContent"];
43795
+ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
43796
+ __name: "index",
43797
+ props: {
43798
+ modelValue: {},
43799
+ toolbarConfig: {}
43800
+ },
43801
+ emits: ["update:modelValue"],
43802
+ setup(__props, { emit: __emit }) {
43803
+ const props2 = __props;
43804
+ const emit2 = __emit;
43805
+ const modal2 = useModal();
43806
+ const { applyFormatting: applyFormatting2, clearFormatting: clearFormatting2 } = useFormatting(modal2);
43807
+ const editableContent = vue.ref();
43808
+ const defaultConfig2 = [
43809
+ "formatBlock",
43810
+ "bold",
43811
+ "italic",
43812
+ "underline",
43813
+ "fontSize",
43814
+ "fontFamily",
43815
+ "textColor",
43816
+ "backgroundColor",
43817
+ "alignLeft",
43818
+ "alignCenter",
43819
+ "alignRight",
43820
+ "alignJustify",
43821
+ "orderedList",
43822
+ "unorderedList",
43823
+ "indent",
43824
+ "outdent",
43825
+ "link",
43826
+ "image",
43827
+ "table",
43828
+ "blockquote",
43829
+ "codeBlock",
43830
+ "splitView",
43831
+ "youtube",
43832
+ "codeView",
43833
+ "clear",
43834
+ "fullScreen"
43835
+ ];
43836
+ const config = vue.ref(props2.toolbarConfig || defaultConfig2);
43837
+ let contentHtml = vue.ref(props2.modelValue);
43838
+ let isCodeView = vue.ref(false);
43839
+ let isSplitView = vue.ref(false);
43840
+ function updateContent() {
43841
+ var _a2;
43842
+ if (!isCodeView.value) {
43843
+ contentHtml.value = ((_a2 = editableContent.value) == null ? void 0 : _a2.innerHTML) ?? "";
43844
+ }
43845
+ emit2("update:modelValue", contentHtml.value);
43846
+ }
43847
+ function updateToolbarHighlight() {
43848
+ if (document.getSelection()) {
43849
+ const selection = document.getSelection();
43850
+ const range2 = (selection == null ? void 0 : selection.rangeCount) ? selection.getRangeAt(0) : null;
43851
+ const container = range2 == null ? void 0 : range2.commonAncestorContainer;
43852
+ if (container) {
43853
+ let currentElement = container.nodeType === 3 ? container.parentElement : container;
43854
+ while (currentElement && currentElement !== editableContent.value) {
43855
+ if (["H1", "H2", "H3"].includes(currentElement.tagName)) {
43856
+ break;
43857
+ }
43858
+ currentElement = currentElement.parentElement;
43859
+ }
43860
+ }
43861
+ }
43862
+ }
43863
+ document.addEventListener("selectionchange", updateToolbarHighlight);
43864
+ function handleToolbarAction(action, value) {
43865
+ if (!editableContent.value) return;
43866
+ if (["alignLeft", "alignCenter", "alignRight", "alignJustify"].includes(action))
43867
+ value = action.replace("align", "").toLowerCase();
43868
+ if (action === "splitView") isSplitView.value = !isSplitView.value;
43869
+ else if (action === "codeView") isCodeView.value = !isCodeView.value;
43870
+ else if (action === "fullScreen") toggleFullScreen();
43871
+ else if (action === "clear") clearFormatting2();
43872
+ else applyFormatting2(action, value);
43873
+ updateContent();
43874
+ }
43875
+ function toggleFullScreen() {
43876
+ const editor = document.querySelector(".rich-text-editor");
43877
+ if (editor) {
43878
+ editor.classList.toggle("fullscreen-mode");
43879
+ }
43880
+ }
43881
+ vue.watch(() => props2.modelValue, (newValue) => {
43882
+ if (newValue !== contentHtml.value) {
43883
+ contentHtml.value = newValue;
43884
+ if (editableContent.value) {
43885
+ editableContent.value.innerHTML = newValue;
43886
+ }
43887
+ }
43888
+ });
43889
+ vue.onMounted(() => {
43890
+ if (editableContent.value) {
43891
+ editableContent.value.innerHTML = contentHtml.value;
43892
+ }
43893
+ });
43894
+ function handleKeyDown2(event) {
43895
+ if (event.ctrlKey || event.metaKey) {
43896
+ switch (event.key.toLowerCase()) {
43897
+ case "b":
43898
+ event.preventDefault();
43899
+ handleToolbarAction("bold");
43900
+ break;
43901
+ case "i":
43902
+ event.preventDefault();
43903
+ handleToolbarAction("italic");
43904
+ break;
43905
+ case "u":
43906
+ event.preventDefault();
43907
+ handleToolbarAction("underline");
43908
+ break;
43909
+ case "k":
43910
+ event.preventDefault();
43911
+ handleToolbarAction("link");
43912
+ break;
43913
+ case "l":
43914
+ event.preventDefault();
43915
+ handleToolbarAction("orderedList");
43916
+ break;
43917
+ }
43918
+ }
43919
+ }
43920
+ function logInput(e) {
43921
+ const target = e.target;
43922
+ contentHtml.value = target.textContent || "";
43923
+ }
43924
+ return (_ctx, _cache) => {
43925
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
43926
+ vue.createVNode(_sfc_main$v, {
43927
+ config: config.value,
43928
+ onAction: handleToolbarAction
43929
+ }, null, 8, ["config"]),
43930
+ vue.createElementVNode("div", _hoisted_2$f, [
43931
+ vue.createElementVNode("div", _hoisted_3$c, [
43932
+ vue.unref(isCodeView) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
43933
+ key: 0,
43934
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(contentHtml) ? contentHtml.value = $event : contentHtml = $event),
43935
+ onInput: updateContent
43936
+ }, null, 544)), [
43937
+ [vue.vModelText, vue.unref(contentHtml)]
43938
+ ]) : (vue.openBlock(), vue.createElementBlock("div", {
43939
+ key: 1,
43940
+ ref_key: "editableContent",
43941
+ ref: editableContent,
43942
+ contenteditable: "true",
43943
+ class: "editableContent",
43944
+ role: "textbox",
43945
+ "aria-multiline": "true",
43946
+ tabindex: "0",
43947
+ onInput: updateContent,
43948
+ onKeydown: handleKeyDown2
43949
+ }, null, 544))
43950
+ ]),
43951
+ vue.unref(isSplitView) ? (vue.openBlock(), vue.createElementBlock("code", {
43952
+ key: 0,
43953
+ contenteditable: "true",
43954
+ class: "preview-area w-100 radius-05 p-1",
43955
+ onInput: _cache[1] || (_cache[1] = (e) => logInput(e)),
43956
+ textContent: vue.toDisplayString(vue.unref(contentHtml))
43957
+ }, null, 40, _hoisted_4$8)) : vue.createCommentVNode("", true)
43958
+ ])
43959
+ ]);
43960
+ };
43961
+ }
43962
+ });
43963
+ const RichText = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-492bb647"]]);
43964
+ const _hoisted_1$m = { class: "flex gap-05" };
43965
+ const _hoisted_2$e = ["disabled"];
43966
+ const _hoisted_3$b = { key: 1 };
43967
+ const _hoisted_4$7 = {
43736
43968
  key: 2,
43737
43969
  class: "ms-auto ps-05 me-05"
43738
43970
  };
43739
43971
  const _hoisted_5$7 = ["value"];
43740
43972
  const _hoisted_6$6 = ["aria-selected", "onClick", "onKeydown"];
43741
43973
  const _hoisted_7$3 = { class: "block" };
43742
- const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
43974
+ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
43743
43975
  __name: "SelectInput",
43744
43976
  props: {
43745
43977
  options: {},
@@ -43915,7 +44147,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
43915
44147
  trigger: vue.withCtx(() => [
43916
44148
  vue.createElementVNode("label", null, [
43917
44149
  vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
43918
- vue.createElementVNode("div", _hoisted_1$o, [
44150
+ vue.createElementVNode("div", _hoisted_1$m, [
43919
44151
  _ctx.searchable && vue.unref(open) ? (vue.openBlock(), vue.createBlock(vue.unref(TextInput), {
43920
44152
  key: 0,
43921
44153
  ref_key: "searchInput",
@@ -43940,8 +44172,8 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
43940
44172
  key: 0,
43941
44173
  icon: _ctx.icon
43942
44174
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
43943
- !_ctx.hideLabel ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3$c, vue.toDisplayString(selectedLabel.value), 1)) : vue.createCommentVNode("", true),
43944
- _ctx.clearable && selectedItemCount.value > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$8, [
44175
+ !_ctx.hideLabel ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3$b, vue.toDisplayString(selectedLabel.value), 1)) : vue.createCommentVNode("", true),
44176
+ _ctx.clearable && selectedItemCount.value > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$7, [
43945
44177
  vue.createVNode(vue.unref(Btn), {
43946
44178
  flat: "",
43947
44179
  thin: "",
@@ -43957,7 +44189,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
43957
44189
  key: 3,
43958
44190
  thin: ""
43959
44191
  }, { icon: vue.unref(open) ? "unfold_less" : "unfold_more" }), null, 16)) : vue.createCommentVNode("", true)
43960
- ], 42, _hoisted_2$f)),
44192
+ ], 42, _hoisted_2$e)),
43961
44193
  _ctx.required ? (vue.openBlock(), vue.createElementBlock("input", {
43962
44194
  key: 2,
43963
44195
  tabindex: "-1",
@@ -44022,239 +44254,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
44022
44254
  };
44023
44255
  }
44024
44256
  });
44025
- const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-4d1e8e98"]]);
44026
- const _hoisted_1$n = {
44027
- class: "toolbar flex gap-025 pb-05 flex-wrap",
44028
- role: "toolbar"
44029
- };
44030
- const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
44031
- __name: "Toolbar",
44032
- props: {
44033
- config: {}
44034
- },
44035
- emits: ["action"],
44036
- setup(__props, { emit: __emit }) {
44037
- const emit2 = __emit;
44038
- const toolbarOptions = [
44039
- { name: "formatBlock", label: "h2", icon: "format_h2" },
44040
- { name: "formatBlock", label: "h3", icon: "format_h3" },
44041
- { name: "formatBlock", label: "h4", icon: "format_h4" },
44042
- { name: "formatBlock", label: "h5", icon: "format_h5" },
44043
- { name: "formatBlock", label: "h6", icon: "format_h6" },
44044
- { name: "separator" },
44045
- { name: "bold", label: "Bold", icon: "format_bold" },
44046
- { name: "italic", label: "Italic", icon: "format_italic" },
44047
- { name: "underline", label: "Underline", icon: "format_underlined" },
44048
- { name: "separator" },
44049
- { name: "orderedList", label: "Ordered List", icon: "format_list_numbered" },
44050
- { name: "unorderedList", label: "Unordered List", icon: "format_list_bulleted" },
44051
- { name: "separator" },
44052
- { name: "link", label: "Link", icon: "add_link" },
44053
- { name: "image", label: "Image", icon: "add_photo_alternate" },
44054
- { name: "youtube", label: "YouTube", icon: "youtube_activity" },
44055
- { name: "separator" },
44056
- { name: "splitView", label: "Split View", icon: "code" },
44057
- { name: "clear", label: "Clear Formatting", icon: "format_clear" },
44058
- { name: "fullScreen", label: "Full Screen", icon: "fullscreen", class: "ms-auto" }
44059
- ];
44060
- return (_ctx, _cache) => {
44061
- const _directive_tooltip = vue.resolveDirective("tooltip");
44062
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
44063
- (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(toolbarOptions, (action, index2) => {
44064
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
44065
- action.name !== "separator" && _ctx.config.includes(action.name) ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(Btn), {
44066
- key: 0,
44067
- icon: action.icon,
44068
- thin: "",
44069
- flat: "",
44070
- "aria-label": action.name,
44071
- class: vue.normalizeClass([action.class, "radius-05"]),
44072
- onClick: ($event) => emit2("action", action.name, action.label)
44073
- }, null, 8, ["icon", "aria-label", "class", "onClick"])), [
44074
- [_directive_tooltip, action.label]
44075
- ]) : action.name === "separator" ? (vue.openBlock(), vue.createElementBlock("span", {
44076
- key: `separator-${index2}`,
44077
- class: "opacity-2 mb-025"
44078
- }, "|")) : vue.createCommentVNode("", true)
44079
- ], 64);
44080
- }), 64))
44081
- ]);
44082
- };
44083
- }
44084
- });
44085
- const _hoisted_1$m = { class: "rich-text-editor rounded pt-05 px-05 pb-1" };
44086
- const _hoisted_2$e = { class: "editor-container flex flex-stretch gap-1 m_column" };
44087
- const _hoisted_3$b = { class: "content-area radius-05 p-1 w-100 grid" };
44088
- const _hoisted_4$7 = ["textContent"];
44089
- const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
44090
- __name: "index",
44091
- props: {
44092
- modelValue: {},
44093
- toolbarConfig: {}
44094
- },
44095
- emits: ["update:modelValue"],
44096
- setup(__props, { emit: __emit }) {
44097
- const props2 = __props;
44098
- const emit2 = __emit;
44099
- const modal2 = useModal();
44100
- const { applyFormatting: applyFormatting2, clearFormatting: clearFormatting2 } = useFormatting(modal2);
44101
- const editableContent = vue.ref();
44102
- const defaultConfig2 = [
44103
- "formatBlock",
44104
- "bold",
44105
- "italic",
44106
- "underline",
44107
- "fontSize",
44108
- "fontFamily",
44109
- "textColor",
44110
- "backgroundColor",
44111
- "alignLeft",
44112
- "alignCenter",
44113
- "alignRight",
44114
- "alignJustify",
44115
- "orderedList",
44116
- "unorderedList",
44117
- "indent",
44118
- "outdent",
44119
- "link",
44120
- "image",
44121
- "table",
44122
- "blockquote",
44123
- "codeBlock",
44124
- "splitView",
44125
- "youtube",
44126
- "codeView",
44127
- "clear",
44128
- "fullScreen"
44129
- ];
44130
- const config = vue.ref(props2.toolbarConfig || defaultConfig2);
44131
- let contentHtml = vue.ref(props2.modelValue);
44132
- let isCodeView = vue.ref(false);
44133
- let isSplitView = vue.ref(false);
44134
- function updateContent() {
44135
- var _a2;
44136
- if (!isCodeView.value) {
44137
- contentHtml.value = ((_a2 = editableContent.value) == null ? void 0 : _a2.innerHTML) ?? "";
44138
- }
44139
- emit2("update:modelValue", contentHtml.value);
44140
- }
44141
- function updateToolbarHighlight() {
44142
- if (document.getSelection()) {
44143
- const selection = document.getSelection();
44144
- const range2 = (selection == null ? void 0 : selection.rangeCount) ? selection.getRangeAt(0) : null;
44145
- const container = range2 == null ? void 0 : range2.commonAncestorContainer;
44146
- if (container) {
44147
- let currentElement = container.nodeType === 3 ? container.parentElement : container;
44148
- while (currentElement && currentElement !== editableContent.value) {
44149
- if (["H1", "H2", "H3"].includes(currentElement.tagName)) {
44150
- break;
44151
- }
44152
- currentElement = currentElement.parentElement;
44153
- }
44154
- }
44155
- }
44156
- }
44157
- document.addEventListener("selectionchange", updateToolbarHighlight);
44158
- function handleToolbarAction(action, value) {
44159
- if (!editableContent.value) return;
44160
- if (["alignLeft", "alignCenter", "alignRight", "alignJustify"].includes(action))
44161
- value = action.replace("align", "").toLowerCase();
44162
- if (action === "splitView") isSplitView.value = !isSplitView.value;
44163
- else if (action === "codeView") isCodeView.value = !isCodeView.value;
44164
- else if (action === "fullScreen") toggleFullScreen();
44165
- else if (action === "clear") clearFormatting2();
44166
- else applyFormatting2(action, value);
44167
- updateContent();
44168
- }
44169
- function toggleFullScreen() {
44170
- const editor = document.querySelector(".rich-text-editor");
44171
- if (editor) {
44172
- editor.classList.toggle("fullscreen-mode");
44173
- }
44174
- }
44175
- vue.watch(() => props2.modelValue, (newValue) => {
44176
- if (newValue !== contentHtml.value) {
44177
- contentHtml.value = newValue;
44178
- if (editableContent.value) {
44179
- editableContent.value.innerHTML = newValue;
44180
- }
44181
- }
44182
- });
44183
- vue.onMounted(() => {
44184
- if (editableContent.value) {
44185
- editableContent.value.innerHTML = contentHtml.value;
44186
- }
44187
- });
44188
- function handleKeyDown2(event) {
44189
- if (event.ctrlKey || event.metaKey) {
44190
- switch (event.key.toLowerCase()) {
44191
- case "b":
44192
- event.preventDefault();
44193
- handleToolbarAction("bold");
44194
- break;
44195
- case "i":
44196
- event.preventDefault();
44197
- handleToolbarAction("italic");
44198
- break;
44199
- case "u":
44200
- event.preventDefault();
44201
- handleToolbarAction("underline");
44202
- break;
44203
- case "k":
44204
- event.preventDefault();
44205
- handleToolbarAction("link");
44206
- break;
44207
- case "l":
44208
- event.preventDefault();
44209
- handleToolbarAction("orderedList");
44210
- break;
44211
- }
44212
- }
44213
- }
44214
- function logInput(e) {
44215
- const target = e.target;
44216
- contentHtml.value = target.textContent || "";
44217
- }
44218
- return (_ctx, _cache) => {
44219
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
44220
- vue.createVNode(_sfc_main$u, {
44221
- config: config.value,
44222
- onAction: handleToolbarAction
44223
- }, null, 8, ["config"]),
44224
- vue.createElementVNode("div", _hoisted_2$e, [
44225
- vue.createElementVNode("div", _hoisted_3$b, [
44226
- vue.unref(isCodeView) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
44227
- key: 0,
44228
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(contentHtml) ? contentHtml.value = $event : contentHtml = $event),
44229
- onInput: updateContent
44230
- }, null, 544)), [
44231
- [vue.vModelText, vue.unref(contentHtml)]
44232
- ]) : (vue.openBlock(), vue.createElementBlock("div", {
44233
- key: 1,
44234
- ref_key: "editableContent",
44235
- ref: editableContent,
44236
- contenteditable: "true",
44237
- class: "editableContent",
44238
- role: "textbox",
44239
- "aria-multiline": "true",
44240
- tabindex: "0",
44241
- onInput: updateContent,
44242
- onKeydown: handleKeyDown2
44243
- }, null, 544))
44244
- ]),
44245
- vue.unref(isSplitView) ? (vue.openBlock(), vue.createElementBlock("code", {
44246
- key: 0,
44247
- contenteditable: "true",
44248
- class: "preview-area w-100 radius-05 p-1",
44249
- onInput: _cache[1] || (_cache[1] = (e) => logInput(e)),
44250
- textContent: vue.toDisplayString(vue.unref(contentHtml))
44251
- }, null, 40, _hoisted_4$7)) : vue.createCommentVNode("", true)
44252
- ])
44253
- ]);
44254
- };
44255
- }
44256
- });
44257
- const RichText = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-492bb647"]]);
44257
+ const SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-4d1e8e98"]]);
44258
44258
  /*!
44259
44259
  * Signature Pad v5.0.3 | https://github.com/szimek/signature_pad
44260
44260
  * (c) 2024 Szymon Nowak | Released under the MIT license
@@ -52612,7 +52612,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
52612
52612
  };
52613
52613
  }
52614
52614
  });
52615
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-e5ae4283"]]);
52615
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-63ff8c9c"]]);
52616
52616
  const _hoisted_1$h = ["title"];
52617
52617
  const _hoisted_2$9 = ["id", "required"];
52618
52618
  const _hoisted_3$7 = ["for"];
@@ -52693,14 +52693,15 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
52693
52693
  ]),
52694
52694
  _: 2
52695
52695
  }, 1032, ["to", "onClick"]);
52696
- }), 128))
52696
+ }), 128)),
52697
+ vue.renderSlot(_ctx.$slots, "end", {}, void 0, true)
52697
52698
  ]),
52698
52699
  _: 3
52699
52700
  });
52700
52701
  };
52701
52702
  }
52702
52703
  });
52703
- const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-557bcad0"]]);
52704
+ const BottomMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-ee7b8f1a"]]);
52704
52705
  const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
52705
52706
  __name: "Layout",
52706
52707
  props: {
@@ -53149,20 +53150,22 @@ function _sfc_render$2(_ctx, _cache) {
53149
53150
  }
53150
53151
  const ListView = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$2]]);
53151
53152
  const _hoisted_1$8 = ["id"];
53152
- const defaultMarkerSVG = '<svg id="eCJDQPwuXje1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 36 36" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" project-id="ac827abc0a8c4922b76bac4df7bd7646" export-id="2cc86932ccbc4825a31fd063b3e75478" cached="false"><style><![CDATA[#eCJDQPwuXje3_ts {animation: eCJDQPwuXje3_ts__ts 3000ms linear infinite normal forwards}@keyframes eCJDQPwuXje3_ts__ts { 0% {transform: translate(18px,18px) scale(1,1)} 3.333333% {transform: translate(18px,18px) scale(1,1);animation-timing-function: cubic-bezier(0.42,0,0.58,1)} 100% {transform: translate(18px,18px) scale(1.8,1.8)}} #eCJDQPwuXje3 {animation: eCJDQPwuXje3_c_o 3000ms linear infinite normal forwards}@keyframes eCJDQPwuXje3_c_o { 0% {opacity: 0} 3.333333% {opacity: 1;animation-timing-function: cubic-bezier(0.42,0,0.58,1)} 100% {opacity: 0}}]]></style><ellipse rx="10.049312" ry="10.049312" transform="translate(18 18)" fill="#2e5bff" stroke-width="0"/><g id="eCJDQPwuXje3_ts" transform="translate(18,18) scale(1,1)"><ellipse id="eCJDQPwuXje3" rx="10.049312" ry="10.049312" transform="translate(0,0)" opacity="0" fill="#2e5bff" stroke-width="0"/></g></svg>';
53153
+ const defaultMarkerSVG = '<svg width="28" height="38" viewBox="0 0 28 38" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.2263 37.7955C17.0897 37.7955 19.4109 37.0138 19.4109 36.0496C19.4109 35.0854 17.0897 34.3037 14.2263 34.3037C11.363 34.3037 9.04175 35.0854 9.04175 36.0496C9.04175 37.0138 11.363 37.7955 14.2263 37.7955Z" fill="black" fill-opacity="0.1"/><path d="M14.2265 0.549591C21.2842 0.549591 27.0131 6.23786 27.0787 13.28V13.4024C27.0787 19.3328 24.4759 24.4306 21.5627 28.2764C18.6511 32.12 15.4577 34.6754 14.3457 35.5097C14.2748 35.5629 14.1778 35.5629 14.1068 35.5097C12.9947 34.675 9.80135 32.1197 6.88984 28.2762C3.97665 24.4304 1.37378 19.3328 1.37378 13.4024C1.37378 6.30387 7.12806 0.549591 14.2265 0.549591Z" fill="#ED1b3E" stroke="#ED6C6F"/><path d="M14.2263 21.6185C18.7639 21.6185 22.4424 17.94 22.4424 13.4024C22.4424 8.86477 18.7639 5.18631 14.2263 5.18631C9.68872 5.18631 6.01025 8.86477 6.01025 13.4024C6.01025 17.94 9.68872 21.6185 14.2263 21.6185Z" fill="white"/></svg>';
53153
53154
  const leafletScriptUrl = "https://unpkg.com/leaflet@1.9.4/dist/leaflet.js";
53154
53155
  const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
53155
53156
  __name: "MapEmbed",
53156
53157
  props: {
53157
53158
  center: { default: () => [31.7683, 35.2137] },
53158
- zoom: { default: 13 },
53159
+ zoom: { default: 15 },
53159
53160
  height: { default: 400 },
53160
53161
  zoomControl: { type: Boolean, default: true },
53161
53162
  markers: {},
53162
53163
  markerIcon: { default: "" }
53163
53164
  },
53164
- setup(__props) {
53165
+ emits: ["select"],
53166
+ setup(__props, { emit: __emit }) {
53165
53167
  const props2 = __props;
53168
+ const emit2 = __emit;
53166
53169
  let L2 = vue.ref();
53167
53170
  let map4 = vue.ref();
53168
53171
  const _markers = vue.ref([]);
@@ -53183,31 +53186,50 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
53183
53186
  L2.value.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { maxZoom: 18 }).addTo(map4.value);
53184
53187
  }
53185
53188
  }
53186
- function addMarker(L22, latlng) {
53189
+ async function addMarker(marker) {
53190
+ var _a2, _b;
53187
53191
  const iconSVG = props2.markerIcon || defaultMarkerSVG;
53188
- const customIcon = L22 == null ? void 0 : L22.icon({
53192
+ const icon = (_a2 = L2.value) == null ? void 0 : _a2.icon({
53189
53193
  iconUrl: `data:image/svg+xml;utf8,${encodeURIComponent(iconSVG)}`,
53190
53194
  iconSize: [32, 32]
53191
53195
  });
53192
- const marker = L22 == null ? void 0 : L22.marker(latlng, { icon: customIcon }).addTo(map4.value);
53193
- _markers.value.push(marker);
53196
+ const latlng = latLangFromMarker(marker);
53197
+ const title = Array.isArray(marker) ? marker[2] : marker.title ?? marker.tooltip;
53198
+ const tooltip = Array.isArray(marker) ? marker[2] : marker.tooltip;
53199
+ const m2 = (_b = L2.value) == null ? void 0 : _b.marker(latlng, { title, icon, interactive: true }).addTo(map4.value);
53200
+ if (tooltip) m2.bindTooltip(tooltip, { direction: "top" });
53201
+ m2.on("click", () => {
53202
+ emit2("select", marker);
53203
+ });
53204
+ _markers.value.push(m2);
53194
53205
  }
53195
53206
  function fitMarkers(L22) {
53196
- var _a2;
53207
+ var _a2, _b;
53197
53208
  if (_markers.value.length > 0) {
53198
- (_a2 = map4.value) == null ? void 0 : _a2.fitBounds(L22.featureGroup(_markers.value).getBounds());
53209
+ const latLngs = _markers.value.map((marker) => marker.getLatLng());
53210
+ const bounds = L22.latLngBounds(latLngs);
53211
+ const center2 = bounds.getCenter();
53212
+ (_a2 = map4.value) == null ? void 0 : _a2.setView(center2, props2.zoom);
53213
+ (_b = map4.value) == null ? void 0 : _b.fitBounds(bounds, {
53214
+ animate: true,
53215
+ padding: [20, 20]
53216
+ // Adjust padding as needed
53217
+ });
53199
53218
  }
53200
53219
  }
53220
+ function latLangFromMarker(marker) {
53221
+ const [lat, lng] = Array.isArray(marker) ? [marker[0], marker[1]] : [marker.lat, marker.lng];
53222
+ return { lat: +lat, lng: +lng };
53223
+ }
53201
53224
  async function watchMarkers(markers) {
53202
53225
  if (!L2.value) L2.value = await loadGlobalL();
53203
53226
  _markers.value.forEach((marker) => marker.remove());
53204
53227
  if (!markers) return;
53205
53228
  for (const marker of markers) {
53206
- const [lat, lon] = Array.isArray(marker) ? marker : [marker.lat, marker.lon];
53207
- if (!map4.value) initializeMap();
53208
- addMarker(L2.value, [lat, lon]);
53209
- fitMarkers(L2.value);
53229
+ if (!map4.value) await initializeMap();
53230
+ addMarker(marker);
53210
53231
  }
53232
+ fitMarkers(L2.value);
53211
53233
  }
53212
53234
  vue.watch(() => props2.markers, watchMarkers, { immediate: true });
53213
53235
  vue.watch(() => props2.center, (center2) => {
@@ -53219,7 +53241,8 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
53219
53241
  return vue.openBlock(), vue.createElementBlock("div", {
53220
53242
  id: id.value,
53221
53243
  class: "leaflet-map",
53222
- style: vue.normalizeStyle({ height: `${props2.height || 400}px` })
53244
+ style: vue.normalizeStyle({ height: `${props2.height || 400}px` }),
53245
+ dir: "ltr"
53223
53246
  }, null, 12, _hoisted_1$8);
53224
53247
  };
53225
53248
  }