@drawbridge/components 0.1.23 → 0.1.24
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/bridge/form-subdomain-embed.js +1 -0
- package/dist/bridge/form-subdomain-embed.mjs +1 -0
- package/dist/bridge/form-subdomain.js +5 -2
- package/dist/bridge/form-subdomain.mjs +5 -2
- package/dist/bridge/template-modal.js +2 -2
- package/dist/bridge/template-modal.mjs +2 -2
- package/dist/dashboard/buttons-subscription.js +27 -66
- package/dist/dashboard/buttons-subscription.mjs +27 -65
- package/dist/dashboard/card-payment-method.js +1 -1
- package/dist/dashboard/card-payment-method.mjs +1 -1
- package/dist/dashboard/card-section.js +2 -2
- package/dist/dashboard/card-section.mjs +2 -2
- package/dist/dashboard/card-setting.js +3 -4
- package/dist/dashboard/card-setting.mjs +3 -4
- package/dist/dashboard/card-task.js +4 -22
- package/dist/dashboard/card-task.mjs +4 -22
- package/dist/dashboard/card-tile.js +6 -6
- package/dist/dashboard/card-tile.mjs +6 -6
- package/dist/dashboard/drawer.js +2 -7
- package/dist/dashboard/drawer.mjs +3 -8
- package/dist/dashboard/form-organization-campaign.js +1 -1
- package/dist/dashboard/form-organization-campaign.mjs +1 -1
- package/dist/dashboard/form-organization-identity.js +3 -3
- package/dist/dashboard/form-organization-identity.mjs +3 -3
- package/dist/dashboard/form-organization-workflow.js +9 -7
- package/dist/dashboard/form-organization-workflow.mjs +9 -7
- package/dist/dashboard/form-organization.js +40 -3
- package/dist/dashboard/form-organization.mjs +40 -3
- package/dist/dashboard/guide.js +238 -0
- package/dist/dashboard/guide.mjs +209 -0
- package/dist/dashboard/input-combobox.js +2 -7
- package/dist/dashboard/input-combobox.mjs +2 -7
- package/dist/dashboard/list.js +1 -1
- package/dist/dashboard/list.mjs +1 -1
- package/dist/dashboard/menu.js +96 -188
- package/dist/dashboard/menu.mjs +97 -189
- package/dist/dashboard/modal.js +3 -9
- package/dist/dashboard/modal.mjs +4 -10
- package/dist/dashboard/notice.js +3 -5
- package/dist/dashboard/notice.mjs +3 -5
- package/dist/dashboard/table-cell-title.js +0 -2
- package/dist/dashboard/table-cell-title.mjs +0 -2
- package/dist/dashboard/table.js +20 -61
- package/dist/dashboard/table.mjs +20 -61
- package/dist/dashboard/template-dashboard.js +133 -35
- package/dist/dashboard/template-dashboard.mjs +134 -36
- package/dist/dashboard/template-socket.js +3 -19
- package/dist/dashboard/template-socket.mjs +3 -19
- package/dist/dashboard/template-ui.js +186 -150
- package/dist/dashboard/template-ui.mjs +187 -151
- package/dist/shared/lib/helpers.js +2 -9
- package/dist/shared/lib/helpers.mjs +2 -9
- package/dist/shared/overlay.js +3 -5
- package/dist/shared/overlay.mjs +3 -5
- package/package.json +13 -28
- package/types/dashboard/card-task.d.ts +1 -5
- package/types/dashboard/guide.d.ts +23 -0
- package/types/dashboard/table.d.ts +1 -3
- package/types/dashboard/template-dashboard.d.ts +1 -4
- package/types/dashboard/template-ui.d.ts +2 -2
- package/dist/dashboard/lib/escape.js +0 -48
- package/dist/dashboard/lib/escape.mjs +0 -25
- package/dist/dashboard/lib/rail.js +0 -75
- package/dist/dashboard/lib/rail.mjs +0 -46
- package/dist/dashboard/lib/throttle.js +0 -57
- package/dist/dashboard/lib/throttle.mjs +0 -34
- package/dist/dashboard/template-rail.js +0 -674
- package/dist/dashboard/template-rail.mjs +0 -640
- package/dist/icons/book-open.js +0 -46
- package/dist/icons/book-open.mjs +0 -27
- package/dist/icons/task.js +0 -46
- package/dist/icons/task.mjs +0 -27
- package/dist/shared/lib/motion.js +0 -27
- package/dist/shared/lib/motion.mjs +0 -4
- package/types/dashboard/lib/rail.d.ts +0 -32
- package/types/dashboard/lib/throttle.d.ts +0 -5
- package/types/dashboard/template-rail.d.ts +0 -36
- package/types/icons/book-open.d.ts +0 -5
- package/types/icons/task.d.ts +0 -5
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isValidElement, useEffect, useState } from "react";
|
|
2
|
+
import { isValidElement, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { keepPreviousData, useIsFetching, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { notFound } from "next/navigation";
|
|
5
|
+
import { useDrawer } from "./lib/hooks.mjs";
|
|
5
6
|
import { iconLabel } from "../shared/lib/icon-labels.mjs";
|
|
6
7
|
import ProviderResource from "./provider-resource.mjs";
|
|
7
|
-
import { railFirst } from "./lib/rail.mjs";
|
|
8
|
-
import { useRail } from "./template-rail.mjs";
|
|
9
8
|
import ArrowRight from "../icons/arrow-right.mjs";
|
|
10
9
|
import LoaderIcon from "../icons/loader.mjs";
|
|
11
10
|
import Refresh from "../icons/refresh.mjs";
|
|
12
11
|
import Empty from "../shared/empty.mjs";
|
|
13
12
|
import Badge from "../shared/badge.mjs";
|
|
14
13
|
import Button from "../shared/button.mjs";
|
|
14
|
+
import List from "./list.mjs";
|
|
15
15
|
import LinkBack from "./link-back.mjs";
|
|
16
16
|
import WrapperGradient from "../wrapper-gradient.mjs";
|
|
17
17
|
import Image from "next/image";
|
|
@@ -340,45 +340,143 @@ const TemplateDashboardError = ({
|
|
|
340
340
|
const TemplateDashboardTasks = ({
|
|
341
341
|
items = []
|
|
342
342
|
}) => {
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
|
|
343
|
+
const queryClient = useQueryClient();
|
|
344
|
+
const { close, open } = useDrawer({
|
|
345
|
+
queryClient
|
|
346
|
+
});
|
|
347
|
+
const array = [...items];
|
|
348
|
+
const first = array.shift();
|
|
349
|
+
const nextSteps = () => ({
|
|
350
|
+
title: /* @__PURE__ */ jsxs(
|
|
351
|
+
"span",
|
|
352
|
+
{
|
|
353
|
+
...{
|
|
354
|
+
className: "flex items-center space-x-3"
|
|
355
|
+
},
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ jsx("span", { children: "Next steps" }),
|
|
358
|
+
/* @__PURE__ */ jsx(
|
|
359
|
+
Badge,
|
|
360
360
|
{
|
|
361
361
|
...{
|
|
362
|
-
|
|
363
|
-
justify: "between",
|
|
364
|
-
onClick: () => set("next"),
|
|
365
|
-
variant: "link"
|
|
362
|
+
type: "warning"
|
|
366
363
|
},
|
|
367
|
-
children:
|
|
368
|
-
"span",
|
|
369
|
-
{
|
|
370
|
-
...{
|
|
371
|
-
className: "flex-1 min-w-0 text-left whitespace-normal hover:underline"
|
|
372
|
-
},
|
|
373
|
-
children: first.title
|
|
374
|
-
}
|
|
375
|
-
)
|
|
364
|
+
children: array.length + 1
|
|
376
365
|
}
|
|
377
366
|
)
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
),
|
|
370
|
+
children: /* @__PURE__ */ jsx(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
...{
|
|
374
|
+
className: "p-6"
|
|
375
|
+
},
|
|
376
|
+
children: /* @__PURE__ */ jsx(
|
|
377
|
+
List,
|
|
378
|
+
{
|
|
379
|
+
...{
|
|
380
|
+
items: [
|
|
381
|
+
{
|
|
382
|
+
...first,
|
|
383
|
+
onClick: () => close()
|
|
384
|
+
},
|
|
385
|
+
...array.map((props) => ({
|
|
386
|
+
...props,
|
|
387
|
+
onClick: () => close()
|
|
388
|
+
}))
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
)
|
|
395
|
+
});
|
|
396
|
+
const shown = useRef(null);
|
|
397
|
+
const openAll = () => {
|
|
398
|
+
const props = nextSteps();
|
|
399
|
+
shown.current = props.children;
|
|
400
|
+
open(props);
|
|
401
|
+
};
|
|
402
|
+
useEffect(
|
|
403
|
+
() => {
|
|
404
|
+
const drawer = queryClient.getQueryData(["drawer"]);
|
|
405
|
+
if (!shown.current || !(drawer == null ? void 0 : drawer.active) || drawer.children !== shown.current) return;
|
|
406
|
+
if (!first) {
|
|
407
|
+
shown.current = null;
|
|
408
|
+
close();
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
openAll();
|
|
412
|
+
},
|
|
413
|
+
// The tasks are the trigger; the rest follows them.
|
|
414
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
415
|
+
[items]
|
|
381
416
|
);
|
|
417
|
+
if (first) {
|
|
418
|
+
return /* @__PURE__ */ jsx(
|
|
419
|
+
"div",
|
|
420
|
+
{
|
|
421
|
+
...{
|
|
422
|
+
className: "px-6 md:px-12"
|
|
423
|
+
},
|
|
424
|
+
children: /* @__PURE__ */ jsx(
|
|
425
|
+
"div",
|
|
426
|
+
{
|
|
427
|
+
...{
|
|
428
|
+
className: "bg-white border border-gray rounded px-4 py-3"
|
|
429
|
+
},
|
|
430
|
+
children: /* @__PURE__ */ jsxs(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
...{
|
|
434
|
+
className: "flex items-center justify-between space-x-6"
|
|
435
|
+
},
|
|
436
|
+
children: [
|
|
437
|
+
first && /* @__PURE__ */ jsx(
|
|
438
|
+
List,
|
|
439
|
+
{
|
|
440
|
+
...{
|
|
441
|
+
items: [
|
|
442
|
+
{
|
|
443
|
+
...first,
|
|
444
|
+
onClick: () => close()
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
svg: false
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
),
|
|
451
|
+
(array == null ? void 0 : array.length) > 0 && /* @__PURE__ */ jsx(
|
|
452
|
+
Button,
|
|
453
|
+
{
|
|
454
|
+
...{
|
|
455
|
+
icon: ArrowRight,
|
|
456
|
+
inline: true,
|
|
457
|
+
onClick: openAll,
|
|
458
|
+
variant: "link"
|
|
459
|
+
},
|
|
460
|
+
children: /* @__PURE__ */ jsx(
|
|
461
|
+
Badge,
|
|
462
|
+
{
|
|
463
|
+
...{
|
|
464
|
+
type: "warning"
|
|
465
|
+
},
|
|
466
|
+
children: array.length + 1
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
)
|
|
474
|
+
}
|
|
475
|
+
)
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
return null;
|
|
382
480
|
};
|
|
383
481
|
const SETTLE_QUIET = 50;
|
|
384
482
|
const SETTLE_CAP = 3e3;
|
|
@@ -35,11 +35,9 @@ __export(template_socket_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(template_socket_exports);
|
|
37
37
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
var import_react = require("react");
|
|
39
38
|
var import_navigation = require("next/navigation");
|
|
40
39
|
var import_react_query = require("@tanstack/react-query");
|
|
41
40
|
var import_hooks = require("./lib/hooks");
|
|
42
|
-
var import_throttle = require("./lib/throttle");
|
|
43
41
|
var import_helpers = require("../shared/lib/helpers");
|
|
44
42
|
var import_template_suspended = __toESM(require("./template-suspended"));
|
|
45
43
|
const TemplateSocketAccount = ({
|
|
@@ -238,15 +236,6 @@ const TemplateSocketOrganization = ({
|
|
|
238
236
|
}) => {
|
|
239
237
|
const params = (0, import_navigation.useParams)();
|
|
240
238
|
const queryClient = (0, import_react_query.useQueryClient)();
|
|
241
|
-
const [refetchNextSteps] = (0, import_react.useState)(() => (0, import_throttle.trailingThrottle)({
|
|
242
|
-
wait: 1e4
|
|
243
|
-
}));
|
|
244
|
-
const refetchOrganization = () => refetchNextSteps(
|
|
245
|
-
"organization." + params.organization,
|
|
246
|
-
() => queryClient.invalidateQueries({
|
|
247
|
-
queryKey: ["organization", params.organization]
|
|
248
|
-
})
|
|
249
|
-
);
|
|
250
239
|
const { data: organization } = (0, import_react_query.useQuery)({
|
|
251
240
|
enabled: false,
|
|
252
241
|
queryKey: ["organization", params == null ? void 0 : params.organization]
|
|
@@ -314,13 +303,6 @@ const TemplateSocketOrganization = ({
|
|
|
314
303
|
queryClient.invalidateQueries({
|
|
315
304
|
queryKey: ["menu", "campaign", params.organization]
|
|
316
305
|
});
|
|
317
|
-
refetchOrganization();
|
|
318
|
-
refetchNextSteps(
|
|
319
|
-
"menu." + params.organization,
|
|
320
|
-
() => queryClient.invalidateQueries({
|
|
321
|
-
queryKey: ["menu", "organization", params.organization]
|
|
322
|
-
})
|
|
323
|
-
);
|
|
324
306
|
queryClient.invalidateQueries({
|
|
325
307
|
queryKey: ["organization-affiliate-campaigns"]
|
|
326
308
|
});
|
|
@@ -472,7 +454,9 @@ const TemplateSocketOrganization = ({
|
|
|
472
454
|
// emits this whenever a count changes. Refetch the authoritative org doc
|
|
473
455
|
// + the usage page / dashboard that display those counts.
|
|
474
456
|
"organization.totals": () => {
|
|
475
|
-
|
|
457
|
+
queryClient.invalidateQueries({
|
|
458
|
+
queryKey: ["organization", params.organization]
|
|
459
|
+
});
|
|
476
460
|
queryClient.invalidateQueries({
|
|
477
461
|
queryKey: ["organization-usage-chart", params.organization]
|
|
478
462
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { useParams } from "next/navigation";
|
|
5
4
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
5
|
import { useSocketRoom } from "./lib/hooks.mjs";
|
|
7
|
-
import { trailingThrottle } from "./lib/throttle.mjs";
|
|
8
6
|
import { isAdmin } from "../shared/lib/helpers.mjs";
|
|
9
7
|
import TemplateSuspended from "./template-suspended.mjs";
|
|
10
8
|
const TemplateSocketAccount = ({
|
|
@@ -203,15 +201,6 @@ const TemplateSocketOrganization = ({
|
|
|
203
201
|
}) => {
|
|
204
202
|
const params = useParams();
|
|
205
203
|
const queryClient = useQueryClient();
|
|
206
|
-
const [refetchNextSteps] = useState(() => trailingThrottle({
|
|
207
|
-
wait: 1e4
|
|
208
|
-
}));
|
|
209
|
-
const refetchOrganization = () => refetchNextSteps(
|
|
210
|
-
"organization." + params.organization,
|
|
211
|
-
() => queryClient.invalidateQueries({
|
|
212
|
-
queryKey: ["organization", params.organization]
|
|
213
|
-
})
|
|
214
|
-
);
|
|
215
204
|
const { data: organization } = useQuery({
|
|
216
205
|
enabled: false,
|
|
217
206
|
queryKey: ["organization", params == null ? void 0 : params.organization]
|
|
@@ -279,13 +268,6 @@ const TemplateSocketOrganization = ({
|
|
|
279
268
|
queryClient.invalidateQueries({
|
|
280
269
|
queryKey: ["menu", "campaign", params.organization]
|
|
281
270
|
});
|
|
282
|
-
refetchOrganization();
|
|
283
|
-
refetchNextSteps(
|
|
284
|
-
"menu." + params.organization,
|
|
285
|
-
() => queryClient.invalidateQueries({
|
|
286
|
-
queryKey: ["menu", "organization", params.organization]
|
|
287
|
-
})
|
|
288
|
-
);
|
|
289
271
|
queryClient.invalidateQueries({
|
|
290
272
|
queryKey: ["organization-affiliate-campaigns"]
|
|
291
273
|
});
|
|
@@ -437,7 +419,9 @@ const TemplateSocketOrganization = ({
|
|
|
437
419
|
// emits this whenever a count changes. Refetch the authoritative org doc
|
|
438
420
|
// + the usage page / dashboard that display those counts.
|
|
439
421
|
"organization.totals": () => {
|
|
440
|
-
|
|
422
|
+
queryClient.invalidateQueries({
|
|
423
|
+
queryKey: ["organization", params.organization]
|
|
424
|
+
});
|
|
441
425
|
queryClient.invalidateQueries({
|
|
442
426
|
queryKey: ["organization-usage-chart", params.organization]
|
|
443
427
|
});
|