@xiping/react-components 0.0.72 → 1.0.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/cjs/components/dock/Duck.d.ts +27 -0
- package/dist/cjs/components/dock/Duck.js +1 -0
- package/dist/cjs/components/dock/index.d.ts +1 -0
- package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
- package/dist/cjs/components/txt-editor/TxtEditor.d.ts +52 -0
- package/dist/cjs/components/txt-editor/TxtEditor.js +1 -0
- package/dist/cjs/components/txt-editor/index.d.ts +3 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js +2 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/config/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/validators/index.js +10 -0
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@monaco-editor/react/dist/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js +1 -0
- package/dist/cjs/react-components.css +1 -1
- package/dist/es/components/dock/Duck.d.ts +27 -0
- package/dist/es/components/dock/Duck.js +85 -0
- package/dist/es/components/dock/index.d.ts +1 -0
- package/dist/es/components/pinch-content/PinchContent.js +1 -1
- package/dist/es/components/txt-editor/TxtEditor.d.ts +52 -0
- package/dist/es/components/txt-editor/TxtEditor.js +54 -0
- package/dist/es/components/txt-editor/index.d.ts +3 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +21 -15
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js +99 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/config/index.js +8 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js +101 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.js +12 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.js +14 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js +9 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js +6 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js +18 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/validators/index.js +37 -0
- package/dist/es/node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@monaco-editor/react/dist/index.js +169 -0
- package/dist/es/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js +131 -0
- package/dist/es/react-components.css +1 -1
- package/package.json +41 -38
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { MotionProps, MotionValue } from 'motion/react';
|
|
3
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
4
|
+
export interface DockProps extends VariantProps<typeof dockVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
iconSize?: number;
|
|
7
|
+
iconMagnification?: number;
|
|
8
|
+
iconDistance?: number;
|
|
9
|
+
direction?: "top" | "middle" | "bottom";
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const dockVariants: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
13
|
+
declare const Dock: React.ForwardRefExoticComponent<DockProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
15
|
+
size?: number;
|
|
16
|
+
magnification?: number;
|
|
17
|
+
distance?: number;
|
|
18
|
+
mouseX?: MotionValue<number>;
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
props?: PropsWithChildren;
|
|
22
|
+
}
|
|
23
|
+
declare const DockIcon: {
|
|
24
|
+
({ size, magnification, distance, mouseX, className, children, ...props }: DockIconProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { Dock, DockIcon, dockVariants };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
3
|
+
import { cva as T } from "class-variance-authority";
|
|
4
|
+
import { useMotionValue as x, motion as k, useTransform as b, useSpring as w } from "motion/react";
|
|
5
|
+
import i, { useRef as A } from "react";
|
|
6
|
+
import { cn as I } from "../../utils/utils.js";
|
|
7
|
+
const y = 40, D = 60, h = 140, C = T(
|
|
8
|
+
"supports-backdrop-blur:bg-white/10 supports-backdrop-blur:dark:bg-black/10 mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border p-2 backdrop-blur-md"
|
|
9
|
+
), v = i.forwardRef(
|
|
10
|
+
({
|
|
11
|
+
className: t,
|
|
12
|
+
children: a,
|
|
13
|
+
iconSize: s = y,
|
|
14
|
+
iconMagnification: c = D,
|
|
15
|
+
iconDistance: m = h,
|
|
16
|
+
direction: n = "middle",
|
|
17
|
+
...u
|
|
18
|
+
}, r) => {
|
|
19
|
+
const o = x(1 / 0), d = () => i.Children.map(a, (e) => i.isValidElement(e) && e.type === E ? i.cloneElement(e, {
|
|
20
|
+
...e.props,
|
|
21
|
+
mouseX: o,
|
|
22
|
+
size: s,
|
|
23
|
+
magnification: c,
|
|
24
|
+
distance: m
|
|
25
|
+
}) : e);
|
|
26
|
+
return /* @__PURE__ */ g(
|
|
27
|
+
k.div,
|
|
28
|
+
{
|
|
29
|
+
ref: r,
|
|
30
|
+
onMouseMove: (e) => o.set(e.pageX),
|
|
31
|
+
onMouseLeave: () => o.set(1 / 0),
|
|
32
|
+
...u,
|
|
33
|
+
className: I(C({ className: t }), {
|
|
34
|
+
"items-start": n === "top",
|
|
35
|
+
"items-center": n === "middle",
|
|
36
|
+
"items-end": n === "bottom"
|
|
37
|
+
}),
|
|
38
|
+
children: d()
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
v.displayName = "Dock";
|
|
44
|
+
const E = ({
|
|
45
|
+
size: t = y,
|
|
46
|
+
magnification: a = D,
|
|
47
|
+
distance: s = h,
|
|
48
|
+
mouseX: c,
|
|
49
|
+
className: m,
|
|
50
|
+
children: n,
|
|
51
|
+
...u
|
|
52
|
+
}) => {
|
|
53
|
+
const r = A(null), o = Math.max(6, t * 0.2), d = x(1 / 0), e = b(c ?? d, (N) => {
|
|
54
|
+
var f;
|
|
55
|
+
const l = ((f = r.current) == null ? void 0 : f.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
56
|
+
return N - l.x - l.width / 2;
|
|
57
|
+
}), M = b(
|
|
58
|
+
e,
|
|
59
|
+
[-s, 0, s],
|
|
60
|
+
[t, a, t]
|
|
61
|
+
), p = w(M, {
|
|
62
|
+
mass: 0.1,
|
|
63
|
+
stiffness: 150,
|
|
64
|
+
damping: 12
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ g(
|
|
67
|
+
k.div,
|
|
68
|
+
{
|
|
69
|
+
ref: r,
|
|
70
|
+
style: { width: p, height: p, padding: o },
|
|
71
|
+
className: I(
|
|
72
|
+
"flex aspect-square cursor-pointer items-center justify-center rounded-full",
|
|
73
|
+
m
|
|
74
|
+
),
|
|
75
|
+
...u,
|
|
76
|
+
children: n
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
E.displayName = "DockIcon";
|
|
81
|
+
export {
|
|
82
|
+
v as Dock,
|
|
83
|
+
E as DockIcon,
|
|
84
|
+
C as dockVariants
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Duck.tsx';
|
|
@@ -12,7 +12,7 @@ const q = C([G, N, U]), o = (i) => i.preventDefault(), Q = (i) => {
|
|
|
12
12
|
canDrag: p = !0,
|
|
13
13
|
canRotate: v = !0,
|
|
14
14
|
scaleBounds: l = { min: 0.3, max: 10 },
|
|
15
|
-
wheelZoomFactor: x =
|
|
15
|
+
wheelZoomFactor: x = 1e-3
|
|
16
16
|
} = i, n = j(null);
|
|
17
17
|
F(() => {
|
|
18
18
|
var t, e, r;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { OnMount } from '@monaco-editor/react';
|
|
2
|
+
export interface TxtEditorProps {
|
|
3
|
+
/**
|
|
4
|
+
* 编辑器高度
|
|
5
|
+
* @default '500px'
|
|
6
|
+
*/
|
|
7
|
+
height?: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* 编辑器宽度
|
|
10
|
+
* @default '100%'
|
|
11
|
+
*/
|
|
12
|
+
width?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* 编辑器默认语言
|
|
15
|
+
* @default 'plaintext'
|
|
16
|
+
*/
|
|
17
|
+
language?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 编辑器默认值
|
|
20
|
+
*/
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 编辑器当前值
|
|
24
|
+
*/
|
|
25
|
+
value?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 编辑器主题
|
|
28
|
+
* @default 'light'
|
|
29
|
+
*/
|
|
30
|
+
theme?: "light" | "vs-dark";
|
|
31
|
+
/**
|
|
32
|
+
* 是否只读
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
readOnly?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 值变化回调
|
|
38
|
+
*/
|
|
39
|
+
onChange?: (value: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* 编辑器加载完成回调
|
|
42
|
+
*/
|
|
43
|
+
onMount?: OnMount;
|
|
44
|
+
/**
|
|
45
|
+
* 文本编辑器样式
|
|
46
|
+
*/
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Monaco Editor 文本编辑器组件
|
|
51
|
+
*/
|
|
52
|
+
export declare const TxtEditor: ({ height, width, language, defaultValue, value, theme, readOnly, onChange, onMount, className, }: TxtEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import c from "../../node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@monaco-editor/react/dist/index.js";
|
|
3
|
+
import { useRef as x } from "react";
|
|
4
|
+
const D = ({
|
|
5
|
+
height: o = "500px",
|
|
6
|
+
width: r = "100%",
|
|
7
|
+
language: d = "plaintext",
|
|
8
|
+
defaultValue: n,
|
|
9
|
+
value: s,
|
|
10
|
+
theme: a = "light",
|
|
11
|
+
readOnly: l = !1,
|
|
12
|
+
onChange: t,
|
|
13
|
+
onMount: i,
|
|
14
|
+
className: f
|
|
15
|
+
}) => {
|
|
16
|
+
const p = x(null);
|
|
17
|
+
return /* @__PURE__ */ u(
|
|
18
|
+
c,
|
|
19
|
+
{
|
|
20
|
+
className: f,
|
|
21
|
+
height: o,
|
|
22
|
+
width: r,
|
|
23
|
+
defaultLanguage: d,
|
|
24
|
+
defaultValue: n,
|
|
25
|
+
value: s,
|
|
26
|
+
theme: a,
|
|
27
|
+
onMount: (e, m) => {
|
|
28
|
+
p.current = e, i == null || i(e, m), e.updateOptions({
|
|
29
|
+
minimap: { enabled: !1 },
|
|
30
|
+
// 禁用小地图
|
|
31
|
+
lineNumbers: "on",
|
|
32
|
+
// 显示行号
|
|
33
|
+
roundedSelection: !1,
|
|
34
|
+
// 方形选区
|
|
35
|
+
scrollBeyondLastLine: !1,
|
|
36
|
+
// 禁止滚动到最后一行之后
|
|
37
|
+
readOnly: l,
|
|
38
|
+
// 是否只读
|
|
39
|
+
fontSize: 14
|
|
40
|
+
// 字体大小
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
onChange: (e) => {
|
|
44
|
+
t == null || t(e || "");
|
|
45
|
+
},
|
|
46
|
+
options: {
|
|
47
|
+
readOnly: l
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
D as TxtEditor
|
|
54
|
+
};
|
package/dist/es/index.d.ts
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Button as
|
|
2
|
+
import { Button as e } from "./components/button/Button.js";
|
|
3
3
|
import { TxtReader as p } from "./components/txt-reader/TxtReader.js";
|
|
4
|
-
import { HyperText as
|
|
4
|
+
import { HyperText as a } from "./components/hyper-text/index.js";
|
|
5
5
|
import { TypingAnimation as n } from "./components/typing-animation/index.js";
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { ShimmerButton as
|
|
9
|
-
import { default as
|
|
10
|
-
import { TextAnimate as
|
|
6
|
+
import { default as d } from "./components/pinch-content/PinchContent.js";
|
|
7
|
+
import { default as u } from "./components/image-viewer/ImageViewer.js";
|
|
8
|
+
import { ShimmerButton as s } from "./components/shimmer-button/ShimmerButton.js";
|
|
9
|
+
import { default as k } from "./components/image-compare/ImageCompare.js";
|
|
10
|
+
import { TextAnimate as I } from "./components/text-animate/TextAnimate.js";
|
|
11
|
+
import { Dock as y, DockIcon as A, dockVariants as B } from "./components/dock/Duck.js";
|
|
12
|
+
import { TxtEditor as D } from "./components/txt-editor/TxtEditor.js";
|
|
11
13
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
e as Button,
|
|
15
|
+
y as Dock,
|
|
16
|
+
A as DockIcon,
|
|
17
|
+
a as HyperText,
|
|
18
|
+
k as ImageCompare,
|
|
19
|
+
u as ImageViewer,
|
|
20
|
+
d as PinchContent,
|
|
21
|
+
s as ShimmerButton,
|
|
22
|
+
I as TextAnimate,
|
|
23
|
+
D as TxtEditor,
|
|
19
24
|
p as TxtReader,
|
|
20
|
-
n as TypingAnimation
|
|
25
|
+
n as TypingAnimation,
|
|
26
|
+
B as dockVariants
|
|
21
27
|
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
function y(r, t, e) {
|
|
2
|
+
return t in r ? Object.defineProperty(r, t, {
|
|
3
|
+
value: e,
|
|
4
|
+
enumerable: !0,
|
|
5
|
+
configurable: !0,
|
|
6
|
+
writable: !0
|
|
7
|
+
}) : r[t] = e, r;
|
|
8
|
+
}
|
|
9
|
+
function f(r, t) {
|
|
10
|
+
var e = Object.keys(r);
|
|
11
|
+
if (Object.getOwnPropertySymbols) {
|
|
12
|
+
var n = Object.getOwnPropertySymbols(r);
|
|
13
|
+
t && (n = n.filter(function(o) {
|
|
14
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
15
|
+
})), e.push.apply(e, n);
|
|
16
|
+
}
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function h(r) {
|
|
20
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
21
|
+
var e = arguments[t] != null ? arguments[t] : {};
|
|
22
|
+
t % 2 ? f(Object(e), !0).forEach(function(n) {
|
|
23
|
+
y(r, n, e[n]);
|
|
24
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : f(Object(e)).forEach(function(n) {
|
|
25
|
+
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(e, n));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return r;
|
|
29
|
+
}
|
|
30
|
+
function s(r, t) {
|
|
31
|
+
if (r == null) return {};
|
|
32
|
+
var e = {}, n = Object.keys(r), o, a;
|
|
33
|
+
for (a = 0; a < n.length; a++)
|
|
34
|
+
o = n[a], !(t.indexOf(o) >= 0) && (e[o] = r[o]);
|
|
35
|
+
return e;
|
|
36
|
+
}
|
|
37
|
+
function j(r, t) {
|
|
38
|
+
if (r == null) return {};
|
|
39
|
+
var e = s(r, t), n, o;
|
|
40
|
+
if (Object.getOwnPropertySymbols) {
|
|
41
|
+
var a = Object.getOwnPropertySymbols(r);
|
|
42
|
+
for (o = 0; o < a.length; o++)
|
|
43
|
+
n = a[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(r, n) && (e[n] = r[n]);
|
|
44
|
+
}
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
function g(r, t) {
|
|
48
|
+
return p(r) || b(r, t) || O(r, t) || d();
|
|
49
|
+
}
|
|
50
|
+
function p(r) {
|
|
51
|
+
if (Array.isArray(r)) return r;
|
|
52
|
+
}
|
|
53
|
+
function b(r, t) {
|
|
54
|
+
if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(r)))) {
|
|
55
|
+
var e = [], n = !0, o = !1, a = void 0;
|
|
56
|
+
try {
|
|
57
|
+
for (var i = r[Symbol.iterator](), u; !(n = (u = i.next()).done) && (e.push(u.value), !(t && e.length === t)); n = !0)
|
|
58
|
+
;
|
|
59
|
+
} catch (c) {
|
|
60
|
+
o = !0, a = c;
|
|
61
|
+
} finally {
|
|
62
|
+
try {
|
|
63
|
+
!n && i.return != null && i.return();
|
|
64
|
+
} finally {
|
|
65
|
+
if (o) throw a;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return e;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function O(r, t) {
|
|
72
|
+
if (r) {
|
|
73
|
+
if (typeof r == "string") return l(r, t);
|
|
74
|
+
var e = Object.prototype.toString.call(r).slice(8, -1);
|
|
75
|
+
if (e === "Object" && r.constructor && (e = r.constructor.name), e === "Map" || e === "Set") return Array.from(r);
|
|
76
|
+
if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return l(r, t);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function l(r, t) {
|
|
80
|
+
(t == null || t > r.length) && (t = r.length);
|
|
81
|
+
for (var e = 0, n = new Array(t); e < t; e++) n[e] = r[e];
|
|
82
|
+
return n;
|
|
83
|
+
}
|
|
84
|
+
function d() {
|
|
85
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
l as arrayLikeToArray,
|
|
90
|
+
p as arrayWithHoles,
|
|
91
|
+
y as defineProperty,
|
|
92
|
+
b as iterableToArrayLimit,
|
|
93
|
+
d as nonIterableRest,
|
|
94
|
+
h as objectSpread2,
|
|
95
|
+
j as objectWithoutProperties,
|
|
96
|
+
s as objectWithoutPropertiesLoose,
|
|
97
|
+
g as slicedToArray,
|
|
98
|
+
O as unsupportedIterableToArray
|
|
99
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { slicedToArray as l, objectWithoutProperties as d } from "../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import v from "../../../../../../../state-local@1.0.7/node_modules/state-local/lib/es/state-local.js";
|
|
3
|
+
import g from "../config/index.js";
|
|
4
|
+
import p from "../validators/index.js";
|
|
5
|
+
import j from "../utils/compose.js";
|
|
6
|
+
import w from "../utils/deepMerge.js";
|
|
7
|
+
import s from "../utils/makeCancelable.js";
|
|
8
|
+
var I = v.create({
|
|
9
|
+
config: g,
|
|
10
|
+
isInitialized: !1,
|
|
11
|
+
resolve: null,
|
|
12
|
+
reject: null,
|
|
13
|
+
monaco: null
|
|
14
|
+
}), u = l(I, 2), i = u[0], c = u[1];
|
|
15
|
+
function z(o) {
|
|
16
|
+
var e = p.config(o), n = e.monaco, r = d(e, ["monaco"]);
|
|
17
|
+
c(function(t) {
|
|
18
|
+
return {
|
|
19
|
+
config: w(t.config, r),
|
|
20
|
+
monaco: n
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function S() {
|
|
25
|
+
var o = i(function(e) {
|
|
26
|
+
var n = e.monaco, r = e.isInitialized, t = e.resolve;
|
|
27
|
+
return {
|
|
28
|
+
monaco: n,
|
|
29
|
+
isInitialized: r,
|
|
30
|
+
resolve: t
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
if (!o.isInitialized) {
|
|
34
|
+
if (c({
|
|
35
|
+
isInitialized: !0
|
|
36
|
+
}), o.monaco)
|
|
37
|
+
return o.resolve(o.monaco), s(f);
|
|
38
|
+
if (window.monaco && window.monaco.editor)
|
|
39
|
+
return m(window.monaco), o.resolve(window.monaco), s(f);
|
|
40
|
+
j(b, M)(P);
|
|
41
|
+
}
|
|
42
|
+
return s(f);
|
|
43
|
+
}
|
|
44
|
+
function b(o) {
|
|
45
|
+
return document.body.appendChild(o);
|
|
46
|
+
}
|
|
47
|
+
function h(o) {
|
|
48
|
+
var e = document.createElement("script");
|
|
49
|
+
return o && (e.src = o), e;
|
|
50
|
+
}
|
|
51
|
+
function M(o) {
|
|
52
|
+
var e = i(function(r) {
|
|
53
|
+
var t = r.config, a = r.reject;
|
|
54
|
+
return {
|
|
55
|
+
config: t,
|
|
56
|
+
reject: a
|
|
57
|
+
};
|
|
58
|
+
}), n = h("".concat(e.config.paths.vs, "/loader.js"));
|
|
59
|
+
return n.onload = function() {
|
|
60
|
+
return o();
|
|
61
|
+
}, n.onerror = e.reject, n;
|
|
62
|
+
}
|
|
63
|
+
function P() {
|
|
64
|
+
var o = i(function(n) {
|
|
65
|
+
var r = n.config, t = n.resolve, a = n.reject;
|
|
66
|
+
return {
|
|
67
|
+
config: r,
|
|
68
|
+
resolve: t,
|
|
69
|
+
reject: a
|
|
70
|
+
};
|
|
71
|
+
}), e = window.require;
|
|
72
|
+
e.config(o.config), e(["vs/editor/editor.main"], function(n) {
|
|
73
|
+
m(n), o.resolve(n);
|
|
74
|
+
}, function(n) {
|
|
75
|
+
o.reject(n);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function m(o) {
|
|
79
|
+
i().monaco || c({
|
|
80
|
+
monaco: o
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function _() {
|
|
84
|
+
return i(function(o) {
|
|
85
|
+
var e = o.monaco;
|
|
86
|
+
return e;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
var f = new Promise(function(o, e) {
|
|
90
|
+
return c({
|
|
91
|
+
resolve: o,
|
|
92
|
+
reject: e
|
|
93
|
+
});
|
|
94
|
+
}), T = {
|
|
95
|
+
config: z,
|
|
96
|
+
init: S,
|
|
97
|
+
__getMonacoInstance: _
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
T as default
|
|
101
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function o(u) {
|
|
2
|
+
return function h() {
|
|
3
|
+
for (var i = this, a = arguments.length, r = new Array(a), t = 0; t < a; t++)
|
|
4
|
+
r[t] = arguments[t];
|
|
5
|
+
return r.length >= u.length ? u.apply(this, r) : function() {
|
|
6
|
+
for (var c = arguments.length, e = new Array(c), n = 0; n < c; n++)
|
|
7
|
+
e[n] = arguments[n];
|
|
8
|
+
return h.apply(i, [].concat(r, e));
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
o as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { objectSpread2 as i } from "../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
function a(t, f) {
|
|
3
|
+
return Object.keys(f).forEach(function(n) {
|
|
4
|
+
f[n] instanceof Object && t[n] && Object.assign(f[n], a(t[n], f[n]));
|
|
5
|
+
}), i(i({}, t), f);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
a as default
|
|
9
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var l = {
|
|
2
|
+
type: "cancelation",
|
|
3
|
+
msg: "operation is manually canceled"
|
|
4
|
+
};
|
|
5
|
+
function u(n) {
|
|
6
|
+
var a = !1, e = new Promise(function(c, t) {
|
|
7
|
+
n.then(function(r) {
|
|
8
|
+
return a ? t(l) : c(r);
|
|
9
|
+
}), n.catch(t);
|
|
10
|
+
});
|
|
11
|
+
return e.cancel = function() {
|
|
12
|
+
return a = !0;
|
|
13
|
+
}, e;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
l as CANCELATION_MESSAGE,
|
|
17
|
+
u as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import a from "../utils/curry.js";
|
|
2
|
+
import t from "../utils/isObject.js";
|
|
3
|
+
function i(o) {
|
|
4
|
+
return o || n("configIsRequired"), t(o) || n("configType"), o.urls ? (c(), {
|
|
5
|
+
paths: {
|
|
6
|
+
vs: o.urls.monacoBase
|
|
7
|
+
}
|
|
8
|
+
}) : o;
|
|
9
|
+
}
|
|
10
|
+
function c() {
|
|
11
|
+
console.warn(r.deprecation);
|
|
12
|
+
}
|
|
13
|
+
function u(o, e) {
|
|
14
|
+
throw new Error(o[e] || o.default);
|
|
15
|
+
}
|
|
16
|
+
var r = {
|
|
17
|
+
configIsRequired: "the configuration object is required",
|
|
18
|
+
configType: "the configuration object should be an object",
|
|
19
|
+
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
20
|
+
deprecation: `Deprecation warning!
|
|
21
|
+
You are using deprecated way of configuration.
|
|
22
|
+
|
|
23
|
+
Instead of using
|
|
24
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
25
|
+
use
|
|
26
|
+
monaco.config({ paths: { vs: '...' } })
|
|
27
|
+
|
|
28
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
29
|
+
`
|
|
30
|
+
}, n = a(u)(r), d = {
|
|
31
|
+
config: i
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
d as default,
|
|
35
|
+
n as errorHandler,
|
|
36
|
+
r as errorMessages
|
|
37
|
+
};
|