@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/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/Toolbar.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/formatting.d.ts +6 -0
- package/dist/components/form/inputs/RichText2/formatting.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/richtext-types.d.ts +1 -1
- package/dist/components/form/inputs/RichText2/richtext-types.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +2 -2
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/index.cjs +141 -77
- package/dist/index.mjs +141 -77
- package/dist/style.css +29 -22
- package/package.json +1 -1
- package/src/components/Carousel.vue +8 -6
- package/src/components/form/inputs/RichText.zip +0 -0
- package/src/components/form/inputs/RichText2/Toolbar.vue +10 -15
- package/src/components/form/inputs/RichText2/formatting.ts +69 -25
- package/src/components/form/inputs/RichText2/index.vue +46 -30
- package/src/components/form/inputs/RichText2/richtext-types.ts +1 -0
- package/src/components/form/inputs/index.ts +2 -2
- package/src/styles/layout.css +4 -0
- package/src/styles/mobilLayout.css +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAyYA,iBAAS,IAAI,SAIZ;AAED,iBAAS,IAAI,SAIZ;AAwCD,iBAAS,cAAc;;yBAsEM,GAAG;;;;YACN,GAAG;;;;YACH,GAAG;;;;;WAUf,OAAO,IAA6B;EAEjD;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAgBnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/Toolbar.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Toolbar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/Toolbar.vue"],"names":[],"mappings":"AAAA,OAmFO,KAAK,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAA;;YAM1C,aAAa;;;;YAAb,aAAa;;;;AAiJ7C,wBAOG"}
|
|
@@ -2,4 +2,10 @@ export declare function applyFormatting(command: string, value?: string): void;
|
|
|
2
2
|
export declare function insertLink(): void;
|
|
3
3
|
export declare function insertImage(): void;
|
|
4
4
|
export declare function createTable(): void;
|
|
5
|
+
declare function clearFormatting(): void;
|
|
6
|
+
export declare function useFormatting(modalInstance?: any): {
|
|
7
|
+
applyFormatting: typeof applyFormatting;
|
|
8
|
+
clearFormatting: typeof clearFormatting;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
5
11
|
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/formatting.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/formatting.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,QA4FlE;AAsED,wBAAgB,UAAU,SAgBzB;AAED,wBAAgB,WAAW,SAiB1B;AAED,wBAAgB,WAAW,SAyB1B;AAED,iBAAS,eAAe,SAYvB;AAED,wBAAgB,aAAa,CAAC,aAAa,CAAC,EAAE,GAAG;;;EAGhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/index.vue"],"names":[],"mappings":"AAAA,OA8SO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;;gBAQjB,MAAM;oBAAkB,aAAa;;;;gBAArC,MAAM;oBAAkB,aAAa;;;;AA0QzE,wBAOG"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type ToolbarConfigOption = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'fontSize' | 'fontFamily' | 'textColor' | 'backgroundColor' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'orderedList' | 'unorderedList' | 'indent' | 'outdent' | 'link' | 'image' | 'table' | 'blockquote' | 'codeBlock' | 'splitView' | 'codeView' | 'youtube' | 'clear' | 'fullScreen';
|
|
1
|
+
export type ToolbarConfigOption = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'fontSize' | 'fontFamily' | 'textColor' | 'backgroundColor' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'orderedList' | 'unorderedList' | 'indent' | 'outdent' | 'link' | 'image' | 'table' | 'blockquote' | 'codeBlock' | 'splitView' | 'codeView' | 'youtube' | 'clear' | 'fullScreen' | 'formatBlock';
|
|
2
2
|
export type ToolbarConfig = ToolbarConfigOption[];
|
|
3
3
|
//# sourceMappingURL=richtext-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richtext-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/richtext-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GACrC,QAAQ,GACR,WAAW,GACX,eAAe,GACf,UAAU,GACV,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,GACd,aAAa,GACb,eAAe,GACf,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,YAAY,GACZ,WAAW,GACX,WAAW,GACX,UAAU,GACV,SAAS,GACT,OAAO,GACP,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"richtext-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/RichText2/richtext-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GACrC,QAAQ,GACR,WAAW,GACX,eAAe,GACf,UAAU,GACV,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,GACd,aAAa,GACb,eAAe,GACf,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,YAAY,GACZ,WAAW,GACX,WAAW,GACX,UAAU,GACV,SAAS,GACT,OAAO,GACP,YAAY,GACZ,aAAa,CAAA;AAEhB,MAAM,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/SelectInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":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AAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -10,8 +10,8 @@ export { default as PasswordInput } from './PasswordInput.vue';
|
|
|
10
10
|
export { default as RadioGroup } from './RadioGroup.vue';
|
|
11
11
|
export { default as RadioPillsInput } from './RadioPillsInput.vue';
|
|
12
12
|
export { default as RangeInput } from './RangeInput.vue';
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
13
|
+
export { default as RichText2 } from './RichText.vue';
|
|
14
|
+
export { default as RichText } from './RichText2/index.vue';
|
|
15
15
|
export { default as SelectInput } from './SelectInput.vue';
|
|
16
16
|
export { default as SignaturePad } from './SignaturePad.vue';
|
|
17
17
|
export { default as TableField } from './TableField.vue';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,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AA;AAC1D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -601,9 +601,11 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
|
601
601
|
}
|
|
602
602
|
function updateHeight() {
|
|
603
603
|
if (!props2.autoHeight || !bglSlider.value) return;
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
setTimeout(() => {
|
|
605
|
+
const children2 = Array.from(bglSlider.value.children[activeSlideIndex.value].children);
|
|
606
|
+
const totalHeight = children2.reduce((sum, el) => sum + el.clientHeight, 0);
|
|
607
|
+
yHeight.value = `${totalHeight}px`;
|
|
608
|
+
}, 200);
|
|
607
609
|
}
|
|
608
610
|
function easeScroll(target, duration = 500) {
|
|
609
611
|
if (!bglSlider.value || isPressed.value) return;
|
|
@@ -635,7 +637,7 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
|
635
637
|
}
|
|
636
638
|
function handleResize() {
|
|
637
639
|
if (!bglSlider.value) return;
|
|
638
|
-
itemCount.value = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props2.items, 2) :
|
|
640
|
+
itemCount.value = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props2.items, 2) : props2.items;
|
|
639
641
|
goToSlide(activeSlideIndex.value);
|
|
640
642
|
}
|
|
641
643
|
function onScrollEnd() {
|
|
@@ -739,7 +741,7 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
|
739
741
|
};
|
|
740
742
|
}
|
|
741
743
|
});
|
|
742
|
-
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-
|
|
744
|
+
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-ca63f224"]]);
|
|
743
745
|
function _isPlaceholder(a2) {
|
|
744
746
|
return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
|
|
745
747
|
}
|
|
@@ -9587,7 +9589,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
9587
9589
|
if (props2.field.$el === "select") return SelectInput;
|
|
9588
9590
|
if (props2.field.$el === "toggle") return ToggleInput;
|
|
9589
9591
|
if (props2.field.$el === "check") return CheckInput;
|
|
9590
|
-
if (props2.field.$el === "richtext") return
|
|
9592
|
+
if (props2.field.$el === "richtext") return RichText;
|
|
9591
9593
|
if (props2.field.$el === "file") return $el;
|
|
9592
9594
|
if (props2.field.$el === "date") return _sfc_main$F;
|
|
9593
9595
|
return props2.field.$el ?? "div";
|
|
@@ -43495,12 +43497,16 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
43495
43497
|
};
|
|
43496
43498
|
}
|
|
43497
43499
|
});
|
|
43500
|
+
let modal;
|
|
43498
43501
|
function applyFormatting(command2, value = "") {
|
|
43499
43502
|
const selection = window.getSelection();
|
|
43500
43503
|
if (selection && selection.rangeCount > 0) {
|
|
43501
43504
|
const range2 = selection.getRangeAt(0);
|
|
43502
43505
|
const span = document.createElement("span");
|
|
43503
43506
|
switch (command2) {
|
|
43507
|
+
case "formatBlock":
|
|
43508
|
+
formatBlock(value);
|
|
43509
|
+
break;
|
|
43504
43510
|
case "bold":
|
|
43505
43511
|
span.style.fontWeight = "bold";
|
|
43506
43512
|
break;
|
|
@@ -43565,8 +43571,9 @@ function applyFormatting(command2, value = "") {
|
|
|
43565
43571
|
increaseFontSize();
|
|
43566
43572
|
break;
|
|
43567
43573
|
case "decreaseFontSize":
|
|
43574
|
+
decreaseFontSize();
|
|
43568
43575
|
break;
|
|
43569
|
-
case "
|
|
43576
|
+
case "link":
|
|
43570
43577
|
insertLink();
|
|
43571
43578
|
break;
|
|
43572
43579
|
case "image":
|
|
@@ -43582,6 +43589,15 @@ function applyFormatting(command2, value = "") {
|
|
|
43582
43589
|
range2.surroundContents(span);
|
|
43583
43590
|
}
|
|
43584
43591
|
}
|
|
43592
|
+
function formatBlock(value) {
|
|
43593
|
+
if (!value) return;
|
|
43594
|
+
const selection = window.getSelection();
|
|
43595
|
+
const range2 = selection == null ? void 0 : selection.getRangeAt(0);
|
|
43596
|
+
if (!range2) return;
|
|
43597
|
+
range2.selectNodeContents(range2.startContainer);
|
|
43598
|
+
const el = document.createElement(value);
|
|
43599
|
+
range2.surroundContents(el);
|
|
43600
|
+
}
|
|
43585
43601
|
function increaseFontSize() {
|
|
43586
43602
|
const selection = window.getSelection();
|
|
43587
43603
|
if (selection && selection.rangeCount > 0) {
|
|
@@ -43593,6 +43609,17 @@ function increaseFontSize() {
|
|
|
43593
43609
|
range2.surroundContents(span);
|
|
43594
43610
|
}
|
|
43595
43611
|
}
|
|
43612
|
+
function decreaseFontSize() {
|
|
43613
|
+
const selection = window.getSelection();
|
|
43614
|
+
if (selection && selection.rangeCount > 0) {
|
|
43615
|
+
const range2 = selection.getRangeAt(0);
|
|
43616
|
+
const span = document.createElement("span");
|
|
43617
|
+
const currentFontSize = Number.parseInt(range2.startContainer.parentNode.style.fontSize || "16", 10);
|
|
43618
|
+
const newFontSize = currentFontSize - 2;
|
|
43619
|
+
span.style.fontSize = `${newFontSize}px`;
|
|
43620
|
+
range2.surroundContents(span);
|
|
43621
|
+
}
|
|
43622
|
+
}
|
|
43596
43623
|
function removeFormatting() {
|
|
43597
43624
|
const selection = window.getSelection();
|
|
43598
43625
|
if (selection && selection.rangeCount > 0) {
|
|
@@ -43625,22 +43652,38 @@ function insertList(type3) {
|
|
|
43625
43652
|
}
|
|
43626
43653
|
}
|
|
43627
43654
|
function insertLink() {
|
|
43628
|
-
const
|
|
43629
|
-
if (
|
|
43630
|
-
|
|
43631
|
-
|
|
43632
|
-
|
|
43655
|
+
const selection = window.getSelection();
|
|
43656
|
+
if (!selection || selection.rangeCount < 1) return;
|
|
43657
|
+
const range2 = selection.getRangeAt(0);
|
|
43658
|
+
modal.showModalForm({ title: "Insert Link", schema: [
|
|
43659
|
+
{ id: "url", $el: "text", label: "URL" },
|
|
43660
|
+
{ id: "openInNewTab", $el: "check", label: "Open in new tab" }
|
|
43661
|
+
], onSubmit: (data2) => {
|
|
43662
|
+
const { url, openInNewTab } = data2;
|
|
43663
|
+
if (url) {
|
|
43633
43664
|
const anchor = document.createElement("a");
|
|
43634
43665
|
anchor.href = url;
|
|
43635
43666
|
range2.surroundContents(anchor);
|
|
43667
|
+
if (openInNewTab) anchor.target = "_blank";
|
|
43636
43668
|
}
|
|
43637
|
-
}
|
|
43669
|
+
} });
|
|
43638
43670
|
}
|
|
43639
43671
|
function insertImage() {
|
|
43640
|
-
|
|
43641
|
-
|
|
43642
|
-
|
|
43643
|
-
showModalForm({ title: "Upload Image", schema: [
|
|
43672
|
+
const selection = window.getSelection();
|
|
43673
|
+
if (!selection || selection.rangeCount < 1) return;
|
|
43674
|
+
const range2 = selection.getRangeAt(0);
|
|
43675
|
+
modal.showModalForm({ title: "Upload Image", schema: [
|
|
43676
|
+
{ id: "src", $el: "file", attrs: { bindkey: "url" } },
|
|
43677
|
+
{ id: "alt", $el: "text", label: "Alt Text" }
|
|
43678
|
+
], onSubmit: (_data) => {
|
|
43679
|
+
const { src } = _data;
|
|
43680
|
+
if (src) {
|
|
43681
|
+
const img = document.createElement("img");
|
|
43682
|
+
img.src = src;
|
|
43683
|
+
img.alt = _data.alt;
|
|
43684
|
+
range2.deleteContents();
|
|
43685
|
+
range2.insertNode(img);
|
|
43686
|
+
}
|
|
43644
43687
|
} });
|
|
43645
43688
|
}
|
|
43646
43689
|
function createTable() {
|
|
@@ -43667,6 +43710,25 @@ function createTable() {
|
|
|
43667
43710
|
}
|
|
43668
43711
|
}
|
|
43669
43712
|
}
|
|
43713
|
+
function clearFormatting() {
|
|
43714
|
+
const selection = window.getSelection();
|
|
43715
|
+
const range2 = selection == null ? void 0 : selection.getRangeAt(0);
|
|
43716
|
+
if (!range2) return;
|
|
43717
|
+
range2.selectNodeContents(range2.startContainer);
|
|
43718
|
+
const contents = range2.extractContents();
|
|
43719
|
+
const text = contents.textContent;
|
|
43720
|
+
if (text !== null && text !== "") {
|
|
43721
|
+
range2.deleteContents();
|
|
43722
|
+
const textNode = document.createTextNode(`${text}`);
|
|
43723
|
+
setTimeout(() => {
|
|
43724
|
+
range2.insertNode(textNode);
|
|
43725
|
+
}, 1);
|
|
43726
|
+
}
|
|
43727
|
+
}
|
|
43728
|
+
function useFormatting(modalInstance) {
|
|
43729
|
+
modal = modalInstance;
|
|
43730
|
+
return { applyFormatting, clearFormatting };
|
|
43731
|
+
}
|
|
43670
43732
|
const _hoisted_1$o = { class: "flex gap-05" };
|
|
43671
43733
|
const _hoisted_2$f = ["disabled"];
|
|
43672
43734
|
const _hoisted_3$c = { key: 1 };
|
|
@@ -43974,6 +44036,11 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43974
44036
|
setup(__props, { emit: __emit }) {
|
|
43975
44037
|
const emit2 = __emit;
|
|
43976
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" },
|
|
43977
44044
|
{ name: "separator" },
|
|
43978
44045
|
{ name: "bold", label: "Bold", icon: "format_bold" },
|
|
43979
44046
|
{ name: "italic", label: "Italic", icon: "format_italic" },
|
|
@@ -43990,31 +44057,22 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
43990
44057
|
{ name: "clear", label: "Clear Formatting", icon: "format_clear" },
|
|
43991
44058
|
{ name: "fullScreen", label: "Full Screen", icon: "fullscreen", class: "ms-auto" }
|
|
43992
44059
|
];
|
|
43993
|
-
function handleSelectChange(selectedOption) {
|
|
43994
|
-
emit2("action", "formatBlock", selectedOption);
|
|
43995
|
-
}
|
|
43996
44060
|
return (_ctx, _cache) => {
|
|
43997
44061
|
const _directive_tooltip = vue.resolveDirective("tooltip");
|
|
43998
44062
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
43999
|
-
vue.createVNode(SelectInput, {
|
|
44000
|
-
class: "m-0 w150",
|
|
44001
|
-
options: ["Text", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Heading 5", "Heading 6", "Blockquote", "Code"],
|
|
44002
|
-
onChange: handleSelectChange
|
|
44003
|
-
}),
|
|
44004
44063
|
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(toolbarOptions, (action, index2) => {
|
|
44005
|
-
return vue.openBlock(), vue.createElementBlock(vue.Fragment,
|
|
44064
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
|
|
44006
44065
|
action.name !== "separator" && _ctx.config.includes(action.name) ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(Btn), {
|
|
44007
|
-
key:
|
|
44066
|
+
key: 0,
|
|
44067
|
+
icon: action.icon,
|
|
44008
44068
|
thin: "",
|
|
44009
44069
|
flat: "",
|
|
44010
|
-
class: vue.normalizeClass([action.class, "radius-05"]),
|
|
44011
44070
|
"aria-label": action.name,
|
|
44012
|
-
|
|
44013
|
-
onClick: ($event) => emit2("action", action.name)
|
|
44014
|
-
}, null, 8, ["
|
|
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"])), [
|
|
44015
44074
|
[_directive_tooltip, action.label]
|
|
44016
|
-
]) : vue.
|
|
44017
|
-
action.name === "separator" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
44075
|
+
]) : action.name === "separator" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
44018
44076
|
key: `separator-${index2}`,
|
|
44019
44077
|
class: "opacity-2 mb-025"
|
|
44020
44078
|
}, "|")) : vue.createCommentVNode("", true)
|
|
@@ -44024,13 +44082,10 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
44024
44082
|
};
|
|
44025
44083
|
}
|
|
44026
44084
|
});
|
|
44027
|
-
const _hoisted_1$m = { class: "rich-text-editor rounded pt-05 px-
|
|
44085
|
+
const _hoisted_1$m = { class: "rich-text-editor rounded pt-05 px-05 pb-1" };
|
|
44028
44086
|
const _hoisted_2$e = { class: "editor-container flex flex-stretch gap-1 m_column" };
|
|
44029
|
-
const _hoisted_3$b = { class: "content-area radius-05 p-1
|
|
44030
|
-
const _hoisted_4$7 =
|
|
44031
|
-
key: 0,
|
|
44032
|
-
class: "preview-area w-100 radius-05 p-1"
|
|
44033
|
-
};
|
|
44087
|
+
const _hoisted_3$b = { class: "content-area radius-05 p-1 w-100 grid" };
|
|
44088
|
+
const _hoisted_4$7 = ["textContent"];
|
|
44034
44089
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
44035
44090
|
__name: "index",
|
|
44036
44091
|
props: {
|
|
@@ -44041,8 +44096,11 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
44041
44096
|
setup(__props, { emit: __emit }) {
|
|
44042
44097
|
const props2 = __props;
|
|
44043
44098
|
const emit2 = __emit;
|
|
44099
|
+
const modal2 = useModal();
|
|
44100
|
+
const { applyFormatting: applyFormatting2, clearFormatting: clearFormatting2 } = useFormatting(modal2);
|
|
44044
44101
|
const editableContent = vue.ref();
|
|
44045
44102
|
const defaultConfig2 = [
|
|
44103
|
+
"formatBlock",
|
|
44046
44104
|
"bold",
|
|
44047
44105
|
"italic",
|
|
44048
44106
|
"underline",
|
|
@@ -44080,36 +44138,32 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
44080
44138
|
}
|
|
44081
44139
|
emit2("update:modelValue", contentHtml.value);
|
|
44082
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);
|
|
44083
44158
|
function handleToolbarAction(action, value) {
|
|
44084
44159
|
if (!editableContent.value) return;
|
|
44085
44160
|
if (["alignLeft", "alignCenter", "alignRight", "alignJustify"].includes(action))
|
|
44086
44161
|
value = action.replace("align", "").toLowerCase();
|
|
44087
|
-
|
|
44088
|
-
|
|
44089
|
-
|
|
44090
|
-
|
|
44091
|
-
|
|
44092
|
-
applyFormatting("insertUnorderedList");
|
|
44093
|
-
break;
|
|
44094
|
-
case "blockquote":
|
|
44095
|
-
applyFormatting("formatBlock", "<blockquote>");
|
|
44096
|
-
break;
|
|
44097
|
-
case "codeBlock":
|
|
44098
|
-
applyFormatting("formatBlock", "<pre>");
|
|
44099
|
-
break;
|
|
44100
|
-
case "splitView":
|
|
44101
|
-
isSplitView.value = !isSplitView.value;
|
|
44102
|
-
break;
|
|
44103
|
-
case "codeView":
|
|
44104
|
-
isCodeView.value = !isCodeView.value;
|
|
44105
|
-
break;
|
|
44106
|
-
case "fullScreen":
|
|
44107
|
-
toggleFullScreen();
|
|
44108
|
-
break;
|
|
44109
|
-
default:
|
|
44110
|
-
applyFormatting(action, value);
|
|
44111
|
-
break;
|
|
44112
|
-
}
|
|
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);
|
|
44113
44167
|
updateContent();
|
|
44114
44168
|
}
|
|
44115
44169
|
function toggleFullScreen() {
|
|
@@ -44157,6 +44211,10 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
44157
44211
|
}
|
|
44158
44212
|
}
|
|
44159
44213
|
}
|
|
44214
|
+
function logInput(e) {
|
|
44215
|
+
const target = e.target;
|
|
44216
|
+
contentHtml.value = target.textContent || "";
|
|
44217
|
+
}
|
|
44160
44218
|
return (_ctx, _cache) => {
|
|
44161
44219
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
44162
44220
|
vue.createVNode(_sfc_main$u, {
|
|
@@ -44184,13 +44242,19 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
44184
44242
|
onKeydown: handleKeyDown2
|
|
44185
44243
|
}, null, 544))
|
|
44186
44244
|
]),
|
|
44187
|
-
vue.unref(isSplitView) ? (vue.openBlock(), vue.createElementBlock("code",
|
|
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)
|
|
44188
44252
|
])
|
|
44189
44253
|
]);
|
|
44190
44254
|
};
|
|
44191
44255
|
}
|
|
44192
44256
|
});
|
|
44193
|
-
const
|
|
44257
|
+
const RichText = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-492bb647"]]);
|
|
44194
44258
|
/*!
|
|
44195
44259
|
* Signature Pad v5.0.3 | https://github.com/szimek/signature_pad
|
|
44196
44260
|
* (c) 2024 Szymon Nowak | Released under the MIT license
|
|
@@ -53376,7 +53440,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53376
53440
|
const props2 = __props;
|
|
53377
53441
|
const emit2 = __emit;
|
|
53378
53442
|
const bagel = useBagel();
|
|
53379
|
-
const
|
|
53443
|
+
const modal2 = vue.ref();
|
|
53380
53444
|
const computedFormSchema = vue.computed(() => {
|
|
53381
53445
|
if (typeof props2.schema === "function") return props2.schema();
|
|
53382
53446
|
return props2.schema;
|
|
@@ -53385,7 +53449,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53385
53449
|
const form = vue.ref();
|
|
53386
53450
|
const closeModal = () => {
|
|
53387
53451
|
var _a2;
|
|
53388
|
-
return (_a2 =
|
|
53452
|
+
return (_a2 = modal2.value) == null ? void 0 : _a2.closeModal();
|
|
53389
53453
|
};
|
|
53390
53454
|
let submitting = vue.ref(false);
|
|
53391
53455
|
async function runSubmit() {
|
|
@@ -53414,7 +53478,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53414
53478
|
return (_ctx, _cache) => {
|
|
53415
53479
|
return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$b), {
|
|
53416
53480
|
ref_key: "modal",
|
|
53417
|
-
ref:
|
|
53481
|
+
ref: modal2,
|
|
53418
53482
|
side: _ctx.side,
|
|
53419
53483
|
width: _ctx.width,
|
|
53420
53484
|
visible: _ctx.visible,
|
|
@@ -55707,21 +55771,21 @@ const ModalPlugin = {
|
|
|
55707
55771
|
const ModalComponent = vue.defineComponent({
|
|
55708
55772
|
data: () => ({ modalStack: modalStack.value }),
|
|
55709
55773
|
render() {
|
|
55710
|
-
return this.modalStack.map((
|
|
55774
|
+
return this.modalStack.map((modal2, index2) => {
|
|
55711
55775
|
const props2 = {
|
|
55712
|
-
...
|
|
55776
|
+
...modal2.modalOptions,
|
|
55713
55777
|
"visible": true,
|
|
55714
55778
|
"onUpdate:visible": () => {
|
|
55715
55779
|
hideModal(index2);
|
|
55716
55780
|
}
|
|
55717
55781
|
};
|
|
55718
|
-
switch (
|
|
55782
|
+
switch (modal2.modalType) {
|
|
55719
55783
|
case "modalForm":
|
|
55720
|
-
return vue.h(ModalForm, props2,
|
|
55784
|
+
return vue.h(ModalForm, props2, modal2.componentSlots);
|
|
55721
55785
|
case "confirmModal":
|
|
55722
55786
|
return vue.h(_sfc_main$a, props2, {});
|
|
55723
55787
|
default:
|
|
55724
|
-
return vue.h(_sfc_main$b, props2,
|
|
55788
|
+
return vue.h(_sfc_main$b, props2, modal2.componentSlots);
|
|
55725
55789
|
}
|
|
55726
55790
|
});
|
|
55727
55791
|
}
|
|
@@ -56102,8 +56166,8 @@ exports.Pill = Pill;
|
|
|
56102
56166
|
exports.RadioGroup = RadioGroup;
|
|
56103
56167
|
exports.RadioPillsInput = RadioPillsInput;
|
|
56104
56168
|
exports.RangeInput = RangeInput;
|
|
56105
|
-
exports.RichText =
|
|
56106
|
-
exports.RichText2 =
|
|
56169
|
+
exports.RichText = RichText;
|
|
56170
|
+
exports.RichText2 = _sfc_main$w;
|
|
56107
56171
|
exports.RouterWrapper = RouterWrapper;
|
|
56108
56172
|
exports.SelectInput = SelectInput;
|
|
56109
56173
|
exports.SidebarMenu = SidebarMenu;
|