@gsc-basic/components 1.0.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/es/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/es/index.js +35 -0
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +1371 -0
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +838 -0
- package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +38 -0
- package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +300 -0
- package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +48 -0
- package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +399 -0
- package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +497 -0
- package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +216 -0
- package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +51 -0
- package/dist/es/node_modules/@codemirror/language/dist/index.js +1299 -0
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +649 -0
- package/dist/es/node_modules/@codemirror/search/dist/index.js +872 -0
- package/dist/es/node_modules/@codemirror/state/dist/index.js +2639 -0
- package/dist/es/node_modules/@codemirror/theme-one-dark/dist/index.js +132 -0
- package/dist/es/node_modules/@codemirror/view/dist/index.js +7280 -0
- package/dist/es/node_modules/@lezer/common/dist/index.js +1430 -0
- package/dist/es/node_modules/@lezer/highlight/dist/index.js +637 -0
- package/dist/es/node_modules/@lezer/java/dist/index.js +62 -0
- package/dist/es/node_modules/@lezer/javascript/dist/index.js +161 -0
- package/dist/es/node_modules/@lezer/json/dist/index.js +34 -0
- package/dist/es/node_modules/@lezer/lr/dist/index.js +1307 -0
- package/dist/es/node_modules/@lezer/python/dist/index.js +221 -0
- package/dist/es/node_modules/@lezer/xml/dist/index.js +100 -0
- package/dist/es/node_modules/@lezer/yaml/dist/index.js +274 -0
- package/dist/es/node_modules/@marijn/find-cluster-break/src/index.js +69 -0
- package/dist/es/node_modules/@vueuse/core/dist/index.js +125 -0
- package/dist/es/node_modules/@vueuse/shared/dist/index.js +55 -0
- package/dist/es/node_modules/codemirror/dist/index.js +40 -0
- package/dist/es/node_modules/crelt/index.js +27 -0
- package/dist/es/node_modules/lodash-es/_Hash.js +20 -0
- package/dist/es/node_modules/lodash-es/_ListCache.js +20 -0
- package/dist/es/node_modules/lodash-es/_Map.js +6 -0
- package/dist/es/node_modules/lodash-es/_MapCache.js +20 -0
- package/dist/es/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/es/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/es/node_modules/lodash-es/_assocIndexOf.js +10 -0
- package/dist/es/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/es/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/es/node_modules/lodash-es/_baseIsNative.js +16 -0
- package/dist/es/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/es/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/es/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/es/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/es/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/es/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/es/node_modules/lodash-es/_getRawTag.js +15 -0
- package/dist/es/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/es/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/es/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/es/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/es/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/es/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/es/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/es/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/es/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/es/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/es/node_modules/lodash-es/_listCacheDelete.js +12 -0
- package/dist/es/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/es/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/es/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/es/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/es/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/es/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/es/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/es/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/es/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/es/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/es/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/es/node_modules/lodash-es/_root.js +5 -0
- package/dist/es/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/es/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/es/node_modules/lodash-es/_toSource.js +17 -0
- package/dist/es/node_modules/lodash-es/eq.js +6 -0
- package/dist/es/node_modules/lodash-es/get.js +8 -0
- package/dist/es/node_modules/lodash-es/isArray.js +4 -0
- package/dist/es/node_modules/lodash-es/isFunction.js +12 -0
- package/dist/es/node_modules/lodash-es/isNil.js +6 -0
- package/dist/es/node_modules/lodash-es/isObject.js +7 -0
- package/dist/es/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/es/node_modules/lodash-es/isString.js +10 -0
- package/dist/es/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/es/node_modules/lodash-es/memoize.js +18 -0
- package/dist/es/node_modules/lodash-es/toString.js +7 -0
- package/dist/es/node_modules/style-mod/src/style-mod.js +109 -0
- package/dist/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +132 -0
- package/dist/es/node_modules/w3c-keyname/index.js +93 -0
- package/dist/es/src/CodeEditor/index.js +6 -0
- package/dist/es/src/CodeEditor/src/index.css +1 -0
- package/dist/es/src/CodeEditor/src/index.vue.js +128 -0
- package/dist/es/src/CodeEditor/src/index2.css +1 -0
- package/dist/es/src/ConfigProvider/index.js +7 -0
- package/dist/es/src/ConfigProvider/src/configProvider.js +14 -0
- package/dist/es/src/ConfigProvider/src/configProviderProps.js +22 -0
- package/dist/es/src/ConfigProvider/src/constants.js +9 -0
- package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +45 -0
- package/dist/es/src/ScaleScreen/index.js +6 -0
- package/dist/es/src/ScaleScreen/src/index.css +1 -0
- package/dist/es/src/ScaleScreen/src/index.vue.js +115 -0
- package/dist/es/src/ScaleScreen/src/index2.css +1 -0
- package/dist/es/src/VideoBackground/index.js +6 -0
- package/dist/es/src/VideoBackground/src/helper.js +29 -0
- package/dist/es/src/VideoBackground/src/index.css +1 -0
- package/dist/es/src/VideoBackground/src/index.vue.js +108 -0
- package/dist/es/src/VideoBackground/src/index2.css +1 -0
- package/dist/es/src/VideoBackground/src/index3.css +1 -0
- package/dist/es/src/VideoBackground/src/videoBackground.js +31 -0
- package/dist/es/src/hooks/useLocale.js +24 -0
- package/dist/es/src/hooks/useNamespace.js +8 -0
- package/dist/es/src/index.js +28 -0
- package/dist/es/src/locale/lang/en-US.js +32 -0
- package/dist/es/src/locale/lang/ja-JP.js +32 -0
- package/dist/es/src/locale/lang/zh-CN.js +32 -0
- package/dist/es/src/styles/tokens.css +1 -0
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/autocomplete/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-java/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-javascript/dist/index.js +13 -0
- package/dist/lib/node_modules/@codemirror/lang-json/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-python/dist/index.js +3 -0
- package/dist/lib/node_modules/@codemirror/lang-sql/dist/index.js +2 -0
- package/dist/lib/node_modules/@codemirror/lang-xml/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-yaml/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lint/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -0
- package/dist/lib/node_modules/@codemirror/state/dist/index.js +5 -0
- package/dist/lib/node_modules/@codemirror/theme-one-dark/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -0
- package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/highlight/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/java/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/javascript/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/json/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/python/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/xml/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/yaml/dist/index.js +1 -0
- package/dist/lib/node_modules/@marijn/find-cluster-break/src/index.js +1 -0
- package/dist/lib/node_modules/@vueuse/core/dist/index.js +1 -0
- package/dist/lib/node_modules/@vueuse/shared/dist/index.js +1 -0
- package/dist/lib/node_modules/codemirror/dist/index.js +1 -0
- package/dist/lib/node_modules/crelt/index.js +1 -0
- package/dist/lib/node_modules/lodash-es/_Hash.js +1 -0
- package/dist/lib/node_modules/lodash-es/_ListCache.js +1 -0
- package/dist/lib/node_modules/lodash-es/_Map.js +1 -0
- package/dist/lib/node_modules/lodash-es/_MapCache.js +1 -0
- package/dist/lib/node_modules/lodash-es/_Symbol.js +1 -0
- package/dist/lib/node_modules/lodash-es/_arrayMap.js +1 -0
- package/dist/lib/node_modules/lodash-es/_assocIndexOf.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseGetTag.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseIsNative.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseToString.js +1 -0
- package/dist/lib/node_modules/lodash-es/_castPath.js +1 -0
- package/dist/lib/node_modules/lodash-es/_coreJsData.js +1 -0
- package/dist/lib/node_modules/lodash-es/_freeGlobal.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getMapData.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getNative.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getRawTag.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getValue.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashClear.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashDelete.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashHas.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashSet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_isKey.js +1 -0
- package/dist/lib/node_modules/lodash-es/_isKeyable.js +1 -0
- package/dist/lib/node_modules/lodash-es/_isMasked.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheClear.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheDelete.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheHas.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheSet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheClear.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheDelete.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheHas.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheSet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_memoizeCapped.js +1 -0
- package/dist/lib/node_modules/lodash-es/_nativeCreate.js +1 -0
- package/dist/lib/node_modules/lodash-es/_objectToString.js +1 -0
- package/dist/lib/node_modules/lodash-es/_root.js +1 -0
- package/dist/lib/node_modules/lodash-es/_stringToPath.js +1 -0
- package/dist/lib/node_modules/lodash-es/_toKey.js +1 -0
- package/dist/lib/node_modules/lodash-es/_toSource.js +1 -0
- package/dist/lib/node_modules/lodash-es/eq.js +1 -0
- package/dist/lib/node_modules/lodash-es/get.js +1 -0
- package/dist/lib/node_modules/lodash-es/isArray.js +1 -0
- package/dist/lib/node_modules/lodash-es/isFunction.js +1 -0
- package/dist/lib/node_modules/lodash-es/isNil.js +1 -0
- package/dist/lib/node_modules/lodash-es/isObject.js +1 -0
- package/dist/lib/node_modules/lodash-es/isObjectLike.js +1 -0
- package/dist/lib/node_modules/lodash-es/isString.js +1 -0
- package/dist/lib/node_modules/lodash-es/isSymbol.js +1 -0
- package/dist/lib/node_modules/lodash-es/memoize.js +1 -0
- package/dist/lib/node_modules/lodash-es/toString.js +1 -0
- package/dist/lib/node_modules/style-mod/src/style-mod.js +3 -0
- package/dist/lib/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +1 -0
- package/dist/lib/node_modules/w3c-keyname/index.js +1 -0
- package/dist/lib/src/CodeEditor/index.js +1 -0
- package/dist/lib/src/CodeEditor/src/index.css +1 -0
- package/dist/lib/src/CodeEditor/src/index.vue.js +1 -0
- package/dist/lib/src/CodeEditor/src/index2.css +1 -0
- package/dist/lib/src/ConfigProvider/index.js +1 -0
- package/dist/lib/src/ConfigProvider/src/configProvider.js +1 -0
- package/dist/lib/src/ConfigProvider/src/configProviderProps.js +1 -0
- package/dist/lib/src/ConfigProvider/src/constants.js +1 -0
- package/dist/lib/src/ConfigProvider/src/useGlobalConfig.js +1 -0
- package/dist/lib/src/ScaleScreen/index.js +1 -0
- package/dist/lib/src/ScaleScreen/src/index.css +1 -0
- package/dist/lib/src/ScaleScreen/src/index.vue.js +1 -0
- package/dist/lib/src/ScaleScreen/src/index2.css +1 -0
- package/dist/lib/src/VideoBackground/index.js +1 -0
- package/dist/lib/src/VideoBackground/src/helper.js +1 -0
- package/dist/lib/src/VideoBackground/src/index.css +1 -0
- package/dist/lib/src/VideoBackground/src/index.vue.js +1 -0
- package/dist/lib/src/VideoBackground/src/index2.css +1 -0
- package/dist/lib/src/VideoBackground/src/index3.css +1 -0
- package/dist/lib/src/VideoBackground/src/videoBackground.js +1 -0
- package/dist/lib/src/hooks/useLocale.js +1 -0
- package/dist/lib/src/hooks/useNamespace.js +1 -0
- package/dist/lib/src/index.js +1 -0
- package/dist/lib/src/locale/lang/en-US.js +1 -0
- package/dist/lib/src/locale/lang/ja-JP.js +1 -0
- package/dist/lib/src/locale/lang/zh-CN.js +1 -0
- package/dist/lib/src/styles/tokens.css +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { defineComponent as T, shallowRef as y, inject as B, computed as z, toRaw as E, onMounted as P, watch as d, onBeforeUnmount as V, h as W } from "vue";
|
|
2
|
+
import { basicSetup as R } from "../../codemirror/dist/index.js";
|
|
3
|
+
import { EditorState as g, Compartment as A, StateEffect as I } from "../../@codemirror/state/dist/index.js";
|
|
4
|
+
import { EditorView as h, keymap as M, placeholder as k } from "../../@codemirror/view/dist/index.js";
|
|
5
|
+
import { indentWithTab as L } from "../../@codemirror/commands/dist/index.js";
|
|
6
|
+
import { indentUnit as N } from "../../@codemirror/language/dist/index.js";
|
|
7
|
+
var G = Object.freeze({ autofocus: !1, disabled: !1, indentWithTab: !0, tabSize: 2, placeholder: "", autoDestroy: !0, extensions: [R] }), _ = /* @__PURE__ */ Symbol("vue-codemirror-global-config"), u, $ = function(t) {
|
|
8
|
+
var r = t.onUpdate, c = t.onChange, m = t.onFocus, f = t.onBlur, s = (function(n, l) {
|
|
9
|
+
var o = {};
|
|
10
|
+
for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && l.indexOf(e) < 0 && (o[e] = n[e]);
|
|
11
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function") {
|
|
12
|
+
var i = 0;
|
|
13
|
+
for (e = Object.getOwnPropertySymbols(n); i < e.length; i++) l.indexOf(e[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, e[i]) && (o[e[i]] = n[e[i]]);
|
|
14
|
+
}
|
|
15
|
+
return o;
|
|
16
|
+
})(t, ["onUpdate", "onChange", "onFocus", "onBlur"]);
|
|
17
|
+
return g.create({ doc: s.doc, selection: s.selection, extensions: (Array.isArray(s.extensions) ? s.extensions : [s.extensions]).concat([h.updateListener.of((function(n) {
|
|
18
|
+
r(n), n.docChanged && c(n.state.doc.toString(), n), n.focusChanged && (n.view.hasFocus ? m(n) : f(n));
|
|
19
|
+
}))]) });
|
|
20
|
+
}, v = function(t) {
|
|
21
|
+
var r = new A();
|
|
22
|
+
return { compartment: r, run: function(c) {
|
|
23
|
+
r.get(t.state) ? t.dispatch({ effects: r.reconfigure(c) }) : t.dispatch({ effects: I.appendConfig.of(r.of(c)) });
|
|
24
|
+
} };
|
|
25
|
+
}, O = function(t, r) {
|
|
26
|
+
var c = v(t), m = c.compartment, f = c.run;
|
|
27
|
+
return function(s) {
|
|
28
|
+
var n = m.get(t.state);
|
|
29
|
+
f(s ?? n !== r ? r : []);
|
|
30
|
+
};
|
|
31
|
+
}, b = { type: Boolean, default: void 0 }, q = { autofocus: b, disabled: b, indentWithTab: b, tabSize: Number, placeholder: String, style: Object, autoDestroy: b, phrases: Object, root: Object, extensions: Array, selection: Object }, H = { modelValue: { type: String, default: "" } }, J = Object.assign(Object.assign({}, q), H);
|
|
32
|
+
(function(t) {
|
|
33
|
+
t.Change = "change", t.Update = "update", t.Focus = "focus", t.Blur = "blur", t.Ready = "ready", t.ModelUpdate = "update:modelValue";
|
|
34
|
+
})(u || (u = {}));
|
|
35
|
+
var p = {};
|
|
36
|
+
p[u.Change] = function(t, r) {
|
|
37
|
+
return !0;
|
|
38
|
+
}, p[u.Update] = function(t) {
|
|
39
|
+
return !0;
|
|
40
|
+
}, p[u.Focus] = function(t) {
|
|
41
|
+
return !0;
|
|
42
|
+
}, p[u.Blur] = function(t) {
|
|
43
|
+
return !0;
|
|
44
|
+
}, p[u.Ready] = function(t) {
|
|
45
|
+
return !0;
|
|
46
|
+
};
|
|
47
|
+
var j = {};
|
|
48
|
+
j[u.ModelUpdate] = p[u.Change];
|
|
49
|
+
var K = Object.assign(Object.assign({}, p), j), Q = T({ name: "VueCodemirror", props: Object.assign({}, J), emits: Object.assign({}, K), setup: function(t, r) {
|
|
50
|
+
var c = y(), m = y(), f = y(), s = Object.assign(Object.assign({}, G), B(_, {})), n = z((function() {
|
|
51
|
+
var l = {};
|
|
52
|
+
return Object.keys(E(t)).forEach((function(o) {
|
|
53
|
+
var e;
|
|
54
|
+
o !== "modelValue" && (l[o] = (e = t[o]) !== null && e !== void 0 ? e : s[o]);
|
|
55
|
+
})), l;
|
|
56
|
+
}));
|
|
57
|
+
return P((function() {
|
|
58
|
+
var l;
|
|
59
|
+
m.value = $({ doc: t.modelValue, selection: n.value.selection, extensions: (l = s.extensions) !== null && l !== void 0 ? l : [], onFocus: function(e) {
|
|
60
|
+
return r.emit(u.Focus, e);
|
|
61
|
+
}, onBlur: function(e) {
|
|
62
|
+
return r.emit(u.Blur, e);
|
|
63
|
+
}, onUpdate: function(e) {
|
|
64
|
+
return r.emit(u.Update, e);
|
|
65
|
+
}, onChange: function(e, i) {
|
|
66
|
+
e !== t.modelValue && (r.emit(u.Change, e, i), r.emit(u.ModelUpdate, e, i));
|
|
67
|
+
} }), f.value = (function(e) {
|
|
68
|
+
return new h(Object.assign({}, e));
|
|
69
|
+
})({ state: m.value, parent: c.value, root: n.value.root });
|
|
70
|
+
var o = (function(e) {
|
|
71
|
+
var i = function() {
|
|
72
|
+
return e.state.doc.toString();
|
|
73
|
+
}, S = v(e).run, C = O(e, [h.editable.of(!1), g.readOnly.of(!0)]), x = O(e, M.of([L])), U = v(e).run, w = v(e).run, D = v(e).run, F = v(e).run;
|
|
74
|
+
return { focus: function() {
|
|
75
|
+
return e.focus();
|
|
76
|
+
}, getDoc: i, setDoc: function(a) {
|
|
77
|
+
a !== i() && e.dispatch({ changes: { from: 0, to: e.state.doc.length, insert: a } });
|
|
78
|
+
}, reExtensions: S, toggleDisabled: C, toggleIndentWithTab: x, setTabSize: function(a) {
|
|
79
|
+
U([g.tabSize.of(a), N.of(" ".repeat(a))]);
|
|
80
|
+
}, setPhrases: function(a) {
|
|
81
|
+
w([g.phrases.of(a)]);
|
|
82
|
+
}, setPlaceholder: function(a) {
|
|
83
|
+
D(k(a));
|
|
84
|
+
}, setStyle: function(a) {
|
|
85
|
+
a === void 0 && (a = {}), F(h.theme({ "&": Object.assign({}, a) }));
|
|
86
|
+
} };
|
|
87
|
+
})(f.value);
|
|
88
|
+
d((function() {
|
|
89
|
+
return t.modelValue;
|
|
90
|
+
}), (function(e) {
|
|
91
|
+
e !== o.getDoc() && o.setDoc(e);
|
|
92
|
+
})), d((function() {
|
|
93
|
+
return t.extensions;
|
|
94
|
+
}), (function(e) {
|
|
95
|
+
return o.reExtensions(e || []);
|
|
96
|
+
}), { immediate: !0 }), d((function() {
|
|
97
|
+
return n.value.disabled;
|
|
98
|
+
}), (function(e) {
|
|
99
|
+
return o.toggleDisabled(e);
|
|
100
|
+
}), { immediate: !0 }), d((function() {
|
|
101
|
+
return n.value.indentWithTab;
|
|
102
|
+
}), (function(e) {
|
|
103
|
+
return o.toggleIndentWithTab(e);
|
|
104
|
+
}), { immediate: !0 }), d((function() {
|
|
105
|
+
return n.value.tabSize;
|
|
106
|
+
}), (function(e) {
|
|
107
|
+
return o.setTabSize(e);
|
|
108
|
+
}), { immediate: !0 }), d((function() {
|
|
109
|
+
return n.value.phrases;
|
|
110
|
+
}), (function(e) {
|
|
111
|
+
return o.setPhrases(e || {});
|
|
112
|
+
}), { immediate: !0 }), d((function() {
|
|
113
|
+
return n.value.placeholder;
|
|
114
|
+
}), (function(e) {
|
|
115
|
+
return o.setPlaceholder(e);
|
|
116
|
+
}), { immediate: !0 }), d((function() {
|
|
117
|
+
return n.value.style;
|
|
118
|
+
}), (function(e) {
|
|
119
|
+
return o.setStyle(e);
|
|
120
|
+
}), { immediate: !0 }), n.value.autofocus && o.focus(), r.emit(u.Ready, { state: m.value, view: f.value, container: c.value });
|
|
121
|
+
})), V((function() {
|
|
122
|
+
n.value.autoDestroy && f.value && (function(l) {
|
|
123
|
+
l.destroy();
|
|
124
|
+
})(f.value);
|
|
125
|
+
})), function() {
|
|
126
|
+
return W("div", { class: "v-codemirror", style: { display: "contents" }, ref: c });
|
|
127
|
+
};
|
|
128
|
+
} }), oe = Q;
|
|
129
|
+
export {
|
|
130
|
+
oe as Codemirror,
|
|
131
|
+
G as DEFAULT_CONFIG
|
|
132
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var t = {
|
|
2
|
+
8: "Backspace",
|
|
3
|
+
9: "Tab",
|
|
4
|
+
10: "Enter",
|
|
5
|
+
12: "NumLock",
|
|
6
|
+
13: "Enter",
|
|
7
|
+
16: "Shift",
|
|
8
|
+
17: "Control",
|
|
9
|
+
18: "Alt",
|
|
10
|
+
20: "CapsLock",
|
|
11
|
+
27: "Escape",
|
|
12
|
+
32: " ",
|
|
13
|
+
33: "PageUp",
|
|
14
|
+
34: "PageDown",
|
|
15
|
+
35: "End",
|
|
16
|
+
36: "Home",
|
|
17
|
+
37: "ArrowLeft",
|
|
18
|
+
38: "ArrowUp",
|
|
19
|
+
39: "ArrowRight",
|
|
20
|
+
40: "ArrowDown",
|
|
21
|
+
44: "PrintScreen",
|
|
22
|
+
45: "Insert",
|
|
23
|
+
46: "Delete",
|
|
24
|
+
59: ";",
|
|
25
|
+
61: "=",
|
|
26
|
+
91: "Meta",
|
|
27
|
+
92: "Meta",
|
|
28
|
+
106: "*",
|
|
29
|
+
107: "+",
|
|
30
|
+
108: ",",
|
|
31
|
+
109: "-",
|
|
32
|
+
110: ".",
|
|
33
|
+
111: "/",
|
|
34
|
+
144: "NumLock",
|
|
35
|
+
145: "ScrollLock",
|
|
36
|
+
160: "Shift",
|
|
37
|
+
161: "Shift",
|
|
38
|
+
162: "Control",
|
|
39
|
+
163: "Control",
|
|
40
|
+
164: "Alt",
|
|
41
|
+
165: "Alt",
|
|
42
|
+
173: "-",
|
|
43
|
+
186: ";",
|
|
44
|
+
187: "=",
|
|
45
|
+
188: ",",
|
|
46
|
+
189: "-",
|
|
47
|
+
190: ".",
|
|
48
|
+
191: "/",
|
|
49
|
+
192: "`",
|
|
50
|
+
219: "[",
|
|
51
|
+
220: "\\",
|
|
52
|
+
221: "]",
|
|
53
|
+
222: "'"
|
|
54
|
+
}, a = {
|
|
55
|
+
48: ")",
|
|
56
|
+
49: "!",
|
|
57
|
+
50: "@",
|
|
58
|
+
51: "#",
|
|
59
|
+
52: "$",
|
|
60
|
+
53: "%",
|
|
61
|
+
54: "^",
|
|
62
|
+
55: "&",
|
|
63
|
+
56: "*",
|
|
64
|
+
57: "(",
|
|
65
|
+
59: ":",
|
|
66
|
+
61: "+",
|
|
67
|
+
173: "_",
|
|
68
|
+
186: ":",
|
|
69
|
+
187: "+",
|
|
70
|
+
188: "<",
|
|
71
|
+
189: "_",
|
|
72
|
+
190: ">",
|
|
73
|
+
191: "?",
|
|
74
|
+
192: "~",
|
|
75
|
+
219: "{",
|
|
76
|
+
220: "|",
|
|
77
|
+
221: "}",
|
|
78
|
+
222: '"'
|
|
79
|
+
}, n = typeof navigator < "u" && /Mac/.test(navigator.platform), y = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
80
|
+
for (var r = 0; r < 10; r++) t[48 + r] = t[96 + r] = String(r);
|
|
81
|
+
for (var r = 1; r <= 24; r++) t[r + 111] = "F" + r;
|
|
82
|
+
for (var r = 65; r <= 90; r++)
|
|
83
|
+
t[r] = String.fromCharCode(r + 32), a[r] = String.fromCharCode(r);
|
|
84
|
+
for (var i in t) a.hasOwnProperty(i) || (a[i] = t[i]);
|
|
85
|
+
function g(o) {
|
|
86
|
+
var f = n && o.metaKey && o.shiftKey && !o.ctrlKey && !o.altKey || y && o.shiftKey && o.key && o.key.length == 1 || o.key == "Unidentified", e = !f && o.key || (o.shiftKey ? a : t)[o.keyCode] || o.key || "Unidentified";
|
|
87
|
+
return e == "Esc" && (e = "Escape"), e == "Del" && (e = "Delete"), e == "Left" && (e = "ArrowLeft"), e == "Up" && (e = "ArrowUp"), e == "Right" && (e = "ArrowRight"), e == "Down" && (e = "ArrowDown"), e;
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
t as base,
|
|
91
|
+
g as keyName,
|
|
92
|
+
a as shift
|
|
93
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-basic-code-editor[data-v-8fba7df2]{min-width:380px;border:1px solid var(--gsc-basic-border-color);border-radius:var(--gsc-basic-border-radius-base)}.gsc-basic-code-editor__copy-btn[data-v-8fba7df2]{height:20px;padding:0 12px;border:0;background-color:transparent;font-size:12px;line-height:1;cursor:pointer;transition:background-color .2s ease,color .2s ease,opacity .2s ease}.gsc-basic-code-editor__copy-btn[data-v-8fba7df2]:disabled{cursor:not-allowed;opacity:.5}.gsc-basic-code-editor[data-v-8fba7df2] .cm-editor{border:0 solid var(--gsc-basic-border-color);border-width:1px 0}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { computed as d, unref as o, reactive as C, createElementBlock as _, openBlock as V, normalizeClass as B, createVNode as T, createElementVNode as l, normalizeStyle as D, isRef as N, createTextVNode as z, toDisplayString as n } from "vue";
|
|
2
|
+
import { useClipboard as L } from "../../../node_modules/@vueuse/core/dist/index.js";
|
|
3
|
+
import { Codemirror as O } from "../../../node_modules/vue-codemirror/dist/vue-codemirror.esm.js";
|
|
4
|
+
import { oneDark as q } from "../../../node_modules/@codemirror/theme-one-dark/dist/index.js";
|
|
5
|
+
import { json as G, jsonParseLinter as J } from "../../../node_modules/@codemirror/lang-json/dist/index.js";
|
|
6
|
+
import { java as A } from "../../../node_modules/@codemirror/lang-java/dist/index.js";
|
|
7
|
+
import { sql as F } from "../../../node_modules/@codemirror/lang-sql/dist/index.js";
|
|
8
|
+
import { javascript as I } from "../../../node_modules/@codemirror/lang-javascript/dist/index.js";
|
|
9
|
+
import { yaml as M } from "../../../node_modules/@codemirror/lang-yaml/dist/index.js";
|
|
10
|
+
import { xml as P } from "../../../node_modules/@codemirror/lang-xml/dist/index.js";
|
|
11
|
+
import { python as R } from "../../../node_modules/@codemirror/lang-python/dist/index.js";
|
|
12
|
+
import { linter as U, lintGutter as $ } from "../../../node_modules/@codemirror/lint/dist/index.js";
|
|
13
|
+
import { useModelBinding as w } from "@gsc-basic/hooks";
|
|
14
|
+
import { useNamespace as H } from "../../hooks/useNamespace.js";
|
|
15
|
+
import { useLocale as K } from "../../hooks/useLocale.js";
|
|
16
|
+
import './index2.css';import './index.css';/* empty css */
|
|
17
|
+
/* empty css */
|
|
18
|
+
import Q from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
19
|
+
const W = { class: "flex items-center justify-between py-1 text-xs dark:text-gray-200 dark:bg-gray-800" }, X = ["disabled"], Y = { class: "flex" }, Z = { class: "pr-2" }, ee = { class: "pr-2" }, te = { class: "pr-2" }, oe = /* @__PURE__ */ Object.assign({
|
|
20
|
+
name: "GscCodeEditor"
|
|
21
|
+
}, {
|
|
22
|
+
__name: "index",
|
|
23
|
+
props: {
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: [String]
|
|
26
|
+
},
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String
|
|
29
|
+
},
|
|
30
|
+
editorStyle: {
|
|
31
|
+
type: [Array, String, Object],
|
|
32
|
+
default: () => ({ height: "180px" })
|
|
33
|
+
},
|
|
34
|
+
language: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "json",
|
|
37
|
+
validator: (s) => ["json", "java", "sql", "yaml", "xml", "python", "javascript"].includes(s)
|
|
38
|
+
},
|
|
39
|
+
isDarkTheme: Boolean,
|
|
40
|
+
disabled: Boolean,
|
|
41
|
+
autofocus: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
emits: ["change", "update:modelValue"],
|
|
47
|
+
setup(s) {
|
|
48
|
+
const a = s, { prefixCls: p } = H("code-editor"), { t: r } = K(), m = {
|
|
49
|
+
json: () => [G(), U(J()), $()],
|
|
50
|
+
java: () => [A()],
|
|
51
|
+
sql: () => [F()],
|
|
52
|
+
yaml: () => [M()],
|
|
53
|
+
xml: () => [P()],
|
|
54
|
+
python: () => [R()],
|
|
55
|
+
javascript: () => [I({
|
|
56
|
+
jsx: !0,
|
|
57
|
+
typescript: !0
|
|
58
|
+
})]
|
|
59
|
+
}, f = d(() => {
|
|
60
|
+
const e = [...m[a.language]?.() ?? []];
|
|
61
|
+
return a.isDarkTheme && e.push(q), e;
|
|
62
|
+
}), g = d(() => {
|
|
63
|
+
if (a.placeholder)
|
|
64
|
+
return a.placeholder;
|
|
65
|
+
const t = `gsc.codeEditor.placeholder.${a.language}`, e = r(t);
|
|
66
|
+
return e === t ? r("gsc.codeEditor.placeholder.default") : e;
|
|
67
|
+
}), [i, y] = w(a, "modelValue", "update:modelValue");
|
|
68
|
+
try {
|
|
69
|
+
a.language === "json" && y(JSON.stringify(JSON.parse(o(i)), null, 2));
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
const h = d(() => {
|
|
73
|
+
const t = o(i);
|
|
74
|
+
return !t || t.length === 0;
|
|
75
|
+
}), {
|
|
76
|
+
copy: b,
|
|
77
|
+
copied: x,
|
|
78
|
+
isSupported: v
|
|
79
|
+
} = L({
|
|
80
|
+
source: i,
|
|
81
|
+
legacy: !0
|
|
82
|
+
}), u = d(() => !v.value || h.value), j = d(() => r(x.value ? "gsc.codeEditor.action.copied" : "gsc.codeEditor.action.copy")), E = () => {
|
|
83
|
+
u.value || b();
|
|
84
|
+
}, c = C({
|
|
85
|
+
lines: null,
|
|
86
|
+
cursor: null,
|
|
87
|
+
length: null
|
|
88
|
+
}), S = (t) => {
|
|
89
|
+
const e = t.state.selection.ranges;
|
|
90
|
+
c.cursor = e[0].anchor, c.length = t.state.doc.length, c.lines = t.state.doc.lines;
|
|
91
|
+
};
|
|
92
|
+
return (t, e) => (V(), _("div", {
|
|
93
|
+
class: B([o(p), s.isDarkTheme ? "dark-bg" : "light-bg"])
|
|
94
|
+
}, [
|
|
95
|
+
T(o(O), {
|
|
96
|
+
modelValue: o(i),
|
|
97
|
+
"onUpdate:modelValue": e[0] || (e[0] = (k) => N(i) ? i.value = k : null),
|
|
98
|
+
placeholder: g.value,
|
|
99
|
+
style: D(s.editorStyle),
|
|
100
|
+
autofocus: s.autofocus,
|
|
101
|
+
"indent-with-tab": !0,
|
|
102
|
+
"tab-size": 2,
|
|
103
|
+
disabled: s.disabled,
|
|
104
|
+
extensions: f.value,
|
|
105
|
+
onUpdate: S
|
|
106
|
+
}, null, 8, ["modelValue", "placeholder", "style", "autofocus", "disabled", "extensions"]),
|
|
107
|
+
l("div", W, [
|
|
108
|
+
l("button", {
|
|
109
|
+
class: "gsc-basic-code-editor__copy-btn dark:text-gray-200",
|
|
110
|
+
type: "button",
|
|
111
|
+
disabled: u.value,
|
|
112
|
+
onClick: E
|
|
113
|
+
}, [
|
|
114
|
+
e[1] || (e[1] = l("i", { class: "i-material-symbols:content-copy-outline" }, null, -1)),
|
|
115
|
+
z(" " + n(j.value), 1)
|
|
116
|
+
], 8, X),
|
|
117
|
+
l("div", Y, [
|
|
118
|
+
l("span", Z, n(o(r)("gsc.codeEditor.info.length")) + ": " + n(c.length), 1),
|
|
119
|
+
l("span", ee, n(o(r)("gsc.codeEditor.info.lines")) + ": " + n(c.lines), 1),
|
|
120
|
+
l("span", te, n(o(r)("gsc.codeEditor.info.cursor")) + ": " + n(c.cursor), 1)
|
|
121
|
+
])
|
|
122
|
+
])
|
|
123
|
+
], 2));
|
|
124
|
+
}
|
|
125
|
+
}), je = /* @__PURE__ */ Q(oe, [["__scopeId", "data-v-8fba7df2"]]);
|
|
126
|
+
export {
|
|
127
|
+
je as default
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-8fba7df2],[data-v-8fba7df2]:before,[data-v-8fba7df2]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-8fba7df2]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.i-material-symbols\:content-copy-outline[data-v-8fba7df2]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E");-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E") no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;vertical-align:-.125em;display:inline-block;width:1em;height:1em}.flex[data-v-8fba7df2]{display:flex}.items-center[data-v-8fba7df2]{align-items:center}.justify-between[data-v-8fba7df2]{justify-content:space-between}.border[data-v-8fba7df2]{border-width:1px}.dark .dark\:bg-gray-800[data-v-8fba7df2]{--un-bg-opacity:1;background-color:#1f2937}@supports (color: rgb(0 0 0 / 0)){.dark .dark\:bg-gray-800[data-v-8fba7df2]{background-color:rgb(31 41 55 / var(--un-bg-opacity))}}.py-1[data-v-8fba7df2]{padding-top:.25rem;padding-bottom:.25rem}.pr-2[data-v-8fba7df2]{padding-right:.5rem}.text-xs[data-v-8fba7df2]{font-size:.75rem;line-height:1rem}.dark .dark\:text-gray-200[data-v-8fba7df2]{--un-text-opacity:1;color:#e5e7eb}@supports (color: rgb(0 0 0 / 0)){.dark .dark\:text-gray-200[data-v-8fba7df2]{color:rgb(229 231 235 / var(--un-text-opacity))}}.transition[data-v-8fba7df2]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease[data-v-8fba7df2]{transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent as i, renderSlot as n } from "vue";
|
|
2
|
+
import { configProviderProps as f } from "./configProviderProps.js";
|
|
3
|
+
import { provideGlobalConfig as t } from "./useGlobalConfig.js";
|
|
4
|
+
const s = i({
|
|
5
|
+
name: "GscConfigProvider",
|
|
6
|
+
props: f,
|
|
7
|
+
setup(o, { slots: r }) {
|
|
8
|
+
const e = t(o);
|
|
9
|
+
return () => n(r, "default", { config: e?.value });
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
s as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defaultInitialZIndex as t } from "./constants.js";
|
|
2
|
+
import r from "../../locale/lang/en-US.js";
|
|
3
|
+
const i = {
|
|
4
|
+
locale: {
|
|
5
|
+
type: Object,
|
|
6
|
+
default: () => r
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "middle",
|
|
11
|
+
validator(e) {
|
|
12
|
+
return ["middle", "small", "large"].includes(e);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
zIndex: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: t
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
i as configProviderProps
|
|
22
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const e = /* @__PURE__ */ Symbol("configProviderContextKey"), o = /* @__PURE__ */ Symbol("zIndexContextKey"), t = /* @__PURE__ */ Symbol("sizeInjectionKey"), n = /* @__PURE__ */ Symbol("localeContextKey"), c = "gsc-basic", y = 999;
|
|
2
|
+
export {
|
|
3
|
+
e as configProviderContextKey,
|
|
4
|
+
y as defaultInitialZIndex,
|
|
5
|
+
c as defaultNamespace,
|
|
6
|
+
n as localeContextKey,
|
|
7
|
+
t as sizeInjectionKey,
|
|
8
|
+
o as zIndexContextKey
|
|
9
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getCurrentInstance as a, inject as v, ref as g, computed as n, unref as o, provide as C } from "vue";
|
|
2
|
+
import { deepMerge as m } from "@gsc-basic/utils";
|
|
3
|
+
import { useLocale as x } from "../../hooks/useLocale.js";
|
|
4
|
+
import { configProviderContextKey as d, defaultInitialZIndex as z, localeContextKey as I, zIndexContextKey as b, sizeInjectionKey as G } from "./constants.js";
|
|
5
|
+
const c = g();
|
|
6
|
+
function p(t, e = void 0) {
|
|
7
|
+
const i = a() ? v(d, c) : c;
|
|
8
|
+
return t ? n(() => i.value?.[t] ?? e) : i;
|
|
9
|
+
}
|
|
10
|
+
function F(t) {
|
|
11
|
+
const e = p(), i = x(n(() => e.value?.locale)), u = n(() => o(t) || e.value?.size || "");
|
|
12
|
+
return y(n(() => o(e) || {})), {
|
|
13
|
+
locale: i,
|
|
14
|
+
zIndex: e.value?.zIndex || z,
|
|
15
|
+
size: u
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const y = (t, e, i = !1) => {
|
|
19
|
+
const u = !!a(), f = u ? p() : void 0, l = e?.provide ?? (u ? C : void 0);
|
|
20
|
+
if (!l) {
|
|
21
|
+
console.warn(
|
|
22
|
+
"provideGlobalConfig",
|
|
23
|
+
"provideGlobalConfig() can only be used inside setup()."
|
|
24
|
+
);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const r = n(() => {
|
|
28
|
+
const s = o(t);
|
|
29
|
+
return f?.value ? m(f.value, s) : s;
|
|
30
|
+
});
|
|
31
|
+
return l(d, r), l(
|
|
32
|
+
I,
|
|
33
|
+
n(() => o(r).locale)
|
|
34
|
+
), l(
|
|
35
|
+
b,
|
|
36
|
+
n(() => o(r).zIndex)
|
|
37
|
+
), l(G, {
|
|
38
|
+
size: n(() => o(r).size || "")
|
|
39
|
+
}), (i || !c.value) && (c.value = o(r)), r;
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
y as provideGlobalConfig,
|
|
43
|
+
F as useGlobalComponentSettings,
|
|
44
|
+
p as useGlobalConfig
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-basic-screen-box[data-v-7eabd167]{overflow:hidden;width:100vw;height:100vh}.gsc-basic-screen-box .screen-wrapper[data-v-7eabd167]{position:relative;overflow:hidden;z-index:100;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transform-origin:left top}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { reactive as y, ref as S, watch as $, onMounted as j, nextTick as w, createElementBlock as v, openBlock as O, normalizeClass as _, normalizeStyle as b, unref as z, createElementVNode as k, renderSlot as N } from "vue";
|
|
2
|
+
import { useWindowSizeFn as B } from "@gsc-basic/hooks";
|
|
3
|
+
import { useNamespace as M } from "../../hooks/useNamespace.js";
|
|
4
|
+
import './index2.css';import './index.css';/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
import C from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const E = {
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
width: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: 1920
|
|
13
|
+
},
|
|
14
|
+
height: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
default: 1080
|
|
17
|
+
},
|
|
18
|
+
fullScreen: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
autoScale: {
|
|
23
|
+
type: [Object, Boolean],
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
delay: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 300
|
|
29
|
+
},
|
|
30
|
+
boxStyle: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({})
|
|
33
|
+
},
|
|
34
|
+
wrapperStyle: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: () => ({})
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setup(s) {
|
|
40
|
+
const i = s, { prefixCls: x } = M("screen-box"), e = y({
|
|
41
|
+
width: 0,
|
|
42
|
+
height: 0,
|
|
43
|
+
originalWidth: 0,
|
|
44
|
+
originalHeight: 0
|
|
45
|
+
}), a = S(null), n = y({}), h = S(null);
|
|
46
|
+
$(
|
|
47
|
+
() => i.autoScale,
|
|
48
|
+
async (t) => {
|
|
49
|
+
t ? m() : W();
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
const g = () => new Promise((t) => {
|
|
53
|
+
h.value.scrollLeft = 0, h.value.scrollTop = 0, w(() => {
|
|
54
|
+
i.width && i.height ? (e.width = i.width, e.height = i.height) : (e.width = a.value?.clientWidth, e.height = a.value?.clientHeight), (!e.originalHeight || !e.originalWidth) && (e.originalWidth = window.screen.width, e.originalHeight = window.screen.height), t();
|
|
55
|
+
});
|
|
56
|
+
}), p = () => {
|
|
57
|
+
e.width && e.height ? Object.assign(n, {
|
|
58
|
+
width: `${e.width}px`,
|
|
59
|
+
height: `${e.height}px`
|
|
60
|
+
}) : Object.assign(n, {
|
|
61
|
+
width: `${e.originalWidth}px`,
|
|
62
|
+
height: `${e.originalHeight}px`
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
function W() {
|
|
66
|
+
Object.assign(n, {
|
|
67
|
+
margin: "",
|
|
68
|
+
transform: ""
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const H = (t) => {
|
|
72
|
+
if (!i.autoScale)
|
|
73
|
+
return;
|
|
74
|
+
const o = a.value.clientWidth, d = a.value.clientHeight, u = document.body.clientWidth, c = document.body.clientHeight;
|
|
75
|
+
let r = Math.max((u - o * t) / 2, 0), l = Math.max((c - d * t) / 2, 0);
|
|
76
|
+
typeof i.autoScale == "object" && (!i.autoScale.x && (r = 0), !i.autoScale.y && (l = 0)), Object.assign(n, {
|
|
77
|
+
margin: `${l}px ${r}px`,
|
|
78
|
+
transform: `scale(${t},${t})`
|
|
79
|
+
});
|
|
80
|
+
}, f = () => {
|
|
81
|
+
const t = document.body.clientWidth, o = document.body.clientHeight, d = e.width || e.originalWidth, u = e.height || e.originalHeight, c = t / +d, r = o / +u;
|
|
82
|
+
if (i.fullScreen)
|
|
83
|
+
return Object.assign(n, {
|
|
84
|
+
transform: `scale(${c},${r})`
|
|
85
|
+
}), !1;
|
|
86
|
+
const l = Math.min(c, r);
|
|
87
|
+
H(l);
|
|
88
|
+
};
|
|
89
|
+
async function m() {
|
|
90
|
+
await g(), p(), f();
|
|
91
|
+
}
|
|
92
|
+
return B(m, i.delay), j(() => {
|
|
93
|
+
w(async () => {
|
|
94
|
+
await g(), p(), f();
|
|
95
|
+
});
|
|
96
|
+
}), (t, o) => (O(), v("section", {
|
|
97
|
+
ref_key: "box",
|
|
98
|
+
ref: h,
|
|
99
|
+
style: b(s.boxStyle),
|
|
100
|
+
class: _([z(x)])
|
|
101
|
+
}, [
|
|
102
|
+
k("div", {
|
|
103
|
+
ref_key: "screenWrapper",
|
|
104
|
+
ref: a,
|
|
105
|
+
style: b({ ...s.wrapperStyle, ...n }),
|
|
106
|
+
class: "screen-wrapper"
|
|
107
|
+
}, [
|
|
108
|
+
N(t.$slots, "default", {}, void 0, !0)
|
|
109
|
+
], 4)
|
|
110
|
+
], 6));
|
|
111
|
+
}
|
|
112
|
+
}, V = /* @__PURE__ */ C(E, [["__scopeId", "data-v-7eabd167"]]);
|
|
113
|
+
export {
|
|
114
|
+
V as default
|
|
115
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-7eabd167],[data-v-7eabd167]:before,[data-v-7eabd167]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-7eabd167]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.relative[data-v-7eabd167]{position:relative}.mx[data-v-7eabd167]{margin-left:1rem;margin-right:1rem}.my[data-v-7eabd167]{margin-top:1rem;margin-bottom:1rem}.hidden[data-v-7eabd167]{display:none}.transform[data-v-7eabd167]{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.px[data-v-7eabd167]{padding-left:1rem;padding-right:1rem}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function t(e, o) {
|
|
2
|
+
if (typeof e > "u")
|
|
3
|
+
throw new TypeError(`${o} requires a video selector as first argument.`);
|
|
4
|
+
if (e = typeof e == "string" ? document.querySelector(e) : e, e.nodeName.toLowerCase() !== "video")
|
|
5
|
+
throw new Error(
|
|
6
|
+
`${o} requires a valid video selector. You passed a <${e.nodeName}>`
|
|
7
|
+
);
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
const e = {
|
|
12
|
+
touch: !!("ontouchstart" in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch),
|
|
13
|
+
ie: window.navigator.userAgent.indexOf("MSIE") > 0 || !!window.navigator.userAgent.match(/Trident.*rv:11\./),
|
|
14
|
+
small: window.matchMedia("(max-width: 34em)").matches
|
|
15
|
+
};
|
|
16
|
+
return e.touch && !e.ie || e.small;
|
|
17
|
+
}
|
|
18
|
+
let n = null;
|
|
19
|
+
const r = (e) => {
|
|
20
|
+
document.body.contains(e) || n?.insertAdjacentElement("afterbegin", e);
|
|
21
|
+
}, a = (e) => {
|
|
22
|
+
n === null && (n = e.parentNode), document.body.contains(e) && n.removeChild(e);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
i as detectTouchOrSmallScreen,
|
|
26
|
+
a as removeVideo,
|
|
27
|
+
r as restoreVideo,
|
|
28
|
+
t as validateSelector
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gsc-basic-video-bg-ready .gsc-basic-video-bg .bg-cover{display:none}.gsc-basic-video-bg-ready .gsc-basic-video-bg-video{display:block!important}
|