@bagelink/vue 0.0.863 → 0.0.869

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.mjs CHANGED
@@ -599,9 +599,11 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
599
599
  }
600
600
  function updateHeight() {
601
601
  if (!props2.autoHeight || !bglSlider.value) return;
602
- const children2 = Array.from(bglSlider.value.children[activeSlideIndex.value].children);
603
- const totalHeight = children2.reduce((sum, el) => sum + el.clientHeight, 0);
604
- yHeight.value = `${totalHeight}px`;
602
+ setTimeout(() => {
603
+ const children2 = Array.from(bglSlider.value.children[activeSlideIndex.value].children);
604
+ const totalHeight = children2.reduce((sum, el) => sum + el.clientHeight, 0);
605
+ yHeight.value = `${totalHeight}px`;
606
+ }, 200);
605
607
  }
606
608
  function easeScroll(target, duration = 500) {
607
609
  if (!bglSlider.value || isPressed.value) return;
@@ -633,7 +635,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
633
635
  }
634
636
  function handleResize() {
635
637
  if (!bglSlider.value) return;
636
- itemCount.value = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props2.items, 2) : Math.min(props2.items, 3);
638
+ itemCount.value = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props2.items, 2) : props2.items;
637
639
  goToSlide(activeSlideIndex.value);
638
640
  }
639
641
  function onScrollEnd() {
@@ -737,7 +739,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
737
739
  };
738
740
  }
739
741
  });
740
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-8e22119a"]]);
742
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-ca63f224"]]);
741
743
  function _isPlaceholder(a2) {
742
744
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
743
745
  }
@@ -9585,7 +9587,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
9585
9587
  if (props2.field.$el === "select") return SelectInput;
9586
9588
  if (props2.field.$el === "toggle") return ToggleInput;
9587
9589
  if (props2.field.$el === "check") return CheckInput;
9588
- if (props2.field.$el === "richtext") return _sfc_main$w;
9590
+ if (props2.field.$el === "richtext") return RichText;
9589
9591
  if (props2.field.$el === "file") return $el;
9590
9592
  if (props2.field.$el === "date") return _sfc_main$F;
9591
9593
  return props2.field.$el ?? "div";
@@ -43493,12 +43495,16 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
43493
43495
  };
43494
43496
  }
43495
43497
  });
