@lumerahq/ui 0.7.1 → 0.7.3

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/README.md CHANGED
@@ -40,6 +40,17 @@ const items = await pbList<User>('users', { filter: JSON.stringify({ status: "ac
40
40
  const user = await pbGet<User>('users', 'user-id');
41
41
  ```
42
42
 
43
+ ### Shareable App Links
44
+
45
+ ```tsx
46
+ import { getShareableAppUrl } from '@lumerahq/ui/lib';
47
+
48
+ const shareUrl = getShareableAppUrl();
49
+ // -> https://your-company.lumerahq.dev/app/my-app/orders/123
50
+ // HashRouter apps retain their hash route:
51
+ // -> https://your-company.lumerahq.dev/app/my-app#/orders/123
52
+ ```
53
+
43
54
  ### Automation Runner
44
55
 
45
56
  ```tsx
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { forwardRef, createElement, useState, useLayoutEffect, useCallback } from "react";
4
- import { b as automationStatuses, n as getAutomationRunFileDownloadUrl, v as listAutomationRunFiles } from "./automations-C-qXt1dk.js";
4
+ import { c as automationStatuses, q as getAutomationRunFileDownloadUrl, w as listAutomationRunFiles } from "./automations-NGijzdAj.js";
5
5
  import { p as clsx, o as cn, a as formatCellValue } from "./formatters-Baj7FkeG.js";
6
- import { u as useAutomationRun } from "./use-automation-run-BJqfJATj.js";
6
+ import { u as useAutomationRun } from "./use-automation-run-CSxc9EhA.js";
7
7
  import * as ReactDOM from "react-dom";
8
8
  const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
9
9
  const toCamelCase = (string) => string.replace(
@@ -1,4 +1,4 @@
1
- import { p as parentApiRequest, B as BridgeError } from "./automations-C-qXt1dk.js";
1
+ import { p as parentApiRequest, B as BridgeError } from "./automations-NGijzdAj.js";
2
2
  const API_PREFIX = "/api";
3
3
  const buildUrl = (path) => {
4
4
  const normalized = path.startsWith("/") ? path : `/${path}`;
@@ -18,10 +18,66 @@ class BridgeError extends Error {
18
18
  const pendingRequests = /* @__PURE__ */ new Map();
19
19
  const initListeners = /* @__PURE__ */ new Set();
20
20
  let listenerAttached = false;
21
+ let routeSyncAttached = false;
21
22
  let storedHostPayload;
23
+ let storedHostOrigin;
24
+ let suppressRouteBroadcast = false;
25
+ let lastBroadcastRoute = "";
22
26
  function getAppProjectExternalId() {
23
27
  return storedHostPayload?.app?.projectExternalId;
24
28
  }
29
+ const normalizeHash = (hash) => {
30
+ if (!hash) return "";
31
+ return hash.startsWith("#") ? hash : `#${hash}`;
32
+ };
33
+ const stripBasePath = (basePathname, pathname) => {
34
+ const normalizedBase = basePathname === "/" ? "/" : basePathname.replace(/\/+$/, "");
35
+ const normalizedPath = pathname || "/";
36
+ if (normalizedBase === "/") {
37
+ return normalizedPath.replace(/^\/+/, "");
38
+ }
39
+ if (normalizedPath === normalizedBase || normalizedPath === `${normalizedBase}/`) {
40
+ return "";
41
+ }
42
+ const withSlash = `${normalizedBase}/`;
43
+ if (normalizedPath.startsWith(withSlash)) {
44
+ return normalizedPath.slice(withSlash.length);
45
+ }
46
+ return null;
47
+ };
48
+ const deriveHostRouteFromCurrentLocation = () => {
49
+ if (typeof window === "undefined") return void 0;
50
+ const appExternalId = storedHostPayload?.app?.externalId;
51
+ const iframeBaseUrl = storedHostPayload?.app?.iframeBaseUrl;
52
+ if (!appExternalId || !iframeBaseUrl) {
53
+ return void 0;
54
+ }
55
+ const baseUrl = new URL(iframeBaseUrl, storedHostOrigin ?? window.location.origin);
56
+ const strippedPath = stripBasePath(baseUrl.pathname || "/", window.location.pathname || "/");
57
+ if (strippedPath === null) {
58
+ return void 0;
59
+ }
60
+ const pathname = strippedPath ? `/app/${appExternalId}/${strippedPath.replace(/^\/+/, "")}` : `/app/${appExternalId}`;
61
+ return {
62
+ pathname,
63
+ search: window.location.search,
64
+ hash: normalizeHash(window.location.hash)
65
+ };
66
+ };
67
+ function getShareableAppUrl(options) {
68
+ const target = deriveHostRouteFromCurrentLocation();
69
+ if (!target) {
70
+ return void 0;
71
+ }
72
+ const route = `${target.pathname}${target.search ?? ""}${target.hash ?? ""}`;
73
+ if (options?.absolute === false) {
74
+ return route;
75
+ }
76
+ if (typeof window === "undefined") {
77
+ return route;
78
+ }
79
+ return new URL(route, storedHostOrigin ?? window.location.origin).toString();
80
+ }
25
81
  const log = (...args) => {
26
82
  };
27
83
  const generateId = () => {
@@ -101,6 +157,92 @@ const playgroundApiRequest = async (request2) => {
101
157
  };
102
158
  }
103
159
  };
160
+ const isStandaloneDevMode = () => false;
161
+ const getCurrentRouteSnapshot = () => ({
162
+ pathname: window.location.pathname,
163
+ search: window.location.search,
164
+ hash: window.location.hash
165
+ });
166
+ const routeSnapshotToString = (payload) => `${payload.pathname}${payload.search ?? ""}${payload.hash ?? ""}`;
167
+ const dispatchSyntheticRouteEvents = (previous, next) => {
168
+ const currentUrl = new URL(routeSnapshotToString(previous), window.location.origin).toString();
169
+ const nextUrl = new URL(routeSnapshotToString(next), window.location.origin).toString();
170
+ window.dispatchEvent(new PopStateEvent("popstate", { state: window.history.state }));
171
+ if (previous.hash !== next.hash) {
172
+ try {
173
+ window.dispatchEvent(
174
+ new HashChangeEvent("hashchange", {
175
+ oldURL: currentUrl,
176
+ newURL: nextUrl
177
+ })
178
+ );
179
+ } catch {
180
+ window.dispatchEvent(new Event("hashchange"));
181
+ }
182
+ }
183
+ };
184
+ const postRouteChange = (mode) => {
185
+ if (typeof window === "undefined" || !isEmbedded() || isStandaloneDevMode() || isPlaygroundMode() || suppressRouteBroadcast) {
186
+ return;
187
+ }
188
+ const payload = { ...getCurrentRouteSnapshot(), mode };
189
+ const route = routeSnapshotToString(payload);
190
+ if (route === lastBroadcastRoute) {
191
+ return;
192
+ }
193
+ lastBroadcastRoute = route;
194
+ window.parent.postMessage({ type: "route-change", payload }, storedHostOrigin ?? "*");
195
+ };
196
+ const applyRouteSyncFromParent = (payload) => {
197
+ if (typeof window === "undefined" || !payload?.pathname) {
198
+ return;
199
+ }
200
+ const nextRoute = routeSnapshotToString(payload);
201
+ const currentRoute = routeSnapshotToString(getCurrentRouteSnapshot());
202
+ if (!nextRoute || nextRoute === currentRoute) {
203
+ lastBroadcastRoute = currentRoute;
204
+ return;
205
+ }
206
+ const previous = getCurrentRouteSnapshot();
207
+ suppressRouteBroadcast = true;
208
+ try {
209
+ window.history.replaceState(window.history.state, "", nextRoute);
210
+ dispatchSyntheticRouteEvents(previous, {
211
+ pathname: payload.pathname,
212
+ search: payload.search ?? "",
213
+ hash: payload.hash ?? ""
214
+ });
215
+ lastBroadcastRoute = nextRoute;
216
+ } finally {
217
+ setTimeout(() => {
218
+ suppressRouteBroadcast = false;
219
+ }, 0);
220
+ }
221
+ };
222
+ const ensureRouteSync = () => {
223
+ if (routeSyncAttached || typeof window === "undefined" || isStandaloneDevMode() || !isEmbedded() || isPlaygroundMode()) {
224
+ return;
225
+ }
226
+ routeSyncAttached = true;
227
+ lastBroadcastRoute = routeSnapshotToString(getCurrentRouteSnapshot());
228
+ const { history } = window;
229
+ const originalPushState = history.pushState.bind(history);
230
+ const originalReplaceState = history.replaceState.bind(history);
231
+ history.pushState = function pushState(...args) {
232
+ originalPushState(...args);
233
+ postRouteChange("push");
234
+ };
235
+ history.replaceState = function replaceState(...args) {
236
+ originalReplaceState(...args);
237
+ postRouteChange("replace");
238
+ };
239
+ window.addEventListener("popstate", () => {
240
+ postRouteChange("replace");
241
+ });
242
+ window.addEventListener("hashchange", () => {
243
+ postRouteChange("replace");
244
+ });
245
+ };
104
246
  const handleMessage = (event) => {
105
247
  if (event.source !== window.parent) {
106
248
  return;
@@ -115,6 +257,7 @@ const handleMessage = (event) => {
115
257
  }
116
258
  const { type, payload } = event.data ?? {};
117
259
  if (type === "init") {
260
+ storedHostOrigin = event.origin;
118
261
  storedHostPayload = payload;
119
262
  initListeners.forEach((listener) => listener(payload));
120
263
  return;
@@ -127,12 +270,17 @@ const handleMessage = (event) => {
127
270
  } else {
128
271
  log("No pending request found for response id", response?.id);
129
272
  }
273
+ return;
274
+ }
275
+ if (type === "route-sync") {
276
+ applyRouteSyncFromParent(payload);
130
277
  }
131
278
  };
132
279
  const ensureListener = () => {
133
280
  if (listenerAttached || typeof window === "undefined") return;
134
281
  listenerAttached = true;
135
282
  window.addEventListener("message", handleMessage);
283
+ ensureRouteSync();
136
284
  };
137
285
  const isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
138
286
  const postReadyMessage = () => {
@@ -156,7 +304,12 @@ const postReadyMessage = () => {
156
304
  name: user.company_name,
157
305
  apiName: user.company_api_name
158
306
  },
159
- user: { id: user.id, name: user.name, email: user.email, role: user.role },
307
+ user: {
308
+ id: user.id,
309
+ name: user.name,
310
+ email: user.email,
311
+ role: user.role
312
+ },
160
313
  message: "Playground mode"
161
314
  };
162
315
  log("Playground mode: init from VB", payload);
@@ -175,6 +328,8 @@ const postReadyMessage = () => {
175
328
  return;
176
329
  }
177
330
  window.parent.postMessage({ type: "ready" }, "*");
331
+ lastBroadcastRoute = "";
332
+ setTimeout(() => postRouteChange("replace"), 0);
178
333
  };
179
334
  const onInitMessage = (listener) => {
180
335
  ensureListener();
@@ -210,7 +365,10 @@ const parentApiRequest = async (request2) => {
210
365
  id,
211
366
  method: request2.method,
212
367
  url: request2.url,
213
- headers: { "X-Lumera-Client": "lumera-custom-app", ...request2.headers },
368
+ headers: {
369
+ "X-Lumera-Client": "lumera-custom-app",
370
+ ...request2.headers
371
+ },
214
372
  body: request2.body,
215
373
  isBase64: request2.isBase64
216
374
  }
@@ -448,33 +606,34 @@ async function listRunsByExternalId(params) {
448
606
  });
449
607
  }
450
608
  export {
451
- pollRun as A,
609
+ pollAutomationRun as A,
452
610
  BridgeError as B,
611
+ pollRun as C,
453
612
  EXPECTED_PARENT_ORIGIN as E,
454
- postReadyMessage as a,
455
- automationStatuses as b,
456
- cancelAutomationRun as c,
457
- cancelRun as d,
458
- clearAutomationCache as e,
459
- createAutomationRun as f,
613
+ getShareableAppUrl as a,
614
+ postReadyMessage as b,
615
+ automationStatuses as c,
616
+ cancelAutomationRun as d,
617
+ cancelRun as e,
618
+ clearAutomationCache as f,
460
619
  getAppProjectExternalId as g,
461
- createRun as h,
620
+ createAutomationRun as h,
462
621
  isEmbedded as i,
463
- ensureAutomationRun as j,
464
- ensureRun as k,
465
- getAutomationByExternalId as l,
466
- getAutomationRun as m,
467
- getAutomationRunFileDownloadUrl as n,
622
+ createRun as j,
623
+ ensureAutomationRun as k,
624
+ ensureRun as l,
625
+ getAutomationByExternalId as m,
626
+ getAutomationRun as n,
468
627
  onInitMessage as o,
469
628
  parentApiRequest as p,
470
- getRun as q,
471
- getRunFiles as r,
472
- getRunFileUrl as s,
473
- isActiveStatus as t,
474
- isTerminalStatus as u,
475
- listAutomationRunFiles as v,
476
- listRuns as w,
477
- listRunsByAgent as x,
478
- listRunsByExternalId as y,
479
- pollAutomationRun as z
629
+ getAutomationRunFileDownloadUrl as q,
630
+ getRun as r,
631
+ getRunFiles as s,
632
+ getRunFileUrl as t,
633
+ isActiveStatus as u,
634
+ isTerminalStatus as v,
635
+ listAutomationRunFiles as w,
636
+ listRuns as x,
637
+ listRunsByAgent as y,
638
+ listRunsByExternalId as z
480
639
  };
@@ -1,4 +1,4 @@
1
- import { A, a, D, b, c, R } from "../RecordSheet-Gz6YUndK.js";
1
+ import { A, a, D, b, c, R } from "../RecordSheet-DJL4aph1.js";
2
2
  export {
3
3
  A as AutomationRunList,
4
4
  a as AutomationRunner,
@@ -1,5 +1,5 @@
1
- import { u, a, b, c, d, e } from "../use-sql-table-9L14vGe4.js";
2
- import { u as u2 } from "../use-automation-run-BJqfJATj.js";
1
+ import { u, a, b, c, d, e } from "../use-sql-table-CEBrg3zE.js";
2
+ import { u as u2 } from "../use-automation-run-CSxc9EhA.js";
3
3
  export {
4
4
  u as useAutomationAgent,
5
5
  u2 as useAutomationRun,
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A, a, D, b, c, R } from "./RecordSheet-Gz6YUndK.js";
2
- import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-9L14vGe4.js";
3
- import { u as u2 } from "./use-automation-run-BJqfJATj.js";
4
- import { B, E, b as b3, c as c3, d as d2, e as e2, f, h, j, k, g, l, m, n, q, s, r, t, i, u as u3, v, w, x, y, o, p, z, A as A2, a as a3 } from "./automations-C-qXt1dk.js";
5
- import { g as g2, a as a4, p as p2, b as b4, c as c4, d as d3, e as e3, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u4 } from "./api-DUHGhS3m.js";
1
+ import { A, a, D, b, c, R } from "./RecordSheet-DJL4aph1.js";
2
+ import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-CEBrg3zE.js";
3
+ import { u as u2 } from "./use-automation-run-CSxc9EhA.js";
4
+ import { B, E, c as c3, d as d2, e as e2, f, h, j, k, l, g, m, n, q, r, t, s, a as a3, u as u3, i, v, w, x, y, z, o, p, A as A2, C, b as b3 } from "./automations-NGijzdAj.js";
5
+ import { g as g2, a as a4, p as p2, b as b4, c as c4, d as d3, e as e3, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u4 } from "./api-BIZPZp2T.js";
6
6
  import { o as o2, f as f3, a as a5, b as b5, c as c5, d as d4, e as e4, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m2, n as n2, s as s3 } from "./formatters-Baj7FkeG.js";
7
7
  import { q as q2 } from "./query-client-DdOWay4_.js";
8
8
  export {
@@ -14,15 +14,15 @@ export {
14
14
  c as DataTablePagination,
15
15
  E as EXPECTED_PARENT_ORIGIN,
16
16
  R as RecordSheet,
17
- b3 as automationStatuses,
18
- c3 as cancelAutomationRun,
19
- d2 as cancelRun,
20
- e2 as clearAutomationCache,
17
+ c3 as automationStatuses,
18
+ d2 as cancelAutomationRun,
19
+ e2 as cancelRun,
20
+ f as clearAutomationCache,
21
21
  o2 as cn,
22
- f as createAutomationRun,
23
- h as createRun,
24
- j as ensureAutomationRun,
25
- k as ensureRun,
22
+ h as createAutomationRun,
23
+ j as createRun,
24
+ k as ensureAutomationRun,
25
+ l as ensureRun,
26
26
  f3 as formatBoolean,
27
27
  a5 as formatCellValue,
28
28
  b5 as formatCurrency,
@@ -38,21 +38,22 @@ export {
38
38
  m2 as formatSelect,
39
39
  n2 as formatText,
40
40
  g as getAppProjectExternalId,
41
- l as getAutomationByExternalId,
42
- m as getAutomationRun,
43
- n as getAutomationRunFileDownloadUrl,
41
+ m as getAutomationByExternalId,
42
+ n as getAutomationRun,
43
+ q as getAutomationRunFileDownloadUrl,
44
44
  g2 as getDownloadUrl,
45
- q as getRun,
46
- s as getRunFileUrl,
47
- r as getRunFiles,
45
+ r as getRun,
46
+ t as getRunFileUrl,
47
+ s as getRunFiles,
48
+ a3 as getShareableAppUrl,
48
49
  a4 as getUploadUrl,
49
- t as isActiveStatus,
50
+ u3 as isActiveStatus,
50
51
  i as isEmbedded,
51
- u3 as isTerminalStatus,
52
- v as listAutomationRunFiles,
53
- w as listRuns,
54
- x as listRunsByAgent,
55
- y as listRunsByExternalId,
52
+ v as isTerminalStatus,
53
+ w as listAutomationRunFiles,
54
+ x as listRuns,
55
+ y as listRunsByAgent,
56
+ z as listRunsByExternalId,
56
57
  o as onInitMessage,
57
58
  p as parentApiRequest,
58
59
  p2 as pbBulkDelete,
@@ -66,9 +67,9 @@ export {
66
67
  j2 as pbUpdate,
67
68
  k2 as pbUpdateRecord,
68
69
  l2 as pbUpsert,
69
- z as pollAutomationRun,
70
- A2 as pollRun,
71
- a3 as postReadyMessage,
70
+ A2 as pollAutomationRun,
71
+ C as pollRun,
72
+ b3 as postReadyMessage,
72
73
  q2 as queryClient,
73
74
  s2 as sendEmail,
74
75
  s3 as stripHtml,
@@ -33,6 +33,8 @@ export type HostPayload = {
33
33
  app?: {
34
34
  externalId?: string;
35
35
  projectExternalId?: string;
36
+ /** Base iframe URL mounted by Lumera, used for share-link generation. */
37
+ iframeBaseUrl?: string;
36
38
  };
37
39
  message?: string;
38
40
  session?: {
@@ -84,6 +86,18 @@ export declare class BridgeError extends Error {
84
86
  * Returns the project external ID (package.json name) if available.
85
87
  */
86
88
  export declare function getAppProjectExternalId(): string | undefined;
89
+ /**
90
+ * Build a shareable Lumera host URL for the current embedded app route.
91
+ *
92
+ * For BrowserRouter apps this returns clean path-based URLs such as
93
+ * `/app/my-app/orders/123`. For HashRouter apps the hash segment is retained,
94
+ * e.g. `/app/my-app#/orders/123`.
95
+ *
96
+ * Returns `undefined` until the bridge init payload is received.
97
+ */
98
+ export declare function getShareableAppUrl(options?: {
99
+ absolute?: boolean;
100
+ }): string | undefined;
87
101
  /**
88
102
  * Check if the app is running embedded in an iframe.
89
103
  *
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,KAC+E,CAAC;AAWnH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB;IAClB,MAAM,EAAE,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ProjectExternalId, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, postReadyMessage, } from './bridge';
6
+ export { BridgeError, type BridgeRequest, type BridgeResponse, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, postReadyMessage, } from './bridge';
7
7
  export { type EmailSendRequest, type EmailSendResult, type FileDescriptor, getDownloadUrl, getUploadUrl, type PbBulkResult, type PbListOptions, type PbListResponse, type PbRecord, type PbSqlRequest, type PbSqlResponse, pbBulkDelete, pbBulkUpdate, pbCreate, pbDelete, pbGet, pbList, pbSearch, pbSql, pbUpdate, pbUpdateRecord, pbUpsert, sendEmail, type UploadOptions, type UploadUrlResponse, uploadFile, } from './api';
8
8
  export { type Automation, type AutomationRun, type AutomationRunFile, type AutomationStatus, automationStatuses, type CreateRunOptions, cancelAutomationRun, cancelRun, clearAutomationCache, createAutomationRun, createRun, ensureAutomationRun, ensureRun, getAutomationByExternalId, getAutomationRun, getAutomationRunFileDownloadUrl, getRun, getRunFiles, getRunFileUrl, isActiveStatus, isTerminalStatus, type LegacyCreateRunOptions, type ListRunsOptions, listAutomationRunFiles, listRuns, listRunsByAgent, listRunsByExternalId, type PollOptions, pollAutomationRun, pollRun, } from './automations';
9
9
  export { type ColumnType, type FileDescriptor as FormatterFileDescriptor, type FormatOptions, formatBoolean, formatCellValue, formatCurrency, formatDate, formatDateTime, formatEditor, formatFile, formatFileSize, formatJson, formatNumber, formatPercent, formatRelation, formatSelect, formatText, stripHtml, } from './formatters';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAEL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EAEnB,sBAAsB,EAEtB,uBAAuB,EAEvB,KAAK,WAAW,EAChB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,UAAU,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EACL,KAAK,UAAU,EACf,KAAK,cAAc,IAAI,uBAAuB,EAC9C,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC"}
package/dist/lib/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { B, E, b, c, d, e, f, h, j, k, g, l, m, n, q, s, r, t, i, u, v, w, x, y, o, p, z, A, a } from "../automations-C-qXt1dk.js";
2
- import { g as g2, a as a2, p as p2, b as b2, c as c2, d as d2, e as e2, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u2 } from "../api-DUHGhS3m.js";
1
+ import { B, E, c, d, e, f, h, j, k, l, g, m, n, q, r, t, s, a, u, i, v, w, x, y, z, o, p, A, C, b } from "../automations-NGijzdAj.js";
2
+ import { g as g2, a as a2, p as p2, b as b2, c as c2, d as d2, e as e2, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u2 } from "../api-BIZPZp2T.js";
3
3
  import { o as o2, f as f3, a as a3, b as b3, c as c3, d as d3, e as e3, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m2, n as n2, s as s3 } from "../formatters-Baj7FkeG.js";
4
4
  import { q as q2 } from "../query-client-DdOWay4_.js";
5
5
  export {
6
6
  B as BridgeError,
7
7
  E as EXPECTED_PARENT_ORIGIN,
8
- b as automationStatuses,
9
- c as cancelAutomationRun,
10
- d as cancelRun,
11
- e as clearAutomationCache,
8
+ c as automationStatuses,
9
+ d as cancelAutomationRun,
10
+ e as cancelRun,
11
+ f as clearAutomationCache,
12
12
  o2 as cn,
13
- f as createAutomationRun,
14
- h as createRun,
15
- j as ensureAutomationRun,
16
- k as ensureRun,
13
+ h as createAutomationRun,
14
+ j as createRun,
15
+ k as ensureAutomationRun,
16
+ l as ensureRun,
17
17
  f3 as formatBoolean,
18
18
  a3 as formatCellValue,
19
19
  b3 as formatCurrency,
@@ -29,21 +29,22 @@ export {
29
29
  m2 as formatSelect,
30
30
  n2 as formatText,
31
31
  g as getAppProjectExternalId,
32
- l as getAutomationByExternalId,
33
- m as getAutomationRun,
34
- n as getAutomationRunFileDownloadUrl,
32
+ m as getAutomationByExternalId,
33
+ n as getAutomationRun,
34
+ q as getAutomationRunFileDownloadUrl,
35
35
  g2 as getDownloadUrl,
36
- q as getRun,
37
- s as getRunFileUrl,
38
- r as getRunFiles,
36
+ r as getRun,
37
+ t as getRunFileUrl,
38
+ s as getRunFiles,
39
+ a as getShareableAppUrl,
39
40
  a2 as getUploadUrl,
40
- t as isActiveStatus,
41
+ u as isActiveStatus,
41
42
  i as isEmbedded,
42
- u as isTerminalStatus,
43
- v as listAutomationRunFiles,
44
- w as listRuns,
45
- x as listRunsByAgent,
46
- y as listRunsByExternalId,
43
+ v as isTerminalStatus,
44
+ w as listAutomationRunFiles,
45
+ x as listRuns,
46
+ y as listRunsByAgent,
47
+ z as listRunsByExternalId,
47
48
  o as onInitMessage,
48
49
  p as parentApiRequest,
49
50
  p2 as pbBulkDelete,
@@ -57,9 +58,9 @@ export {
57
58
  j2 as pbUpdate,
58
59
  k2 as pbUpdateRecord,
59
60
  l2 as pbUpsert,
60
- z as pollAutomationRun,
61
- A as pollRun,
62
- a as postReadyMessage,
61
+ A as pollAutomationRun,
62
+ C as pollRun,
63
+ b as postReadyMessage,
63
64
  q2 as queryClient,
64
65
  s2 as sendEmail,
65
66
  s3 as stripHtml,
@@ -1,6 +1,6 @@
1
1
  import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
2
2
  import { useState, useRef, useEffect, useCallback } from "react";
3
- import { j as ensureAutomationRun, f as createAutomationRun, c as cancelAutomationRun, b as automationStatuses, m as getAutomationRun } from "./automations-C-qXt1dk.js";
3
+ import { k as ensureAutomationRun, h as createAutomationRun, d as cancelAutomationRun, c as automationStatuses, n as getAutomationRun } from "./automations-NGijzdAj.js";
4
4
  function useAutomationRun(options) {
5
5
  const {
6
6
  agentId,
@@ -1,7 +1,7 @@
1
1
  import { useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
2
2
  import { useState, useCallback, useEffect, useMemo } from "react";
3
- import { x as listRunsByAgent, b as automationStatuses, f as createAutomationRun, o as onInitMessage } from "./automations-C-qXt1dk.js";
4
- import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-DUHGhS3m.js";
3
+ import { y as listRunsByAgent, c as automationStatuses, h as createAutomationRun, o as onInitMessage } from "./automations-NGijzdAj.js";
4
+ import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-BIZPZp2T.js";
5
5
  function useAutomationAgent({
6
6
  agentId,
7
7
  limit = 5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/ui",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"