@webiny/app-admin 6.5.0-beta.1 → 6.5.0-beta.11
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/base/Admin.js +2 -0
- package/base/Admin.js.map +1 -1
- package/base/Base/FieldRenderers/AutoCompleteRenderer.js +1 -0
- package/base/Base/FieldRenderers/AutoCompleteRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.d.ts +2 -2
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.d.ts +2 -2
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +8 -4
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.d.ts +2 -2
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/{TemplatePicker.d.ts → TemplatePicker/AddTemplateButton.d.ts} +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/AddTemplateButton.js +24 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/AddTemplateButton.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.d.ts +13 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.js +21 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.d.ts +3 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.js +35 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.d.ts +8 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.js +22 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.d.ts +10 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.js +46 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.d.ts +8 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.js +16 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.d.ts +10 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js +22 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.d.ts +3 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js +35 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/index.d.ts +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/index.js +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/types.d.ts +6 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/types.js +0 -0
- package/base/Base/FieldRenderers/SelectRenderer.js +1 -0
- package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/VerticalTabsRenderer.d.ts +2 -2
- package/components/Filters/Filters.js +7 -1
- package/components/Filters/Filters.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.d.ts +2 -2
- package/components/IconPicker/IconPickerComponent.js +1 -1
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/ListView/ListViewBulkActions.d.ts +2 -2
- package/components/ListView/ListViewContent.d.ts +2 -2
- package/components/ListView/ListViewFilters.d.ts +2 -2
- package/components/ListView/index.d.ts +6 -6
- package/components/RolesMultiAutocomplete/index.js +1 -1
- package/components/RolesMultiAutocomplete/index.js.map +1 -1
- package/components/Table/components/Table/TableInner.d.ts +2 -2
- package/components/TeamsMultiAutocomplete/index.js +1 -1
- package/components/TeamsMultiAutocomplete/index.js.map +1 -1
- package/domain/Identity.js +1 -1
- package/domain/Identity.js.map +1 -1
- package/features/debugger/Debugger.d.ts +8 -0
- package/features/debugger/Debugger.js +25 -0
- package/features/debugger/Debugger.js.map +1 -0
- package/features/debugger/DebuggerIndicator.d.ts +16 -0
- package/features/debugger/DebuggerIndicator.js +31 -0
- package/features/debugger/DebuggerIndicator.js.map +1 -0
- package/features/debugger/DebuggerStore.d.ts +55 -0
- package/features/debugger/DebuggerStore.js +65 -0
- package/features/debugger/DebuggerStore.js.map +1 -0
- package/features/debugger/DebuggerView.d.ts +4 -0
- package/features/debugger/DebuggerView.js +49 -0
- package/features/debugger/DebuggerView.js.map +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.d.ts +15 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.js +15 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.js.map +1 -0
- package/features/debugger/debuggerLink.d.ts +12 -0
- package/features/debugger/debuggerLink.js +10 -0
- package/features/debugger/debuggerLink.js.map +1 -0
- package/features/debugger/feature.d.ts +1 -0
- package/features/debugger/feature.js +18 -0
- package/features/debugger/feature.js.map +1 -0
- package/features/debugger/index.d.ts +7 -0
- package/features/debugger/index.js +7 -0
- package/features/debugger/permissions.d.ts +68 -0
- package/features/debugger/permissions.js +27 -0
- package/features/debugger/permissions.js.map +1 -0
- package/features/debugger/report.d.ts +7 -0
- package/features/debugger/report.js +22 -0
- package/features/debugger/report.js.map +1 -0
- package/features/debugger/routes.d.ts +4 -0
- package/features/debugger/routes.js +10 -0
- package/features/debugger/routes.js.map +1 -0
- package/features/formModel/Field.d.ts +7 -1
- package/features/formModel/Field.js +13 -5
- package/features/formModel/Field.js.map +1 -1
- package/features/formModel/FieldBuilder.test.js +25 -0
- package/features/formModel/FieldBuilder.test.js.map +1 -1
- package/features/formModel/FormErrors.d.ts +2 -2
- package/features/formModel/FormErrors.js +1 -1
- package/features/formModel/FormErrors.js.map +1 -1
- package/features/formModel/FormModel.d.ts +2 -0
- package/features/formModel/FormModel.js +25 -0
- package/features/formModel/FormModel.js.map +1 -1
- package/features/formModel/FormModel.test.js +587 -2
- package/features/formModel/FormModel.test.js.map +1 -1
- package/features/formModel/FormView.d.ts +8 -4
- package/features/formModel/ObjectField.d.ts +11 -1
- package/features/formModel/ObjectField.js +45 -20
- package/features/formModel/ObjectField.js.map +1 -1
- package/features/formModel/PresenterErrors.d.ts +2 -2
- package/features/formModel/abstractions.d.ts +30 -1
- package/features/formModel/abstractions.js.map +1 -1
- package/features/formModel/createFieldRenderer.js +3 -4
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/demo/FormModelDemo.d.ts +2 -2
- package/features/formModel/fieldTypes/DateTimeFieldType.d.ts +2 -0
- package/features/formModel/fieldTypes/DateTimeFieldType.js +19 -15
- package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/ObjectFieldType.d.ts +3 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js +23 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
- package/features/notifications/NotificationsRenderer.d.ts +2 -2
- package/features/wcp/WcpGateway.js +7 -0
- package/features/wcp/WcpGateway.js.map +1 -1
- package/hooks/useHotkeys.js +3 -1
- package/hooks/useHotkeys.js.map +1 -1
- package/hooks/useSnackbar.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/package.json +34 -34
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.js +1 -2
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.js.map +1 -1
- package/presentation/accessManagement/apiKeys/components/ApiKeysView.d.ts +2 -2
- package/presentation/accessManagement/roles/RolesPresenter.js +1 -2
- package/presentation/accessManagement/roles/RolesPresenter.js.map +1 -1
- package/presentation/accessManagement/roles/components/RolesView.d.ts +2 -2
- package/presentation/accessManagement/teams/TeamsPresenter.js +1 -2
- package/presentation/accessManagement/teams/TeamsPresenter.js.map +1 -1
- package/presentation/accessManagement/teams/components/TeamsView.d.ts +2 -2
- package/presentation/installation/components/SystemInstaller/SystemInstaller.d.ts +2 -2
- package/presentation/listPresenter/QueryMatcher.js +3 -3
- package/presentation/listPresenter/QueryMatcher.js.map +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.d.ts +2 -2
- package/presentation/trashBin/components/BulkActions/RestoreItems.d.ts +2 -2
- package/presentation/trashBin/components/TrashBinOverlay.d.ts +2 -2
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +0 -68
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ITemplateVM } from "../../../../../features/formModel/index.js";
|
|
3
|
+
import type { ViewMode } from "./types.js";
|
|
4
|
+
interface TemplateListProps {
|
|
5
|
+
viewMode: ViewMode;
|
|
6
|
+
templates: ITemplateVM[];
|
|
7
|
+
onSelect: (template: ITemplateVM) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const TemplateList: ({ viewMode, templates, onSelect }: TemplateListProps) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { TemplateCard } from "./TemplateCard.js";
|
|
3
|
+
import { TemplateListItem } from "./TemplateListItem.js";
|
|
4
|
+
const TemplateList = ({ viewMode, templates, onSelect })=>{
|
|
5
|
+
if ("list" === viewMode) return /*#__PURE__*/ react.createElement("div", {
|
|
6
|
+
className: "flex flex-col gap-y-sm mb-xs"
|
|
7
|
+
}, templates.map((template)=>/*#__PURE__*/ react.createElement(TemplateListItem, {
|
|
8
|
+
key: template.id,
|
|
9
|
+
template: template,
|
|
10
|
+
onSelect: onSelect
|
|
11
|
+
})));
|
|
12
|
+
return /*#__PURE__*/ react.createElement("div", {
|
|
13
|
+
className: "gap-md flex flex-wrap p-xs mb-xs"
|
|
14
|
+
}, templates.map((template)=>/*#__PURE__*/ react.createElement(TemplateCard, {
|
|
15
|
+
key: template.id,
|
|
16
|
+
template: template,
|
|
17
|
+
onSelect: onSelect
|
|
18
|
+
})));
|
|
19
|
+
};
|
|
20
|
+
export { TemplateList };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=TemplateList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js","sources":["../../../../../../src/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ITemplateVM } from \"~/features/formModel/index.js\";\nimport { TemplateCard } from \"./TemplateCard.js\";\nimport { TemplateListItem } from \"./TemplateListItem.js\";\nimport type { ViewMode } from \"./types.js\";\n\ninterface TemplateListProps {\n viewMode: ViewMode;\n templates: ITemplateVM[];\n onSelect: (template: ITemplateVM) => void;\n}\n\nexport const TemplateList = ({ viewMode, templates, onSelect }: TemplateListProps) => {\n if (viewMode === \"list\") {\n return (\n <div className={\"flex flex-col gap-y-sm mb-xs\"}>\n {templates.map(template => (\n <TemplateListItem key={template.id} template={template} onSelect={onSelect} />\n ))}\n </div>\n );\n }\n\n return (\n <div className={\"gap-md flex flex-wrap p-xs mb-xs\"}>\n {templates.map(template => (\n <TemplateCard key={template.id} template={template} onSelect={onSelect} />\n ))}\n </div>\n );\n};\n"],"names":["TemplateList","viewMode","templates","onSelect","template","TemplateListItem","TemplateCard"],"mappings":";;;AAYO,MAAMA,eAAe,CAAC,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAqB;IAC7E,IAAIF,AAAa,WAAbA,UACA,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXC,UAAU,GAAG,CAACE,CAAAA,WAAAA,WAAAA,GACX,oBAACC,kBAAgBA;YAAC,KAAKD,SAAS,EAAE;YAAE,UAAUA;YAAU,UAAUD;;IAMlF,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXD,UAAU,GAAG,CAACE,CAAAA,WAAAA,WAAAA,GACX,oBAACE,cAAYA;YAAC,KAAKF,SAAS,EAAE;YAAE,UAAUA;YAAU,UAAUD;;AAI9E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { Button, Text } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent } from "@webiny/icons/add_circle_outline.svg";
|
|
4
|
+
import { SelectableTemplate } from "./SelectableTemplate.js";
|
|
5
|
+
import { TemplateIcon } from "./TemplateIcon.js";
|
|
6
|
+
const TemplateListItem = ({ template, onSelect })=>/*#__PURE__*/ react.createElement(SelectableTemplate, {
|
|
7
|
+
template: template,
|
|
8
|
+
onSelect: onSelect,
|
|
9
|
+
className: "flex items-center py-sm-extra px-md rounded-lg bg-neutral-light hover:bg-[#f1f2f4]"
|
|
10
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
11
|
+
className: "flex items-center justify-center shrink-0 pr-md"
|
|
12
|
+
}, /*#__PURE__*/ react.createElement(TemplateIcon, {
|
|
13
|
+
icon: template.icon,
|
|
14
|
+
size: 24
|
|
15
|
+
})), /*#__PURE__*/ react.createElement("div", {
|
|
16
|
+
className: "flex-1 min-w-0"
|
|
17
|
+
}, /*#__PURE__*/ react.createElement(Text, {
|
|
18
|
+
size: "md",
|
|
19
|
+
className: "text-neutral-primary font-semibold truncate"
|
|
20
|
+
}, template.label), template.description && /*#__PURE__*/ react.createElement(Text, {
|
|
21
|
+
size: "sm",
|
|
22
|
+
as: "div",
|
|
23
|
+
className: "text-neutral-muted"
|
|
24
|
+
}, template.description)), /*#__PURE__*/ react.createElement("div", {
|
|
25
|
+
className: "hidden group-hover:block group-focus-visible:block"
|
|
26
|
+
}, /*#__PURE__*/ react.createElement(Button, {
|
|
27
|
+
size: "md",
|
|
28
|
+
variant: "primary",
|
|
29
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
30
|
+
tabIndex: -1,
|
|
31
|
+
"aria-hidden": true
|
|
32
|
+
}, "Insert")));
|
|
33
|
+
export { TemplateListItem };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=TemplateListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js","sources":["../../../../../../src/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as PlusIcon } from \"@webiny/icons/add_circle_outline.svg\";\nimport { SelectableTemplate } from \"./SelectableTemplate.js\";\nimport { TemplateIcon } from \"./TemplateIcon.js\";\nimport type { TemplateItemProps } from \"./types.js\";\n\n// Used #f1f2f4 b/c in Figma, the color was result of multiple colors combined.\nexport const TemplateListItem = ({ template, onSelect }: TemplateItemProps) => {\n return (\n <SelectableTemplate\n template={template}\n onSelect={onSelect}\n className={\n \"flex items-center py-sm-extra px-md rounded-lg bg-neutral-light hover:bg-[#f1f2f4]\"\n }\n >\n <div className={\"flex items-center justify-center shrink-0 pr-md\"}>\n <TemplateIcon icon={template.icon} size={24} />\n </div>\n <div className={\"flex-1 min-w-0\"}>\n <Text size={\"md\"} className={\"text-neutral-primary font-semibold truncate\"}>\n {template.label}\n </Text>\n {template.description && (\n <Text size={\"sm\"} as={\"div\"} className={\"text-neutral-muted\"}>\n {template.description}\n </Text>\n )}\n </div>\n <div className={\"hidden group-hover:block group-focus-visible:block\"}>\n <Button\n size={\"md\"}\n variant={\"primary\"}\n icon={<PlusIcon />}\n tabIndex={-1}\n aria-hidden={true}\n >\n Insert\n </Button>\n </div>\n </SelectableTemplate>\n );\n};\n"],"names":["TemplateListItem","template","onSelect","SelectableTemplate","TemplateIcon","Text","Button","PlusIcon"],"mappings":";;;;;AASO,MAAMA,mBAAmB,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAqB,GAC/D,WAAP,GACI,oBAACC,oBAAkBA;QACf,UAAUF;QACV,UAAUC;QACV,WACI;qBAGJ,oBAAC;QAAI,WAAW;qBACZ,oBAACE,cAAYA;QAAC,MAAMH,SAAS,IAAI;QAAE,MAAM;uBAE7C,oBAAC;QAAI,WAAW;qBACZ,oBAACI,MAAIA;QAAC,MAAM;QAAM,WAAW;OACxBJ,SAAS,KAAK,GAElBA,SAAS,WAAW,IAAI,WAAJ,GACjB,oBAACI,MAAIA;QAAC,MAAM;QAAM,IAAI;QAAO,WAAW;OACnCJ,SAAS,WAAW,kBAIjC,oBAAC;QAAI,WAAW;qBACZ,oBAACK,QAAMA;QACH,MAAM;QACN,SAAS;QACT,oBAAM,oBAACC,gBAAQA;QACf,UAAU;QACV,eAAa;OAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AddTemplateButton, type AddTemplateButtonProps } from "./AddTemplateButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AddTemplateButton } from "./AddTemplateButton.js";
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/FieldRenderers/SelectRenderer.js","sources":["../../../../src/base/Base/FieldRenderers/SelectRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { createFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport { Select } from \"@webiny/admin-ui\";\nimport type { IValueOption } from \"~/features/formModel/index.js\";\n\ndeclare module \"../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n select: { fieldType: \"text\" | \"number\"; options: true; settings: undefined };\n /** @deprecated Use \"select\" instead. */\n dropdown: { fieldType: \"text\" | \"number\"; options: true; settings: undefined };\n }\n}\n\nconst isValidValue = (value: unknown): value is string | number =>\n typeof value === \"string\" || typeof value === \"number\";\n\nexport const SelectRenderer = createFieldRenderer(({ field }) => {\n const options: IValueOption[] = field.options ?? [];\n\n return (\n <Select\n label={field.label}\n hint={field.help}\n placeholder={field.placeholder}\n description={field.description}\n note={field.note}\n value={isValidValue(field.value) ? String(field.value) : \"\"}\n onChange={value => {\n field.onChange(value);\n field.onBlur();\n }}\n required={field.required}\n disabled={field.disabled}\n validation={field.validation}\n options={options.map(opt => ({\n label: opt.label,\n value: isValidValue(opt.value) ? String(opt.value) : opt.value,\n disabled: opt.disabled\n }))}\n />\n );\n});\n"],"names":["isValidValue","value","SelectRenderer","createFieldRenderer","field","options","Select","String","opt"],"mappings":";;;AAaA,MAAMA,eAAe,CAACC,QAClB,AAAiB,YAAjB,OAAOA,SAAsB,AAAiB,YAAjB,OAAOA;AAEjC,MAAMC,iBAAiBC,oBAAoB,CAAC,EAAEC,KAAK,EAAE;IACxD,MAAMC,UAA0BD,MAAM,OAAO,IAAI,EAAE;IAEnD,OAAO,WAAP,GACI,oBAACE,QAAMA;QACH,OAAOF,MAAM,KAAK;QAClB,MAAMA,MAAM,IAAI;QAChB,aAAaA,MAAM,WAAW;QAC9B,aAAaA,MAAM,WAAW;QAC9B,MAAMA,MAAM,IAAI;QAChB,OAAOJ,aAAaI,MAAM,KAAK,IAAIG,OAAOH,MAAM,KAAK,IAAI;QACzD,UAAUH,CAAAA;YACNG,MAAM,QAAQ,CAACH;YACfG,MAAM,MAAM;QAChB;QACA,UAAUA,MAAM,QAAQ;
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/SelectRenderer.js","sources":["../../../../src/base/Base/FieldRenderers/SelectRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { createFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport { Select } from \"@webiny/admin-ui\";\nimport type { IValueOption } from \"~/features/formModel/index.js\";\n\ndeclare module \"../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n select: { fieldType: \"text\" | \"number\"; options: true; settings: undefined };\n /** @deprecated Use \"select\" instead. */\n dropdown: { fieldType: \"text\" | \"number\"; options: true; settings: undefined };\n }\n}\n\nconst isValidValue = (value: unknown): value is string | number =>\n typeof value === \"string\" || typeof value === \"number\";\n\nexport const SelectRenderer = createFieldRenderer(({ field }) => {\n const options: IValueOption[] = field.options ?? [];\n\n return (\n <Select\n label={field.label}\n hint={field.help}\n placeholder={field.placeholder}\n description={field.description}\n note={field.note}\n value={isValidValue(field.value) ? String(field.value) : \"\"}\n onChange={value => {\n field.onChange(value);\n field.onBlur();\n }}\n required={field.required}\n // Clearing a required field can only leave it invalid, so it gets no reset action.\n displayResetAction={!field.required}\n disabled={field.disabled}\n validation={field.validation}\n options={options.map(opt => ({\n label: opt.label,\n value: isValidValue(opt.value) ? String(opt.value) : opt.value,\n disabled: opt.disabled\n }))}\n />\n );\n});\n"],"names":["isValidValue","value","SelectRenderer","createFieldRenderer","field","options","Select","String","opt"],"mappings":";;;AAaA,MAAMA,eAAe,CAACC,QAClB,AAAiB,YAAjB,OAAOA,SAAsB,AAAiB,YAAjB,OAAOA;AAEjC,MAAMC,iBAAiBC,oBAAoB,CAAC,EAAEC,KAAK,EAAE;IACxD,MAAMC,UAA0BD,MAAM,OAAO,IAAI,EAAE;IAEnD,OAAO,WAAP,GACI,oBAACE,QAAMA;QACH,OAAOF,MAAM,KAAK;QAClB,MAAMA,MAAM,IAAI;QAChB,aAAaA,MAAM,WAAW;QAC9B,aAAaA,MAAM,WAAW;QAC9B,MAAMA,MAAM,IAAI;QAChB,OAAOJ,aAAaI,MAAM,KAAK,IAAIG,OAAOH,MAAM,KAAK,IAAI;QACzD,UAAUH,CAAAA;YACNG,MAAM,QAAQ,CAACH;YACfG,MAAM,MAAM;QAChB;QACA,UAAUA,MAAM,QAAQ;QAExB,oBAAoB,CAACA,MAAM,QAAQ;QACnC,UAAUA,MAAM,QAAQ;QACxB,YAAYA,MAAM,UAAU;QAC5B,SAASC,QAAQ,GAAG,CAACG,CAAAA,MAAQ;gBACzB,OAAOA,IAAI,KAAK;gBAChB,OAAOR,aAAaQ,IAAI,KAAK,IAAID,OAAOC,IAAI,KAAK,IAAIA,IAAI,KAAK;gBAC9D,UAAUA,IAAI,QAAQ;YAC1B;;AAGZ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { TabsNodeRendererProps } from "../../../features/formModel/FormView.js";
|
|
3
|
-
export declare const VerticalTabsRenderer: (({ node }: TabsNodeRendererProps) => React.JSX.Element) & {
|
|
4
|
-
|
|
3
|
+
export declare const VerticalTabsRenderer: (({ node }: TabsNodeRendererProps) => React.JSX.Element) & React.NamedExoticComponent<TabsNodeRendererProps> & {
|
|
4
|
+
readonly type: ({ node }: TabsNodeRendererProps) => React.JSX.Element;
|
|
5
5
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { Separator } from "@webiny/admin-ui";
|
|
3
3
|
import { Form } from "@webiny/form";
|
|
4
|
+
const GRID_COLUMNS = 4;
|
|
4
5
|
const Filters = (props)=>{
|
|
5
6
|
if (!props.show || !props.filters.length) return null;
|
|
6
7
|
return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement("div", {
|
|
@@ -14,7 +15,12 @@ const Filters = (props)=>{
|
|
|
14
15
|
}, props.filters.map((filter)=>/*#__PURE__*/ react.createElement("div", {
|
|
15
16
|
key: filter.name,
|
|
16
17
|
className: "empty:hidden min-w-0"
|
|
17
|
-
}, filter.element)), props.children && /*#__PURE__*/ react.createElement("div",
|
|
18
|
+
}, filter.element)), props.children && /*#__PURE__*/ react.createElement("div", {
|
|
19
|
+
className: "min-w-0",
|
|
20
|
+
style: {
|
|
21
|
+
gridColumn: `span ${GRID_COLUMNS - props.filters.length % GRID_COLUMNS}`
|
|
22
|
+
}
|
|
23
|
+
}, props.children)))), /*#__PURE__*/ react.createElement(Separator, null));
|
|
18
24
|
};
|
|
19
25
|
export { Filters };
|
|
20
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Filters/Filters.js","sources":["../../../src/components/Filters/Filters.tsx"],"sourcesContent":["import React from \"react\";\nimport { Separator } from \"@webiny/admin-ui\";\nimport type { FormOnSubmit, FormProps, GenericFormData } from \"@webiny/form\";\nimport { Form } from \"@webiny/form\";\n\ntype Filter = {\n name: string;\n element: React.ReactElement;\n};\n\nexport type GenericFiltersData = GenericFormData;\n\nexport type FiltersOnSubmit<T extends GenericFiltersData = GenericFiltersData> = FormOnSubmit<T>;\n\nexport interface FiltersProps<T extends GenericFormData = GenericFormData> extends Pick<\n FormProps<T>,\n \"data\" | \"onChange\"\n> {\n filters: Filter[];\n show: boolean;\n children?: React.ReactNode;\n [\"data-testid\"]?: string;\n}\n\nexport const Filters = <T extends GenericFiltersData = GenericFiltersData>(\n props: FiltersProps<T>\n) => {\n if (!props.show || !props.filters.length) {\n return null;\n }\n\n return (\n <>\n <div\n className={\"w-full bg-neutral-base px-md my-sm\"}\n data-testid={props[\"data-testid\"] || \"filters-container\"}\n >\n <Form data={props.data} onChange={props.onChange}>\n {() => (\n <div className={\"w-full grid grid-cols-4 gap-sm items-center\"}>\n {props.filters.map(filter => (\n <div key={filter.name} className={\"empty:hidden min-w-0\"}>\n {filter.element}\n </div>\n ))}\n {props.children && <div
|
|
1
|
+
{"version":3,"file":"components/Filters/Filters.js","sources":["../../../src/components/Filters/Filters.tsx"],"sourcesContent":["import React from \"react\";\nimport { Separator } from \"@webiny/admin-ui\";\nimport type { FormOnSubmit, FormProps, GenericFormData } from \"@webiny/form\";\nimport { Form } from \"@webiny/form\";\n\ntype Filter = {\n name: string;\n element: React.ReactElement;\n};\n\nconst GRID_COLUMNS = 4;\n\nexport type GenericFiltersData = GenericFormData;\n\nexport type FiltersOnSubmit<T extends GenericFiltersData = GenericFiltersData> = FormOnSubmit<T>;\n\nexport interface FiltersProps<T extends GenericFormData = GenericFormData> extends Pick<\n FormProps<T>,\n \"data\" | \"onChange\"\n> {\n filters: Filter[];\n show: boolean;\n children?: React.ReactNode;\n [\"data-testid\"]?: string;\n}\n\nexport const Filters = <T extends GenericFiltersData = GenericFiltersData>(\n props: FiltersProps<T>\n) => {\n if (!props.show || !props.filters.length) {\n return null;\n }\n\n return (\n <>\n <div\n className={\"w-full bg-neutral-base px-md my-sm\"}\n data-testid={props[\"data-testid\"] || \"filters-container\"}\n >\n <Form data={props.data} onChange={props.onChange}>\n {() => (\n <div className={\"w-full grid grid-cols-4 gap-sm items-center\"}>\n {props.filters.map(filter => (\n <div key={filter.name} className={\"empty:hidden min-w-0\"}>\n {filter.element}\n </div>\n ))}\n {props.children && (\n // Children (e.g. advanced search) take the rest of the row.\n <div\n className={\"min-w-0\"}\n style={{\n gridColumn: `span ${\n GRID_COLUMNS - (props.filters.length % GRID_COLUMNS)\n }`\n }}\n >\n {props.children}\n </div>\n )}\n </div>\n )}\n </Form>\n </div>\n <Separator />\n </>\n );\n};\n"],"names":["GRID_COLUMNS","Filters","props","Form","filter","Separator"],"mappings":";;;AAUA,MAAMA,eAAe;AAgBd,MAAMC,UAAU,CACnBC;IAEA,IAAI,CAACA,MAAM,IAAI,IAAI,CAACA,MAAM,OAAO,CAAC,MAAM,EACpC,OAAO;IAGX,OAAO,WAAP,GACI,wDACI,oBAAC;QACG,WAAW;QACX,eAAaA,KAAK,CAAC,cAAc,IAAI;qBAErC,oBAACC,MAAIA;QAAC,MAAMD,MAAM,IAAI;QAAE,UAAUA,MAAM,QAAQ;OAC3C,kBACG,oBAAC;YAAI,WAAW;WACXA,MAAM,OAAO,CAAC,GAAG,CAACE,CAAAA,SAAAA,WAAAA,GACf,oBAAC;gBAAI,KAAKA,OAAO,IAAI;gBAAE,WAAW;eAC7BA,OAAO,OAAO,IAGtBF,MAAM,QAAQ,I,cAEX,oBAAC;YACG,WAAW;YACX,OAAO;gBACH,YAAY,CAAC,KAAK,EACdF,eAAgBE,MAAM,OAAO,CAAC,MAAM,GAAGF,cACzC;YACN;WAECE,MAAM,QAAQ,oBAOvC,oBAACG,WAASA;AAGtB"}
|
|
@@ -12,6 +12,6 @@ export interface IconPickerProps extends FormComponentProps {
|
|
|
12
12
|
export interface IconPickerComponentProps extends IconPickerProps {
|
|
13
13
|
presenter: IconPickerPresenter;
|
|
14
14
|
}
|
|
15
|
-
export declare const IconPickerComponent: (({ presenter, label, description, removable, required, disabled, ...props }: IconPickerComponentProps) => React.JSX.Element) & {
|
|
16
|
-
|
|
15
|
+
export declare const IconPickerComponent: (({ presenter, label, description, removable, required, disabled, ...props }: IconPickerComponentProps) => React.JSX.Element) & React.NamedExoticComponent<IconPickerComponentProps> & {
|
|
16
|
+
readonly type: ({ presenter, label, description, removable, required, disabled, ...props }: IconPickerComponentProps) => React.JSX.Element;
|
|
17
17
|
};
|
|
@@ -27,7 +27,7 @@ const IconPickerComponent = observer(({ presenter, label, description, removable
|
|
|
27
27
|
]);
|
|
28
28
|
const handleOnOpenChange = useCallback((open)=>{
|
|
29
29
|
if (open) return presenter.openMenu();
|
|
30
|
-
return presenter.closeMenu();
|
|
30
|
+
else return presenter.closeMenu();
|
|
31
31
|
}, [
|
|
32
32
|
presenter.openMenu,
|
|
33
33
|
presenter.closeMenu
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/IconPicker/IconPickerComponent.js","sources":["../../../src/components/IconPicker/IconPickerComponent.tsx"],"sourcesContent":["import React, { useEffect, useCallback, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport isEqual from \"lodash/isEqual.js\";\nimport type { FormComponentProps } from \"@webiny/admin-ui\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n PopoverPrimitive\n} from \"@webiny/admin-ui\";\nimport { IconPickerContent, IconPickerTrigger } from \"./components/index.js\";\nimport type { IconPickerPresenter } from \"./IconPickerPresenter.js\";\nimport { IconPickerPresenterProvider } from \"./IconPickerPresenterProvider.js\";\nimport type { Icon } from \"./types.js\";\nimport { ICON_PICKER_SIZE } from \"./types.js\";\n\nexport interface IconPickerProps extends FormComponentProps {\n size?: ICON_PICKER_SIZE;\n removable?: boolean;\n value?: Icon;\n onChange?: (value: Icon | undefined) => void;\n}\n\nexport interface IconPickerComponentProps extends IconPickerProps {\n presenter: IconPickerPresenter;\n}\n\nexport const IconPickerComponent = observer(\n ({\n presenter,\n label,\n description,\n removable,\n required,\n disabled,\n ...props\n }: IconPickerComponentProps) => {\n const { value, onChange } = props;\n const { isValid: validationIsValid, message: validationMessage } = props.validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n const { activeTab, isMenuOpened, isLoading, iconTypes, selectedIcon, size } = presenter.vm;\n\n useEffect(() => {\n if (onChange && selectedIcon && !isEqual(selectedIcon, value)) {\n onChange(selectedIcon);\n }\n }, [JSON.stringify(selectedIcon)]);\n\n const removeIcon = useCallback(() => {\n if (onChange) {\n presenter.setIcon(null);\n onChange(undefined);\n }\n }, [onChange]);\n\n const handleOnOpenChange = useCallback(\n (open: boolean) => {\n if (open) {\n return presenter.openMenu();\n } else {\n return presenter.closeMenu();\n }\n },\n [presenter.openMenu, presenter.closeMenu]\n );\n\n return (\n <IconPickerPresenterProvider presenter={presenter}>\n <FormComponentLabel text={label} required={required} disabled={disabled} />\n <FormComponentDescription text={description} />\n <PopoverPrimitive open={isMenuOpened} onOpenChange={handleOnOpenChange}>\n <PopoverPrimitive.Trigger>\n <IconPickerTrigger icon={selectedIcon} />\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content\n style={{ width: size === ICON_PICKER_SIZE.SMALL ? \"248px\" : \"328px\" }}\n >\n <IconPickerContent\n loading={isLoading}\n removable={value && removable}\n iconTypes={iconTypes}\n activeTab={activeTab}\n removeIcon={removeIcon}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive>\n <FormComponentErrorMessage text={validationMessage} invalid={invalid} />\n </IconPickerPresenterProvider>\n );\n }\n);\n"],"names":["IconPickerComponent","observer","presenter","label","description","removable","required","disabled","props","value","onChange","validationIsValid","validationMessage","invalid","useMemo","activeTab","isMenuOpened","isLoading","iconTypes","selectedIcon","size","useEffect","isEqual","JSON","removeIcon","useCallback","undefined","handleOnOpenChange","open","IconPickerPresenterProvider","FormComponentLabel","FormComponentDescription","PopoverPrimitive","IconPickerTrigger","ICON_PICKER_SIZE","IconPickerContent","FormComponentErrorMessage"],"mappings":";;;;;;;AA2BO,MAAMA,sBAAsBC,SAC/B,CAAC,EACGC,SAAS,EACTC,KAAK,EACLC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,OACoB;IACvB,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAC5B,MAAM,EAAE,SAASG,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGJ,MAAM,UAAU,IAAI,CAAC;IACxF,MAAMK,UAAUC,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAC9E,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,EAAEC,IAAI,EAAE,GAAGlB,UAAU,EAAE;IAE1FmB,UAAU;QACN,IAAIX,YAAYS,gBAAgB,CAACG,QAAQH,cAAcV,QACnDC,SAASS;IAEjB,GAAG;QAACI,KAAK,SAAS,CAACJ;KAAc;IAEjC,MAAMK,aAAaC,YAAY;QAC3B,IAAIf,UAAU;YACVR,UAAU,OAAO,CAAC;YAClBQ,SAASgB;QACb;IACJ,GAAG;QAAChB;KAAS;IAEb,MAAMiB,qBAAqBF,YACvB,CAACG;QACG,IAAIA,MACA,OAAO1B,UAAU,QAAQ;
|
|
1
|
+
{"version":3,"file":"components/IconPicker/IconPickerComponent.js","sources":["../../../src/components/IconPicker/IconPickerComponent.tsx"],"sourcesContent":["import React, { useEffect, useCallback, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport isEqual from \"lodash/isEqual.js\";\nimport type { FormComponentProps } from \"@webiny/admin-ui\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n PopoverPrimitive\n} from \"@webiny/admin-ui\";\nimport { IconPickerContent, IconPickerTrigger } from \"./components/index.js\";\nimport type { IconPickerPresenter } from \"./IconPickerPresenter.js\";\nimport { IconPickerPresenterProvider } from \"./IconPickerPresenterProvider.js\";\nimport type { Icon } from \"./types.js\";\nimport { ICON_PICKER_SIZE } from \"./types.js\";\n\nexport interface IconPickerProps extends FormComponentProps {\n size?: ICON_PICKER_SIZE;\n removable?: boolean;\n value?: Icon;\n onChange?: (value: Icon | undefined) => void;\n}\n\nexport interface IconPickerComponentProps extends IconPickerProps {\n presenter: IconPickerPresenter;\n}\n\nexport const IconPickerComponent = observer(\n ({\n presenter,\n label,\n description,\n removable,\n required,\n disabled,\n ...props\n }: IconPickerComponentProps) => {\n const { value, onChange } = props;\n const { isValid: validationIsValid, message: validationMessage } = props.validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n const { activeTab, isMenuOpened, isLoading, iconTypes, selectedIcon, size } = presenter.vm;\n\n useEffect(() => {\n if (onChange && selectedIcon && !isEqual(selectedIcon, value)) {\n onChange(selectedIcon);\n }\n }, [JSON.stringify(selectedIcon)]);\n\n const removeIcon = useCallback(() => {\n if (onChange) {\n presenter.setIcon(null);\n onChange(undefined);\n }\n }, [onChange]);\n\n const handleOnOpenChange = useCallback(\n (open: boolean) => {\n if (open) {\n return presenter.openMenu();\n } else {\n return presenter.closeMenu();\n }\n },\n [presenter.openMenu, presenter.closeMenu]\n );\n\n return (\n <IconPickerPresenterProvider presenter={presenter}>\n <FormComponentLabel text={label} required={required} disabled={disabled} />\n <FormComponentDescription text={description} />\n <PopoverPrimitive open={isMenuOpened} onOpenChange={handleOnOpenChange}>\n <PopoverPrimitive.Trigger>\n <IconPickerTrigger icon={selectedIcon} />\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content\n style={{ width: size === ICON_PICKER_SIZE.SMALL ? \"248px\" : \"328px\" }}\n >\n <IconPickerContent\n loading={isLoading}\n removable={value && removable}\n iconTypes={iconTypes}\n activeTab={activeTab}\n removeIcon={removeIcon}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive>\n <FormComponentErrorMessage text={validationMessage} invalid={invalid} />\n </IconPickerPresenterProvider>\n );\n }\n);\n"],"names":["IconPickerComponent","observer","presenter","label","description","removable","required","disabled","props","value","onChange","validationIsValid","validationMessage","invalid","useMemo","activeTab","isMenuOpened","isLoading","iconTypes","selectedIcon","size","useEffect","isEqual","JSON","removeIcon","useCallback","undefined","handleOnOpenChange","open","IconPickerPresenterProvider","FormComponentLabel","FormComponentDescription","PopoverPrimitive","IconPickerTrigger","ICON_PICKER_SIZE","IconPickerContent","FormComponentErrorMessage"],"mappings":";;;;;;;AA2BO,MAAMA,sBAAsBC,SAC/B,CAAC,EACGC,SAAS,EACTC,KAAK,EACLC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,OACoB;IACvB,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAC5B,MAAM,EAAE,SAASG,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGJ,MAAM,UAAU,IAAI,CAAC;IACxF,MAAMK,UAAUC,QAAQ,IAAMH,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAC9E,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,EAAEC,IAAI,EAAE,GAAGlB,UAAU,EAAE;IAE1FmB,UAAU;QACN,IAAIX,YAAYS,gBAAgB,CAACG,QAAQH,cAAcV,QACnDC,SAASS;IAEjB,GAAG;QAACI,KAAK,SAAS,CAACJ;KAAc;IAEjC,MAAMK,aAAaC,YAAY;QAC3B,IAAIf,UAAU;YACVR,UAAU,OAAO,CAAC;YAClBQ,SAASgB;QACb;IACJ,GAAG;QAAChB;KAAS;IAEb,MAAMiB,qBAAqBF,YACvB,CAACG;QACG,IAAIA,MACA,OAAO1B,UAAU,QAAQ;aAEzB,OAAOA,UAAU,SAAS;IAElC,GACA;QAACA,UAAU,QAAQ;QAAEA,UAAU,SAAS;KAAC;IAG7C,OAAO,WAAP,GACI,oBAAC2B,6BAA2BA;QAAC,WAAW3B;qBACpC,oBAAC4B,oBAAkBA;QAAC,MAAM3B;QAAO,UAAUG;QAAU,UAAUC;sBAC/D,oBAACwB,0BAAwBA;QAAC,MAAM3B;sBAChC,oBAAC4B,kBAAgBA;QAAC,MAAMhB;QAAc,cAAcW;qBAChD,oBAACK,iBAAiB,OAAO,sBACrB,oBAACC,mBAAiBA;QAAC,MAAMd;uBAE7B,oBAACa,iBAAiB,OAAO;QACrB,OAAO;YAAE,OAAOZ,SAASc,iBAAiB,KAAK,GAAG,UAAU;QAAQ;qBAEpE,oBAACC,mBAAiBA;QACd,SAASlB;QACT,WAAWR,SAASJ;QACpB,WAAWa;QACX,WAAWH;QACX,YAAYS;wBAIxB,oBAACY,2BAAyBA;QAAC,MAAMxB;QAAmB,SAASC;;AAGzE"}
|
|
@@ -5,7 +5,7 @@ export interface ListViewBulkActionsProps {
|
|
|
5
5
|
itemLabelPlural?: string;
|
|
6
6
|
actions: React.ComponentProps<typeof Buttons>["actions"];
|
|
7
7
|
}
|
|
8
|
-
declare const ListViewBulkActions: (({ itemLabel, itemLabelPlural, actions: bulkActions }: ListViewBulkActionsProps) => React.JSX.Element) & {
|
|
9
|
-
|
|
8
|
+
declare const ListViewBulkActions: (({ itemLabel, itemLabelPlural, actions: bulkActions }: ListViewBulkActionsProps) => React.JSX.Element) & React.NamedExoticComponent<ListViewBulkActionsProps> & {
|
|
9
|
+
readonly type: ({ itemLabel, itemLabelPlural, actions: bulkActions }: ListViewBulkActionsProps) => React.JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
export { ListViewBulkActions };
|
|
@@ -6,7 +6,7 @@ export interface ListViewContentProps {
|
|
|
6
6
|
searchEmpty?: React.ReactNode;
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
declare const ListViewContent: (({ loadMoreThreshold, loadMoreDebounceMs, empty, searchEmpty, children }: ListViewContentProps) => React.JSX.Element) & {
|
|
10
|
-
|
|
9
|
+
declare const ListViewContent: (({ loadMoreThreshold, loadMoreDebounceMs, empty, searchEmpty, children }: ListViewContentProps) => React.JSX.Element) & React.NamedExoticComponent<ListViewContentProps> & {
|
|
10
|
+
readonly type: ({ loadMoreThreshold, loadMoreDebounceMs, empty, searchEmpty, children }: ListViewContentProps) => React.JSX.Element;
|
|
11
11
|
};
|
|
12
12
|
export { ListViewContent };
|
|
@@ -9,7 +9,7 @@ export interface ListViewFiltersProps {
|
|
|
9
9
|
filtersToWhere?: FiltersToWhereConverter[];
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
}
|
|
12
|
-
declare const ListViewFilters: (({ filters, filtersToWhere, children }: ListViewFiltersProps) => React.JSX.Element) & {
|
|
13
|
-
|
|
12
|
+
declare const ListViewFilters: (({ filters, filtersToWhere, children }: ListViewFiltersProps) => React.JSX.Element) & React.NamedExoticComponent<ListViewFiltersProps> & {
|
|
13
|
+
readonly type: ({ filters, filtersToWhere, children }: ListViewFiltersProps) => React.JSX.Element;
|
|
14
14
|
};
|
|
15
15
|
export { ListViewFilters };
|
|
@@ -8,14 +8,14 @@ export declare const ListView: typeof ListViewBase & {
|
|
|
8
8
|
};
|
|
9
9
|
Header: typeof ListViewHeader;
|
|
10
10
|
BottomBar: typeof ListViewBottomBar;
|
|
11
|
-
BulkActions: (({ itemLabel, itemLabelPlural, actions: bulkActions }: import("./ListViewBulkActions.js").ListViewBulkActionsProps) => import("react").JSX.Element) & {
|
|
12
|
-
|
|
11
|
+
BulkActions: (({ itemLabel, itemLabelPlural, actions: bulkActions }: import("./ListViewBulkActions.js").ListViewBulkActionsProps) => import("react").JSX.Element) & import("react").NamedExoticComponent<import("./ListViewBulkActions.js").ListViewBulkActionsProps> & {
|
|
12
|
+
readonly type: ({ itemLabel, itemLabelPlural, actions: bulkActions }: import("./ListViewBulkActions.js").ListViewBulkActionsProps) => import("react").JSX.Element;
|
|
13
13
|
};
|
|
14
|
-
Filters: (({ filters, filtersToWhere, children }: import("./ListViewFilters.js").ListViewFiltersProps) => import("react").JSX.Element) & {
|
|
15
|
-
|
|
14
|
+
Filters: (({ filters, filtersToWhere, children }: import("./ListViewFilters.js").ListViewFiltersProps) => import("react").JSX.Element) & import("react").NamedExoticComponent<import("./ListViewFilters.js").ListViewFiltersProps> & {
|
|
15
|
+
readonly type: ({ filters, filtersToWhere, children }: import("./ListViewFilters.js").ListViewFiltersProps) => import("react").JSX.Element;
|
|
16
16
|
};
|
|
17
|
-
Content: (({ loadMoreThreshold, loadMoreDebounceMs, empty, searchEmpty, children }: import("./ListViewContent.js").ListViewContentProps) => import("react").JSX.Element) & {
|
|
18
|
-
|
|
17
|
+
Content: (({ loadMoreThreshold, loadMoreDebounceMs, empty, searchEmpty, children }: import("./ListViewContent.js").ListViewContentProps) => import("react").JSX.Element) & import("react").NamedExoticComponent<import("./ListViewContent.js").ListViewContentProps> & {
|
|
18
|
+
readonly type: ({ loadMoreThreshold, loadMoreDebounceMs, empty, searchEmpty, children }: import("./ListViewContent.js").ListViewContentProps) => import("react").JSX.Element;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
export { useListView } from "./context.js";
|
|
@@ -18,7 +18,7 @@ const RolesMultiAutocomplete = ({ onChange, ...props })=>{
|
|
|
18
18
|
const selected = Array.isArray(props.values) ? props.values : Array.isArray(props.value) ? props.value : [];
|
|
19
19
|
return selected.map((s)=>{
|
|
20
20
|
if ("string" == typeof s) return s;
|
|
21
|
-
if ("object" == typeof s) return s?.id;
|
|
21
|
+
else if ("object" == typeof s) return s?.id;
|
|
22
22
|
return null;
|
|
23
23
|
}).filter((s)=>!!s);
|
|
24
24
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/RolesMultiAutocomplete/index.js","sources":["../../../src/components/RolesMultiAutocomplete/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { MultiAutoComplete } from \"@webiny/admin-ui\";\nimport { LIST_ROLES } from \"./graphql.js\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype RolesMultiAutocompleteProps = Omit<\n React.ComponentProps<typeof MultiAutoComplete>,\n \"options\" | \"onValuesChange\"\n> & {\n onChange?: (values: string[]) => void;\n};\n\nexport const RolesMultiAutocomplete = ({ onChange, ...props }: RolesMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_ROLES);\n const rawOptions = loading || !data ? [] : data.security.roles.data;\n\n const options = useMemo(\n () => rawOptions.map((role: any) => ({ label: role.name, value: role.id })),\n [rawOptions]\n );\n\n const onValuesChange = useCallback((ids: string[]) => onChange?.(ids), [onChange]);\n\n /**\n * This is required because the Bind, which currently wraps this component passes \"values\" as \"value\" prop, not \"values\".\n * \"values\" is added to safeguard for future changes. When we move to new forms, remove this part.\n */\n const values = useMemo(() => {\n const selected = Array.isArray(props.values)\n ? props.values\n : Array.isArray(props.value)\n ? props.value\n : [];\n\n return selected\n .map(s => {\n if (typeof s === \"string\") {\n return s;\n } else if (typeof s === \"object\") {\n return s?.id;\n }\n return null;\n })\n .filter((s): s is string => !!s);\n }, [props.values, props.value]);\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n values={loading ? undefined : (values as string[] | undefined)}\n onValuesChange={onValuesChange}\n />\n );\n};\n"],"names":["RolesMultiAutocomplete","onChange","props","data","loading","useQuery","LIST_ROLES","rawOptions","options","useMemo","role","onValuesChange","useCallback","ids","values","selected","Array","s","MultiAutoComplete","undefined"],"mappings":";;;;AAYO,MAAMA,yBAAyB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAAoC;IACtF,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC,SAASC;IACnC,MAAMC,aAAaH,WAAW,CAACD,OAAO,EAAE,GAAGA,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI;IAEnE,MAAMK,UAAUC,QACZ,IAAMF,WAAW,GAAG,CAAC,CAACG,OAAe;gBAAE,OAAOA,KAAK,IAAI;gBAAE,OAAOA,KAAK,EAAE;YAAC,KACxE;QAACH;KAAW;IAGhB,MAAMI,iBAAiBC,YAAY,CAACC,MAAkBZ,WAAWY,MAAM;QAACZ;KAAS;IAMjF,MAAMa,SAASL,QAAQ;QACnB,MAAMM,WAAWC,MAAM,OAAO,CAACd,MAAM,MAAM,IACrCA,MAAM,MAAM,GACZc,MAAM,OAAO,CAACd,MAAM,KAAK,IACvBA,MAAM,KAAK,GACX,EAAE;QAEV,OAAOa,SACF,GAAG,CAACE,CAAAA;YACD,IAAI,AAAa,YAAb,OAAOA,GACP,OAAOA;
|
|
1
|
+
{"version":3,"file":"components/RolesMultiAutocomplete/index.js","sources":["../../../src/components/RolesMultiAutocomplete/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { MultiAutoComplete } from \"@webiny/admin-ui\";\nimport { LIST_ROLES } from \"./graphql.js\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype RolesMultiAutocompleteProps = Omit<\n React.ComponentProps<typeof MultiAutoComplete>,\n \"options\" | \"onValuesChange\"\n> & {\n onChange?: (values: string[]) => void;\n};\n\nexport const RolesMultiAutocomplete = ({ onChange, ...props }: RolesMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_ROLES);\n const rawOptions = loading || !data ? [] : data.security.roles.data;\n\n const options = useMemo(\n () => rawOptions.map((role: any) => ({ label: role.name, value: role.id })),\n [rawOptions]\n );\n\n const onValuesChange = useCallback((ids: string[]) => onChange?.(ids), [onChange]);\n\n /**\n * This is required because the Bind, which currently wraps this component passes \"values\" as \"value\" prop, not \"values\".\n * \"values\" is added to safeguard for future changes. When we move to new forms, remove this part.\n */\n const values = useMemo(() => {\n const selected = Array.isArray(props.values)\n ? props.values\n : Array.isArray(props.value)\n ? props.value\n : [];\n\n return selected\n .map(s => {\n if (typeof s === \"string\") {\n return s;\n } else if (typeof s === \"object\") {\n return s?.id;\n }\n return null;\n })\n .filter((s): s is string => !!s);\n }, [props.values, props.value]);\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n values={loading ? undefined : (values as string[] | undefined)}\n onValuesChange={onValuesChange}\n />\n );\n};\n"],"names":["RolesMultiAutocomplete","onChange","props","data","loading","useQuery","LIST_ROLES","rawOptions","options","useMemo","role","onValuesChange","useCallback","ids","values","selected","Array","s","MultiAutoComplete","undefined"],"mappings":";;;;AAYO,MAAMA,yBAAyB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAAoC;IACtF,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC,SAASC;IACnC,MAAMC,aAAaH,WAAW,CAACD,OAAO,EAAE,GAAGA,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI;IAEnE,MAAMK,UAAUC,QACZ,IAAMF,WAAW,GAAG,CAAC,CAACG,OAAe;gBAAE,OAAOA,KAAK,IAAI;gBAAE,OAAOA,KAAK,EAAE;YAAC,KACxE;QAACH;KAAW;IAGhB,MAAMI,iBAAiBC,YAAY,CAACC,MAAkBZ,WAAWY,MAAM;QAACZ;KAAS;IAMjF,MAAMa,SAASL,QAAQ;QACnB,MAAMM,WAAWC,MAAM,OAAO,CAACd,MAAM,MAAM,IACrCA,MAAM,MAAM,GACZc,MAAM,OAAO,CAACd,MAAM,KAAK,IACvBA,MAAM,KAAK,GACX,EAAE;QAEV,OAAOa,SACF,GAAG,CAACE,CAAAA;YACD,IAAI,AAAa,YAAb,OAAOA,GACP,OAAOA;iBACJ,IAAI,AAAa,YAAb,OAAOA,GACd,OAAOA,GAAG;YAEd,OAAO;QACX,GACC,MAAM,CAAC,CAACA,IAAmB,CAAC,CAACA;IACtC,GAAG;QAACf,MAAM,MAAM;QAAEA,MAAM,KAAK;KAAC;IAE9B,OAAO,WAAP,GACI,oBAACgB,mBAAiBA;QACb,GAAGhB,KAAK;QACT,SAASM;QACT,QAAQJ,UAAUe,SAAaL;QAC/B,gBAAgBH;;AAG5B"}
|
|
@@ -19,6 +19,6 @@ export interface TableInnerProps<T extends TableRow> {
|
|
|
19
19
|
sorting: DataTableSorting;
|
|
20
20
|
tablePresenter: TablePresenter;
|
|
21
21
|
}
|
|
22
|
-
export declare const TableInner: (<T extends TableRow>(props: TableInnerProps<T>) => React.JSX.Element) & {
|
|
23
|
-
|
|
22
|
+
export declare const TableInner: (<T extends TableRow>(props: TableInnerProps<T>) => React.JSX.Element) & React.NamedExoticComponent<TableInnerProps<TableRow<unknown>>> & {
|
|
23
|
+
readonly type: <T extends TableRow>(props: TableInnerProps<T>) => React.JSX.Element;
|
|
24
24
|
};
|
|
@@ -18,7 +18,7 @@ const TeamsMultiAutocomplete = ({ onChange, ...props })=>{
|
|
|
18
18
|
const selected = Array.isArray(props.values) ? props.values : Array.isArray(props.value) ? props.value : [];
|
|
19
19
|
return selected.map((s)=>{
|
|
20
20
|
if ("string" == typeof s) return s;
|
|
21
|
-
if ("object" == typeof s) return s?.id;
|
|
21
|
+
else if ("object" == typeof s) return s?.id;
|
|
22
22
|
return null;
|
|
23
23
|
}).filter((s)=>!!s);
|
|
24
24
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/TeamsMultiAutocomplete/index.js","sources":["../../../src/components/TeamsMultiAutocomplete/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { MultiAutoComplete } from \"@webiny/admin-ui\";\nimport { LIST_TEAMS } from \"./graphql.js\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamsMultiAutocompleteProps = Omit<\n React.ComponentProps<typeof MultiAutoComplete>,\n \"options\" | \"onValuesChange\"\n> & {\n onChange?: (values: string[]) => void;\n};\n\nexport const TeamsMultiAutocomplete = ({ onChange, ...props }: TeamsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n const rawOptions = loading || !data?.security?.teams?.data ? [] : data.security.teams.data;\n\n const options = useMemo(\n () => rawOptions.map((team: any) => ({ label: team.name, value: team.id })),\n [rawOptions]\n );\n\n const onValuesChange = useCallback((ids: string[]) => onChange?.(ids), [onChange]);\n /**\n * This is required because the Bind, which currently wraps this component passes \"values\" as \"value\" prop, not \"values\".\n * \"values\" is added to safeguard for future changes. When we move to new forms, remove this part.\n */\n const values = useMemo(() => {\n const selected = Array.isArray(props.values)\n ? props.values\n : Array.isArray(props.value)\n ? props.value\n : [];\n\n return selected\n .map(s => {\n if (typeof s === \"string\") {\n return s;\n } else if (typeof s === \"object\") {\n return s?.id;\n }\n return null;\n })\n .filter((s): s is string => !!s);\n }, [props.values, props.value]);\n\n return (\n <MultiAutoComplete\n uniqueValues\n {...props}\n options={options}\n values={loading ? undefined : (values as string[] | undefined)}\n onValuesChange={onValuesChange}\n />\n );\n};\n"],"names":["TeamsMultiAutocomplete","onChange","props","data","loading","useQuery","LIST_TEAMS","rawOptions","options","useMemo","team","onValuesChange","useCallback","ids","values","selected","Array","s","MultiAutoComplete","undefined"],"mappings":";;;;AAYO,MAAMA,yBAAyB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAAoC;IACtF,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC,SAASC;IACnC,MAAMC,aAAaH,WAAW,CAACD,MAAM,UAAU,OAAO,OAAO,EAAE,GAAGA,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI;IAE1F,MAAMK,UAAUC,QACZ,IAAMF,WAAW,GAAG,CAAC,CAACG,OAAe;gBAAE,OAAOA,KAAK,IAAI;gBAAE,OAAOA,KAAK,EAAE;YAAC,KACxE;QAACH;KAAW;IAGhB,MAAMI,iBAAiBC,YAAY,CAACC,MAAkBZ,WAAWY,MAAM;QAACZ;KAAS;IAKjF,MAAMa,SAASL,QAAQ;QACnB,MAAMM,WAAWC,MAAM,OAAO,CAACd,MAAM,MAAM,IACrCA,MAAM,MAAM,GACZc,MAAM,OAAO,CAACd,MAAM,KAAK,IACvBA,MAAM,KAAK,GACX,EAAE;QAEV,OAAOa,SACF,GAAG,CAACE,CAAAA;YACD,IAAI,AAAa,YAAb,OAAOA,GACP,OAAOA;
|
|
1
|
+
{"version":3,"file":"components/TeamsMultiAutocomplete/index.js","sources":["../../../src/components/TeamsMultiAutocomplete/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { MultiAutoComplete } from \"@webiny/admin-ui\";\nimport { LIST_TEAMS } from \"./graphql.js\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamsMultiAutocompleteProps = Omit<\n React.ComponentProps<typeof MultiAutoComplete>,\n \"options\" | \"onValuesChange\"\n> & {\n onChange?: (values: string[]) => void;\n};\n\nexport const TeamsMultiAutocomplete = ({ onChange, ...props }: TeamsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n const rawOptions = loading || !data?.security?.teams?.data ? [] : data.security.teams.data;\n\n const options = useMemo(\n () => rawOptions.map((team: any) => ({ label: team.name, value: team.id })),\n [rawOptions]\n );\n\n const onValuesChange = useCallback((ids: string[]) => onChange?.(ids), [onChange]);\n /**\n * This is required because the Bind, which currently wraps this component passes \"values\" as \"value\" prop, not \"values\".\n * \"values\" is added to safeguard for future changes. When we move to new forms, remove this part.\n */\n const values = useMemo(() => {\n const selected = Array.isArray(props.values)\n ? props.values\n : Array.isArray(props.value)\n ? props.value\n : [];\n\n return selected\n .map(s => {\n if (typeof s === \"string\") {\n return s;\n } else if (typeof s === \"object\") {\n return s?.id;\n }\n return null;\n })\n .filter((s): s is string => !!s);\n }, [props.values, props.value]);\n\n return (\n <MultiAutoComplete\n uniqueValues\n {...props}\n options={options}\n values={loading ? undefined : (values as string[] | undefined)}\n onValuesChange={onValuesChange}\n />\n );\n};\n"],"names":["TeamsMultiAutocomplete","onChange","props","data","loading","useQuery","LIST_TEAMS","rawOptions","options","useMemo","team","onValuesChange","useCallback","ids","values","selected","Array","s","MultiAutoComplete","undefined"],"mappings":";;;;AAYO,MAAMA,yBAAyB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAAoC;IACtF,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC,SAASC;IACnC,MAAMC,aAAaH,WAAW,CAACD,MAAM,UAAU,OAAO,OAAO,EAAE,GAAGA,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI;IAE1F,MAAMK,UAAUC,QACZ,IAAMF,WAAW,GAAG,CAAC,CAACG,OAAe;gBAAE,OAAOA,KAAK,IAAI;gBAAE,OAAOA,KAAK,EAAE;YAAC,KACxE;QAACH;KAAW;IAGhB,MAAMI,iBAAiBC,YAAY,CAACC,MAAkBZ,WAAWY,MAAM;QAACZ;KAAS;IAKjF,MAAMa,SAASL,QAAQ;QACnB,MAAMM,WAAWC,MAAM,OAAO,CAACd,MAAM,MAAM,IACrCA,MAAM,MAAM,GACZc,MAAM,OAAO,CAACd,MAAM,KAAK,IACvBA,MAAM,KAAK,GACX,EAAE;QAEV,OAAOa,SACF,GAAG,CAACE,CAAAA;YACD,IAAI,AAAa,YAAb,OAAOA,GACP,OAAOA;iBACJ,IAAI,AAAa,YAAb,OAAOA,GACd,OAAOA,GAAG;YAEd,OAAO;QACX,GACC,MAAM,CAAC,CAACA,IAAmB,CAAC,CAACA;IACtC,GAAG;QAACf,MAAM,MAAM;QAAEA,MAAM,KAAK;KAAC;IAE9B,OAAO,WAAP,GACI,oBAACgB,mBAAiBA;QACd;QACC,GAAGhB,KAAK;QACT,SAASM;QACT,QAAQJ,UAAUe,SAAaL;QAC/B,gBAAgBH;;AAG5B"}
|
package/domain/Identity.js
CHANGED
|
@@ -62,7 +62,7 @@ class Identity {
|
|
|
62
62
|
const perms = this.data.permissions || [];
|
|
63
63
|
const exactMatch = perms.find((p)=>p.name === name);
|
|
64
64
|
if (exactMatch) return exactMatch;
|
|
65
|
-
if (exact) return null;
|
|
65
|
+
else if (exact) return null;
|
|
66
66
|
return perms.find((p)=>minimatch(name, p.name)) || null;
|
|
67
67
|
}
|
|
68
68
|
getPermissions(name) {
|
package/domain/Identity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain/Identity.js","sources":["../../src/domain/Identity.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { minimatch } from \"minimatch\";\nimport type { Tenant } from \"~/features/tenancy/abstractions.js\";\n\nexport interface IPermission {\n name: string;\n [key: string]: any;\n}\n\nexport interface IRole {\n id: string;\n slug: string;\n name: string;\n}\n\nexport interface ITeam {\n id: string;\n slug: string;\n name: string;\n}\n\nexport interface IProfile {\n external: boolean;\n email?: string;\n firstName?: string;\n lastName?: string;\n avatar?: {\n src?: string;\n };\n}\n\nexport interface IdentityData {\n id: string;\n type: string;\n displayName: string;\n roles: IRole[];\n teams: ITeam[];\n permissions: Identity.Permission[];\n profile: Identity.Profile;\n currentTenant: Tenant;\n defaultTenant: Tenant;\n}\n\nconst anonymousData: IdentityData = {\n id: \"anonymous\",\n displayName: \"Anonymous\",\n type: \"admin\",\n roles: [],\n teams: [],\n permissions: [],\n profile: {\n external: false\n },\n currentTenant: {\n id: \"root\",\n name: \"Root\"\n },\n defaultTenant: {\n id: \"root\",\n name: \"Root\"\n }\n};\n\nexport class Identity {\n private constructor(\n private data: Identity.Data,\n private identityType: \"anonymous\" | \"authenticated\"\n ) {\n makeAutoObservable(this);\n }\n\n static createAuthenticated(data: Identity.Data) {\n return new Identity(data, \"authenticated\");\n }\n\n static createAnonymous() {\n return new Identity(anonymousData, \"anonymous\");\n }\n\n get isAuthenticated(): boolean {\n return this.identityType === \"authenticated\";\n }\n\n get id() {\n return this.data.id;\n }\n\n get type() {\n return this.data.type;\n }\n\n get displayName() {\n return this.data.displayName;\n }\n\n get roles() {\n return this.data.roles ?? [];\n }\n\n get teams() {\n return this.data.teams ?? [];\n }\n\n get profile() {\n return this.data.profile;\n }\n\n get currentTenant() {\n return this.data.currentTenant;\n }\n\n get defaultTenant() {\n return this.data.defaultTenant;\n }\n\n getPermission<T extends Identity.Permission = Identity.Permission>(\n name: string,\n exact?: boolean\n ): T | null {\n const perms = (this.data.permissions || []) as T[];\n const exactMatch = perms.find(p => p.name === name);\n if (exactMatch) {\n return exactMatch as T;\n } else if (exact) {\n return null;\n }\n\n // Try matching using patterns\n return perms.find(p => minimatch(name, p.name)) || null;\n }\n\n getPermissions<T extends Identity.Permission = Identity.Permission>(name?: string): Array<T> {\n const permissions = this.data.permissions || [];\n if (!name) {\n return permissions as T[];\n }\n\n return permissions.filter(current => {\n const exactMatch = current.name === name;\n if (exactMatch) {\n return true;\n }\n\n // Try matching using patterns.\n return minimatch(name, current.name);\n }) as T[];\n }\n\n update(updates: Partial<Pick<Identity.Data, \"displayName\" | \"profile\">>) {\n runInAction(() => {\n this.data.displayName = updates.displayName || this.data.displayName;\n this.data.profile = updates.profile || this.data.profile;\n });\n }\n}\n\nexport namespace Identity {\n export type Data = IdentityData;\n export type Permission = IPermission;\n export type Profile = IProfile;\n}\n"],"names":["anonymousData","Identity","data","identityType","makeAutoObservable","name","exact","perms","exactMatch","p","minimatch","permissions","current","updates","runInAction"],"mappings":";;AA2CA,MAAMA,gBAA8B;IAChC,IAAI;IACJ,aAAa;IACb,MAAM;IACN,OAAO,EAAE;IACT,OAAO,EAAE;IACT,aAAa,EAAE;IACf,SAAS;QACL,UAAU;IACd;IACA,eAAe;QACX,IAAI;QACJ,MAAM;IACV;IACA,eAAe;QACX,IAAI;QACJ,MAAM;IACV;AACJ;AAEO,MAAMC;IACT,YACYC,IAAmB,EACnBC,YAA2C,CACrD;aAFUD,IAAI,GAAJA;aACAC,YAAY,GAAZA;QAERC,mBAAmB,IAAI;IAC3B;IAEA,OAAO,oBAAoBF,IAAmB,EAAE;QAC5C,OAAO,IAAID,SAASC,MAAM;IAC9B;IAEA,OAAO,kBAAkB;QACrB,OAAO,IAAID,SAASD,eAAe;IACvC;IAEA,IAAI,kBAA2B;QAC3B,OAAO,AAAsB,oBAAtB,IAAI,CAAC,YAAY;IAC5B;IAEA,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE;IACvB;IAEA,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI;IACzB;IAEA,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW;IAChC;IAEA,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;IAChC;IAEA,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;IAChC;IAEA,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO;IAC5B;IAEA,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa;IAClC;IAEA,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa;IAClC;IAEA,cACIK,IAAY,EACZC,KAAe,EACP;QACR,MAAMC,QAAS,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE;QAC1C,MAAMC,aAAaD,MAAM,IAAI,CAACE,CAAAA,IAAKA,EAAE,IAAI,KAAKJ;QAC9C,IAAIG,YACA,OAAOA;
|
|
1
|
+
{"version":3,"file":"domain/Identity.js","sources":["../../src/domain/Identity.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { minimatch } from \"minimatch\";\nimport type { Tenant } from \"~/features/tenancy/abstractions.js\";\n\nexport interface IPermission {\n name: string;\n [key: string]: any;\n}\n\nexport interface IRole {\n id: string;\n slug: string;\n name: string;\n}\n\nexport interface ITeam {\n id: string;\n slug: string;\n name: string;\n}\n\nexport interface IProfile {\n external: boolean;\n email?: string;\n firstName?: string;\n lastName?: string;\n avatar?: {\n src?: string;\n };\n}\n\nexport interface IdentityData {\n id: string;\n type: string;\n displayName: string;\n roles: IRole[];\n teams: ITeam[];\n permissions: Identity.Permission[];\n profile: Identity.Profile;\n currentTenant: Tenant;\n defaultTenant: Tenant;\n}\n\nconst anonymousData: IdentityData = {\n id: \"anonymous\",\n displayName: \"Anonymous\",\n type: \"admin\",\n roles: [],\n teams: [],\n permissions: [],\n profile: {\n external: false\n },\n currentTenant: {\n id: \"root\",\n name: \"Root\"\n },\n defaultTenant: {\n id: \"root\",\n name: \"Root\"\n }\n};\n\nexport class Identity {\n private constructor(\n private data: Identity.Data,\n private identityType: \"anonymous\" | \"authenticated\"\n ) {\n makeAutoObservable(this);\n }\n\n static createAuthenticated(data: Identity.Data) {\n return new Identity(data, \"authenticated\");\n }\n\n static createAnonymous() {\n return new Identity(anonymousData, \"anonymous\");\n }\n\n get isAuthenticated(): boolean {\n return this.identityType === \"authenticated\";\n }\n\n get id() {\n return this.data.id;\n }\n\n get type() {\n return this.data.type;\n }\n\n get displayName() {\n return this.data.displayName;\n }\n\n get roles() {\n return this.data.roles ?? [];\n }\n\n get teams() {\n return this.data.teams ?? [];\n }\n\n get profile() {\n return this.data.profile;\n }\n\n get currentTenant() {\n return this.data.currentTenant;\n }\n\n get defaultTenant() {\n return this.data.defaultTenant;\n }\n\n getPermission<T extends Identity.Permission = Identity.Permission>(\n name: string,\n exact?: boolean\n ): T | null {\n const perms = (this.data.permissions || []) as T[];\n const exactMatch = perms.find(p => p.name === name);\n if (exactMatch) {\n return exactMatch as T;\n } else if (exact) {\n return null;\n }\n\n // Try matching using patterns\n return perms.find(p => minimatch(name, p.name)) || null;\n }\n\n getPermissions<T extends Identity.Permission = Identity.Permission>(name?: string): Array<T> {\n const permissions = this.data.permissions || [];\n if (!name) {\n return permissions as T[];\n }\n\n return permissions.filter(current => {\n const exactMatch = current.name === name;\n if (exactMatch) {\n return true;\n }\n\n // Try matching using patterns.\n return minimatch(name, current.name);\n }) as T[];\n }\n\n update(updates: Partial<Pick<Identity.Data, \"displayName\" | \"profile\">>) {\n runInAction(() => {\n this.data.displayName = updates.displayName || this.data.displayName;\n this.data.profile = updates.profile || this.data.profile;\n });\n }\n}\n\nexport namespace Identity {\n export type Data = IdentityData;\n export type Permission = IPermission;\n export type Profile = IProfile;\n}\n"],"names":["anonymousData","Identity","data","identityType","makeAutoObservable","name","exact","perms","exactMatch","p","minimatch","permissions","current","updates","runInAction"],"mappings":";;AA2CA,MAAMA,gBAA8B;IAChC,IAAI;IACJ,aAAa;IACb,MAAM;IACN,OAAO,EAAE;IACT,OAAO,EAAE;IACT,aAAa,EAAE;IACf,SAAS;QACL,UAAU;IACd;IACA,eAAe;QACX,IAAI;QACJ,MAAM;IACV;IACA,eAAe;QACX,IAAI;QACJ,MAAM;IACV;AACJ;AAEO,MAAMC;IACT,YACYC,IAAmB,EACnBC,YAA2C,CACrD;aAFUD,IAAI,GAAJA;aACAC,YAAY,GAAZA;QAERC,mBAAmB,IAAI;IAC3B;IAEA,OAAO,oBAAoBF,IAAmB,EAAE;QAC5C,OAAO,IAAID,SAASC,MAAM;IAC9B;IAEA,OAAO,kBAAkB;QACrB,OAAO,IAAID,SAASD,eAAe;IACvC;IAEA,IAAI,kBAA2B;QAC3B,OAAO,AAAsB,oBAAtB,IAAI,CAAC,YAAY;IAC5B;IAEA,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE;IACvB;IAEA,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI;IACzB;IAEA,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW;IAChC;IAEA,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;IAChC;IAEA,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;IAChC;IAEA,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO;IAC5B;IAEA,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa;IAClC;IAEA,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa;IAClC;IAEA,cACIK,IAAY,EACZC,KAAe,EACP;QACR,MAAMC,QAAS,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE;QAC1C,MAAMC,aAAaD,MAAM,IAAI,CAACE,CAAAA,IAAKA,EAAE,IAAI,KAAKJ;QAC9C,IAAIG,YACA,OAAOA;aACJ,IAAIF,OACP,OAAO;QAIX,OAAOC,MAAM,IAAI,CAACE,CAAAA,IAAKC,UAAUL,MAAMI,EAAE,IAAI,MAAM;IACvD;IAEA,eAAoEJ,IAAa,EAAY;QACzF,MAAMM,cAAc,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE;QAC/C,IAAI,CAACN,MACD,OAAOM;QAGX,OAAOA,YAAY,MAAM,CAACC,CAAAA;YACtB,MAAMJ,aAAaI,QAAQ,IAAI,KAAKP;YACpC,IAAIG,YACA,OAAO;YAIX,OAAOE,UAAUL,MAAMO,QAAQ,IAAI;QACvC;IACJ;IAEA,OAAOC,OAAgE,EAAE;QACrEC,YAAY;YACR,IAAI,CAAC,IAAI,CAAC,WAAW,GAAGD,QAAQ,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW;YACpE,IAAI,CAAC,IAAI,CAAC,OAAO,GAAGA,QAAQ,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO;QAC5D;IACJ;AACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* No menu entry: the header indicator is the way in, and it downloads the report directly. The
|
|
4
|
+
* panel remains reachable by URL for anyone who wants the namespace filter or the session list.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Debugger: (() => React.JSX.Element) & React.NamedExoticComponent<unknown> & {
|
|
7
|
+
readonly type: () => React.JSX.Element;
|
|
8
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import react, { useEffect } from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { AdminConfig } from "../../config/AdminConfig.js";
|
|
4
|
+
import { AdminLayout } from "../../components/AdminLayout.js";
|
|
5
|
+
import { useCanCaptureDebugData } from "./permissions.js";
|
|
6
|
+
import { debuggerStore } from "./DebuggerStore.js";
|
|
7
|
+
import { DebuggerView } from "./DebuggerView.js";
|
|
8
|
+
import { DebuggerRoutes } from "./routes.js";
|
|
9
|
+
const Debugger = observer(()=>{
|
|
10
|
+
const canDebug = useCanCaptureDebugData();
|
|
11
|
+
useEffect(()=>{
|
|
12
|
+
debuggerStore.applyPermission(canDebug);
|
|
13
|
+
}, [
|
|
14
|
+
canDebug
|
|
15
|
+
]);
|
|
16
|
+
return /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Route, {
|
|
17
|
+
route: DebuggerRoutes.Debugger,
|
|
18
|
+
element: /*#__PURE__*/ react.createElement(AdminLayout, {
|
|
19
|
+
title: "Debugger"
|
|
20
|
+
}, /*#__PURE__*/ react.createElement(DebuggerView, null))
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
export { Debugger };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=Debugger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/debugger/Debugger.js","sources":["../../../src/features/debugger/Debugger.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { AdminLayout } from \"~/components/AdminLayout.js\";\nimport { useCanCaptureDebugData } from \"./permissions.js\";\nimport { debuggerStore } from \"./DebuggerStore.js\";\nimport { DebuggerView } from \"./DebuggerView.js\";\nimport { DebuggerRoutes } from \"./routes.js\";\n\n/**\n * No menu entry: the header indicator is the way in, and it downloads the report directly. The\n * panel remains reachable by URL for anyone who wants the namespace filter or the session list.\n */\nexport const Debugger = observer(() => {\n const canDebug = useCanCaptureDebugData();\n\n /**\n * Holding the permission is the opt-in, so capture starts on. An identity that has explicitly\n * turned it off keeps it off; one that loses the permission has it turned off for them.\n */\n useEffect(() => {\n debuggerStore.applyPermission(canDebug);\n }, [canDebug]);\n\n return (\n <AdminConfig>\n <AdminConfig.Route\n route={DebuggerRoutes.Debugger}\n element={\n <AdminLayout title={\"Debugger\"}>\n <DebuggerView />\n </AdminLayout>\n }\n />\n </AdminConfig>\n );\n});\n"],"names":["Debugger","observer","canDebug","useCanCaptureDebugData","useEffect","debuggerStore","AdminConfig","DebuggerRoutes","AdminLayout","DebuggerView"],"mappings":";;;;;;;;AAaO,MAAMA,WAAWC,SAAS;IAC7B,MAAMC,WAAWC;IAMjBC,UAAU;QACNC,cAAc,eAAe,CAACH;IAClC,GAAG;QAACA;KAAS;IAEb,OAAO,WAAP,GACI,oBAACI,aAAWA,MAAAA,WAAAA,GACR,oBAACA,YAAY,KAAK;QACd,OAAOC,eAAe,QAAQ;QAC9B,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACC,cAAYA;;AAMrC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Says that capture is on, how much has been collected, and offers the two things worth doing
|
|
4
|
+
* about it.
|
|
5
|
+
*
|
|
6
|
+
* Renders nothing when the toggle is off, which is the normal state - the header is not the place to
|
|
7
|
+
* advertise a feature nobody switched on. When it is on it is deliberately hard to miss, because
|
|
8
|
+
* leaving capture running is the mistake it exists to prevent.
|
|
9
|
+
*
|
|
10
|
+
* Clearing matters as much as downloading: an hour of browsing collects a great deal, and everything
|
|
11
|
+
* held is in memory and lands in the next report whether or not it is relevant to the problem being
|
|
12
|
+
* reproduced.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DebuggerIndicator: (() => React.JSX.Element | null) & React.NamedExoticComponent<unknown> & {
|
|
15
|
+
readonly type: () => React.JSX.Element | null;
|
|
16
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { DropdownMenu, Tag } from "@webiny/admin-ui";
|
|
4
|
+
import { ReactComponent } from "@webiny/icons/bug_report.svg";
|
|
5
|
+
import { debuggerStore } from "./DebuggerStore.js";
|
|
6
|
+
import { downloadReport } from "./report.js";
|
|
7
|
+
const DebuggerIndicator = observer(()=>{
|
|
8
|
+
if (!debuggerStore.enabled) return null;
|
|
9
|
+
const count = debuggerStore.entryCount;
|
|
10
|
+
const hasEntries = count > 0;
|
|
11
|
+
return /*#__PURE__*/ react.createElement(DropdownMenu, {
|
|
12
|
+
trigger: /*#__PURE__*/ react.createElement(Tag, {
|
|
13
|
+
variant: "warning",
|
|
14
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
15
|
+
content: hasEntries ? `Debug mode · ${count}` : "Debug mode",
|
|
16
|
+
title: hasEntries ? `Debug capture is on. ${count} entries collected.` : "Debug capture is on. Nothing collected yet.",
|
|
17
|
+
className: "cursor-pointer"
|
|
18
|
+
})
|
|
19
|
+
}, /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
|
|
20
|
+
text: "Download report",
|
|
21
|
+
disabled: !hasEntries,
|
|
22
|
+
onClick: downloadReport
|
|
23
|
+
}), /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
|
|
24
|
+
text: "Clear collected data",
|
|
25
|
+
disabled: !hasEntries,
|
|
26
|
+
onClick: debuggerStore.clear
|
|
27
|
+
}));
|
|
28
|
+
});
|
|
29
|
+
export { DebuggerIndicator };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=DebuggerIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/debugger/DebuggerIndicator.js","sources":["../../../src/features/debugger/DebuggerIndicator.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DropdownMenu, Tag } from \"@webiny/admin-ui\";\nimport { ReactComponent as DebuggerIcon } from \"@webiny/icons/bug_report.svg\";\nimport { debuggerStore } from \"./DebuggerStore.js\";\nimport { downloadReport } from \"./report.js\";\n\n/**\n * Says that capture is on, how much has been collected, and offers the two things worth doing\n * about it.\n *\n * Renders nothing when the toggle is off, which is the normal state - the header is not the place to\n * advertise a feature nobody switched on. When it is on it is deliberately hard to miss, because\n * leaving capture running is the mistake it exists to prevent.\n *\n * Clearing matters as much as downloading: an hour of browsing collects a great deal, and everything\n * held is in memory and lands in the next report whether or not it is relevant to the problem being\n * reproduced.\n */\nexport const DebuggerIndicator = observer(() => {\n if (!debuggerStore.enabled) {\n return null;\n }\n\n const count = debuggerStore.entryCount;\n const hasEntries = count > 0;\n\n return (\n <DropdownMenu\n trigger={\n <Tag\n variant={\"warning\"}\n icon={<DebuggerIcon />}\n content={hasEntries ? `Debug mode · ${count}` : \"Debug mode\"}\n title={\n hasEntries\n ? `Debug capture is on. ${count} entries collected.`\n : \"Debug capture is on. Nothing collected yet.\"\n }\n className={\"cursor-pointer\"}\n />\n }\n >\n <DropdownMenu.Item\n text={\"Download report\"}\n disabled={!hasEntries}\n onClick={downloadReport}\n />\n <DropdownMenu.Item\n text={\"Clear collected data\"}\n disabled={!hasEntries}\n onClick={debuggerStore.clear}\n />\n </DropdownMenu>\n );\n});\n"],"names":["DebuggerIndicator","observer","debuggerStore","count","hasEntries","DropdownMenu","Tag","DebuggerIcon","downloadReport"],"mappings":";;;;;;AAmBO,MAAMA,oBAAoBC,SAAS;IACtC,IAAI,CAACC,cAAc,OAAO,EACtB,OAAO;IAGX,MAAMC,QAAQD,cAAc,UAAU;IACtC,MAAME,aAAaD,QAAQ;IAE3B,OAAO,WAAP,GACI,oBAACE,cAAYA;QACT,uBACI,oBAACC,KAAGA;YACA,SAAS;YACT,oBAAM,oBAACC,gBAAYA;YACnB,SAASH,aAAa,CAAC,aAAa,EAAED,OAAO,GAAG;YAChD,OACIC,aACM,CAAC,qBAAqB,EAAED,MAAM,mBAAmB,CAAC,GAClD;YAEV,WAAW;;qBAInB,oBAACE,aAAa,IAAI;QACd,MAAM;QACN,UAAU,CAACD;QACX,SAASI;sBAEb,oBAACH,aAAa,IAAI;QACd,MAAM;QACN,UAAU,CAACD;QACX,SAASF,cAAc,KAAK;;AAI5C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface IDebugEntry {
|
|
2
|
+
seq: number;
|
|
3
|
+
namespace: string;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
elapsed: number;
|
|
6
|
+
data: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface IDebugPayload {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
requestId?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
namespaces?: string[];
|
|
13
|
+
operations?: string[];
|
|
14
|
+
entries?: IDebugEntry[];
|
|
15
|
+
bytes?: number;
|
|
16
|
+
dropped?: number;
|
|
17
|
+
truncated?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ICollectedSession extends IDebugPayload {
|
|
20
|
+
collectedAt: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Holds the debug toggle and the sessions collected from responses.
|
|
24
|
+
*
|
|
25
|
+
* The toggle persists across reloads, because reproducing a bug often involves one. The collected
|
|
26
|
+
* sessions deliberately do not: they hold customer data, and leaving that in browser storage after
|
|
27
|
+
* the session is a worse exposure than the response itself, which is transient.
|
|
28
|
+
*/
|
|
29
|
+
export declare class DebuggerStore {
|
|
30
|
+
private _enabled;
|
|
31
|
+
private _namespaces;
|
|
32
|
+
private _sessions;
|
|
33
|
+
constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Turns capture on for an identity that holds the permission, unless they have already turned it
|
|
36
|
+
* off themselves.
|
|
37
|
+
*
|
|
38
|
+
* Holding `dev-tools.debug` is the opt-in: the permission is granted deliberately, for a support
|
|
39
|
+
* session, and nobody should then have to find a second switch before the thing they were asked
|
|
40
|
+
* to reproduce is captured.
|
|
41
|
+
*/
|
|
42
|
+
applyPermission: (canCapture: boolean) => void;
|
|
43
|
+
get enabled(): boolean;
|
|
44
|
+
get namespaces(): string;
|
|
45
|
+
get sessions(): ICollectedSession[];
|
|
46
|
+
get entryCount(): number;
|
|
47
|
+
setEnabled: (enabled: boolean) => void;
|
|
48
|
+
setNamespaces: (namespaces: string) => void;
|
|
49
|
+
collect: (payload: IDebugPayload) => void;
|
|
50
|
+
clear: () => void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A single store instance, read by the Apollo link on every request and by the panel.
|
|
54
|
+
*/
|
|
55
|
+
export declare const debuggerStore: DebuggerStore;
|