@histoire/vendors 0.8.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.
@@ -0,0 +1,27 @@
1
+ import './vue.runtime.esm-bundler.js';
2
+
3
+ var isVue2 = false;
4
+ var isVue3 = true;
5
+ var Vue2 = undefined;
6
+
7
+ function install() {}
8
+
9
+ function set(target, key, val) {
10
+ if (Array.isArray(target)) {
11
+ target.length = Math.max(target.length, key);
12
+ target.splice(key, 1, val);
13
+ return val
14
+ }
15
+ target[key] = val;
16
+ return val
17
+ }
18
+
19
+ function del(target, key) {
20
+ if (Array.isArray(target)) {
21
+ target.splice(key, 1);
22
+ return
23
+ }
24
+ delete target[key];
25
+ }
26
+
27
+ export { isVue3 as a, del as d, isVue2 as i, set as s };
@@ -0,0 +1,168 @@
1
+ function getDevtoolsGlobalHook() {
2
+ return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
3
+ }
4
+ function getTarget() {
5
+ // @ts-ignore
6
+ return (typeof navigator !== 'undefined' && typeof window !== 'undefined')
7
+ ? window
8
+ : typeof global !== 'undefined'
9
+ ? global
10
+ : {};
11
+ }
12
+ const isProxyAvailable = typeof Proxy === 'function';
13
+
14
+ const HOOK_SETUP = 'devtools-plugin:setup';
15
+ const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';
16
+
17
+ let supported;
18
+ let perf;
19
+ function isPerformanceSupported() {
20
+ var _a;
21
+ if (supported !== undefined) {
22
+ return supported;
23
+ }
24
+ if (typeof window !== 'undefined' && window.performance) {
25
+ supported = true;
26
+ perf = window.performance;
27
+ }
28
+ else if (typeof global !== 'undefined' && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
29
+ supported = true;
30
+ perf = global.perf_hooks.performance;
31
+ }
32
+ else {
33
+ supported = false;
34
+ }
35
+ return supported;
36
+ }
37
+ function now() {
38
+ return isPerformanceSupported() ? perf.now() : Date.now();
39
+ }
40
+
41
+ class ApiProxy {
42
+ constructor(plugin, hook) {
43
+ this.target = null;
44
+ this.targetQueue = [];
45
+ this.onQueue = [];
46
+ this.plugin = plugin;
47
+ this.hook = hook;
48
+ const defaultSettings = {};
49
+ if (plugin.settings) {
50
+ for (const id in plugin.settings) {
51
+ const item = plugin.settings[id];
52
+ defaultSettings[id] = item.defaultValue;
53
+ }
54
+ }
55
+ const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
56
+ let currentSettings = Object.assign({}, defaultSettings);
57
+ try {
58
+ const raw = localStorage.getItem(localSettingsSaveId);
59
+ const data = JSON.parse(raw);
60
+ Object.assign(currentSettings, data);
61
+ }
62
+ catch (e) {
63
+ // noop
64
+ }
65
+ this.fallbacks = {
66
+ getSettings() {
67
+ return currentSettings;
68
+ },
69
+ setSettings(value) {
70
+ try {
71
+ localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
72
+ }
73
+ catch (e) {
74
+ // noop
75
+ }
76
+ currentSettings = value;
77
+ },
78
+ now() {
79
+ return now();
80
+ },
81
+ };
82
+ if (hook) {
83
+ hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
84
+ if (pluginId === this.plugin.id) {
85
+ this.fallbacks.setSettings(value);
86
+ }
87
+ });
88
+ }
89
+ this.proxiedOn = new Proxy({}, {
90
+ get: (_target, prop) => {
91
+ if (this.target) {
92
+ return this.target.on[prop];
93
+ }
94
+ else {
95
+ return (...args) => {
96
+ this.onQueue.push({
97
+ method: prop,
98
+ args,
99
+ });
100
+ };
101
+ }
102
+ },
103
+ });
104
+ this.proxiedTarget = new Proxy({}, {
105
+ get: (_target, prop) => {
106
+ if (this.target) {
107
+ return this.target[prop];
108
+ }
109
+ else if (prop === 'on') {
110
+ return this.proxiedOn;
111
+ }
112
+ else if (Object.keys(this.fallbacks).includes(prop)) {
113
+ return (...args) => {
114
+ this.targetQueue.push({
115
+ method: prop,
116
+ args,
117
+ resolve: () => { },
118
+ });
119
+ return this.fallbacks[prop](...args);
120
+ };
121
+ }
122
+ else {
123
+ return (...args) => {
124
+ return new Promise(resolve => {
125
+ this.targetQueue.push({
126
+ method: prop,
127
+ args,
128
+ resolve,
129
+ });
130
+ });
131
+ };
132
+ }
133
+ },
134
+ });
135
+ }
136
+ async setRealTarget(target) {
137
+ this.target = target;
138
+ for (const item of this.onQueue) {
139
+ this.target.on[item.method](...item.args);
140
+ }
141
+ for (const item of this.targetQueue) {
142
+ item.resolve(await this.target[item.method](...item.args));
143
+ }
144
+ }
145
+ }
146
+
147
+ function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
148
+ const descriptor = pluginDescriptor;
149
+ const target = getTarget();
150
+ const hook = getDevtoolsGlobalHook();
151
+ const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
152
+ if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
153
+ hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
154
+ }
155
+ else {
156
+ const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
157
+ const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
158
+ list.push({
159
+ pluginDescriptor: descriptor,
160
+ setupFn,
161
+ proxy,
162
+ });
163
+ if (proxy)
164
+ setupFn(proxy.proxiedTarget);
165
+ }
166
+ }
167
+
168
+ export { setupDevtoolsPlugin as s };
@@ -0,0 +1 @@
1
+ export * from '../../node_modules/pinia';