@tailor-cms/ce-flashcards-edit 0.0.2 → 0.0.3
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 +98 -76
- package/dist/index.css +2 -8
- package/dist/index.js +98 -76
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3670,6 +3670,39 @@ function isEmpty(value) {
|
|
|
3670
3670
|
return true;
|
|
3671
3671
|
}
|
|
3672
3672
|
//#endregion
|
|
3673
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
|
|
3674
|
+
/**
|
|
3675
|
+
* Performs a deep comparison between two values to determine if they are
|
|
3676
|
+
* equivalent.
|
|
3677
|
+
*
|
|
3678
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
3679
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
3680
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
3681
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
3682
|
+
* nodes are compared by strict equality, i.e. `===`.
|
|
3683
|
+
*
|
|
3684
|
+
* @static
|
|
3685
|
+
* @memberOf _
|
|
3686
|
+
* @since 0.1.0
|
|
3687
|
+
* @category Lang
|
|
3688
|
+
* @param {*} value The value to compare.
|
|
3689
|
+
* @param {*} other The other value to compare.
|
|
3690
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
3691
|
+
* @example
|
|
3692
|
+
*
|
|
3693
|
+
* var object = { 'a': 1 };
|
|
3694
|
+
* var other = { 'a': 1 };
|
|
3695
|
+
*
|
|
3696
|
+
* _.isEqual(object, other);
|
|
3697
|
+
* // => true
|
|
3698
|
+
*
|
|
3699
|
+
* object === other;
|
|
3700
|
+
* // => false
|
|
3701
|
+
*/
|
|
3702
|
+
function isEqual(value, other) {
|
|
3703
|
+
return baseIsEqual(value, other);
|
|
3704
|
+
}
|
|
3705
|
+
//#endregion
|
|
3673
3706
|
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.js
|
|
3674
3707
|
/** `Object#toString` result references. */
|
|
3675
3708
|
var numberTag = "[object Number]";
|
|
@@ -5538,7 +5571,7 @@ Bt.mounted, Bt.unmounted;
|
|
|
5538
5571
|
//#endregion
|
|
5539
5572
|
//#region src/components/FlashcardItem.vue?vue&type=script&setup=true&lang.ts
|
|
5540
5573
|
var _hoisted_1$1 = { class: "d-flex align-center w-100" };
|
|
5541
|
-
var _hoisted_2
|
|
5574
|
+
var _hoisted_2 = { class: "ml-2" };
|
|
5542
5575
|
var _hoisted_3 = { class: "text-title-small text-left mt-1" };
|
|
5543
5576
|
var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
5544
5577
|
__name: "FlashcardItem",
|
|
@@ -5618,11 +5651,13 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0
|
|
|
5618
5651
|
const _component_VExpansionPanelText = (0, vue.resolveComponent)("VExpansionPanelText");
|
|
5619
5652
|
const _component_VExpansionPanel = (0, vue.resolveComponent)("VExpansionPanel");
|
|
5620
5653
|
const _directive_tooltip = (0, vue.resolveDirective)("tooltip");
|
|
5621
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)(_component_VExpansionPanel, {
|
|
5654
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(_component_VExpansionPanel, {
|
|
5655
|
+
value: __props.item.id,
|
|
5656
|
+
class: "border sm"
|
|
5657
|
+
}, {
|
|
5622
5658
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VHover, null, {
|
|
5623
5659
|
default: (0, vue.withCtx)(({ isHovering, props: hoverProps }) => [(0, vue.createVNode)(_component_VExpansionPanelTitle, (0, vue.mergeProps)(hoverProps, {
|
|
5624
5660
|
class: "pa-2 pr-4",
|
|
5625
|
-
color: "primary-lighten-5",
|
|
5626
5661
|
"min-height": "56"
|
|
5627
5662
|
}), {
|
|
5628
5663
|
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$1, [
|
|
@@ -5631,7 +5666,7 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0
|
|
|
5631
5666
|
class: "flashcard-drag-handle",
|
|
5632
5667
|
onDrag: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop", "prevent"]))
|
|
5633
5668
|
}, [(0, vue.createVNode)(_component_VIcon, { icon: "mdi-drag-vertical" })], 32)) : (0, vue.createCommentVNode)("", true),
|
|
5634
|
-
(0, vue.createElementVNode)("span", _hoisted_2
|
|
5669
|
+
(0, vue.createElementVNode)("span", _hoisted_2, "Card " + (0, vue.toDisplayString)(__props.position), 1),
|
|
5635
5670
|
(0, vue.createVNode)(_component_VSpacer),
|
|
5636
5671
|
(0, vue.createVNode)(_component_VFadeTransition, null, {
|
|
5637
5672
|
default: (0, vue.withCtx)(() => [(isHovering || __props.isExpanded) && !__props.isReadonly && __props.allowDeletion ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
|
|
@@ -5666,7 +5701,8 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0
|
|
|
5666
5701
|
key: 0,
|
|
5667
5702
|
class: "mt-4",
|
|
5668
5703
|
icon: "mdi-information-outline",
|
|
5669
|
-
variant: "tonal"
|
|
5704
|
+
variant: "tonal",
|
|
5705
|
+
prominent: ""
|
|
5670
5706
|
}, {
|
|
5671
5707
|
default: (0, vue.withCtx)(() => [__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)(" No content elements added to this side. ")], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createTextVNode)(" Click the button below to add a content element. ")], 64))]),
|
|
5672
5708
|
_: 1
|
|
@@ -5697,7 +5733,6 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0
|
|
|
5697
5733
|
border: ""
|
|
5698
5734
|
}, {
|
|
5699
5735
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VIcon, {
|
|
5700
|
-
class: "text-medium-emphasis",
|
|
5701
5736
|
icon: "mdi-sync",
|
|
5702
5737
|
size: "18"
|
|
5703
5738
|
})]),
|
|
@@ -5723,11 +5758,10 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
5723
5758
|
};
|
|
5724
5759
|
//#endregion
|
|
5725
5760
|
//#region src/components/FlashcardItem.vue
|
|
5726
|
-
var FlashcardItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FlashcardItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5761
|
+
var FlashcardItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FlashcardItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-462cae17"]]);
|
|
5727
5762
|
//#endregion
|
|
5728
5763
|
//#region src/components/Edit.vue?vue&type=script&setup=true&lang.ts
|
|
5729
|
-
var _hoisted_1 = { class: "text-
|
|
5730
|
-
var _hoisted_2 = { class: "pa-6 text-center" };
|
|
5764
|
+
var _hoisted_1 = { class: "tce-flashcards text-center" };
|
|
5731
5765
|
//#endregion
|
|
5732
5766
|
//#region src/components/Edit.vue
|
|
5733
5767
|
var Edit_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5796,83 +5830,67 @@ var Edit_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
|
|
|
5796
5830
|
emit("save", elementData);
|
|
5797
5831
|
}
|
|
5798
5832
|
});
|
|
5833
|
+
(0, vue.watch)(() => props.element.data, (data) => {
|
|
5834
|
+
if (isEqual(data, elementData)) return;
|
|
5835
|
+
Object.assign(elementData, cloneDeep(data));
|
|
5836
|
+
});
|
|
5799
5837
|
return (_ctx, _cache) => {
|
|
5800
|
-
const _component_VIcon = (0, vue.resolveComponent)("VIcon");
|
|
5801
|
-
const _component_VToolbar = (0, vue.resolveComponent)("VToolbar");
|
|
5802
5838
|
const _component_VExpandTransition = (0, vue.resolveComponent)("VExpandTransition");
|
|
5803
5839
|
const _component_VExpansionPanels = (0, vue.resolveComponent)("VExpansionPanels");
|
|
5804
5840
|
const _component_VBtn = (0, vue.resolveComponent)("VBtn");
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5841
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.createVNode)(_component_VExpansionPanels, {
|
|
5842
|
+
ref_key: "panels",
|
|
5843
|
+
ref: panels,
|
|
5844
|
+
modelValue: expanded.value,
|
|
5845
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
|
|
5846
|
+
class: "text-left",
|
|
5847
|
+
rounded: "lg",
|
|
5848
|
+
flat: "",
|
|
5849
|
+
multiple: ""
|
|
5809
5850
|
}, {
|
|
5810
|
-
default: (0, vue.withCtx)(() => [(0, vue.
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
height: "36"
|
|
5814
|
-
}, {
|
|
5815
|
-
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VIcon, {
|
|
5816
|
-
icon: (0, vue.unref)(manifest$1).ui.icon,
|
|
5817
|
-
color: "secondary-lighten-2",
|
|
5818
|
-
size: "18",
|
|
5819
|
-
start: ""
|
|
5820
|
-
}, null, 8, ["icon"]), (0, vue.createElementVNode)("span", _hoisted_1, (0, vue.toDisplayString)((0, vue.unref)(manifest$1).name), 1)]),
|
|
5821
|
-
_: 1
|
|
5822
|
-
}), (0, vue.createElementVNode)("div", _hoisted_2, [(0, vue.createVNode)(_component_VExpansionPanels, {
|
|
5823
|
-
ref_key: "panels",
|
|
5824
|
-
ref: panels,
|
|
5825
|
-
modelValue: expanded.value,
|
|
5826
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
|
|
5827
|
-
rounded: "lg",
|
|
5828
|
-
flat: "",
|
|
5829
|
-
multiple: ""
|
|
5851
|
+
default: (0, vue.withCtx)(() => [!!cardCount.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VExpandTransition, {
|
|
5852
|
+
key: 0,
|
|
5853
|
+
group: ""
|
|
5830
5854
|
}, {
|
|
5831
|
-
default: (0, vue.withCtx)(() => [
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
"position",
|
|
5857
|
-
"onDelete"
|
|
5858
|
-
]);
|
|
5859
|
-
}), 128))]),
|
|
5860
|
-
_: 1
|
|
5861
|
-
})) : (0, vue.createCommentVNode)("", true)]),
|
|
5855
|
+
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(cards.value, (item, index) => {
|
|
5856
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(FlashcardItem_default, {
|
|
5857
|
+
key: item.id,
|
|
5858
|
+
"allow-deletion": cardCount.value > 1,
|
|
5859
|
+
"embed-element-config": __props.embedElementConfig,
|
|
5860
|
+
embeds: embedsByFace.value[item.id],
|
|
5861
|
+
"is-expanded": expanded.value.includes(item.id),
|
|
5862
|
+
"is-focused": __props.isFocused,
|
|
5863
|
+
"is-readonly": __props.isReadonly,
|
|
5864
|
+
item,
|
|
5865
|
+
position: index + 1,
|
|
5866
|
+
onDelete: ($event) => deleteItem(item.id),
|
|
5867
|
+
onSave: _cache[0] || (_cache[0] = ($event) => saveItem($event))
|
|
5868
|
+
}, null, 8, [
|
|
5869
|
+
"allow-deletion",
|
|
5870
|
+
"embed-element-config",
|
|
5871
|
+
"embeds",
|
|
5872
|
+
"is-expanded",
|
|
5873
|
+
"is-focused",
|
|
5874
|
+
"is-readonly",
|
|
5875
|
+
"item",
|
|
5876
|
+
"position",
|
|
5877
|
+
"onDelete"
|
|
5878
|
+
]);
|
|
5879
|
+
}), 128))]),
|
|
5862
5880
|
_: 1
|
|
5863
|
-
}
|
|
5864
|
-
key: 0,
|
|
5865
|
-
class: "mt-6",
|
|
5866
|
-
"prepend-icon": "mdi-card-plus-outline",
|
|
5867
|
-
text: "Add Card",
|
|
5868
|
-
variant: "text",
|
|
5869
|
-
onClick: addCard
|
|
5870
|
-
})) : (0, vue.createCommentVNode)("", true)])]),
|
|
5881
|
+
})) : (0, vue.createCommentVNode)("", true)]),
|
|
5871
5882
|
_: 1
|
|
5872
|
-
})
|
|
5883
|
+
}, 8, ["modelValue"]), !__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
|
|
5884
|
+
key: 0,
|
|
5885
|
+
class: "mt-4",
|
|
5886
|
+
"prepend-icon": "mdi-plus",
|
|
5887
|
+
text: "Add Card",
|
|
5888
|
+
variant: "text",
|
|
5889
|
+
onClick: addCard
|
|
5890
|
+
})) : (0, vue.createCommentVNode)("", true)]);
|
|
5873
5891
|
};
|
|
5874
5892
|
}
|
|
5875
|
-
}), [["__scopeId", "data-v-
|
|
5893
|
+
}), [["__scopeId", "data-v-4b1514a0"]]);
|
|
5876
5894
|
//#endregion
|
|
5877
5895
|
//#region src/components/TopToolbar.vue
|
|
5878
5896
|
var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -5883,6 +5901,10 @@ var TopToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5883
5901
|
const elementBus = (0, vue.inject)("$elementBus");
|
|
5884
5902
|
const form = (0, vue.ref)();
|
|
5885
5903
|
const height = (0, vue.ref)(props.element.data.height);
|
|
5904
|
+
(0, vue.watch)(() => props.element.data.height, (value) => {
|
|
5905
|
+
if (value === height.value) return;
|
|
5906
|
+
height.value = value;
|
|
5907
|
+
});
|
|
5886
5908
|
(0, vue.watch)(height, debounce(async () => {
|
|
5887
5909
|
if (!form.value) return;
|
|
5888
5910
|
const { valid } = await form.value.validate();
|
package/dist/index.css
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
.
|
|
2
|
-
border: thin solid rgba(0, 0, 0, 0.12);
|
|
3
|
-
}
|
|
4
|
-
.flashcard-drag-handle[data-v-bd92ec6b] {
|
|
1
|
+
.flashcard-drag-handle[data-v-462cae17] {
|
|
5
2
|
cursor: pointer;
|
|
6
|
-
}
|
|
7
|
-
text-align: left;
|
|
8
|
-
}
|
|
9
|
-
[data-v-a6cbf847] .sortable-ghost > * {
|
|
3
|
+
}[data-v-4b1514a0] .sortable-ghost > * {
|
|
10
4
|
visibility: hidden;
|
|
11
5
|
}
|
package/dist/index.js
CHANGED
|
@@ -3666,6 +3666,39 @@ function isEmpty(value) {
|
|
|
3666
3666
|
return true;
|
|
3667
3667
|
}
|
|
3668
3668
|
//#endregion
|
|
3669
|
+
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
|
|
3670
|
+
/**
|
|
3671
|
+
* Performs a deep comparison between two values to determine if they are
|
|
3672
|
+
* equivalent.
|
|
3673
|
+
*
|
|
3674
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
3675
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
3676
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
3677
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
3678
|
+
* nodes are compared by strict equality, i.e. `===`.
|
|
3679
|
+
*
|
|
3680
|
+
* @static
|
|
3681
|
+
* @memberOf _
|
|
3682
|
+
* @since 0.1.0
|
|
3683
|
+
* @category Lang
|
|
3684
|
+
* @param {*} value The value to compare.
|
|
3685
|
+
* @param {*} other The other value to compare.
|
|
3686
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
3687
|
+
* @example
|
|
3688
|
+
*
|
|
3689
|
+
* var object = { 'a': 1 };
|
|
3690
|
+
* var other = { 'a': 1 };
|
|
3691
|
+
*
|
|
3692
|
+
* _.isEqual(object, other);
|
|
3693
|
+
* // => true
|
|
3694
|
+
*
|
|
3695
|
+
* object === other;
|
|
3696
|
+
* // => false
|
|
3697
|
+
*/
|
|
3698
|
+
function isEqual(value, other) {
|
|
3699
|
+
return baseIsEqual(value, other);
|
|
3700
|
+
}
|
|
3701
|
+
//#endregion
|
|
3669
3702
|
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.js
|
|
3670
3703
|
/** `Object#toString` result references. */
|
|
3671
3704
|
var numberTag = "[object Number]";
|
|
@@ -5534,7 +5567,7 @@ Bt.mounted, Bt.unmounted;
|
|
|
5534
5567
|
//#endregion
|
|
5535
5568
|
//#region src/components/FlashcardItem.vue?vue&type=script&setup=true&lang.ts
|
|
5536
5569
|
var _hoisted_1$1 = { class: "d-flex align-center w-100" };
|
|
5537
|
-
var _hoisted_2
|
|
5570
|
+
var _hoisted_2 = { class: "ml-2" };
|
|
5538
5571
|
var _hoisted_3 = { class: "text-title-small text-left mt-1" };
|
|
5539
5572
|
var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5540
5573
|
__name: "FlashcardItem",
|
|
@@ -5614,11 +5647,13 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
5614
5647
|
const _component_VExpansionPanelText = resolveComponent("VExpansionPanelText");
|
|
5615
5648
|
const _component_VExpansionPanel = resolveComponent("VExpansionPanel");
|
|
5616
5649
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
5617
|
-
return openBlock(), createBlock(_component_VExpansionPanel, {
|
|
5650
|
+
return openBlock(), createBlock(_component_VExpansionPanel, {
|
|
5651
|
+
value: __props.item.id,
|
|
5652
|
+
class: "border sm"
|
|
5653
|
+
}, {
|
|
5618
5654
|
default: withCtx(() => [createVNode(_component_VHover, null, {
|
|
5619
5655
|
default: withCtx(({ isHovering, props: hoverProps }) => [createVNode(_component_VExpansionPanelTitle, mergeProps(hoverProps, {
|
|
5620
5656
|
class: "pa-2 pr-4",
|
|
5621
|
-
color: "primary-lighten-5",
|
|
5622
5657
|
"min-height": "56"
|
|
5623
5658
|
}), {
|
|
5624
5659
|
default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [
|
|
@@ -5627,7 +5662,7 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
5627
5662
|
class: "flashcard-drag-handle",
|
|
5628
5663
|
onDrag: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop", "prevent"]))
|
|
5629
5664
|
}, [createVNode(_component_VIcon, { icon: "mdi-drag-vertical" })], 32)) : createCommentVNode("", true),
|
|
5630
|
-
createElementVNode("span", _hoisted_2
|
|
5665
|
+
createElementVNode("span", _hoisted_2, "Card " + toDisplayString(__props.position), 1),
|
|
5631
5666
|
createVNode(_component_VSpacer),
|
|
5632
5667
|
createVNode(_component_VFadeTransition, null, {
|
|
5633
5668
|
default: withCtx(() => [(isHovering || __props.isExpanded) && !__props.isReadonly && __props.allowDeletion ? withDirectives((openBlock(), createBlock(_component_VBtn, {
|
|
@@ -5662,7 +5697,8 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
5662
5697
|
key: 0,
|
|
5663
5698
|
class: "mt-4",
|
|
5664
5699
|
icon: "mdi-information-outline",
|
|
5665
|
-
variant: "tonal"
|
|
5700
|
+
variant: "tonal",
|
|
5701
|
+
prominent: ""
|
|
5666
5702
|
}, {
|
|
5667
5703
|
default: withCtx(() => [__props.isReadonly ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" No content elements added to this side. ")], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Click the button below to add a content element. ")], 64))]),
|
|
5668
5704
|
_: 1
|
|
@@ -5693,7 +5729,6 @@ var FlashcardItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
5693
5729
|
border: ""
|
|
5694
5730
|
}, {
|
|
5695
5731
|
default: withCtx(() => [createVNode(_component_VIcon, {
|
|
5696
|
-
class: "text-medium-emphasis",
|
|
5697
5732
|
icon: "mdi-sync",
|
|
5698
5733
|
size: "18"
|
|
5699
5734
|
})]),
|
|
@@ -5719,11 +5754,10 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
5719
5754
|
};
|
|
5720
5755
|
//#endregion
|
|
5721
5756
|
//#region src/components/FlashcardItem.vue
|
|
5722
|
-
var FlashcardItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FlashcardItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5757
|
+
var FlashcardItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(FlashcardItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-462cae17"]]);
|
|
5723
5758
|
//#endregion
|
|
5724
5759
|
//#region src/components/Edit.vue?vue&type=script&setup=true&lang.ts
|
|
5725
|
-
var _hoisted_1 = { class: "text-
|
|
5726
|
-
var _hoisted_2 = { class: "pa-6 text-center" };
|
|
5760
|
+
var _hoisted_1 = { class: "tce-flashcards text-center" };
|
|
5727
5761
|
//#endregion
|
|
5728
5762
|
//#region src/components/Edit.vue
|
|
5729
5763
|
var Edit_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -5792,83 +5826,67 @@ var Edit_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
|
|
|
5792
5826
|
emit("save", elementData);
|
|
5793
5827
|
}
|
|
5794
5828
|
});
|
|
5829
|
+
watch(() => props.element.data, (data) => {
|
|
5830
|
+
if (isEqual(data, elementData)) return;
|
|
5831
|
+
Object.assign(elementData, cloneDeep(data));
|
|
5832
|
+
});
|
|
5795
5833
|
return (_ctx, _cache) => {
|
|
5796
|
-
const _component_VIcon = resolveComponent("VIcon");
|
|
5797
|
-
const _component_VToolbar = resolveComponent("VToolbar");
|
|
5798
5834
|
const _component_VExpandTransition = resolveComponent("VExpandTransition");
|
|
5799
5835
|
const _component_VExpansionPanels = resolveComponent("VExpansionPanels");
|
|
5800
5836
|
const _component_VBtn = resolveComponent("VBtn");
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5837
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_VExpansionPanels, {
|
|
5838
|
+
ref_key: "panels",
|
|
5839
|
+
ref: panels,
|
|
5840
|
+
modelValue: expanded.value,
|
|
5841
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
|
|
5842
|
+
class: "text-left",
|
|
5843
|
+
rounded: "lg",
|
|
5844
|
+
flat: "",
|
|
5845
|
+
multiple: ""
|
|
5805
5846
|
}, {
|
|
5806
|
-
default: withCtx(() => [
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
height: "36"
|
|
5810
|
-
}, {
|
|
5811
|
-
default: withCtx(() => [createVNode(_component_VIcon, {
|
|
5812
|
-
icon: unref(manifest$1).ui.icon,
|
|
5813
|
-
color: "secondary-lighten-2",
|
|
5814
|
-
size: "18",
|
|
5815
|
-
start: ""
|
|
5816
|
-
}, null, 8, ["icon"]), createElementVNode("span", _hoisted_1, toDisplayString(unref(manifest$1).name), 1)]),
|
|
5817
|
-
_: 1
|
|
5818
|
-
}), createElementVNode("div", _hoisted_2, [createVNode(_component_VExpansionPanels, {
|
|
5819
|
-
ref_key: "panels",
|
|
5820
|
-
ref: panels,
|
|
5821
|
-
modelValue: expanded.value,
|
|
5822
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
|
|
5823
|
-
rounded: "lg",
|
|
5824
|
-
flat: "",
|
|
5825
|
-
multiple: ""
|
|
5847
|
+
default: withCtx(() => [!!cardCount.value ? (openBlock(), createBlock(_component_VExpandTransition, {
|
|
5848
|
+
key: 0,
|
|
5849
|
+
group: ""
|
|
5826
5850
|
}, {
|
|
5827
|
-
default: withCtx(() => [
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
"position",
|
|
5853
|
-
"onDelete"
|
|
5854
|
-
]);
|
|
5855
|
-
}), 128))]),
|
|
5856
|
-
_: 1
|
|
5857
|
-
})) : createCommentVNode("", true)]),
|
|
5851
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(cards.value, (item, index) => {
|
|
5852
|
+
return openBlock(), createBlock(FlashcardItem_default, {
|
|
5853
|
+
key: item.id,
|
|
5854
|
+
"allow-deletion": cardCount.value > 1,
|
|
5855
|
+
"embed-element-config": __props.embedElementConfig,
|
|
5856
|
+
embeds: embedsByFace.value[item.id],
|
|
5857
|
+
"is-expanded": expanded.value.includes(item.id),
|
|
5858
|
+
"is-focused": __props.isFocused,
|
|
5859
|
+
"is-readonly": __props.isReadonly,
|
|
5860
|
+
item,
|
|
5861
|
+
position: index + 1,
|
|
5862
|
+
onDelete: ($event) => deleteItem(item.id),
|
|
5863
|
+
onSave: _cache[0] || (_cache[0] = ($event) => saveItem($event))
|
|
5864
|
+
}, null, 8, [
|
|
5865
|
+
"allow-deletion",
|
|
5866
|
+
"embed-element-config",
|
|
5867
|
+
"embeds",
|
|
5868
|
+
"is-expanded",
|
|
5869
|
+
"is-focused",
|
|
5870
|
+
"is-readonly",
|
|
5871
|
+
"item",
|
|
5872
|
+
"position",
|
|
5873
|
+
"onDelete"
|
|
5874
|
+
]);
|
|
5875
|
+
}), 128))]),
|
|
5858
5876
|
_: 1
|
|
5859
|
-
}
|
|
5860
|
-
key: 0,
|
|
5861
|
-
class: "mt-6",
|
|
5862
|
-
"prepend-icon": "mdi-card-plus-outline",
|
|
5863
|
-
text: "Add Card",
|
|
5864
|
-
variant: "text",
|
|
5865
|
-
onClick: addCard
|
|
5866
|
-
})) : createCommentVNode("", true)])]),
|
|
5877
|
+
})) : createCommentVNode("", true)]),
|
|
5867
5878
|
_: 1
|
|
5868
|
-
})
|
|
5879
|
+
}, 8, ["modelValue"]), !__props.isReadonly ? (openBlock(), createBlock(_component_VBtn, {
|
|
5880
|
+
key: 0,
|
|
5881
|
+
class: "mt-4",
|
|
5882
|
+
"prepend-icon": "mdi-plus",
|
|
5883
|
+
text: "Add Card",
|
|
5884
|
+
variant: "text",
|
|
5885
|
+
onClick: addCard
|
|
5886
|
+
})) : createCommentVNode("", true)]);
|
|
5869
5887
|
};
|
|
5870
5888
|
}
|
|
5871
|
-
}), [["__scopeId", "data-v-
|
|
5889
|
+
}), [["__scopeId", "data-v-4b1514a0"]]);
|
|
5872
5890
|
//#endregion
|
|
5873
5891
|
//#region src/components/TopToolbar.vue
|
|
5874
5892
|
var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
@@ -5879,6 +5897,10 @@ var TopToolbar_default = /* @__PURE__ */ defineComponent({
|
|
|
5879
5897
|
const elementBus = inject("$elementBus");
|
|
5880
5898
|
const form = ref();
|
|
5881
5899
|
const height = ref(props.element.data.height);
|
|
5900
|
+
watch(() => props.element.data.height, (value) => {
|
|
5901
|
+
if (value === height.value) return;
|
|
5902
|
+
height.value = value;
|
|
5903
|
+
});
|
|
5882
5904
|
watch(height, debounce(async () => {
|
|
5883
5905
|
if (!form.value) return;
|
|
5884
5906
|
const { valid } = await form.value.validate();
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Tailor CMS flashcards element authoring component",
|
|
4
4
|
"author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.3",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
33
33
|
"vue-tsc": "^3.3.3",
|
|
34
34
|
"vuetify": "^4.0.6",
|
|
35
|
-
"@tailor-cms/ce-flashcards-manifest": "0.0.
|
|
35
|
+
"@tailor-cms/ce-flashcards-manifest": "0.0.3"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|