43498
+ let modal;
43496
43499
  function applyFormatting(command2, value = "") {
43497
43500
  const selection = window.getSelection();
43498
43501
  if (selection && selection.rangeCount > 0) {
43499
43502
  const range2 = selection.getRangeAt(0);
43500
43503
  const span = document.createElement("span");
43501
43504
  switch (command2) {
43505
+ case "formatBlock":
43506
+ formatBlock(value);
43507
+ break;
43502
43508
  case "bold":
43503
43509
  span.style.fontWeight = "bold";
43504
43510
  break;
@@ -43563,8 +43569,9 @@ function applyFormatting(command2, value = "") {
43563
43569
  increaseFontSize();
43564
43570
  break;
43565
43571
  case "decreaseFontSize":
43572
+ decreaseFontSize();
43566
43573
  break;
43567
- case "insertLink":
43574
+ case "link":
43568
43575
  insertLink();
43569
43576
  break;
43570
43577
  case "image":
@@ -43580,6 +43587,15 @@ function applyFormatting(command2, value = "") {
43580
43587
  range2.surroundContents(span);
43581
43588
  }
43582
43589
  }
43590
+ function formatBlock(value) {
43591
+ if (!value) return;
43592
+ const selection = window.getSelection();
43593
+ const range2 = selection == null ? void 0 : selection.getRangeAt(0);
43594
+ if (!range2) return;
43595
+ range2.selectNodeContents(range2.startContainer);
43596
+ const el = document.createElement(value);
43597
+ range2.surroundContents(el);
43598
+ }
43583
43599
  function increaseFontSize() {
43584
43600
  const selection = window.getSelection();
43585
43601
  if (selection && selection.rangeCount > 0) {
@@ -43591,6 +43607,17 @@ function increaseFontSize() {
43591
43607
  range2.surroundContents(span);
43592
43608
  }
43593
43609
  }
43610
+ function decreaseFontSize() {
43611
+ const selection = window.getSelection();
43612
+ if (selection && selection.rangeCount > 0) {
43613
+ const range2 = selection.getRangeAt(0);
43614
+ const span = document.createElement("span");
43615
+ const currentFontSize = Number.parseInt(range2.startContainer.parentNode.style.fontSize || "16", 10);
43616
+ const newFontSize = currentFontSize - 2;
43617
+ span.style.fontSize = `${newFontSize}px`;
43618
+ range2.surroundContents(span);
43619
+ }
43620
+ }
43594
43621
  function removeFormatting() {
43595
43622
  const selection = window.getSelection();
43596
43623
  if (selection && selection.rangeCount > 0) {
@@ -43623,22 +43650,38 @@ function insertList(type3) {
43623
43650
  }
43624
43651
  }
43625
43652
  function insertLink() {
43626
- const url = prompt("Enter the URL:");
43627
- if (url) {
43628
- const selection = window.getSelection();
43629
- if (selection && selection.rangeCount > 0) {
43630
- const range2 = selection.getRangeAt(0);
43653
+ const selection = window.getSelection();
43654
+ if (!selection || selection.rangeCount < 1) return;
43655
+ const range2 = selection.getRangeAt(0);
43656
+ modal.showModalForm({ title: "Insert Link", schema: [
43657
+ { id: "url", $el: "text", label: "URL" },
43658
+ { id: "openInNewTab", $el: "check", label: "Open in new tab" }
43659
+ ], onSubmit: (data2) => {
43660
+ const { url, openInNewTab } = data2;
43661
+ if (url) {
43631
43662
  const anchor = document.createElement("a");
43632
43663
  anchor.href = url;
43633
43664
  range2.surroundContents(anchor);
43665
+ if (openInNewTab) anchor.target = "_blank";
43634
43666
  }
43635
- }
43667
+ } });
43636
43668
  }
43637
43669
  function insertImage() {
43638
- console.log("image");
43639
- const { showModalForm } = useModal();
43640
- console.log(showModalForm);
43641
- showModalForm({ title: "Upload Image", schema: [{ id: "image", type: "file" }], onSubmit: (_data) => {
43670
+ const selection = window.getSelection();
43671
+ if (!selection || selection.rangeCount < 1) return;
43672
+ const range2 = selection.getRangeAt(0);
43673
+ modal.showModalForm({ title: "Upload Image", schema: [
43674
+ { id: "src", $el: "file", attrs: { bindkey: "url" } },
43675
+ { id: "alt", $el: "text", label: "Alt Text" }
43676
+ ], onSubmit: (_data) => {
43677
+ const { src } = _data;
43678
+ if (src) {
43679
+ const img = document.createElement("img");
43680
+ img.src = src;
43681
+ img.alt = _data.alt;
43682
+ range2.deleteContents();
43683
+ range2.insertNode(img);
43684
+ }
43642
43685
  } });
43643
43686
  }
43644
43687
  function createTable() {
@@ -43665,6 +43708,25 @@ function createTable() {
43665
43708
  }
43666
43709
  }
43667
43710
  }
43711
+ function clearFormatting() {
43712
+ const selection = window.getSelection();
43713
+ const range2 = selection == null ? void 0 : selection.getRangeAt(0);
43714
+ if (!range2) return;
43715
+ range2.selectNodeContents(range2.startContainer);
43716
+ const contents = range2.extractContents();
43717
+ const text = contents.textContent;
43718
+ if (text !== null && text !== "") {
43719
+ range2.deleteContents();
43720
+ const textNode = document.createTextNode(`${text}`);
43721
+ setTimeout(() => {
43722
+ range2.insertNode(textNode);
43723
+ }, 1);
43724
+ }
43725
+ }
43726
+ function useFormatting(modalInstance) {
43727
+ modal = modalInstance;
43728
+ return { applyFormatting, clearFormatting };
43729
+ }
43668
43730
  const _hoisted_1$o = { class: "flex gap-05" };
43669
43731
  const _hoisted_2$f = ["disabled"];
43670
43732
  const _hoisted_3$c = { key: 1 };
@@ -43972,6 +44034,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
43972
44034
  setup(__props, { emit: __emit }) {
43973
44035
  const emit2 = __emit;
43974
44036
  const toolbarOptions = [
44037
+ { name: "formatBlock", label: "h2", icon: "format_h2" },
44038
+ { name: "formatBlock", label: "h3", icon: "format_h3" },
44039
+ { name: "formatBlock", label: "h4", icon: "format_h4" },
44040
+ { name: "formatBlock", label: "h5", icon: "format_h5" },
44041
+ { name: "formatBlock", label: "h6", icon: "format_h6" },
43975
44042
  { name: "separator" },
43976
44043
  { name: "bold", label: "Bold", icon: "format_bold" },
43977
44044
  { name: "italic", label: "Italic", icon: "format_italic" },
@@ -43988,31 +44055,22 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
43988
44055
  { name: "clear", label: "Clear Formatting", icon: "format_clear" },
43989
44056
  { name: "fullScreen", label: "Full Screen", icon: "fullscreen", class: "ms-auto" }
43990
44057
  ];
43991
- function handleSelectChange(selectedOption) {
43992
- emit2("action", "formatBlock", selectedOption);
43993
- }
43994
44058
  return (_ctx, _cache) => {
43995
44059
  const _directive_tooltip = resolveDirective("tooltip");
43996
44060
  return openBlock(), createElementBlock("div", _hoisted_1$n, [
43997
- createVNode(SelectInput, {
43998
- class: "m-0 w150",
43999
- options: ["Text", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Heading 5", "Heading 6", "Blockquote", "Code"],
44000
- onChange: handleSelectChange
44001
- }),
44002
44061
  (openBlock(), createElementBlock(Fragment$1, null, renderList(toolbarOptions, (action, index2) => {
44003
- return openBlock(), createElementBlock(Fragment$1, null, [
44062
+ return openBlock(), createElementBlock(Fragment$1, { key: index2 }, [
44004
44063
  action.name !== "separator" && _ctx.config.includes(action.name) ? withDirectives((openBlock(), createBlock(unref(Btn), {
44005
- key: action.name,
44064
+ key: 0,
44065
+ icon: action.icon,
44006
44066
  thin: "",
44007
44067
  flat: "",
44008
- class: normalizeClass([action.class, "radius-05"]),
44009
44068
  "aria-label": action.name,
44010
- icon: action.icon,
44011
- onClick: ($event) => emit2("action", action.name)
44012
- }, null, 8, ["class", "aria-label", "icon", "onClick"])), [
44069
+ class: normalizeClass([action.class, "radius-05"]),
44070
+ onClick: ($event) => emit2("action", action.name, action.label)
44071
+ }, null, 8, ["icon", "aria-label", "class", "onClick"])), [
44013
44072
  [_directive_tooltip, action.label]
44014
- ]) : createCommentVNode("", true),
44015
- action.name === "separator" ? (openBlock(), createElementBlock("span", {
44073
+ ]) : action.name === "separator" ? (openBlock(), createElementBlock("span", {
44016
44074
  key: `separator-${index2}`,
44017
44075
  class: "opacity-2 mb-025"
44018
44076
  }, "|")) : createCommentVNode("", true)
@@ -44022,13 +44080,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
44022
44080
  };
44023
44081
  }
44024
44082
  });
44025
- const _hoisted_1$m = { class: "rich-text-editor rounded pt-05 px-1 pb-1" };
44083
+ const _hoisted_1$m = { class: "rich-text-editor rounded pt-05 px-05 pb-1" };
44026
44084
  const _hoisted_2$e = { class: "editor-container flex flex-stretch gap-1 m_column" };
44027
- const _hoisted_3$b = { class: "content-area radius-05 p-1 shadow-light w-100 grid" };
44028
- const _hoisted_4$7 = {
44029
- key: 0,
44030
- class: "preview-area w-100 radius-05 p-1"
44031
- };
44085
+ const _hoisted_3$b = { class: "content-area radius-05 p-1 w-100 grid" };
44086
+ const _hoisted_4$7 = ["textContent"];
44032
44087
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
44033
44088
  __name: "index",
44034
44089
  props: {
@@ -44039,8 +44094,11 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
44039
44094
  setup(__props, { emit: __emit }) {
44040
44095
  const props2 = __props;
44041
44096
  const emit2 = __emit;
44097
+ const modal2 = useModal();
44098
+ const { applyFormatting: applyFormatting2, clearFormatting: clearFormatting2 } = useFormatting(modal2);
44042
44099
  const editableContent = ref();
44043
44100
  const defaultConfig2 = [
44101
+ "formatBlock",
44044
44102
  "bold",
44045
44103
  "italic",
44046
44104
  "underline",
@@ -44078,36 +44136,32 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
44078
44136
  }
44079
44137
  emit2("update:modelValue", contentHtml.value);
44080
44138
  }
44139
+ function updateToolbarHighlight() {
44140
+ if (document.getSelection()) {
44141
+ const selection = document.getSelection();
44142
+ const range2 = (selection == null ? void 0 : selection.rangeCount) ? selection.getRangeAt(0) : null;
44143
+ const container = range2 == null ? void 0 : range2.commonAncestorContainer;
44144
+ if (container) {
44145
+ let currentElement = container.nodeType === 3 ? container.parentElement : container;
44146
+ while (currentElement && currentElement !== editableContent.value) {
44147
+ if (["H1", "H2", "H3"].includes(currentElement.tagName)) {
44148
+ break;
44149
+ }
44150
+ currentElement = currentElement.parentElement;
44151
+ }
44152
+ }
44153
+ }
44154
+ }
44155
+ document.addEventListener("selectionchange", updateToolbarHighlight);
44081
44156
  function handleToolbarAction(action, value) {
44082
44157
  if (!editableContent.value) return;
44083
44158
  if (["alignLeft", "alignCenter", "alignRight", "alignJustify"].includes(action))
44084
44159
  value = action.replace("align", "").toLowerCase();
44085
- switch (action) {
44086
- case "orderedList":
44087
- applyFormatting("insertOrderedList");
44088
- break;
44089
- case "unorderedList":
44090
- applyFormatting("insertUnorderedList");
44091
- break;
44092
- case "blockquote":
44093
- applyFormatting("formatBlock", "<blockquote>");
44094
- break;
44095
- case "codeBlock":
44096
- applyFormatting("formatBlock", "<pre>");
44097
- break;
44098
- case "splitView":
44099
- isSplitView.value = !isSplitView.value;
44100
- break;
44101
- case "codeView":
44102
- isCodeView.value = !isCodeView.value;
44103
- break;
44104
- case "fullScreen":
44105
- toggleFullScreen();
44106
- break;
44107
- default:
44108
- applyFormatting(action, value);
44109
- break;
44110
- }
44160
+ if (action === "splitView") isSplitView.value = !isSplitView.value;
44161
+ else if (action === "codeView") isCodeView.value = !isCodeView.value;
44162
+ else if (action === "fullScreen") toggleFullScreen();
44163
+ else if (action === "clear") clearFormatting2();
44164
+ else applyFormatting2(action, value);
44111
44165
  updateContent();
44112
44166
  }
44113
44167
  function toggleFullScreen() {
@@ -44155,6 +44209,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
44155
44209
  }
44156
44210
  }
44157
44211
  }
44212
+ function logInput(e) {
44213
+ const target = e.target;
44214
+ contentHtml.value = target.textContent || "";
44215
+ }
44158
44216
  return (_ctx, _cache) => {
44159
44217
  return openBlock(), createElementBlock("div", _hoisted_1$m, [
44160
44218
  createVNode(_sfc_main$u, {
@@ -44182,13 +44240,19 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
44182
44240
  onKeydown: handleKeyDown2
44183
44241
  }, null, 544))
44184
44242
  ]),
44185
- unref(isSplitView) ? (openBlock(), createElementBlock("code", _hoisted_4$7, toDisplayString(unref(contentHtml)), 1)) : createCommentVNode("", true)
44243
+ unref(isSplitView) ? (openBlock(), createElementBlock("code", {
44244
+ key: 0,
44245
+ contenteditable: "true",
44246
+ class: "preview-area w-100 radius-05 p-1",
44247
+ onInput: _cache[1] || (_cache[1] = (e) => logInput(e)),
44248
+ textContent: toDisplayString(unref(contentHtml))
44249
+ }, null, 40, _hoisted_4$7)) : createCommentVNode("", true)
44186
44250
  ])
44187
44251
  ]);
44188
44252
  };
44189
44253
  }
44190
44254
  });
44191
- const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-8f1898f5"]]);
44255
+ const RichText = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-492bb647"]]);
44192
44256
  /*!
44193
44257
  * Signature Pad v5.0.3 | https://github.com/szimek/signature_pad
44194
44258
  * (c) 2024 Szymon Nowak | Released under the MIT license
@@ -53374,7 +53438,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
53374
53438
  const props2 = __props;
53375
53439
  const emit2 = __emit;
53376
53440
  const bagel = useBagel();
53377
- const modal = ref();
53441
+ const modal2 = ref();
53378
53442
  const computedFormSchema = computed(() => {
53379
53443
  if (typeof props2.schema === "function") return props2.schema();
53380
53444
  return props2.schema;
@@ -53383,7 +53447,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
53383
53447
  const form = ref();
53384
53448
  const closeModal = () => {
53385
53449
  var _a2;
53386
- return (_a2 = modal.value) == null ? void 0 : _a2.closeModal();
53450
+ return (_a2 = modal2.value) == null ? void 0 : _a2.closeModal();
53387
53451
  };
53388
53452
  let submitting = ref(false);
53389
53453
  async function runSubmit() {
@@ -53412,7 +53476,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
53412
53476
  return (_ctx, _cache) => {
53413
53477
  return openBlock(), createBlock(unref(_sfc_main$b), {
53414
53478
  ref_key: "modal",
53415
- ref: modal,
53479
+ ref: modal2,
53416
53480
  side: _ctx.side,
53417
53481
  width: _ctx.width,
53418
53482
  visible: _ctx.visible,
@@ -55705,21 +55769,21 @@ const ModalPlugin = {
55705
55769
  const ModalComponent = defineComponent({
55706
55770
  data: () => ({ modalStack: modalStack.value }),
55707
55771
  render() {
55708
- return this.modalStack.map((modal, index2) => {
55772
+ return this.modalStack.map((modal2, index2) => {
55709
55773
  const props2 = {
55710
- ...modal.modalOptions,
55774
+ ...modal2.modalOptions,
55711
55775
  "visible": true,
55712
55776
  "onUpdate:visible": () => {
55713
55777
  hideModal(index2);
55714
55778
  }
55715
55779
  };
55716
- switch (modal.modalType) {
55780
+ switch (modal2.modalType) {
55717
55781
  case "modalForm":
55718
- return h$2(ModalForm, props2, modal.componentSlots);
55782
+ return h$2(ModalForm, props2, modal2.componentSlots);
55719
55783
  case "confirmModal":
55720
55784
  return h$2(_sfc_main$a, props2, {});
55721
55785
  default:
55722
- return h$2(_sfc_main$b, props2, modal.componentSlots);
55786
+ return h$2(_sfc_main$b, props2, modal2.componentSlots);
55723
55787
  }
55724
55788
  });
55725
55789
  }
@@ -56101,8 +56165,8 @@ export {
56101
56165
  RadioGroup,
56102
56166
  RadioPillsInput,
56103
56167
  RangeInput,
56104
- _sfc_main$w as RichText,
56105
- index$1 as RichText2,
56168
+ RichText,
56169
+ _sfc_main$w as RichText2,
56106
56170
  RouterWrapper,
56107
56171
  SelectInput,
56108
56172
  SidebarMenu,
package/dist/style.css CHANGED
@@ -350,7 +350,7 @@ display: block;
350
350
  padding: 0;
351
351
  }
352
352
 
353
- .blocker[data-v-8e22119a] {
353
+ .blocker[data-v-ca63f224] {
354
354
  position: fixed;
355
355
  top: 0;
356
356
  left: 0;
@@ -358,7 +358,7 @@ display: block;
358
358
  height: 100%;
359
359
  z-index: 100;
360
360
  }
361
- .bgl-slider[data-v-8e22119a] {
361
+ .bgl-slider[data-v-ca63f224] {
362
362
  display: grid;
363
363
  position: relative;
364
364
  /* scroll-behavior: smooth; */
@@ -367,44 +367,44 @@ display: block;
367
367
  /* scroll-snap-type: x mandatory; */
368
368
  overflow-x: hidden;
369
369
  }
370
- .autoHeight[data-v-8e22119a] {
370
+ .autoHeight[data-v-ca63f224] {
371
371
  transition: height ease 0.7s;
372
372
  }
373
- .bgl-slider.allowScroll[data-v-8e22119a] {
373
+ .bgl-slider.allowScroll[data-v-ca63f224] {
374
374
  overflow-x: scroll;
375
375
  }
376
- .bgl-slider[data-v-8e22119a] {
376
+ .bgl-slider[data-v-ca63f224] {
377
377
  grid-auto-columns: calc(100% / var(--item-count) - calc(var(--item-count) - 1) * 1%);
378
378
  gap: 1%;
379
379
  }
380
- .bgl-slider.odd[data-v-8e22119a] {
380
+ .bgl-slider.odd[data-v-ca63f224] {
381
381
  grid-auto-columns: calc(100% / var(--item-count) - calc(var(--item-count) - 2) * 1%);
382
382
  }
383
- .bgl-slider.slides-1[data-v-8e22119a] {
383
+ .bgl-slider.slides-1[data-v-ca63f224] {
384
384
  grid-auto-columns: 100%;
385
385
  gap: 0;
386
386
  }
387
- .bgl-slider[data-v-8e22119a]::-webkit-scrollbar {
387
+ .bgl-slider[data-v-ca63f224]::-webkit-scrollbar {
388
388
  display: none;
389
389
  }
390
- .bgl-slider[data-v-8e22119a] * {
390
+ .bgl-slider[data-v-ca63f224] * {
391
391
  scroll-snap-align: start;
392
392
  }
393
- .dragging.bgl-slider[data-v-8e22119a] {
393
+ .dragging.bgl-slider[data-v-ca63f224] {
394
394
  cursor: grabbing;
395
395
  cursor: -webkit-grabbing;
396
396
  scroll-snap-type: unset;
397
397
  }
398
- .clicking.bgl-slider[data-v-8e22119a] {
398
+ .clicking.bgl-slider[data-v-ca63f224] {
399
399
  scroll-behavior: unset;
400
400
  }
401
- .dragging.bgl-slider[data-v-8e22119a] * {
401
+ .dragging.bgl-slider[data-v-ca63f224] * {
402
402
  scroll-snap-align: unset;
403
403
  user-select: none;
404
404
  }
405
405
  @media screen and (max-width: 600px) {
406
- .bgl-slider.slides-1[data-v-8e22119a] * {
407
- margin-inline-start: 1%;
406
+ .bgl-slider.slides-1[data-v-ca63f224]> * {
407
+ margin-inline-start: 0%;
408
408
  }
409
409
  }
410
410
 
@@ -1288,29 +1288,29 @@ p {
1288
1288
  8 #818181 /* few chars */
1289
1289
  ;
1290
1290
  }
1291
- .preview-area[data-v-8f1898f5]{
1291
+ .preview-area[data-v-492bb647]{
1292
1292
  font-family: "FontWithASyntaxHighlighter", monospace;
1293
1293
  font-palette: --myCustomPalette;
1294
1294
  background: var(--bgl-code-bg);
1295
1295
  color: var(--bgl-code-color)
1296
1296
  }
1297
- .rich-text-editor[data-v-8f1898f5] {
1297
+ .rich-text-editor[data-v-492bb647] {
1298
1298
  background: var(--input-bg);
1299
1299
  margin-bottom: 0.5rem;
1300
1300
  width: 100%;
1301
1301
  }
1302
- .editableContent[data-v-8f1898f5]{
1302
+ .editableContent[data-v-492bb647]{
1303
1303
  min-height: 100%;
1304
1304
  white-space: pre-wrap;
1305
1305
  outline: none;
1306
1306
  }
1307
- .content-area[data-v-8f1898f5]{
1307
+ .content-area[data-v-492bb647]{
1308
1308
  background: var(--bgl-richtext-color);
1309
1309
  }
1310
- .content-area[data-v-8f1898f5], .preview-area[data-v-8f1898f5]{
1310
+ .content-area[data-v-492bb647], .preview-area[data-v-492bb647]{
1311
1311
  min-height: 200px;
1312
1312
  }
1313
- .fullscreen-mode[data-v-8f1898f5] {
1313
+ .fullscreen-mode[data-v-492bb647] {
1314
1314
  position: fixed;
1315
1315
  top: 0;
1316
1316
  left: 0;
@@ -1322,14 +1322,14 @@ p {
1322
1322
  overflow: auto;
1323
1323
  border-radius: 0;
1324
1324
  }
1325
- .fullscreen-mode .content-area[data-v-8f1898f5]{
1325
+ .fullscreen-mode .content-area[data-v-492bb647]{
1326
1326
  height: calc(100vh - 5rem);
1327
1327
  padding: 4rem !important;
1328
1328
  max-width: 900px;
1329
1329
  margin-inline: auto ;
1330
1330
  overflow-y: auto;
1331
1331
  }
1332
- .fullscreen-mode .toolbar[data-v-8f1898f5]{
1332
+ .fullscreen-mode .toolbar[data-v-492bb647]{
1333
1333
  max-width: 900px;
1334
1334
  margin-inline: auto ;
1335
1335
  /* border-bottom: 1px solid var(--border-color); */
@@ -3567,6 +3567,9 @@ to {
3567
3567
  .oval {
3568
3568
  border-radius: 100%;
3569
3569
  }
3570
+ .aspect-ratio-1 {
3571
+ aspect-ratio: 1;
3572
+ }
3570
3573
  .flex-center {
3571
3574
  justify-content: center;
3572
3575
  align-items: center;
@@ -6886,6 +6889,10 @@ to {
6886
6889
  border-radius: 100%;
6887
6890
  }
6888
6891
 
6892
+ .m_aspect-ratio-1 {
6893
+ aspect-ratio: 1;
6894
+ }
6895
+
6889
6896
  .m_flex-center {
6890
6897
  justify-items: center;
6891
6898
  align-items: center;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.863",
4
+ "version": "0.0.869",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -40,9 +40,11 @@ function disableDrag() {
40
40
 
41
41
  function updateHeight() {
42
42
  if (!props.autoHeight || !bglSlider) return
43
- const children = Array.from(bglSlider.children[activeSlideIndex].children)
44
- const totalHeight = children.reduce((sum, el) => sum + el.clientHeight, 0)
45
- yHeight = `${totalHeight}px`
43
+ setTimeout(() => {
44
+ const children = Array.from(bglSlider.children[activeSlideIndex].children)
45
+ const totalHeight = children.reduce((sum, el) => sum + el.clientHeight, 0)
46
+ yHeight = `${totalHeight}px`
47
+ }, 200)
46
48
  }
47
49
 
48
50
  function easeScroll(target: number, duration = 500) {
@@ -81,7 +83,7 @@ function handleSlideChange() {
81
83
 
82
84
  function handleResize() {
83
85
  if (!bglSlider) return
84
- itemCount = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props.items, 2) : Math.min(props.items, 3)
86
+ itemCount = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props.items, 2) : props.items
85
87
  goToSlide(activeSlideIndex)
86
88
  }
87
89
 
@@ -250,8 +252,8 @@ watch(() => activeSlideIndex, handleSlideChange)
250
252
  }
251
253
 
252
254
  @media screen and (max-width: 600px) {
253
- .bgl-slider.slides-1 * {
254
- margin-inline-start: 1%;
255
+ .bgl-slider.slides-1> * {
256
+ margin-inline-start: 0%;
255
257
  }
256
258
 
257
259
  }
@@ -16,6 +16,11 @@ interface toolbarOption {
16
16
  class?: string
17
17
  }
18
18
  const toolbarOptions: toolbarOption[] = [
19
+ { name: 'formatBlock', label: 'h2', icon: 'format_h2' },
20
+ { name: 'formatBlock', label: 'h3', icon: 'format_h3' },
21
+ { name: 'formatBlock', label: 'h4', icon: 'format_h4' },
22
+ { name: 'formatBlock', label: 'h5', icon: 'format_h5' },
23
+ { name: 'formatBlock', label: 'h6', icon: 'format_h6' },
19
24
  { name: 'separator' },
20
25
  { name: 'bold', label: 'Bold', icon: 'format_bold' },
21
26
  { name: 'italic', label: 'Italic', icon: 'format_italic' },
@@ -46,34 +51,24 @@ const toolbarOptions: toolbarOption[] = [
46
51
  // emit('action', 'fontSize', size)
47
52
  // }
48
53
  // }
49
- function handleSelectChange(selectedOption: string) {
50
- emit('action', 'formatBlock', selectedOption)
51
- }
52
54
  </script>
53
55
 
54
56
  <template>
55
57
  <div class="toolbar flex gap-025 pb-05 flex-wrap" role="toolbar">
56
- <SelectInput
57
- class="m-0 w150"
58
- :options="['Text', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5', 'Heading 6', 'Blockquote', 'Code']"
59
- @change="handleSelectChange"
60
- />
61
-
62
- <template v-for="(action, index) in toolbarOptions">
58
+ <template v-for="(action, index) in toolbarOptions" :key="index">
63
59
  <Btn
64
60
  v-if="action.name !== 'separator' && config.includes(action.name)"
65
- :key="action.name"
66
61
  v-tooltip="action.label"
62
+ :icon="action.icon"
67
63
  thin
68
64
  flat
65
+ :aria-label="action.name"
69
66
  :class="action.class"
70
67
  class="radius-05"
71
- :aria-label="action.name"
72
- :icon="action.icon"
73
- @click="emit('action', action.name)"
68
+ @click="emit('action', action.name, action.label)"
74
69
  />
75
70
  <span
76
- v-if="action.name === 'separator'"
71
+ v-else-if="action.name === 'separator'"
77
72
  :key="`separator-${index}`"
78
73
  class=" opacity-2 mb-025"
79
74
  >|</span>