@drawbridge/components 0.1.13 → 0.1.15
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/components/styles.css +364 -2
- package/dist/advertisement.js +3 -1
- package/dist/advertisement.mjs +3 -1
- package/dist/bridge/advertisements.js +2 -0
- package/dist/bridge/advertisements.mjs +2 -0
- package/dist/bridge/countdown.js +2 -1
- package/dist/bridge/countdown.mjs +2 -1
- package/dist/bridge/form-subdomain-embed.js +18 -20
- package/dist/bridge/form-subdomain-embed.mjs +18 -20
- package/dist/bridge/form-subdomain-header.js +24 -1
- package/dist/bridge/form-subdomain-header.mjs +24 -1
- package/dist/bridge/form-subdomain-missions.js +577 -0
- package/dist/bridge/form-subdomain-missions.mjs +540 -0
- package/dist/bridge/form-subdomain.js +530 -220
- package/dist/bridge/form-subdomain.mjs +533 -222
- package/dist/bridge/lib/entry.js +59 -0
- package/dist/bridge/lib/entry.mjs +29 -0
- package/dist/bridge/lib/location.js +38 -0
- package/dist/bridge/lib/location.mjs +13 -0
- package/dist/bridge/lib/order.js +71 -0
- package/dist/bridge/lib/order.mjs +44 -0
- package/dist/bridge/lib/url.js +9 -0
- package/dist/bridge/lib/url.mjs +7 -0
- package/dist/bridge/share-button.js +5 -3
- package/dist/bridge/share-button.mjs +5 -3
- package/dist/bridge/subdomain-content.js +7 -6
- package/dist/bridge/subdomain-content.mjs +7 -6
- package/dist/bridge/template-layout.js +59 -21
- package/dist/bridge/template-layout.mjs +59 -21
- package/dist/bridge/template-modal.js +42 -76
- package/dist/bridge/template-modal.mjs +39 -73
- package/dist/bridge/template-preview.js +208 -0
- package/dist/bridge/template-preview.mjs +173 -0
- package/dist/bridge/template-subdomain-gallery.js +6 -2
- package/dist/bridge/template-subdomain-gallery.mjs +6 -2
- package/dist/bridge/template-subdomain-link.js +6 -1
- package/dist/bridge/template-subdomain-link.mjs +6 -1
- package/dist/bridge/template-subdomain.js +20 -15
- package/dist/bridge/template-subdomain.mjs +20 -15
- package/dist/dashboard/accordion.js +74 -39
- package/dist/dashboard/accordion.mjs +74 -39
- package/dist/dashboard/avatar.js +109 -3
- package/dist/dashboard/avatar.mjs +106 -4
- package/dist/dashboard/buttons-subscription.js +384 -0
- package/dist/dashboard/buttons-subscription.mjs +349 -0
- package/dist/dashboard/card-campaign-switch.js +277 -0
- package/dist/dashboard/card-campaign-switch.mjs +243 -0
- package/dist/dashboard/card-order.js +231 -29
- package/dist/dashboard/card-order.mjs +231 -29
- package/dist/dashboard/card-section.js +26 -2
- package/dist/dashboard/card-section.mjs +26 -2
- package/dist/dashboard/card-tile.js +6 -7
- package/dist/dashboard/card-tile.mjs +6 -7
- package/dist/dashboard/connection-workflows.js +205 -0
- package/dist/dashboard/connection-workflows.mjs +171 -0
- package/dist/dashboard/device.js +95 -0
- package/dist/dashboard/device.mjs +72 -0
- package/dist/dashboard/form-admin-campaign.js +19 -50
- package/dist/dashboard/form-admin-campaign.mjs +20 -51
- package/dist/dashboard/form-ai.js +9 -6
- package/dist/dashboard/form-ai.mjs +9 -6
- package/dist/dashboard/form-auth.js +35 -25
- package/dist/dashboard/form-auth.mjs +36 -26
- package/dist/dashboard/form-file.js +10 -1
- package/dist/dashboard/form-file.mjs +10 -1
- package/dist/dashboard/form-filters-analytics.js +14 -1
- package/dist/dashboard/form-filters-analytics.mjs +15 -2
- package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
- package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
- package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
- package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
- package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
- package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
- package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
- package/dist/dashboard/form-organization-campaign-field-select.js +51 -5
- package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
- package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
- package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
- package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-link.js +7 -1
- package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
- package/dist/dashboard/form-organization-campaign-mission.js +291 -0
- package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
- package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-page.js +20 -11
- package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
- package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
- package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-section.js +243 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +214 -0
- package/dist/dashboard/form-organization-campaign.js +114 -469
- package/dist/dashboard/form-organization-campaign.mjs +113 -467
- package/dist/dashboard/form-organization-export.js +4 -7
- package/dist/dashboard/form-organization-export.mjs +4 -7
- package/dist/dashboard/form-organization-identity.js +46 -51
- package/dist/dashboard/form-organization-identity.mjs +46 -51
- package/dist/dashboard/form-organization-workflow.js +708 -687
- package/dist/dashboard/form-organization-workflow.mjs +704 -683
- package/dist/dashboard/form-organization.js +82 -110
- package/dist/dashboard/form-organization.mjs +81 -109
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-payment-methods.js +20 -9
- package/dist/dashboard/form-payment-methods.mjs +20 -9
- package/dist/dashboard/form-stripe.js +30 -0
- package/dist/dashboard/form-stripe.mjs +26 -0
- package/dist/dashboard/input-array.js +4 -2
- package/dist/dashboard/input-array.mjs +4 -2
- package/dist/dashboard/input-combobox.js +7 -3
- package/dist/dashboard/input-combobox.mjs +7 -3
- package/dist/dashboard/input-date.js +7 -0
- package/dist/dashboard/input-date.mjs +7 -0
- package/dist/dashboard/input-fields.js +80 -20
- package/dist/dashboard/input-fields.mjs +80 -20
- package/dist/dashboard/input-file.js +21 -1
- package/dist/dashboard/input-file.mjs +21 -1
- package/dist/dashboard/input-font.js +10 -1
- package/dist/dashboard/input-font.mjs +10 -1
- package/dist/dashboard/lib/item-list.js +57 -0
- package/dist/dashboard/lib/item-list.mjs +33 -0
- package/dist/dashboard/lib/menu.js +50 -0
- package/dist/dashboard/lib/menu.mjs +26 -0
- package/dist/dashboard/locked.js +82 -0
- package/dist/dashboard/locked.mjs +53 -0
- package/dist/dashboard/menu.js +72 -19
- package/dist/dashboard/menu.mjs +72 -19
- package/dist/dashboard/note-ai.js +69 -0
- package/dist/dashboard/note-ai.mjs +36 -0
- package/dist/dashboard/preview.js +419 -0
- package/dist/dashboard/preview.mjs +384 -0
- package/dist/dashboard/steps.js +39 -13
- package/dist/dashboard/steps.mjs +37 -12
- package/dist/dashboard/table-contacts.js +136 -0
- package/dist/dashboard/table-contacts.mjs +103 -0
- package/dist/dashboard/template-not-found.js +4 -2
- package/dist/dashboard/template-not-found.mjs +4 -2
- package/dist/dashboard/template-socket.js +20 -7
- package/dist/dashboard/template-socket.mjs +20 -7
- package/dist/icons/desktop.js +46 -0
- package/dist/icons/desktop.mjs +27 -0
- package/dist/icons/phone.js +46 -0
- package/dist/icons/phone.mjs +27 -0
- package/dist/icons/puzzle-piece.js +46 -0
- package/dist/icons/puzzle-piece.mjs +27 -0
- package/dist/icons/tablet.js +46 -0
- package/dist/icons/tablet.mjs +27 -0
- package/dist/icons/users.js +46 -0
- package/dist/icons/users.mjs +27 -0
- package/dist/input-checkbox.js +1 -0
- package/dist/input-checkbox.mjs +1 -0
- package/dist/input-code.js +83 -0
- package/dist/input-code.mjs +50 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -1
- package/dist/shared/button.js +1 -1
- package/dist/shared/button.mjs +1 -1
- package/dist/shared/input-checkbox-list.js +0 -1
- package/dist/shared/input-checkbox-list.mjs +0 -1
- package/dist/shared/input-switch.js +6 -1
- package/dist/shared/input-switch.mjs +6 -1
- package/dist/shared/lib/campaign.js +123 -0
- package/dist/shared/lib/campaign.mjs +96 -0
- package/dist/shared/lib/helpers.js +14 -2
- package/dist/shared/lib/helpers.mjs +13 -2
- package/package.json +133 -13
- package/types/bridge/form-subdomain-header.d.ts +2 -0
- package/types/bridge/form-subdomain-missions.d.ts +38 -0
- package/types/bridge/form-subdomain.d.ts +23 -1
- package/types/bridge/lib/entry.d.ts +26 -0
- package/types/bridge/lib/location.d.ts +13 -0
- package/types/bridge/lib/order.d.ts +30 -0
- package/types/bridge/lib/url.d.ts +19 -0
- package/types/bridge/template-modal.d.ts +1 -1
- package/types/bridge/template-preview.d.ts +10 -0
- package/types/bridge/template-subdomain-link.d.ts +2 -0
- package/types/dashboard/accordion.d.ts +2 -0
- package/types/dashboard/avatar.d.ts +18 -2
- package/types/dashboard/buttons-subscription.d.ts +22 -0
- package/types/dashboard/card-campaign-switch.d.ts +32 -0
- package/types/dashboard/card-order.d.ts +25 -1
- package/types/dashboard/card-section.d.ts +2 -0
- package/types/dashboard/connection-workflows.d.ts +33 -0
- package/types/dashboard/device.d.ts +12 -0
- package/types/dashboard/form-admin-campaign.d.ts +3 -2
- package/types/dashboard/form-ai.d.ts +2 -2
- package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
- package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
- package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
- package/types/dashboard/form-organization-campaign-section.d.ts +29 -0
- package/types/dashboard/form-organization-campaign.d.ts +27 -17
- package/types/dashboard/form-organization-identity.d.ts +2 -0
- package/types/dashboard/form-organization-workflow.d.ts +56 -47
- package/types/dashboard/form-organization.d.ts +7 -2
- package/types/dashboard/form-stripe.d.ts +3 -0
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-date.d.ts +2 -0
- package/types/dashboard/input-fields.d.ts +3 -2
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/lib/item-list.d.ts +14 -0
- package/types/dashboard/lib/menu.d.ts +17 -0
- package/types/dashboard/locked.d.ts +10 -0
- package/types/dashboard/menu.d.ts +10 -2
- package/types/dashboard/note-ai.d.ts +15 -0
- package/types/dashboard/preview.d.ts +33 -0
- package/types/dashboard/steps.d.ts +19 -4
- package/types/dashboard/table-cell-title.d.ts +2 -2
- package/types/dashboard/table-contacts.d.ts +2 -0
- package/types/icons/desktop.d.ts +5 -0
- package/types/icons/phone.d.ts +5 -0
- package/types/icons/puzzle-piece.d.ts +5 -0
- package/types/icons/tablet.d.ts +5 -0
- package/types/icons/users.d.ts +5 -0
- package/types/input-code.d.ts +23 -0
- package/types/shared/input-switch.d.ts +2 -0
- package/types/shared/lib/campaign.d.ts +35 -0
- package/types/shared/lib/helpers.d.ts +3 -0
- package/dist/dashboard/card-integration.js +0 -187
- package/dist/dashboard/card-integration.mjs +0 -158
- package/dist/dashboard/iframe.js +0 -159
- package/dist/dashboard/iframe.mjs +0 -130
- package/types/dashboard/card-integration.d.ts +0 -24
- package/types/dashboard/iframe.d.ts +0 -18
|
@@ -8,11 +8,13 @@ import Trash from "../icons/trash.mjs";
|
|
|
8
8
|
import Button from "../shared/button.mjs";
|
|
9
9
|
const InputFile = ({
|
|
10
10
|
button = {},
|
|
11
|
+
description,
|
|
11
12
|
disabled,
|
|
12
13
|
endpoint,
|
|
13
14
|
filters,
|
|
14
15
|
nullable = true,
|
|
15
16
|
onChange,
|
|
17
|
+
onDescription,
|
|
16
18
|
organization,
|
|
17
19
|
type,
|
|
18
20
|
value
|
|
@@ -48,7 +50,25 @@ const InputFile = ({
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
),
|
|
51
|
-
|
|
53
|
+
onDescription ? (
|
|
54
|
+
// @story pages/build
|
|
55
|
+
// This slot's own Description, empty until typed, the file's name
|
|
56
|
+
// as its placeholder. The parent form's Save sends it.
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
...{
|
|
61
|
+
"aria-label": "Description",
|
|
62
|
+
className: "p-0 w-full border-0 text-black placeholder:text-gray-dark/60 focus:outline-hidden focus:ring-0 focus:border-inherit",
|
|
63
|
+
disabled,
|
|
64
|
+
maxLength: 150,
|
|
65
|
+
onChange: (event) => onDescription(event.target.value),
|
|
66
|
+
placeholder: value == null ? void 0 : value.filename,
|
|
67
|
+
value: description || ""
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
) : /* @__PURE__ */ jsx(
|
|
52
72
|
"input",
|
|
53
73
|
{
|
|
54
74
|
...{
|
|
@@ -310,7 +310,16 @@ const FontPickerModal = ({
|
|
|
310
310
|
className: "flex-1 min-w-0"
|
|
311
311
|
},
|
|
312
312
|
children: [
|
|
313
|
-
filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
313
|
+
filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
314
|
+
import_empty.default,
|
|
315
|
+
{
|
|
316
|
+
...{
|
|
317
|
+
// The picker's modal is white: the grey box.
|
|
318
|
+
variant: "secondary"
|
|
319
|
+
},
|
|
320
|
+
children: "No fonts found"
|
|
321
|
+
}
|
|
322
|
+
),
|
|
314
323
|
filtered.map(({ value: family }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
315
324
|
FontItem,
|
|
316
325
|
{
|
|
@@ -278,7 +278,16 @@ const FontPickerModal = ({
|
|
|
278
278
|
className: "flex-1 min-w-0"
|
|
279
279
|
},
|
|
280
280
|
children: [
|
|
281
|
-
filtered.length === 0 && /* @__PURE__ */ jsx(
|
|
281
|
+
filtered.length === 0 && /* @__PURE__ */ jsx(
|
|
282
|
+
Empty,
|
|
283
|
+
{
|
|
284
|
+
...{
|
|
285
|
+
// The picker's modal is white: the grey box.
|
|
286
|
+
variant: "secondary"
|
|
287
|
+
},
|
|
288
|
+
children: "No fonts found"
|
|
289
|
+
}
|
|
290
|
+
),
|
|
282
291
|
filtered.map(({ value: family }, index) => /* @__PURE__ */ jsx(
|
|
283
292
|
FontItem,
|
|
284
293
|
{
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var item_list_exports = {};
|
|
19
|
+
__export(item_list_exports, {
|
|
20
|
+
itemSummary: () => itemSummary,
|
|
21
|
+
itemsBody: () => itemsBody
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(item_list_exports);
|
|
24
|
+
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
25
|
+
var import_fields_validate = require("@drawbridge/drawbridge-utils/fields-validate");
|
|
26
|
+
const itemSummary = (item = {}, prices, currency) => {
|
|
27
|
+
var _a;
|
|
28
|
+
return [
|
|
29
|
+
prices && typeof (item == null ? void 0 : item.price) === "number" && (0, import_drawbridge_utils.formatCurrency)({
|
|
30
|
+
code: currency.toUpperCase(),
|
|
31
|
+
display: "parts",
|
|
32
|
+
value: item.price
|
|
33
|
+
}),
|
|
34
|
+
((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) && import_fields_validate.errors.limit(item.attributes.max)
|
|
35
|
+
].filter(Boolean).join(" \xB7 ");
|
|
36
|
+
};
|
|
37
|
+
const itemsBody = (items = []) => items.map((item) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
return {
|
|
40
|
+
attributes: {
|
|
41
|
+
max: ((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) ?? null
|
|
42
|
+
},
|
|
43
|
+
description: (item == null ? void 0 : item.description) || null,
|
|
44
|
+
...(item == null ? void 0 : item.id) && {
|
|
45
|
+
id: item.id
|
|
46
|
+
},
|
|
47
|
+
// Resolved to the file on every read; an unresolved id is kept as it is.
|
|
48
|
+
image: (typeof (item == null ? void 0 : item.image) === "string" ? item.image : (_b = item == null ? void 0 : item.image) == null ? void 0 : _b.id) || null,
|
|
49
|
+
name: item == null ? void 0 : item.name,
|
|
50
|
+
price: (item == null ? void 0 : item.price) ?? null
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
itemSummary,
|
|
56
|
+
itemsBody
|
|
57
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { formatCurrency } from "@drawbridge/drawbridge-utils";
|
|
2
|
+
import { errors } from "@drawbridge/drawbridge-utils/fields-validate";
|
|
3
|
+
const itemSummary = (item = {}, prices, currency) => {
|
|
4
|
+
var _a;
|
|
5
|
+
return [
|
|
6
|
+
prices && typeof (item == null ? void 0 : item.price) === "number" && formatCurrency({
|
|
7
|
+
code: currency.toUpperCase(),
|
|
8
|
+
display: "parts",
|
|
9
|
+
value: item.price
|
|
10
|
+
}),
|
|
11
|
+
((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) && errors.limit(item.attributes.max)
|
|
12
|
+
].filter(Boolean).join(" \xB7 ");
|
|
13
|
+
};
|
|
14
|
+
const itemsBody = (items = []) => items.map((item) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
return {
|
|
17
|
+
attributes: {
|
|
18
|
+
max: ((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) ?? null
|
|
19
|
+
},
|
|
20
|
+
description: (item == null ? void 0 : item.description) || null,
|
|
21
|
+
...(item == null ? void 0 : item.id) && {
|
|
22
|
+
id: item.id
|
|
23
|
+
},
|
|
24
|
+
// Resolved to the file on every read; an unresolved id is kept as it is.
|
|
25
|
+
image: (typeof (item == null ? void 0 : item.image) === "string" ? item.image : (_b = item == null ? void 0 : item.image) == null ? void 0 : _b.id) || null,
|
|
26
|
+
name: item == null ? void 0 : item.name,
|
|
27
|
+
price: (item == null ? void 0 : item.price) ?? null
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
itemSummary,
|
|
32
|
+
itemsBody
|
|
33
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var menu_exports = {};
|
|
19
|
+
__export(menu_exports, {
|
|
20
|
+
isActive: () => isActive,
|
|
21
|
+
menuRow: () => menuRow
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(menu_exports);
|
|
24
|
+
const isActive = (item, path = "") => {
|
|
25
|
+
if (!(item == null ? void 0 : item.href)) return false;
|
|
26
|
+
if (item.exact) return path === item.href;
|
|
27
|
+
return path === item.href || path.startsWith(item.href + "/");
|
|
28
|
+
};
|
|
29
|
+
const menuRow = (row = {}, path = "") => {
|
|
30
|
+
const children = (row.children || []).map((child) => ({
|
|
31
|
+
...child,
|
|
32
|
+
active: isActive(child, path)
|
|
33
|
+
}));
|
|
34
|
+
const inside = children.some((child) => child.active);
|
|
35
|
+
const active = isActive(row, path);
|
|
36
|
+
const open = active || inside;
|
|
37
|
+
return {
|
|
38
|
+
...row,
|
|
39
|
+
active,
|
|
40
|
+
children,
|
|
41
|
+
error: Boolean(row.error) || !open && children.some((child) => child.error),
|
|
42
|
+
highlighted: active && !inside,
|
|
43
|
+
open
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
isActive,
|
|
49
|
+
menuRow
|
|
50
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const isActive = (item, path = "") => {
|
|
2
|
+
if (!(item == null ? void 0 : item.href)) return false;
|
|
3
|
+
if (item.exact) return path === item.href;
|
|
4
|
+
return path === item.href || path.startsWith(item.href + "/");
|
|
5
|
+
};
|
|
6
|
+
const menuRow = (row = {}, path = "") => {
|
|
7
|
+
const children = (row.children || []).map((child) => ({
|
|
8
|
+
...child,
|
|
9
|
+
active: isActive(child, path)
|
|
10
|
+
}));
|
|
11
|
+
const inside = children.some((child) => child.active);
|
|
12
|
+
const active = isActive(row, path);
|
|
13
|
+
const open = active || inside;
|
|
14
|
+
return {
|
|
15
|
+
...row,
|
|
16
|
+
active,
|
|
17
|
+
children,
|
|
18
|
+
error: Boolean(row.error) || !open && children.some((child) => child.error),
|
|
19
|
+
highlighted: active && !inside,
|
|
20
|
+
open
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
isActive,
|
|
25
|
+
menuRow
|
|
26
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var locked_exports = {};
|
|
30
|
+
__export(locked_exports, {
|
|
31
|
+
default: () => locked_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(locked_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_button = __toESM(require("../shared/button"));
|
|
37
|
+
var import_tooltip = __toESM(require("../shared/tooltip"));
|
|
38
|
+
var import_lock = __toESM(require("../icons/lock"));
|
|
39
|
+
const Locked = ({ locked }) => {
|
|
40
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
41
|
+
if (!locked) return null;
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
import_tooltip.default,
|
|
44
|
+
{
|
|
45
|
+
...{
|
|
46
|
+
content: locked,
|
|
47
|
+
open
|
|
48
|
+
},
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
"span",
|
|
51
|
+
{
|
|
52
|
+
...{
|
|
53
|
+
"aria-label": locked,
|
|
54
|
+
className: "inline-flex rounded [&_button]:pointer-events-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-black",
|
|
55
|
+
onBlur: () => setOpen(false),
|
|
56
|
+
onClick: () => setOpen(true),
|
|
57
|
+
onFocus: () => setOpen(true),
|
|
58
|
+
onMouseEnter: () => setOpen(true),
|
|
59
|
+
onMouseLeave: () => setOpen(false),
|
|
60
|
+
role: "img",
|
|
61
|
+
tabIndex: 0
|
|
62
|
+
},
|
|
63
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_button.default,
|
|
65
|
+
{
|
|
66
|
+
...{
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
disabled: true,
|
|
69
|
+
icon: import_lock.default,
|
|
70
|
+
inline: true,
|
|
71
|
+
size: "small",
|
|
72
|
+
tabIndex: -1,
|
|
73
|
+
variant: "secondary"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
var locked_default = Locked;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import Button from "../shared/button.mjs";
|
|
5
|
+
import Tooltip from "../shared/tooltip.mjs";
|
|
6
|
+
import LockIcon from "../icons/lock.mjs";
|
|
7
|
+
const Locked = ({ locked }) => {
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
if (!locked) return null;
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Tooltip,
|
|
12
|
+
{
|
|
13
|
+
...{
|
|
14
|
+
content: locked,
|
|
15
|
+
open
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ jsx(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
...{
|
|
21
|
+
"aria-label": locked,
|
|
22
|
+
className: "inline-flex rounded [&_button]:pointer-events-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-black",
|
|
23
|
+
onBlur: () => setOpen(false),
|
|
24
|
+
onClick: () => setOpen(true),
|
|
25
|
+
onFocus: () => setOpen(true),
|
|
26
|
+
onMouseEnter: () => setOpen(true),
|
|
27
|
+
onMouseLeave: () => setOpen(false),
|
|
28
|
+
role: "img",
|
|
29
|
+
tabIndex: 0
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ jsx(
|
|
32
|
+
Button,
|
|
33
|
+
{
|
|
34
|
+
...{
|
|
35
|
+
"aria-hidden": true,
|
|
36
|
+
disabled: true,
|
|
37
|
+
icon: LockIcon,
|
|
38
|
+
inline: true,
|
|
39
|
+
size: "small",
|
|
40
|
+
tabIndex: -1,
|
|
41
|
+
variant: "secondary"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
var locked_default = Locked;
|
|
51
|
+
export {
|
|
52
|
+
locked_default as default
|
|
53
|
+
};
|
package/dist/dashboard/menu.js
CHANGED
|
@@ -58,43 +58,91 @@ var import_provider_resource = __toESM(require("./provider-resource"));
|
|
|
58
58
|
var import_wrapper_ai = __toESM(require("./wrapper-ai"));
|
|
59
59
|
var import_button = __toESM(require("../shared/button"));
|
|
60
60
|
var import_external = __toESM(require("../icons/external"));
|
|
61
|
+
var import_chart = __toESM(require("../icons/chart"));
|
|
62
|
+
var import_document = __toESM(require("../icons/document"));
|
|
63
|
+
var import_flag = __toESM(require("../icons/flag"));
|
|
64
|
+
var import_home = __toESM(require("../icons/home"));
|
|
65
|
+
var import_link2 = __toESM(require("../icons/link"));
|
|
66
|
+
var import_puzzle_piece = __toESM(require("../icons/puzzle-piece"));
|
|
67
|
+
var import_queue = __toESM(require("../icons/queue"));
|
|
68
|
+
var import_share = __toESM(require("../icons/share"));
|
|
69
|
+
var import_star = __toESM(require("../icons/star"));
|
|
70
|
+
var import_users = __toESM(require("../icons/users"));
|
|
71
|
+
var import_menu = require("./lib/menu");
|
|
72
|
+
const icons = {
|
|
73
|
+
chart: import_chart.default,
|
|
74
|
+
document: import_document.default,
|
|
75
|
+
flag: import_flag.default,
|
|
76
|
+
home: import_home.default,
|
|
77
|
+
link: import_link2.default,
|
|
78
|
+
// Connections (Darren, Dulce Local walk, 2026-10-29).
|
|
79
|
+
"puzzle-piece": import_puzzle_piece.default,
|
|
80
|
+
queue: import_queue.default,
|
|
81
|
+
share: import_share.default,
|
|
82
|
+
star: import_star.default,
|
|
83
|
+
users: import_users.default
|
|
84
|
+
};
|
|
61
85
|
const MenuItem = ({
|
|
62
86
|
active,
|
|
63
87
|
badge,
|
|
64
88
|
child,
|
|
65
|
-
children,
|
|
89
|
+
children = [],
|
|
66
90
|
disabled,
|
|
67
91
|
element: Element = import_link.default,
|
|
68
92
|
error,
|
|
93
|
+
highlighted = active,
|
|
94
|
+
icon,
|
|
69
95
|
locked,
|
|
70
96
|
onClick = () => {
|
|
71
97
|
},
|
|
98
|
+
open = active,
|
|
72
99
|
title,
|
|
73
100
|
...rest
|
|
74
101
|
}) => {
|
|
75
|
-
const
|
|
76
|
-
const isActive = active || hasChildren && children.some((c) => c.active);
|
|
102
|
+
const Icon = icons[icon];
|
|
77
103
|
const classes = {
|
|
78
104
|
row: [
|
|
79
|
-
"flex items-center justify-between transform duration-300 text-left py-1
|
|
80
|
-
|
|
81
|
-
|
|
105
|
+
"flex items-center justify-between w-full transform duration-300 text-left py-1 rounded",
|
|
106
|
+
// A page under a row lines up with the row's name, past its icon.
|
|
107
|
+
child ? "pl-9 pr-2" : "px-2",
|
|
108
|
+
highlighted ? "bg-gray-dark" : "hover:bg-gray-dark/50",
|
|
82
109
|
// A Button fades itself from its own disabled prop.
|
|
83
110
|
disabled && Element !== "button" && "disabled"
|
|
84
111
|
],
|
|
85
112
|
text: [
|
|
86
|
-
"flex items-center
|
|
87
|
-
|
|
113
|
+
"flex items-center gap-2 w-full min-w-0",
|
|
114
|
+
child && !highlighted ? "text-white/60" : "text-white",
|
|
115
|
+
// The open row stays bold while a page under it is highlighted.
|
|
116
|
+
open && "font-medium"
|
|
88
117
|
]
|
|
89
118
|
};
|
|
90
119
|
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
92
121
|
"span",
|
|
93
122
|
{
|
|
94
123
|
...{
|
|
95
124
|
className: classes.text.filter(Boolean).join(" ")
|
|
96
125
|
},
|
|
97
|
-
children:
|
|
126
|
+
children: [
|
|
127
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
Icon,
|
|
129
|
+
{
|
|
130
|
+
...{
|
|
131
|
+
"aria-hidden": true,
|
|
132
|
+
className: "w-5 h-5 shrink-0"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
...{
|
|
140
|
+
className: "truncate"
|
|
141
|
+
},
|
|
142
|
+
children: title
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
]
|
|
98
146
|
}
|
|
99
147
|
),
|
|
100
148
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -167,21 +215,22 @@ const MenuItem = ({
|
|
|
167
215
|
children: content
|
|
168
216
|
}
|
|
169
217
|
),
|
|
170
|
-
|
|
218
|
+
open && children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
171
219
|
"div",
|
|
172
220
|
{
|
|
173
221
|
...{
|
|
174
|
-
className: "mb-
|
|
222
|
+
className: "mt-0.5 mb-2"
|
|
175
223
|
},
|
|
176
|
-
children: children.map((props, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
224
|
+
children: children.map(({ key: childKey, exact, ...props }, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
225
|
MenuItem,
|
|
178
226
|
{
|
|
179
227
|
...{
|
|
180
228
|
...props,
|
|
181
|
-
child: true
|
|
229
|
+
child: true,
|
|
230
|
+
onClick
|
|
182
231
|
}
|
|
183
232
|
},
|
|
184
|
-
key
|
|
233
|
+
childKey || key
|
|
185
234
|
))
|
|
186
235
|
}
|
|
187
236
|
)
|
|
@@ -219,17 +268,21 @@ const Menu = ({
|
|
|
219
268
|
children: group.title
|
|
220
269
|
}
|
|
221
270
|
),
|
|
222
|
-
group.items.map((
|
|
223
|
-
const
|
|
271
|
+
group.items.map((item, index) => {
|
|
272
|
+
const { key: itemKey, exact, ...row } = (0, import_menu.menuRow)(item, path);
|
|
224
273
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
274
|
MenuItem,
|
|
226
275
|
{
|
|
227
276
|
...{
|
|
228
|
-
...
|
|
277
|
+
...row,
|
|
278
|
+
// An item with no href is not a destination, and MenuItem
|
|
279
|
+
// defaults its element to Link — which hands next/link an
|
|
280
|
+
// undefined href, and formatUrl then destructures `auth` off
|
|
281
|
+
// undefined and takes the WHOLE PAGE down. A menu row that
|
|
282
|
+
// forgot its href should be an inert row, not a white screen.
|
|
229
283
|
...!item.href && {
|
|
230
284
|
element: "div"
|
|
231
285
|
},
|
|
232
|
-
active,
|
|
233
286
|
onClick
|
|
234
287
|
}
|
|
235
288
|
},
|