@sepveneto/free-dom 0.3.0 → 0.4.0-beta.0
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.css +3 -1
- package/dist/index.js +20 -7
- package/dist/index.mjs +22 -8
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ../../../../../../../tmp/tmp-
|
|
1
|
+
/* ../../../../../../../tmp/tmp-1773-CH54J03asN0x/core/src/style/index.css */
|
|
2
2
|
:root {
|
|
3
3
|
--free-dom-theme: #4089ef;
|
|
4
4
|
--free-dom-line: var(--free-dom-theme);
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
}
|
|
24
24
|
.free-dom__widget-wrapper {
|
|
25
25
|
display: inline-block;
|
|
26
|
+
box-sizing: border-box;
|
|
26
27
|
border: 1px dashed transparent;
|
|
27
28
|
transition: border-color 0.3s;
|
|
28
29
|
box-sizing: content-box;
|
|
29
30
|
user-select: none;
|
|
31
|
+
overflow: hidden;
|
|
30
32
|
}
|
|
31
33
|
.free-dom__widget-wrapper.is-absolute {
|
|
32
34
|
position: absolute;
|
package/dist/index.js
CHANGED
|
@@ -416,10 +416,25 @@ var FreeDom = (0, import_vue_demi2.defineComponent)({
|
|
|
416
416
|
onMousedown: (evt) => this.onMousedownDot(evt, dot)
|
|
417
417
|
});
|
|
418
418
|
}) : null;
|
|
419
|
-
const
|
|
419
|
+
const defaultSlots = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default;
|
|
420
|
+
if (!defaultSlots) {
|
|
421
|
+
console.error("[free-dom] must have a default slot");
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
if (defaultSlots.length > 1) {
|
|
425
|
+
console.error("[free-dom] must have only one default slot");
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
const defaultSlot = defaultSlots[0];
|
|
429
|
+
const node = (0, import_vue_demi2.cloneVNode)(defaultSlot);
|
|
430
|
+
if (Array.isArray(node.children)) {
|
|
431
|
+
node.children = [...node.children, ...dots];
|
|
432
|
+
} else {
|
|
433
|
+
console.error("[free-dom] generate resiable handles failed");
|
|
434
|
+
}
|
|
420
435
|
if (import_vue_demi2.isVue2) {
|
|
421
436
|
return (0, import_vue_demi2.h)(
|
|
422
|
-
|
|
437
|
+
node,
|
|
423
438
|
{
|
|
424
439
|
class: [
|
|
425
440
|
"free-dom__widget-wrapper",
|
|
@@ -433,12 +448,11 @@ var FreeDom = (0, import_vue_demi2.defineComponent)({
|
|
|
433
448
|
on: {
|
|
434
449
|
mousedown: this.onMousedown
|
|
435
450
|
}
|
|
436
|
-
}
|
|
437
|
-
[dots, defaultSlot]
|
|
451
|
+
}
|
|
438
452
|
);
|
|
439
453
|
}
|
|
440
454
|
return (0, import_vue_demi2.h)(
|
|
441
|
-
|
|
455
|
+
node,
|
|
442
456
|
{
|
|
443
457
|
ref: "widgetRef",
|
|
444
458
|
class: [
|
|
@@ -450,8 +464,7 @@ var FreeDom = (0, import_vue_demi2.defineComponent)({
|
|
|
450
464
|
],
|
|
451
465
|
style: this.wrapStyle,
|
|
452
466
|
onMousedown: this.onMousedown
|
|
453
|
-
}
|
|
454
|
-
[defaultSlot, dots]
|
|
467
|
+
}
|
|
455
468
|
);
|
|
456
469
|
}
|
|
457
470
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
reactive,
|
|
18
18
|
isVue2,
|
|
19
19
|
shallowRef,
|
|
20
|
-
watchEffect
|
|
20
|
+
watchEffect,
|
|
21
|
+
cloneVNode
|
|
21
22
|
} from "vue-demi";
|
|
22
23
|
|
|
23
24
|
// src/hooks/use-normalize-style.ts
|
|
@@ -403,10 +404,25 @@ var FreeDom = defineComponent({
|
|
|
403
404
|
onMousedown: (evt) => this.onMousedownDot(evt, dot)
|
|
404
405
|
});
|
|
405
406
|
}) : null;
|
|
406
|
-
const
|
|
407
|
+
const defaultSlots = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default;
|
|
408
|
+
if (!defaultSlots) {
|
|
409
|
+
console.error("[free-dom] must have a default slot");
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
if (defaultSlots.length > 1) {
|
|
413
|
+
console.error("[free-dom] must have only one default slot");
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
const defaultSlot = defaultSlots[0];
|
|
417
|
+
const node = cloneVNode(defaultSlot);
|
|
418
|
+
if (Array.isArray(node.children)) {
|
|
419
|
+
node.children = [...node.children, ...dots];
|
|
420
|
+
} else {
|
|
421
|
+
console.error("[free-dom] generate resiable handles failed");
|
|
422
|
+
}
|
|
407
423
|
if (isVue2) {
|
|
408
424
|
return h(
|
|
409
|
-
|
|
425
|
+
node,
|
|
410
426
|
{
|
|
411
427
|
class: [
|
|
412
428
|
"free-dom__widget-wrapper",
|
|
@@ -420,12 +436,11 @@ var FreeDom = defineComponent({
|
|
|
420
436
|
on: {
|
|
421
437
|
mousedown: this.onMousedown
|
|
422
438
|
}
|
|
423
|
-
}
|
|
424
|
-
[dots, defaultSlot]
|
|
439
|
+
}
|
|
425
440
|
);
|
|
426
441
|
}
|
|
427
442
|
return h(
|
|
428
|
-
|
|
443
|
+
node,
|
|
429
444
|
{
|
|
430
445
|
ref: "widgetRef",
|
|
431
446
|
class: [
|
|
@@ -437,8 +452,7 @@ var FreeDom = defineComponent({
|
|
|
437
452
|
],
|
|
438
453
|
style: this.wrapStyle,
|
|
439
454
|
onMousedown: this.onMousedown
|
|
440
|
-
}
|
|
441
|
-
[defaultSlot, dots]
|
|
455
|
+
}
|
|
442
456
|
);
|
|
443
457
|
}
|
|
444
458
|
});
|