@datapos/datapos-shared 0.3.188 → 0.3.190

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.
@@ -1,19 +1,19 @@
1
- const U = ["createObject", "dropObject", "removeRecords", "upsertRecords"], P = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
- function B() {
1
+ const F = ["createObject", "dropObject", "removeRecords", "upsertRecords"], U = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
+ function P() {
3
3
  function e(a, r, t) {
4
4
  t.textContent = "Cytoscape.js diagram goes here...";
5
5
  }
6
6
  return { render: e };
7
7
  }
8
- function W() {
8
+ function B() {
9
9
  function e(a, r, t) {
10
10
  t.textContent = "values table goes here...";
11
11
  }
12
12
  return { render: e };
13
13
  }
14
- const A = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", I = "highcharts";
15
- let b, R = !1;
16
- function H() {
14
+ const S = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", I = "highcharts";
15
+ let b, T = !1;
16
+ function W() {
17
17
  async function e(n, s, m, h) {
18
18
  await t();
19
19
  const l = [];
@@ -72,45 +72,39 @@ function H() {
72
72
  );
73
73
  }
74
74
  async function o() {
75
- if (R) return;
76
- await import(`${A}highcharts-more.src.js`), R = !0;
75
+ if (T) return;
76
+ await import(`${S}highcharts-more.src.js`), T = !0;
77
77
  }
78
78
  return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart: r };
79
79
  }
80
- const O = 4, N = `https://cdn.jsdelivr.net/npm/micromark@${O}/+esm`, w = 1, _ = `https://cdn.jsdelivr.net/npm/prismjs@${w}/+esm`, C = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`, L = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`;
81
- let x, T;
82
- function V() {
80
+ const A = 4, O = `https://cdn.jsdelivr.net/npm/micromark@${A}/+esm`, w = 1, N = `https://cdn.jsdelivr.net/npm/prismjs@${w}/+esm`, _ = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`, C = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`;
81
+ let x;
82
+ function H() {
83
83
  async function e() {
84
- return await r(), { micromark: x, Prism: T };
84
+ return await r(), { micromark: x };
85
85
  }
86
86
  async function a() {
87
87
  await r();
88
88
  }
89
89
  async function r() {
90
- if (x && T) return;
91
- const t = await Promise.all([
92
- import(
93
- /* @vite-ignore */
94
- N
95
- ),
96
- import(
97
- /* @vite-ignore */
98
- _
99
- )
100
- // import(/* @vite-ignore */ PRISM_JAVASCRIPT_URL),
101
- // import(/* @vite-ignore */ PRISM_JSON_URL)
102
- ]);
103
- x = t[0].micromark, T = t[1].default, console.log("globalThis", globalThis), await Promise.all([import(
90
+ if (x) return;
91
+ x = (await Promise.all([import(
104
92
  /* @vite-ignore */
105
- C
93
+ O
94
+ ), import(
95
+ /* @vite-ignore */
96
+ N
97
+ )]))[0].micromark, await Promise.all([import(
98
+ /* @vite-ignore */
99
+ _
106
100
  ), import(
107
101
  /* @vite-ignore */
108
- L
102
+ C
109
103
  )]);
110
104
  }
111
105
  return { getStuff: e, render: a };
112
106
  }
113
- const z = 0, X = (e) => e, G = () => Date.now(), J = {
107
+ const V = 0, z = (e) => e, X = () => Date.now(), G = {
114
108
  cartesian_areaLine: { categoryId: "cartesian", typeId: "areaLine", label: { "en-gb": "Area Line" }, options: { highchartsType: "area" } },
115
109
  cartesian_areaSpline: { categoryId: "cartesian", typeId: "areaSpline", label: { "en-gb": "Area Spline" }, options: { highchartsType: "area" } },
116
110
  cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
@@ -140,52 +134,52 @@ class g extends D {
140
134
  super(a, r, t), this.name = "ApplicationError";
141
135
  }
142
136
  }
143
- class K extends g {
137
+ class J extends g {
144
138
  constructor(a, r, t) {
145
139
  super(a, r, t), this.name = "APIError";
146
140
  }
147
141
  }
148
- class q extends g {
142
+ class K extends g {
149
143
  constructor(a, r, t) {
150
144
  super(a, r, t), this.name = "EngineError";
151
145
  }
152
146
  }
153
- class v extends g {
147
+ class R extends g {
154
148
  body;
155
149
  constructor(a, r, t, o) {
156
150
  super(a, r, o), this.name = "FetchError", this.body = t;
157
151
  }
158
152
  }
159
- class $ extends g {
153
+ class L extends g {
160
154
  componentName;
161
155
  info;
162
156
  constructor(a, r, t, o, n) {
163
157
  super(a, r, n), this.name = "VueHandledError", this.info = t, this.componentName = o;
164
158
  }
165
159
  }
166
- class Q extends g {
160
+ class q extends g {
167
161
  constructor(a, r, t) {
168
162
  super(a, r, t), this.name = "WindowHandledRuntimeError";
169
163
  }
170
164
  }
171
- class Y extends g {
165
+ class Q extends g {
172
166
  constructor(a, r, t) {
173
167
  super(a, r, t), this.name = "WindowHandledPromiseRejectionError";
174
168
  }
175
169
  }
176
- class Z extends D {
170
+ class Y extends D {
177
171
  constructor(a, r, t) {
178
172
  super(a, r, t), this.name = "OperationalError";
179
173
  }
180
174
  }
181
- async function ee(e, a, r) {
175
+ async function Z(e, a, r) {
182
176
  const t = `${a} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
183
- return new v(t, r, o);
177
+ return new R(t, r, o);
184
178
  }
185
- function te(e) {
179
+ function ee(e) {
186
180
  return e.map((a) => a.message).join(" ");
187
181
  }
188
- function re(e, a = "Unknown error.") {
182
+ function te(e, a = "Unknown error.") {
189
183
  if (e instanceof Error) return e;
190
184
  if (typeof e == "string") return new Error(e);
191
185
  try {
@@ -194,15 +188,15 @@ function re(e, a = "Unknown error.") {
194
188
  return new Error(a);
195
189
  }
196
190
  }
197
- function ae(e) {
191
+ function re(e) {
198
192
  const a = /* @__PURE__ */ new Set(), r = [];
199
193
  let t = e;
200
194
  for (; t && !a.has(t); ) {
201
195
  a.add(t);
202
196
  let o;
203
- if (t instanceof v)
197
+ if (t instanceof R)
204
198
  o = { body: t.body, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
205
- else if (t instanceof $)
199
+ else if (t instanceof L)
206
200
  o = { componentName: t.componentName, info: t.info, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
207
201
  else if (t instanceof D)
208
202
  o = { locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
@@ -214,7 +208,7 @@ function ae(e) {
214
208
  }
215
209
  return r;
216
210
  }
217
- const S = "en-US", y = {}, ne = (e) => {
211
+ const v = "en-US", y = {}, ae = (e) => {
218
212
  switch (e) {
219
213
  case "Edm.Binary":
220
214
  return "unknown";
@@ -253,17 +247,17 @@ const S = "en-US", y = {}, ne = (e) => {
253
247
  default:
254
248
  return "unknown";
255
249
  }
256
- }, oe = (e) => {
250
+ }, ne = (e) => {
257
251
  if (e) {
258
252
  const a = e.lastIndexOf("/"), r = e.lastIndexOf(".", a > -1 ? a : e.length);
259
253
  return r > -1 ? e.substring(0, r) : e;
260
254
  }
261
- }, se = (e) => {
255
+ }, oe = (e) => {
262
256
  if (e) {
263
257
  const a = e.lastIndexOf(".");
264
258
  if (a > -1) return e.substring(a + 1);
265
259
  }
266
- }, i = (e, a = 2, r = a, t = S) => {
260
+ }, i = (e, a = 2, r = a, t = v) => {
267
261
  if (e == null) return "";
268
262
  const o = `${t}decimal${a}.${r}`;
269
263
  let n = y[o];
@@ -275,7 +269,7 @@ const S = "en-US", y = {}, ne = (e) => {
275
269
  style: "decimal",
276
270
  useGrouping: !0
277
271
  }), y[o] = n), n.format(e);
278
- }, ie = (e) => e == null ? "" : e < 1e3 ? E(e) : e < 1e6 ? `${i(e / 1e3, 2, 0)}K` : e < 1e9 ? `${i(e / 1e6, 2, 0)}M` : e < 1e12 ? `${i(e / 1e9, 2, 0)}B` : `${i(e / 1e12, 2, 0)}T`, le = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${E(e)} bytes` : e < 1048576 ? `${i(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${i(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${i(e / 1073741824, 2, 0)} GB` : `${i(e / 1099511627776, 2, 0)} TB`, ce = (e) => e == null ? "" : e < 1e3 ? `${E(e)} ms` : e === 1e3 ? `${E(e)} sec` : e < 6e4 ? `${i(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${i(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${i(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${i(e / 864e5, 2, 0)} days`, E = (e, a = S) => {
272
+ }, se = (e) => e == null ? "" : e < 1e3 ? E(e) : e < 1e6 ? `${i(e / 1e3, 2, 0)}K` : e < 1e9 ? `${i(e / 1e6, 2, 0)}M` : e < 1e12 ? `${i(e / 1e9, 2, 0)}B` : `${i(e / 1e12, 2, 0)}T`, ie = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${E(e)} bytes` : e < 1048576 ? `${i(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${i(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${i(e / 1073741824, 2, 0)} GB` : `${i(e / 1099511627776, 2, 0)} TB`, le = (e) => e == null ? "" : e < 1e3 ? `${E(e)} ms` : e === 1e3 ? `${E(e)} sec` : e < 6e4 ? `${i(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${i(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${i(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${i(e / 864e5, 2, 0)} days`, E = (e, a = v) => {
279
273
  if (e == null) return "";
280
274
  const r = `${a}decimal0.0`;
281
275
  let t = y[r];
@@ -287,7 +281,7 @@ const S = "en-US", y = {}, ne = (e) => {
287
281
  style: "decimal",
288
282
  useGrouping: !0
289
283
  }), y[r] = t), t.format(e);
290
- }, de = (e) => {
284
+ }, ce = (e) => {
291
285
  switch (e) {
292
286
  case "csv":
293
287
  return "text/csv";
@@ -301,7 +295,7 @@ const S = "en-US", y = {}, ne = (e) => {
301
295
  default:
302
296
  return "application/octet-stream";
303
297
  }
304
- }, M = [
298
+ }, $ = [
305
299
  { id: "dtv", label: { "en-gb": "Delimited Text" } },
306
300
  { id: "e/e", label: { "en-gb": "Entity/Event" } },
307
301
  { id: "jsonArray", label: { "en-gb": "JSON Array" } },
@@ -309,22 +303,22 @@ const S = "en-US", y = {}, ne = (e) => {
309
303
  { id: "xls", label: { "en-gb": "XLS" } },
310
304
  { id: "xlsx", label: { "en-gb": "XLSX" } },
311
305
  { id: "xml", label: { "en-gb": "XML" } }
312
- ], me = (e = d) => {
306
+ ], de = (e = d) => {
313
307
  const a = [];
314
- for (const r of M) a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
308
+ for (const r of $) a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
315
309
  return a;
316
- }, j = [
310
+ }, M = [
317
311
  { id: `
318
312
  `, label: { "en-gb": "Newline" } },
319
313
  { id: "\r", label: { "en-gb": "Carriage Return" } },
320
314
  { id: `\r
321
315
  `, label: { "en-gb": "Carriage Return/Newline" } }
322
- ], ue = (e = d) => {
316
+ ], me = (e = d) => {
323
317
  const a = [];
324
- for (const r of j)
318
+ for (const r of M)
325
319
  a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
326
320
  return a;
327
- }, k = [
321
+ }, j = [
328
322
  { id: ":", label: { "en-gb": "Colon" } },
329
323
  { id: ",", label: { "en-gb": "Comma" } },
330
324
  { id: "!", label: { "en-gb": "Exclamation Mark" } },
@@ -336,12 +330,12 @@ const S = "en-US", y = {}, ne = (e) => {
336
330
  { id: "_", label: { "en-gb": "Underscore" } },
337
331
  { id: "0x1F", label: { "en-gb": "Unit Separator" } },
338
332
  { id: "|", label: { "en-gb": "Vertical Bar" } }
339
- ], pe = (e = d) => {
333
+ ], ue = (e = d) => {
340
334
  const a = [];
341
- for (const r of k)
335
+ for (const r of j)
342
336
  a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
343
337
  return a;
344
- }, F = [
338
+ }, k = [
345
339
  { id: "alpha", color: "red", label: { "en-gb": "alpha" } },
346
340
  { id: "beta", color: "amber", label: { "en-gb": "beta" } },
347
341
  { id: "generalAvailability", color: "green", label: { "en-gb": "" } },
@@ -351,45 +345,45 @@ const S = "en-US", y = {}, ne = (e) => {
351
345
  { id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
352
346
  { id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
353
347
  { id: "underReview", color: "other", label: { "en-gb": "under-review" } }
354
- ], ge = (e, a = d) => {
355
- const r = F.find((t) => t.id === e);
348
+ ], pe = (e, a = d) => {
349
+ const r = k.find((t) => t.id === e);
356
350
  return r ? { ...r, label: r.label[a] || r.label[d] || e } : { id: e, color: "other", label: e };
357
351
  }, d = "en-gb";
358
352
  export {
359
- K as APIError,
353
+ J as APIError,
360
354
  g as ApplicationError,
361
- U as CONNECTOR_DESTINATION_OPERATIONS,
362
- P as CONNECTOR_SOURCE_OPERATIONS,
355
+ F as CONNECTOR_DESTINATION_OPERATIONS,
356
+ U as CONNECTOR_SOURCE_OPERATIONS,
363
357
  d as DEFAULT_LOCALE_CODE,
364
- z as DefaultTimestamp,
365
- q as EngineError,
366
- v as FetchError,
367
- Z as OperationalError,
368
- $ as VueError,
369
- Y as WindowPromiseRejectionError,
370
- Q as WindowRuntimeError,
371
- ee as buildFetchError,
372
- te as concatenateSerialisedErrorMessages,
373
- X as convertMillisecondsToTimestamp,
374
- ne as convertODataTypeIdToUsageTypeId,
375
- se as extractExtensionFromPath,
376
- oe as extractNameFromPath,
358
+ V as DefaultTimestamp,
359
+ K as EngineError,
360
+ R as FetchError,
361
+ Y as OperationalError,
362
+ L as VueError,
363
+ Q as WindowPromiseRejectionError,
364
+ q as WindowRuntimeError,
365
+ Z as buildFetchError,
366
+ ee as concatenateSerialisedErrorMessages,
367
+ z as convertMillisecondsToTimestamp,
368
+ ae as convertODataTypeIdToUsageTypeId,
369
+ oe as extractExtensionFromPath,
370
+ ne as extractNameFromPath,
377
371
  i as formatNumberAsDecimalNumber,
378
- ce as formatNumberAsDuration,
379
- ie as formatNumberAsSize,
380
- le as formatNumberAsStorageSize,
372
+ le as formatNumberAsDuration,
373
+ se as formatNumberAsSize,
374
+ ie as formatNumberAsStorageSize,
381
375
  E as formatNumberAsWholeNumber,
382
- ge as getComponentStatus,
383
- G as getCurrentTimestamp,
384
- me as getDataFormats,
385
- ue as getRecordDelimiters,
386
- pe as getValueDelimiters,
387
- de as lookupMimeTypeForExtension,
388
- re as normalizeToError,
389
- J as presentationViewTypeMap,
390
- ae as serialiseError,
391
- B as useCytoscapeJS,
392
- W as useDataTable,
393
- H as useHighcharts,
394
- V as useMicromark
376
+ pe as getComponentStatus,
377
+ X as getCurrentTimestamp,
378
+ de as getDataFormats,
379
+ me as getRecordDelimiters,
380
+ ue as getValueDelimiters,
381
+ ce as lookupMimeTypeForExtension,
382
+ te as normalizeToError,
383
+ G as presentationViewTypeMap,
384
+ re as serialiseError,
385
+ P as useCytoscapeJS,
386
+ B as useDataTable,
387
+ W as useHighcharts,
388
+ H as useMicromark
395
389
  };
@@ -1,5 +1,4 @@
1
1
  import { micromark } from 'micromark';
2
- import { default as Prism } from 'prismjs';
3
2
  import { Module } from '../../module';
4
3
  import { Component, ComponentConfig, ComponentRef } from '..';
5
4
  export interface Presenter extends Module, Component {
@@ -18,5 +17,4 @@ export type PresenterLocalisedConfig = Omit<PresenterConfig, 'label' | 'descript
18
17
  };
19
18
  export type PresenterTools = {
20
19
  micromark: typeof micromark;
21
- Prism: typeof Prism;
22
20
  };
@@ -1,9 +1,7 @@
1
1
  import { micromark } from 'micromark';
2
- import { default as Prism } from 'prismjs';
3
2
  export declare function useMicromark(): {
4
3
  getStuff: () => Promise<{
5
4
  micromark: typeof micromark;
6
- Prism: typeof Prism;
7
5
  }>;
8
6
  render: () => Promise<void>;
9
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.188",
3
+ "version": "0.3.190",
4
4
  "description": "A TypeScript library containing common declarations and utilities used across other Data Positioning repositories.",
5
5
  "license": "MIT",
6
6
  "private": false,