mce 0.13.7 → 0.13.9
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/README.md
CHANGED
|
@@ -104,9 +104,9 @@ npm i mce
|
|
|
104
104
|
<template #transformer="{ box }" />
|
|
105
105
|
<template #floatbar />
|
|
106
106
|
<template #drawboard />
|
|
107
|
-
<EditorLayoutItem
|
|
108
|
-
<EditorLayoutItem
|
|
109
|
-
<EditorLayoutItem
|
|
107
|
+
<EditorLayoutItem position="top" :size="56" />
|
|
108
|
+
<EditorLayoutItem position="left" :size="380" />
|
|
109
|
+
<EditorLayoutItem position="right" :size="260" />
|
|
110
110
|
</EditorLayout>
|
|
111
111
|
</div>
|
|
112
112
|
</template>
|
|
@@ -5,6 +5,11 @@ type __VLS_Slots = {} & {
|
|
|
5
5
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
6
|
overlaps: import("vue").Prop<string[]>;
|
|
7
7
|
fullHeight: BooleanConstructor;
|
|
8
|
+
class: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
9
|
+
style: {
|
|
10
|
+
type: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
11
|
+
default: null;
|
|
12
|
+
};
|
|
8
13
|
}>, {
|
|
9
14
|
items: import("vue").ComputedRef<{
|
|
10
15
|
size: number;
|
|
@@ -27,7 +32,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
27
32
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
33
|
overlaps: import("vue").Prop<string[]>;
|
|
29
34
|
fullHeight: BooleanConstructor;
|
|
35
|
+
class: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
36
|
+
style: {
|
|
37
|
+
type: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
38
|
+
default: null;
|
|
39
|
+
};
|
|
30
40
|
}>> & Readonly<{}>, {
|
|
41
|
+
style: string | unknown[] | Record<string, any>;
|
|
31
42
|
fullHeight: boolean;
|
|
32
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -11,7 +11,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
11
11
|
type: (NumberConstructor | StringConstructor)[];
|
|
12
12
|
default: number;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
class: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
15
|
+
style: {
|
|
16
|
+
type: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
17
|
+
default: null;
|
|
18
|
+
};
|
|
15
19
|
position: {
|
|
16
20
|
type: PropType<"top" | "right" | "bottom" | "left">;
|
|
17
21
|
required: true;
|
|
@@ -32,7 +36,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
32
36
|
type: (NumberConstructor | StringConstructor)[];
|
|
33
37
|
default: number;
|
|
34
38
|
};
|
|
35
|
-
|
|
39
|
+
class: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
40
|
+
style: {
|
|
41
|
+
type: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
42
|
+
default: null;
|
|
43
|
+
};
|
|
36
44
|
position: {
|
|
37
45
|
type: PropType<"top" | "right" | "bottom" | "left">;
|
|
38
46
|
required: true;
|
|
@@ -47,7 +55,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
47
55
|
};
|
|
48
56
|
}>> & Readonly<{}>, {
|
|
49
57
|
size: string | number;
|
|
50
|
-
|
|
58
|
+
style: string | unknown[] | Record<string, any>;
|
|
51
59
|
order: string | number;
|
|
52
60
|
modelValue: boolean;
|
|
53
61
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -20,7 +20,6 @@ interface LayoutProvide {
|
|
|
20
20
|
elementSize: Ref<number | string | undefined>;
|
|
21
21
|
active: Ref<boolean>;
|
|
22
22
|
disableTransitions?: Ref<boolean>;
|
|
23
|
-
absolute: Ref<boolean | undefined>;
|
|
24
23
|
}) => {
|
|
25
24
|
layoutItemStyles: Ref<CSSProperties>;
|
|
26
25
|
layoutItemScrimStyles: Ref<CSSProperties>;
|
|
@@ -50,7 +49,6 @@ export declare function makeLayoutItemProps(): {
|
|
|
50
49
|
type: (NumberConstructor | StringConstructor)[];
|
|
51
50
|
default: number;
|
|
52
51
|
};
|
|
53
|
-
absolute: BooleanConstructor;
|
|
54
52
|
};
|
|
55
53
|
export declare function useLayout(): {
|
|
56
54
|
getLayoutItem: (id: string) => LayoutItem | undefined;
|
|
@@ -65,7 +63,6 @@ export declare function useLayoutItem(options: {
|
|
|
65
63
|
elementSize: Ref<number | string | undefined>;
|
|
66
64
|
active: Ref<boolean>;
|
|
67
65
|
disableTransitions?: Ref<boolean>;
|
|
68
|
-
absolute: Ref<boolean | undefined>;
|
|
69
66
|
}): {
|
|
70
67
|
layoutItemStyles: Ref<CSSProperties, CSSProperties>;
|
|
71
68
|
layoutRect: Ref<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -6571,7 +6571,7 @@ function useResizeObserver(callback, box = "content") {
|
|
|
6571
6571
|
}
|
|
6572
6572
|
const MceLayoutKey = Symbol.for("mce:layout");
|
|
6573
6573
|
const MceLayoutItemKey = Symbol.for("mce:layout-item");
|
|
6574
|
-
const ROOT_ZINDEX =
|
|
6574
|
+
const ROOT_ZINDEX = 500;
|
|
6575
6575
|
function makeLayoutProps() {
|
|
6576
6576
|
return {
|
|
6577
6577
|
overlaps: {
|
|
@@ -6589,8 +6589,7 @@ function makeLayoutItemProps() {
|
|
|
6589
6589
|
order: {
|
|
6590
6590
|
type: [Number, String],
|
|
6591
6591
|
default: 0
|
|
6592
|
-
}
|
|
6593
|
-
absolute: Boolean
|
|
6592
|
+
}
|
|
6594
6593
|
};
|
|
6595
6594
|
}
|
|
6596
6595
|
function useLayout() {
|
|
@@ -6726,8 +6725,7 @@ function createLayout(props) {
|
|
|
6726
6725
|
layoutSize,
|
|
6727
6726
|
elementSize,
|
|
6728
6727
|
active,
|
|
6729
|
-
disableTransitions
|
|
6730
|
-
absolute
|
|
6728
|
+
disableTransitions
|
|
6731
6729
|
}) => {
|
|
6732
6730
|
priorities.set(id, order);
|
|
6733
6731
|
positions.set(id, position);
|
|
@@ -6751,7 +6749,6 @@ function createLayout(props) {
|
|
|
6751
6749
|
[position.value]: 0,
|
|
6752
6750
|
zIndex: zIndex.value,
|
|
6753
6751
|
transform: `translate${isHorizontal ? "X" : "Y"}(${(active.value ? 0 : -(size === 0 ? 100 : size)) * (isOppositeHorizontal || isOppositeVertical ? -1 : 1)}${unit})`,
|
|
6754
|
-
position: absolute.value || rootZIndex.value !== ROOT_ZINDEX ? "absolute" : "fixed",
|
|
6755
6752
|
...transitionsEnabled.value ? void 0 : { transition: "none" }
|
|
6756
6753
|
};
|
|
6757
6754
|
if (!isMounted.value)
|
|
@@ -9409,6 +9406,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
9409
9406
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
9410
9407
|
__name: "Layout",
|
|
9411
9408
|
props: {
|
|
9409
|
+
class: [String, Array, Object],
|
|
9410
|
+
style: {
|
|
9411
|
+
type: [String, Array, Object],
|
|
9412
|
+
default: null
|
|
9413
|
+
},
|
|
9412
9414
|
...makeLayoutProps()
|
|
9413
9415
|
},
|
|
9414
9416
|
setup(__props, { expose: __expose }) {
|
|
@@ -9427,8 +9429,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
9427
9429
|
return (_ctx, _cache) => {
|
|
9428
9430
|
return openBlock(), createElementBlock("div", {
|
|
9429
9431
|
ref: unref(layoutRef),
|
|
9430
|
-
class: normalizeClass([unref(layoutClasses)]),
|
|
9431
|
-
style: normalizeStyle([unref(layoutStyles)])
|
|
9432
|
+
class: normalizeClass(normalizeClass([unref(layoutClasses), props.class])),
|
|
9433
|
+
style: normalizeStyle(normalizeStyle([unref(layoutStyles), props.style]))
|
|
9432
9434
|
}, [
|
|
9433
9435
|
renderSlot(_ctx.$slots, "default")
|
|
9434
9436
|
], 6);
|
|
@@ -9438,6 +9440,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
9438
9440
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
9439
9441
|
__name: "LayoutItem",
|
|
9440
9442
|
props: {
|
|
9443
|
+
class: [String, Array, Object],
|
|
9444
|
+
style: {
|
|
9445
|
+
type: [String, Array, Object],
|
|
9446
|
+
default: null
|
|
9447
|
+
},
|
|
9441
9448
|
position: {
|
|
9442
9449
|
type: String,
|
|
9443
9450
|
required: true
|
|
@@ -9460,15 +9467,16 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
9460
9467
|
position: toRef(() => props.position),
|
|
9461
9468
|
elementSize: toRef(() => props.size),
|
|
9462
9469
|
layoutSize: toRef(() => props.size),
|
|
9463
|
-
active: toRef(() => props.modelValue)
|
|
9464
|
-
absolute: toRef(() => props.absolute)
|
|
9470
|
+
active: toRef(() => props.modelValue)
|
|
9465
9471
|
});
|
|
9466
9472
|
return (_ctx, _cache) => {
|
|
9467
9473
|
return openBlock(), createElementBlock("div", {
|
|
9468
|
-
class: normalizeClass([
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9474
|
+
class: normalizeClass(normalizeClass([
|
|
9475
|
+
"mce-layout-item",
|
|
9476
|
+
`mce-layout-item--${props.position}`,
|
|
9477
|
+
props.class
|
|
9478
|
+
])),
|
|
9479
|
+
style: normalizeStyle(normalizeStyle([unref(layoutItemStyles), props.style]))
|
|
9472
9480
|
}, [
|
|
9473
9481
|
renderSlot(_ctx.$slots, "default")
|
|
9474
9482
|
], 6);
|