@sepveneto/dnde 0.4.3 → 0.5.1
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/Editor.vue.d.ts +6 -2
- package/dist/editor.js +91 -21
- package/package.json +1 -1
package/dist/Editor.vue.d.ts
CHANGED
|
@@ -125,7 +125,9 @@ declare const _default: Vue.DefineComponent<Vue.ExtractPropTypes<{
|
|
|
125
125
|
_view: "page";
|
|
126
126
|
list: any[];
|
|
127
127
|
}): void;
|
|
128
|
-
}, {}, {}, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin, {
|
|
128
|
+
}, {}, {}, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin, {
|
|
129
|
+
change: (...args: any[]) => void;
|
|
130
|
+
}, string, Vue.PublicProps, Readonly<Vue.ExtractPropTypes<{
|
|
129
131
|
readonly remoteUrl: {
|
|
130
132
|
readonly type: StringConstructor;
|
|
131
133
|
readonly required: true;
|
|
@@ -138,7 +140,9 @@ declare const _default: Vue.DefineComponent<Vue.ExtractPropTypes<{
|
|
|
138
140
|
readonly type: Vue.PropType<Record<string, any>>;
|
|
139
141
|
readonly default: () => {};
|
|
140
142
|
};
|
|
141
|
-
}>> & Readonly<{
|
|
143
|
+
}>> & Readonly<{
|
|
144
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
145
|
+
}>, {
|
|
142
146
|
readonly widgets: import("./store").LikeWidget[];
|
|
143
147
|
readonly extra: Record<string, any>;
|
|
144
148
|
}, {}, {}, {}, string, Vue.ComponentProvideOptions, true, {}, any>;
|
package/dist/editor.js
CHANGED
|
@@ -18013,7 +18013,7 @@ function apply(func, thisArg, args) {
|
|
|
18013
18013
|
* _.times(2, _.noop);
|
|
18014
18014
|
* // => [undefined, undefined]
|
|
18015
18015
|
*/
|
|
18016
|
-
function noop$
|
|
18016
|
+
function noop$3() {
|
|
18017
18017
|
// No operation performed.
|
|
18018
18018
|
}
|
|
18019
18019
|
|
|
@@ -22651,7 +22651,7 @@ var INFINITY$1 = 1 / 0;
|
|
|
22651
22651
|
* @param {Array} values The values to add to the set.
|
|
22652
22652
|
* @returns {Object} Returns the new set.
|
|
22653
22653
|
*/
|
|
22654
|
-
var createSet = !(Set$1 && (1 / setToArray(new Set$1([,-0]))[1]) == INFINITY$1) ? noop$
|
|
22654
|
+
var createSet = !(Set$1 && (1 / setToArray(new Set$1([,-0]))[1]) == INFINITY$1) ? noop$3 : function(values) {
|
|
22655
22655
|
return new Set$1(values);
|
|
22656
22656
|
};
|
|
22657
22657
|
|
|
@@ -22786,7 +22786,7 @@ const isDef = (val) => typeof val !== "undefined";
|
|
|
22786
22786
|
const isFunction = (val) => typeof val === "function";
|
|
22787
22787
|
const isString$1 = (val) => typeof val === "string";
|
|
22788
22788
|
const clamp$1 = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
22789
|
-
const noop$
|
|
22789
|
+
const noop$2 = () => {
|
|
22790
22790
|
};
|
|
22791
22791
|
const isIOS = isClient$1 && ((_a$2 = window == null ? void 0 : window.navigator) == null ? void 0 : _a$2.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
22792
22792
|
|
|
@@ -22794,7 +22794,7 @@ function resolveUnref(r) {
|
|
|
22794
22794
|
return typeof r === "function" ? r() : unref(r);
|
|
22795
22795
|
}
|
|
22796
22796
|
|
|
22797
|
-
function createFilterWrapper(filter, fn) {
|
|
22797
|
+
function createFilterWrapper$1(filter, fn) {
|
|
22798
22798
|
function wrapper(...args) {
|
|
22799
22799
|
return new Promise((resolve, reject) => {
|
|
22800
22800
|
Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
|
|
@@ -22802,14 +22802,14 @@ function createFilterWrapper(filter, fn) {
|
|
|
22802
22802
|
}
|
|
22803
22803
|
return wrapper;
|
|
22804
22804
|
}
|
|
22805
|
-
function debounceFilter(ms, options = {}) {
|
|
22805
|
+
function debounceFilter$1(ms, options = {}) {
|
|
22806
22806
|
let timer;
|
|
22807
22807
|
let maxTimer;
|
|
22808
|
-
let lastRejector = noop$
|
|
22808
|
+
let lastRejector = noop$2;
|
|
22809
22809
|
const _clearTimeout = (timer2) => {
|
|
22810
22810
|
clearTimeout(timer2);
|
|
22811
22811
|
lastRejector();
|
|
22812
|
-
lastRejector = noop$
|
|
22812
|
+
lastRejector = noop$2;
|
|
22813
22813
|
};
|
|
22814
22814
|
const filter = (invoke) => {
|
|
22815
22815
|
const duration = resolveUnref(ms);
|
|
@@ -22847,14 +22847,14 @@ function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = fa
|
|
|
22847
22847
|
let lastExec = 0;
|
|
22848
22848
|
let timer;
|
|
22849
22849
|
let isLeading = true;
|
|
22850
|
-
let lastRejector = noop$
|
|
22850
|
+
let lastRejector = noop$2;
|
|
22851
22851
|
let lastValue;
|
|
22852
22852
|
const clear = () => {
|
|
22853
22853
|
if (timer) {
|
|
22854
22854
|
clearTimeout(timer);
|
|
22855
22855
|
timer = void 0;
|
|
22856
22856
|
lastRejector();
|
|
22857
|
-
lastRejector = noop$
|
|
22857
|
+
lastRejector = noop$2;
|
|
22858
22858
|
}
|
|
22859
22859
|
};
|
|
22860
22860
|
const filter = (_invoke) => {
|
|
@@ -22972,13 +22972,13 @@ function reactiveComputed(fn) {
|
|
|
22972
22972
|
return toReactive(computed(fn));
|
|
22973
22973
|
}
|
|
22974
22974
|
|
|
22975
|
-
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
22976
|
-
return createFilterWrapper(debounceFilter(ms, options), fn);
|
|
22975
|
+
function useDebounceFn$1(fn, ms = 200, options = {}) {
|
|
22976
|
+
return createFilterWrapper$1(debounceFilter$1(ms, options), fn);
|
|
22977
22977
|
}
|
|
22978
22978
|
|
|
22979
22979
|
function refDebounced(value, ms = 200, options = {}) {
|
|
22980
22980
|
const debounced = ref(value.value);
|
|
22981
|
-
const updater = useDebounceFn(() => {
|
|
22981
|
+
const updater = useDebounceFn$1(() => {
|
|
22982
22982
|
debounced.value = value.value;
|
|
22983
22983
|
}, ms, options);
|
|
22984
22984
|
watch(value, () => updater());
|
|
@@ -22986,7 +22986,7 @@ function refDebounced(value, ms = 200, options = {}) {
|
|
|
22986
22986
|
}
|
|
22987
22987
|
|
|
22988
22988
|
function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
|
|
22989
|
-
return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
|
|
22989
|
+
return createFilterWrapper$1(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
|
|
22990
22990
|
}
|
|
22991
22991
|
|
|
22992
22992
|
function tryOnMounted(fn, sync = true) {
|
|
@@ -23057,7 +23057,7 @@ function useEventListener$1(...args) {
|
|
|
23057
23057
|
[target, events, listeners, options] = args;
|
|
23058
23058
|
}
|
|
23059
23059
|
if (!target)
|
|
23060
|
-
return noop$
|
|
23060
|
+
return noop$2;
|
|
23061
23061
|
if (!Array.isArray(events))
|
|
23062
23062
|
events = [events];
|
|
23063
23063
|
if (!Array.isArray(listeners))
|
|
@@ -23094,7 +23094,7 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
23094
23094
|
return;
|
|
23095
23095
|
if (isIOS && !_iOSWorkaround) {
|
|
23096
23096
|
_iOSWorkaround = true;
|
|
23097
|
-
Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", noop$
|
|
23097
|
+
Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", noop$2));
|
|
23098
23098
|
}
|
|
23099
23099
|
let shouldListen = true;
|
|
23100
23100
|
const shouldIgnore = (event) => {
|
|
@@ -23351,7 +23351,7 @@ function useIntersectionObserver(target, callback, options = {}) {
|
|
|
23351
23351
|
window = defaultWindow$1
|
|
23352
23352
|
} = options;
|
|
23353
23353
|
const isSupported = useSupported(() => window && "IntersectionObserver" in window);
|
|
23354
|
-
let cleanup = noop$
|
|
23354
|
+
let cleanup = noop$2;
|
|
23355
23355
|
const stopWatch = isSupported.value ? watch(() => ({
|
|
23356
23356
|
el: unrefElement$1(target),
|
|
23357
23357
|
root: unrefElement$1(root)
|
|
@@ -23367,9 +23367,9 @@ function useIntersectionObserver(target, callback, options = {}) {
|
|
|
23367
23367
|
observer.observe(el);
|
|
23368
23368
|
cleanup = () => {
|
|
23369
23369
|
observer.disconnect();
|
|
23370
|
-
cleanup = noop$
|
|
23370
|
+
cleanup = noop$2;
|
|
23371
23371
|
};
|
|
23372
|
-
}, { immediate: true, flush: "post" }) : noop$
|
|
23372
|
+
}, { immediate: true, flush: "post" }) : noop$2;
|
|
23373
23373
|
const stop = () => {
|
|
23374
23374
|
cleanup();
|
|
23375
23375
|
stopWatch();
|
|
@@ -82334,10 +82334,71 @@ const isClient = typeof window !== "undefined" && typeof document !== "undefined
|
|
|
82334
82334
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
82335
82335
|
const toString = Object.prototype.toString;
|
|
82336
82336
|
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
82337
|
+
const noop$1 = () => {
|
|
82338
|
+
};
|
|
82339
|
+
|
|
82340
|
+
function createFilterWrapper(filter, fn) {
|
|
82341
|
+
function wrapper(...args) {
|
|
82342
|
+
return new Promise((resolve, reject) => {
|
|
82343
|
+
Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
|
|
82344
|
+
});
|
|
82345
|
+
}
|
|
82346
|
+
return wrapper;
|
|
82347
|
+
}
|
|
82348
|
+
function debounceFilter(ms, options = {}) {
|
|
82349
|
+
let timer;
|
|
82350
|
+
let maxTimer;
|
|
82351
|
+
let lastRejector = noop$1;
|
|
82352
|
+
const _clearTimeout = (timer2) => {
|
|
82353
|
+
clearTimeout(timer2);
|
|
82354
|
+
lastRejector();
|
|
82355
|
+
lastRejector = noop$1;
|
|
82356
|
+
};
|
|
82357
|
+
let lastInvoker;
|
|
82358
|
+
const filter = (invoke) => {
|
|
82359
|
+
const duration = toValue(ms);
|
|
82360
|
+
const maxDuration = toValue(options.maxWait);
|
|
82361
|
+
if (timer)
|
|
82362
|
+
_clearTimeout(timer);
|
|
82363
|
+
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
82364
|
+
if (maxTimer) {
|
|
82365
|
+
_clearTimeout(maxTimer);
|
|
82366
|
+
maxTimer = null;
|
|
82367
|
+
}
|
|
82368
|
+
return Promise.resolve(invoke());
|
|
82369
|
+
}
|
|
82370
|
+
return new Promise((resolve, reject) => {
|
|
82371
|
+
lastRejector = options.rejectOnCancel ? reject : resolve;
|
|
82372
|
+
lastInvoker = invoke;
|
|
82373
|
+
if (maxDuration && !maxTimer) {
|
|
82374
|
+
maxTimer = setTimeout(() => {
|
|
82375
|
+
if (timer)
|
|
82376
|
+
_clearTimeout(timer);
|
|
82377
|
+
maxTimer = null;
|
|
82378
|
+
resolve(lastInvoker());
|
|
82379
|
+
}, maxDuration);
|
|
82380
|
+
}
|
|
82381
|
+
timer = setTimeout(() => {
|
|
82382
|
+
if (maxTimer)
|
|
82383
|
+
_clearTimeout(maxTimer);
|
|
82384
|
+
maxTimer = null;
|
|
82385
|
+
resolve(invoke());
|
|
82386
|
+
}, duration);
|
|
82387
|
+
});
|
|
82388
|
+
};
|
|
82389
|
+
return filter;
|
|
82390
|
+
}
|
|
82337
82391
|
function toArray(value) {
|
|
82338
82392
|
return Array.isArray(value) ? value : [value];
|
|
82339
82393
|
}
|
|
82340
82394
|
|
|
82395
|
+
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
82396
|
+
return createFilterWrapper(
|
|
82397
|
+
debounceFilter(ms, options),
|
|
82398
|
+
fn
|
|
82399
|
+
);
|
|
82400
|
+
}
|
|
82401
|
+
|
|
82341
82402
|
function watchImmediate(source, cb, options) {
|
|
82342
82403
|
return watch(
|
|
82343
82404
|
source,
|
|
@@ -105495,7 +105556,7 @@ const useEditor = defineStore("editor", () => {
|
|
|
105495
105556
|
}
|
|
105496
105557
|
function setData(data) {
|
|
105497
105558
|
const widget2 = app.widgetMap.get(data._view) || defaultPage;
|
|
105498
|
-
const { style, list, data: props } = data;
|
|
105559
|
+
const { style, list = [], data: props } = data;
|
|
105499
105560
|
const info = {
|
|
105500
105561
|
props,
|
|
105501
105562
|
style,
|
|
@@ -106847,7 +106908,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
106847
106908
|
default: withCtx(() => [
|
|
106848
106909
|
createVNode(unref(ViewRender), {
|
|
106849
106910
|
type: element.type,
|
|
106850
|
-
config: element
|
|
106911
|
+
config: element
|
|
106851
106912
|
}, null, 8, ["type", "config"])
|
|
106852
106913
|
]),
|
|
106853
106914
|
_: 2
|
|
@@ -106894,7 +106955,9 @@ const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["styles", [_style_0]]]);
|
|
|
106894
106955
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
106895
106956
|
__name: "Editor",
|
|
106896
106957
|
props: editorProps,
|
|
106897
|
-
|
|
106958
|
+
emits: ["change"],
|
|
106959
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
106960
|
+
const emit = __emit;
|
|
106898
106961
|
runtimeExports.init({
|
|
106899
106962
|
name: "editor",
|
|
106900
106963
|
remotes: [],
|
|
@@ -106920,6 +106983,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
106920
106983
|
}
|
|
106921
106984
|
const editor = useEditor();
|
|
106922
106985
|
editor.shadowRoot = useShadowRoot();
|
|
106986
|
+
const updateModelValue = useDebounceFn(() => {
|
|
106987
|
+
const data = editor.getData();
|
|
106988
|
+
emit("change", data);
|
|
106989
|
+
}, 1e3);
|
|
106990
|
+
watch(() => editor.rootNode, () => {
|
|
106991
|
+
updateModelValue();
|
|
106992
|
+
}, { deep: true });
|
|
106923
106993
|
window.__shadowdom_css_runtime__ = async (tagLink) => {
|
|
106924
106994
|
try {
|
|
106925
106995
|
const res = await fetch(tagLink.href);
|