@blocklet/labels 1.6.182 → 1.6.183
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/components/label/types.d.ts +4 -0
- package/dist/index-LED75_5N.mjs +17467 -0
- package/dist/index-gwsJxz2s.mjs +155 -0
- package/dist/index.es.js +70 -1321
- package/dist/index.umd.js +16633 -380
- package/dist/label2/labels-context.d.ts +6 -0
- package/dist/label2/session.d.ts +19 -0
- package/dist/label2/tree.d.ts +3 -1
- package/dist/types.d.ts +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { g as getDefaultExportFromCjs, c as commonjsGlobal } from "./index-LED75_5N.mjs";
|
|
2
|
+
function _mergeNamespaces(n, m) {
|
|
3
|
+
for (var i = 0; i < m.length; i++) {
|
|
4
|
+
const e = m[i];
|
|
5
|
+
if (typeof e !== "string" && !Array.isArray(e)) {
|
|
6
|
+
for (const k in e) {
|
|
7
|
+
if (k !== "default" && !(k in n)) {
|
|
8
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
+
if (d) {
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: () => e[k]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
20
|
+
}
|
|
21
|
+
var bridge = {
|
|
22
|
+
default: commonjsGlobal,
|
|
23
|
+
// for typescript
|
|
24
|
+
call: function(method, args, cb) {
|
|
25
|
+
var ret = "";
|
|
26
|
+
if (typeof args == "function") {
|
|
27
|
+
cb = args;
|
|
28
|
+
args = {};
|
|
29
|
+
}
|
|
30
|
+
var arg = { data: args === void 0 ? null : args };
|
|
31
|
+
if (typeof cb == "function") {
|
|
32
|
+
var cbName = "dscb" + window.dscb++;
|
|
33
|
+
window[cbName] = cb;
|
|
34
|
+
arg["_dscbstub"] = cbName;
|
|
35
|
+
}
|
|
36
|
+
arg = JSON.stringify(arg);
|
|
37
|
+
if (window._dsbridge) {
|
|
38
|
+
ret = _dsbridge.call(method, arg);
|
|
39
|
+
} else if (window._dswk || navigator.userAgent.indexOf("_dsbridge") != -1) {
|
|
40
|
+
ret = prompt("_dsbridge=" + method, arg);
|
|
41
|
+
}
|
|
42
|
+
return JSON.parse(ret || "{}").data;
|
|
43
|
+
},
|
|
44
|
+
register: function(name, fun, asyn) {
|
|
45
|
+
var q = asyn ? window._dsaf : window._dsf;
|
|
46
|
+
if (!window._dsInit) {
|
|
47
|
+
window._dsInit = true;
|
|
48
|
+
setTimeout(function() {
|
|
49
|
+
bridge.call("_dsb.dsinit");
|
|
50
|
+
}, 0);
|
|
51
|
+
}
|
|
52
|
+
if (typeof fun == "object") {
|
|
53
|
+
q._obs[name] = fun;
|
|
54
|
+
} else {
|
|
55
|
+
q[name] = fun;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
registerAsyn: function(name, fun) {
|
|
59
|
+
this.register(name, fun, true);
|
|
60
|
+
},
|
|
61
|
+
hasNativeMethod: function(name, type) {
|
|
62
|
+
return this.call("_dsb.hasNativeMethod", { name, type: type || "all" });
|
|
63
|
+
},
|
|
64
|
+
disableJavascriptDialogBlock: function(disable) {
|
|
65
|
+
this.call("_dsb.disableJavascriptDialogBlock", {
|
|
66
|
+
disable: disable !== false
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
!function() {
|
|
71
|
+
if (window._dsf)
|
|
72
|
+
return;
|
|
73
|
+
var ob = {
|
|
74
|
+
_dsf: {
|
|
75
|
+
_obs: {}
|
|
76
|
+
},
|
|
77
|
+
_dsaf: {
|
|
78
|
+
_obs: {}
|
|
79
|
+
},
|
|
80
|
+
dscb: 0,
|
|
81
|
+
dsBridge: bridge,
|
|
82
|
+
close: function() {
|
|
83
|
+
bridge.call("_dsb.closePage");
|
|
84
|
+
},
|
|
85
|
+
_handleMessageFromNative: function(info) {
|
|
86
|
+
var arg = JSON.parse(info.data);
|
|
87
|
+
var ret = {
|
|
88
|
+
id: info.callbackId,
|
|
89
|
+
complete: true
|
|
90
|
+
};
|
|
91
|
+
var f = this._dsf[info.method];
|
|
92
|
+
var af = this._dsaf[info.method];
|
|
93
|
+
var callSyn = function(f2, ob3) {
|
|
94
|
+
ret.data = f2.apply(ob3, arg);
|
|
95
|
+
bridge.call("_dsb.returnValue", ret);
|
|
96
|
+
};
|
|
97
|
+
var callAsyn = function(f2, ob3) {
|
|
98
|
+
arg.push(function(data, complete) {
|
|
99
|
+
ret.data = data;
|
|
100
|
+
ret.complete = complete !== false;
|
|
101
|
+
bridge.call("_dsb.returnValue", ret);
|
|
102
|
+
});
|
|
103
|
+
f2.apply(ob3, arg);
|
|
104
|
+
};
|
|
105
|
+
if (f) {
|
|
106
|
+
callSyn(f, this._dsf);
|
|
107
|
+
} else if (af) {
|
|
108
|
+
callAsyn(af, this._dsaf);
|
|
109
|
+
} else {
|
|
110
|
+
var name = info.method.split(".");
|
|
111
|
+
if (name.length < 2)
|
|
112
|
+
return;
|
|
113
|
+
var method = name.pop();
|
|
114
|
+
var namespace = name.join(".");
|
|
115
|
+
var obs = this._dsf._obs;
|
|
116
|
+
var ob2 = obs[namespace] || {};
|
|
117
|
+
var m = ob2[method];
|
|
118
|
+
if (m && typeof m == "function") {
|
|
119
|
+
callSyn(m, ob2);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
obs = this._dsaf._obs;
|
|
123
|
+
ob2 = obs[namespace] || {};
|
|
124
|
+
m = ob2[method];
|
|
125
|
+
if (m && typeof m == "function") {
|
|
126
|
+
callAsyn(m, ob2);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
for (var attr in ob) {
|
|
133
|
+
window[attr] = ob[attr];
|
|
134
|
+
}
|
|
135
|
+
bridge.register("_hasJavascriptMethod", function(method, tag) {
|
|
136
|
+
var name = method.split(".");
|
|
137
|
+
if (name.length < 2) {
|
|
138
|
+
return !!(_dsf[name] || _dsaf[name]);
|
|
139
|
+
} else {
|
|
140
|
+
var method = name.pop();
|
|
141
|
+
var namespace = name.join(".");
|
|
142
|
+
var ob2 = _dsf._obs[namespace] || _dsaf._obs[namespace];
|
|
143
|
+
return ob2 && !!ob2[method];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}();
|
|
147
|
+
var dsbridge = bridge;
|
|
148
|
+
const index = /* @__PURE__ */ getDefaultExportFromCjs(dsbridge);
|
|
149
|
+
const index$1 = /* @__PURE__ */ _mergeNamespaces({
|
|
150
|
+
__proto__: null,
|
|
151
|
+
default: index
|
|
152
|
+
}, [dsbridge]);
|
|
153
|
+
export {
|
|
154
|
+
index$1 as i
|
|
155
|
+
};
|