@webiny/app-admin-ui 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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.
Files changed (137) hide show
  1. package/Breadcrumbs/Breadcrumbs.d.ts +14 -0
  2. package/Breadcrumbs/Breadcrumbs.js +74 -0
  3. package/Breadcrumbs/Breadcrumbs.js.map +1 -0
  4. package/CommandPalette/CommandPalette.d.ts +6 -0
  5. package/CommandPalette/CommandPalette.js +202 -0
  6. package/CommandPalette/CommandPalette.js.map +1 -0
  7. package/CommandPalette/components/AiModeBadge.d.ts +3 -0
  8. package/CommandPalette/components/AiModeBadge.js +11 -0
  9. package/CommandPalette/components/AiModeBadge.js.map +1 -0
  10. package/CommandPalette/components/AiSuggestions.d.ts +9 -0
  11. package/CommandPalette/components/AiSuggestions.js +32 -0
  12. package/CommandPalette/components/AiSuggestions.js.map +1 -0
  13. package/CommandPalette/components/AiTurn.d.ts +11 -0
  14. package/CommandPalette/components/AiTurn.js +61 -0
  15. package/CommandPalette/components/AiTurn.js.map +1 -0
  16. package/CommandPalette/components/AnswerSkeleton.d.ts +6 -0
  17. package/CommandPalette/components/AnswerSkeleton.js +20 -0
  18. package/CommandPalette/components/AnswerSkeleton.js.map +1 -0
  19. package/CommandPalette/components/ApprovalPlan.d.ts +16 -0
  20. package/CommandPalette/components/ApprovalPlan.js +56 -0
  21. package/CommandPalette/components/ApprovalPlan.js.map +1 -0
  22. package/CommandPalette/components/CommandDetail.d.ts +13 -0
  23. package/CommandPalette/components/CommandDetail.js +39 -0
  24. package/CommandPalette/components/CommandDetail.js.map +1 -0
  25. package/CommandPalette/components/CommandItemRow.d.ts +5 -0
  26. package/CommandPalette/components/CommandItemRow.js +41 -0
  27. package/CommandPalette/components/CommandItemRow.js.map +1 -0
  28. package/CommandPalette/components/GroupHeading.d.ts +4 -0
  29. package/CommandPalette/components/GroupHeading.js +10 -0
  30. package/CommandPalette/components/GroupHeading.js.map +1 -0
  31. package/CommandPalette/components/HintIcon.d.ts +4 -0
  32. package/CommandPalette/components/HintIcon.js +11 -0
  33. package/CommandPalette/components/HintIcon.js.map +1 -0
  34. package/CommandPalette/components/Kbd.d.ts +4 -0
  35. package/CommandPalette/components/Kbd.js +14 -0
  36. package/CommandPalette/components/Kbd.js.map +1 -0
  37. package/CommandPalette/components/NoResults.d.ts +13 -0
  38. package/CommandPalette/components/NoResults.js +33 -0
  39. package/CommandPalette/components/NoResults.js.map +1 -0
  40. package/CommandPalette/components/PaletteFooter.d.ts +13 -0
  41. package/CommandPalette/components/PaletteFooter.js +18 -0
  42. package/CommandPalette/components/PaletteFooter.js.map +1 -0
  43. package/CommandPalette/components/ToolChip.d.ts +7 -0
  44. package/CommandPalette/components/ToolChip.js +32 -0
  45. package/CommandPalette/components/ToolChip.js.map +1 -0
  46. package/CommandPalette/components/index.d.ts +13 -0
  47. package/CommandPalette/components/index.js +13 -0
  48. package/CommandPalette/constants.d.ts +8 -0
  49. package/CommandPalette/constants.js +5 -0
  50. package/CommandPalette/constants.js.map +1 -0
  51. package/CommandPalette/deriveRows.d.ts +19 -0
  52. package/CommandPalette/deriveRows.js +100 -0
  53. package/CommandPalette/deriveRows.js.map +1 -0
  54. package/CommandPalette/modes/PaletteMode.d.ts +73 -0
  55. package/CommandPalette/modes/PaletteMode.js +0 -0
  56. package/CommandPalette/modes/createAiMode.d.ts +13 -0
  57. package/CommandPalette/modes/createAiMode.js +80 -0
  58. package/CommandPalette/modes/createAiMode.js.map +1 -0
  59. package/CommandPalette/modes/index.d.ts +2 -0
  60. package/CommandPalette/modes/index.js +1 -0
  61. package/CommandPalette/types.d.ts +15 -0
  62. package/CommandPalette/types.js +0 -0
  63. package/CommandPalette/usePaletteHotkeys.d.ts +16 -0
  64. package/CommandPalette/usePaletteHotkeys.js +38 -0
  65. package/CommandPalette/usePaletteHotkeys.js.map +1 -0
  66. package/Dashboard/Welcome.d.ts +1 -1
  67. package/Dashboard/Welcome.js +29 -44
  68. package/Dashboard/Welcome.js.map +1 -1
  69. package/Dashboard/components/AssistanceWidget.js +52 -57
  70. package/Dashboard/components/AssistanceWidget.js.map +1 -1
  71. package/Dashboard/components/CommunityWidget.js +56 -63
  72. package/Dashboard/components/CommunityWidget.js.map +1 -1
  73. package/Dashboard/components/MissingPermissionsWidget.js +13 -14
  74. package/Dashboard/components/MissingPermissionsWidget.js.map +1 -1
  75. package/Dashboard/components/assets/github.js +14 -0
  76. package/Dashboard/components/assets/github.js.map +1 -0
  77. package/Dashboard/components/assets/slack.js +27 -0
  78. package/Dashboard/components/assets/slack.js.map +1 -0
  79. package/Dashboard/components/assets/x-twitter.js +18 -0
  80. package/Dashboard/components/assets/x-twitter.js.map +1 -0
  81. package/Dashboard/components/assets/youtube.js +28 -0
  82. package/Dashboard/components/assets/youtube.js.map +1 -0
  83. package/Dashboard/components/index.d.ts +3 -4
  84. package/Dashboard/components/index.js +3 -6
  85. package/Dashboard.js +7 -8
  86. package/Dashboard.js.map +1 -1
  87. package/Dialog/DialogContainer.js +55 -67
  88. package/Dialog/DialogContainer.js.map +1 -1
  89. package/Dialog/DialogProvider.js +6 -9
  90. package/Dialog/DialogProvider.js.map +1 -1
  91. package/Dialog.js +6 -10
  92. package/Dialog.js.map +1 -1
  93. package/Layout.js +50 -29
  94. package/Layout.js.map +1 -1
  95. package/Logo.js +12 -13
  96. package/Logo.js.map +1 -1
  97. package/Navigation/Navigation.js +31 -33
  98. package/Navigation/Navigation.js.map +1 -1
  99. package/Navigation/SidebarMenuItems.d.ts +1 -1
  100. package/Navigation/SidebarMenuItems.js +32 -40
  101. package/Navigation/SidebarMenuItems.js.map +1 -1
  102. package/NotFound/notFound.js +297 -0
  103. package/NotFound/notFound.js.map +1 -0
  104. package/NotFound.js +17 -18
  105. package/NotFound.js.map +1 -1
  106. package/README.md +9 -5
  107. package/UserMenu/UserMenu.js +17 -25
  108. package/UserMenu/UserMenu.js.map +1 -1
  109. package/UserMenu/UserMenuHandle.js +33 -42
  110. package/UserMenu/UserMenuHandle.js.map +1 -1
  111. package/UserMenu/UserMenuItem.js +9 -12
  112. package/UserMenu/UserMenuItem.js.map +1 -1
  113. package/UserMenu/UserMenuLink.js +9 -12
  114. package/UserMenu/UserMenuLink.js.map +1 -1
  115. package/UserMenu/UserMenuSeparator.js +9 -9
  116. package/UserMenu/UserMenuSeparator.js.map +1 -1
  117. package/UserMenu.js +8 -9
  118. package/UserMenu.js.map +1 -1
  119. package/index.js +22 -11
  120. package/index.js.map +1 -1
  121. package/package.json +21 -25
  122. package/static/svg/github.08a73b00.svg +1 -0
  123. package/static/svg/notFound.e8b15981.svg +1 -0
  124. package/static/svg/slack.1b2ba162.svg +8 -0
  125. package/static/svg/x-twitter.46e7218c.svg +5 -0
  126. package/static/svg/youtube.3c232651.svg +11 -0
  127. package/styles.scss +1 -1
  128. package/Dashboard/components/ApplicationWidget.d.ts +0 -9
  129. package/Dashboard/components/ApplicationWidget.js +0 -31
  130. package/Dashboard/components/ApplicationWidget.js.map +0 -1
  131. package/Dashboard/components/index.js.map +0 -1
  132. package/Navigation/SidebarProvider.d.ts +0 -6
  133. package/Navigation/SidebarProvider.js +0 -9
  134. package/Navigation/SidebarProvider.js.map +0 -1
  135. package/Navigation.d.ts +0 -2
  136. package/Navigation.js +0 -11
  137. package/Navigation.js.map +0 -1
@@ -0,0 +1,73 @@
1
+ import type React from "react";
2
+ import type { Hint } from "../components/index.js";
3
+ /**
4
+ * What a mode needs from the palette while it is handling a key.
5
+ *
6
+ * The palette owns the query and the input element, because there is ONE input row across every
7
+ * mode and switching must not move or remount it. A mode reads and writes the query through this
8
+ * rather than holding its own.
9
+ */
10
+ export interface PaletteModeKeyContext {
11
+ query: string;
12
+ setQuery(value: string): void;
13
+ /** Leave this mode and return to the command list. */
14
+ exit(): void;
15
+ }
16
+ /** How the palette should present itself while this mode is active. */
17
+ export interface PaletteModeAppearance {
18
+ /** Rendered in the input row, ahead of the input itself. */
19
+ icon: React.ReactNode;
20
+ iconColor: "accent" | "neutral-light";
21
+ iconLabel: string;
22
+ /** Optional marker beside the icon, e.g. a mode name pill. */
23
+ badge?: React.ReactNode;
24
+ placeholder: string;
25
+ footerLabel: string;
26
+ hints: Hint[];
27
+ /**
28
+ * Taller panel. A conversation grows and wants the room; a command list does not, and a list
29
+ * stretched to full height looks broken when it holds three items.
30
+ */
31
+ tall: boolean;
32
+ }
33
+ /**
34
+ * One way the palette can behave.
35
+ *
36
+ * A mode supplies its body, its keys and how the palette should look while it is active; the palette
37
+ * owns the shell, the query and the input. The point of the split is that adding a mode does not
38
+ * mean editing the palette: everything AI lives in `createAiMode`, and the palette only knows this
39
+ * interface.
40
+ *
41
+ * `appearance` and `body` are read during render, so an implementation can serve them from getters
42
+ * over observable state and let a reactive palette re-render on its own.
43
+ */
44
+ export interface PaletteMode {
45
+ appearance: PaletteModeAppearance;
46
+ /** Rendered in the palette's scroll area, in place of the command list. */
47
+ body: React.ReactNode;
48
+ /**
49
+ * Enter the mode, optionally carrying what the user had already typed.
50
+ *
51
+ * The seed exists for ONE entry point: the "Ask AI" button in the no-results state. A command
52
+ * search that found nothing already holds a sentence the user typed, and the button turns it
53
+ * into the question instead of making them retype it. Every other way in (space on an empty
54
+ * query, `mod+k`, selecting the Ask AI command) passes nothing and leaves an empty input.
55
+ *
56
+ * The palette calls this; the mode decides what a seed means. Returning focus to the shared
57
+ * input is the palette's job, since the input is the palette's.
58
+ */
59
+ enter(seed?: string): void;
60
+ /** Drop any state. Called when the mode is left and when the palette closes. */
61
+ reset(): void;
62
+ /**
63
+ * Handle a key while this mode is active. Return true when the key was consumed, so the palette
64
+ * leaves it alone.
65
+ */
66
+ handleKey(event: React.KeyboardEvent, context: PaletteModeKeyContext): boolean;
67
+ /**
68
+ * Called after the palette renders this mode's body, with the scroll container it was rendered
69
+ * into. For a mode whose body grows, such as a conversation, this is where it keeps the newest
70
+ * content in view. The element belongs to the palette; a mode only reads or scrolls it.
71
+ */
72
+ afterRender?(scrollContainer: HTMLElement): void;
73
+ }
File without changes
@@ -0,0 +1,13 @@
1
+ import type { AdminAssistantPresenter } from "@webiny/app-admin";
2
+ import type { PaletteMode } from "./PaletteMode.js";
3
+ /**
4
+ * The assistant, as a palette mode.
5
+ *
6
+ * Everything specific to it lives here: what the input row shows, what Enter and Backspace do, and
7
+ * what fills the panel. The conversation itself belongs to `AdminAssistantPresenter`.
8
+ *
9
+ * A plain object rather than a hook. `appearance` and `body` are getters, so reading them during a
10
+ * reactive component's render tracks the presenter's observables and re-renders on a new turn, with
11
+ * no dependency arrays to keep honest.
12
+ */
13
+ export declare const createAiMode: (presenter: AdminAssistantPresenter.Interface) => PaletteMode;
@@ -0,0 +1,80 @@
1
+ import react from "react";
2
+ import { ReactComponent } from "@webiny/icons/auto_awesome.svg";
3
+ import { ReactComponent as keyboard_return_svg_ReactComponent } from "@webiny/icons/keyboard_return.svg";
4
+ import { ReactComponent as backspace_svg_ReactComponent } from "@webiny/icons/backspace.svg";
5
+ import { AiModeBadge, AiSuggestions, AiTurn, HintIcon } from "../components/index.js";
6
+ const HINTS = [
7
+ {
8
+ keys: /*#__PURE__*/ react.createElement(HintIcon, {
9
+ element: /*#__PURE__*/ react.createElement(keyboard_return_svg_ReactComponent, null)
10
+ }),
11
+ label: "Ask"
12
+ },
13
+ {
14
+ keys: /*#__PURE__*/ react.createElement(HintIcon, {
15
+ element: /*#__PURE__*/ react.createElement(backspace_svg_ReactComponent, null)
16
+ }),
17
+ label: "Commands"
18
+ },
19
+ {
20
+ keys: "esc",
21
+ label: "Close"
22
+ }
23
+ ];
24
+ const createAiMode = (presenter)=>({
25
+ get appearance () {
26
+ const started = presenter.vm.turns.length > 0;
27
+ return {
28
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
29
+ iconColor: "accent",
30
+ iconLabel: "Ask AI",
31
+ badge: /*#__PURE__*/ react.createElement(AiModeBadge, null),
32
+ placeholder: started ? "Ask a follow-up…" : "Ask about this project…",
33
+ footerLabel: "Webiny AI",
34
+ hints: HINTS,
35
+ tall: true
36
+ };
37
+ },
38
+ get body () {
39
+ const { turns, busy } = presenter.vm;
40
+ if (0 === turns.length) return /*#__PURE__*/ react.createElement(AiSuggestions, {
41
+ onAsk: (question)=>presenter.ask(question)
42
+ });
43
+ return turns.map((turn, index)=>/*#__PURE__*/ react.createElement(AiTurn, {
44
+ key: index,
45
+ turn: turn,
46
+ initials: "You",
47
+ busy: busy,
48
+ onApprove: ()=>presenter.decide(index, true),
49
+ onReject: ()=>presenter.decide(index, false)
50
+ }));
51
+ },
52
+ enter (seed) {
53
+ if (seed?.trim()) presenter.ask(seed);
54
+ },
55
+ reset () {
56
+ presenter.reset();
57
+ },
58
+ handleKey (event, context) {
59
+ if ("Enter" === event.key) {
60
+ event.preventDefault();
61
+ presenter.ask(context.query);
62
+ context.setQuery("");
63
+ return true;
64
+ }
65
+ if ("Backspace" === event.key && "" === context.query) {
66
+ event.preventDefault();
67
+ context.exit();
68
+ return true;
69
+ }
70
+ return false;
71
+ },
72
+ afterRender (container) {
73
+ container.scrollTo({
74
+ top: container.scrollHeight
75
+ });
76
+ }
77
+ });
78
+ export { createAiMode };
79
+
80
+ //# sourceMappingURL=createAiMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette/modes/createAiMode.js","sources":["../../../src/CommandPalette/modes/createAiMode.tsx"],"sourcesContent":["import React from \"react\";\nimport type { AdminAssistantPresenter } from \"@webiny/app-admin\";\nimport { ReactComponent as AiIcon } from \"@webiny/icons/auto_awesome.svg\";\nimport { ReactComponent as ReturnIcon } from \"@webiny/icons/keyboard_return.svg\";\nimport { ReactComponent as BackspaceIcon } from \"@webiny/icons/backspace.svg\";\nimport { AiModeBadge, AiSuggestions, AiTurn, HintIcon, type Hint } from \"../components/index.js\";\nimport type { PaletteMode, PaletteModeKeyContext } from \"./PaletteMode.js\";\n\nconst HINTS: Hint[] = [\n { keys: <HintIcon element={<ReturnIcon />} />, label: \"Ask\" },\n { keys: <HintIcon element={<BackspaceIcon />} />, label: \"Commands\" },\n { keys: \"esc\", label: \"Close\" }\n];\n\n/**\n * The assistant, as a palette mode.\n *\n * Everything specific to it lives here: what the input row shows, what Enter and Backspace do, and\n * what fills the panel. The conversation itself belongs to `AdminAssistantPresenter`.\n *\n * A plain object rather than a hook. `appearance` and `body` are getters, so reading them during a\n * reactive component's render tracks the presenter's observables and re-renders on a new turn, with\n * no dependency arrays to keep honest.\n */\nexport const createAiMode = (presenter: AdminAssistantPresenter.Interface): PaletteMode => ({\n get appearance() {\n const started = presenter.vm.turns.length > 0;\n\n return {\n icon: <AiIcon />,\n iconColor: \"accent\" as const,\n iconLabel: \"Ask AI\",\n badge: <AiModeBadge />,\n placeholder: started ? \"Ask a follow-up…\" : \"Ask about this project…\",\n footerLabel: \"Webiny AI\",\n hints: HINTS,\n tall: true\n };\n },\n\n get body() {\n const { turns, busy } = presenter.vm;\n\n if (turns.length === 0) {\n return <AiSuggestions onAsk={question => presenter.ask(question)} />;\n }\n\n return turns.map((turn, index) => (\n <AiTurn\n key={index}\n turn={turn}\n initials=\"You\"\n busy={busy}\n onApprove={() => presenter.decide(index, true)}\n onReject={() => presenter.decide(index, false)}\n />\n ));\n },\n\n // A seed only arrives from the no-results \"Ask AI\" button; see `PaletteMode.enter`.\n enter(seed?: string) {\n if (seed?.trim()) {\n presenter.ask(seed);\n }\n },\n\n reset() {\n presenter.reset();\n },\n\n handleKey(event: React.KeyboardEvent, context: PaletteModeKeyContext) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n presenter.ask(context.query);\n context.setQuery(\"\");\n return true;\n }\n\n // Backspace on an empty input leaves the mode, mirroring how space entered it.\n if (event.key === \"Backspace\" && context.query === \"\") {\n event.preventDefault();\n context.exit();\n return true;\n }\n\n return false;\n },\n\n // Answers are long enough to push earlier turns off-screen, so keep the newest one visible.\n afterRender(container: HTMLElement) {\n container.scrollTo({ top: container.scrollHeight });\n }\n});\n"],"names":["HINTS","HintIcon","ReturnIcon","BackspaceIcon","createAiMode","presenter","started","AiIcon","AiModeBadge","turns","busy","AiSuggestions","question","turn","index","AiTurn","seed","event","context","container"],"mappings":";;;;;AAQA,MAAMA,QAAgB;IAClB;QAAE,MAAM,WAAN,GAAM,oBAACC,UAAQA;YAAC,uBAAS,oBAACC,oCAAUA;;QAAS,OAAO;IAAM;IAC5D;QAAE,MAAM,WAAN,GAAM,oBAACD,UAAQA;YAAC,uBAAS,oBAACE,8BAAaA;;QAAS,OAAO;IAAW;IACpE;QAAE,MAAM;QAAO,OAAO;IAAQ;CACjC;AAYM,MAAMC,eAAe,CAACC,YAA+D;QACxF,IAAI,cAAa;YACb,MAAMC,UAAUD,UAAU,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG;YAE5C,OAAO;gBACH,MAAM,WAAN,GAAM,oBAACE,gBAAMA;gBACb,WAAW;gBACX,WAAW;gBACX,OAAO,WAAP,GAAO,oBAACC,aAAWA;gBACnB,aAAaF,UAAU,qBAAqB;gBAC5C,aAAa;gBACb,OAAON;gBACP,MAAM;YACV;QACJ;QAEA,IAAI,QAAO;YACP,MAAM,EAAES,KAAK,EAAEC,IAAI,EAAE,GAAGL,UAAU,EAAE;YAEpC,IAAII,AAAiB,MAAjBA,MAAM,MAAM,EACZ,OAAO,WAAP,GAAO,oBAACE,eAAaA;gBAAC,OAAOC,CAAAA,WAAYP,UAAU,GAAG,CAACO;;YAG3D,OAAOH,MAAM,GAAG,CAAC,CAACI,MAAMC,QAAAA,WAAAA,GACpB,oBAACC,QAAMA;oBACH,KAAKD;oBACL,MAAMD;oBACN,UAAS;oBACT,MAAMH;oBACN,WAAW,IAAML,UAAU,MAAM,CAACS,OAAO;oBACzC,UAAU,IAAMT,UAAU,MAAM,CAACS,OAAO;;QAGpD;QAGA,OAAME,IAAa;YACf,IAAIA,MAAM,QACNX,UAAU,GAAG,CAACW;QAEtB;QAEA;YACIX,UAAU,KAAK;QACnB;QAEA,WAAUY,KAA0B,EAAEC,OAA8B;YAChE,IAAID,AAAc,YAAdA,MAAM,GAAG,EAAc;gBACvBA,MAAM,cAAc;gBACpBZ,UAAU,GAAG,CAACa,QAAQ,KAAK;gBAC3BA,QAAQ,QAAQ,CAAC;gBACjB,OAAO;YACX;YAGA,IAAID,AAAc,gBAAdA,MAAM,GAAG,IAAoBC,AAAkB,OAAlBA,QAAQ,KAAK,EAAS;gBACnDD,MAAM,cAAc;gBACpBC,QAAQ,IAAI;gBACZ,OAAO;YACX;YAEA,OAAO;QACX;QAGA,aAAYC,SAAsB;YAC9BA,UAAU,QAAQ,CAAC;gBAAE,KAAKA,UAAU,YAAY;YAAC;QACrD;IACJ"}
@@ -0,0 +1,2 @@
1
+ export { createAiMode } from "./createAiMode.js";
2
+ export type { PaletteMode, PaletteModeAppearance, PaletteModeKeyContext } from "./PaletteMode.js";
@@ -0,0 +1 @@
1
+ export { createAiMode } from "./createAiMode.js";
@@ -0,0 +1,15 @@
1
+ import type React from "react";
2
+ export interface CommandRow {
3
+ key: string;
4
+ value: string;
5
+ label: string;
6
+ sub?: string;
7
+ icon?: React.ReactNode;
8
+ shortcut?: string[];
9
+ verb: string;
10
+ onRun: () => void;
11
+ }
12
+ export interface CommandGroup {
13
+ title: string;
14
+ rows: CommandRow[];
15
+ }
File without changes
@@ -0,0 +1,16 @@
1
+ import { type CommandPalettePresenter } from "@webiny/app-admin";
2
+ interface PaletteHotkeysParams {
3
+ presenter: CommandPalettePresenter.Interface;
4
+ close: () => void;
5
+ /** False when the license blocks the assistant, so mod+k must not cycle into it. */
6
+ aiEnabled: boolean;
7
+ }
8
+ /**
9
+ * The palette's global keys: the ones that work while it is closed, or while focus is not in the
10
+ * input. Keys that only mean something while typing stay on the input's `onKeyDown`.
11
+ *
12
+ * Reads the view model during render, so a reactive component calling this still re-renders when
13
+ * the palette opens, a detail view appears, or AI mode is entered.
14
+ */
15
+ export declare const usePaletteHotkeys: ({ presenter, close, aiEnabled }: PaletteHotkeysParams) => void;
16
+ export {};
@@ -0,0 +1,38 @@
1
+ import { useMemo } from "react";
2
+ import { useHotkeys } from "@webiny/app-admin";
3
+ import { PALETTE_HOTKEY_ZINDEX } from "./constants.js";
4
+ const usePaletteHotkeys = ({ presenter, close, aiEnabled })=>{
5
+ const { isOpen, activeCommand, aiModeActive } = presenter.vm;
6
+ const keys = useMemo(()=>({
7
+ "mod+k": (e)=>{
8
+ e.preventDefault();
9
+ if (!isOpen) return void presenter.open();
10
+ if (activeCommand) return void presenter.cancelCommand();
11
+ if (aiEnabled && !aiModeActive) return void presenter.enterAiMode();
12
+ close();
13
+ },
14
+ backspace: (e)=>{
15
+ const target = e.target;
16
+ const editable = target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target?.isContentEditable;
17
+ if (!isOpen || !activeCommand || editable) return;
18
+ e.preventDefault();
19
+ presenter.cancelCommand();
20
+ },
21
+ ...presenter.shortcutKeys
22
+ }), [
23
+ presenter,
24
+ presenter.shortcutKeys,
25
+ isOpen,
26
+ activeCommand,
27
+ aiModeActive,
28
+ close,
29
+ aiEnabled
30
+ ]);
31
+ useHotkeys({
32
+ zIndex: PALETTE_HOTKEY_ZINDEX,
33
+ keys
34
+ });
35
+ };
36
+ export { usePaletteHotkeys };
37
+
38
+ //# sourceMappingURL=usePaletteHotkeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette/usePaletteHotkeys.js","sources":["../../src/CommandPalette/usePaletteHotkeys.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useHotkeys, type CommandPalettePresenter } from \"@webiny/app-admin\";\nimport { PALETTE_HOTKEY_ZINDEX } from \"./constants.js\";\n\ninterface PaletteHotkeysParams {\n presenter: CommandPalettePresenter.Interface;\n /* Not `presenter.close`: closing also resets the mode, which is the palette's business. */\n close: () => void;\n /** False when the license blocks the assistant, so mod+k must not cycle into it. */\n aiEnabled: boolean;\n}\n\n/**\n * The palette's global keys: the ones that work while it is closed, or while focus is not in the\n * input. Keys that only mean something while typing stay on the input's `onKeyDown`.\n *\n * Reads the view model during render, so a reactive component calling this still re-renders when\n * the palette opens, a detail view appears, or AI mode is entered.\n */\nexport const usePaletteHotkeys = ({ presenter, close, aiEnabled }: PaletteHotkeysParams) => {\n const { isOpen, activeCommand, aiModeActive } = presenter.vm;\n\n /*\n * mod+k cycles closed -> commands -> AI -> closed, so the same key that opens the palette also\n * reaches the assistant without the user having to know about the space shortcut. Closing from AI\n * mode keeps mod+k a way OUT of the palette, which is what it does everywhere else.\n * Backspace backs out of a detail view; command shortcuts run directly.\n */\n const keys = useMemo(\n () => ({\n \"mod+k\": (e: KeyboardEvent) => {\n e.preventDefault();\n\n if (!isOpen) {\n presenter.open();\n return;\n }\n\n /*\n * A detail view renders in place of the command list, so switching to AI mode from\n * there would put the user in a mode they cannot see. Back out to the list instead.\n */\n if (activeCommand) {\n presenter.cancelCommand();\n return;\n }\n\n if (aiEnabled && !aiModeActive) {\n presenter.enterAiMode();\n return;\n }\n\n close();\n },\n backspace: (e: KeyboardEvent) => {\n /*\n * This listener is global and stays registered while the palette is closed, so it\n * must leave Backspace alone unless there is a detail view to back out of, and never\n * touch it inside an input, textarea or rich text editor.\n */\n const target = e.target as HTMLElement | null;\n const editable =\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target?.isContentEditable;\n if (!isOpen || !activeCommand || editable) {\n return;\n }\n e.preventDefault();\n presenter.cancelCommand();\n },\n ...presenter.shortcutKeys\n }),\n [presenter, presenter.shortcutKeys, isOpen, activeCommand, aiModeActive, close, aiEnabled]\n );\n\n useHotkeys({ zIndex: PALETTE_HOTKEY_ZINDEX, keys });\n};\n"],"names":["usePaletteHotkeys","presenter","close","aiEnabled","isOpen","activeCommand","aiModeActive","keys","useMemo","e","target","editable","HTMLInputElement","HTMLTextAreaElement","useHotkeys","PALETTE_HOTKEY_ZINDEX"],"mappings":";;;AAmBO,MAAMA,oBAAoB,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAEC,SAAS,EAAwB;IACnF,MAAM,EAAEC,MAAM,EAAEC,aAAa,EAAEC,YAAY,EAAE,GAAGL,UAAU,EAAE;IAQ5D,MAAMM,OAAOC,QACT,IAAO;YACH,SAAS,CAACC;gBACNA,EAAE,cAAc;gBAEhB,IAAI,CAACL,QAAQ,YACTH,UAAU,IAAI;gBAQlB,IAAII,eAAe,YACfJ,UAAU,aAAa;gBAI3B,IAAIE,aAAa,CAACG,cAAc,YAC5BL,UAAU,WAAW;gBAIzBC;YACJ;YACA,WAAW,CAACO;gBAMR,MAAMC,SAASD,EAAE,MAAM;gBACvB,MAAME,WACFD,kBAAkBE,oBAClBF,kBAAkBG,uBAClBH,QAAQ;gBACZ,IAAI,CAACN,UAAU,CAACC,iBAAiBM,UAC7B;gBAEJF,EAAE,cAAc;gBAChBR,UAAU,aAAa;YAC3B;YACA,GAAGA,UAAU,YAAY;QAC7B,IACA;QAACA;QAAWA,UAAU,YAAY;QAAEG;QAAQC;QAAeC;QAAcJ;QAAOC;KAAU;IAG9FW,WAAW;QAAE,QAAQC;QAAuBR;IAAK;AACrD"}
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const Welcome: () => React.JSX.Element | null;
2
+ declare const Welcome: () => React.JSX.Element;
3
3
  export default Welcome;
@@ -1,48 +1,33 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { Grid, Heading } from "@webiny/admin-ui";
3
- import { useSecurity } from "@webiny/app-security/hooks/useSecurity";
4
- import { plugins } from "@webiny/plugins";
5
- import { ApplicationWidget, AssistanceWidget, CommunityWidget, MissingPermissionsWidget } from "./components";
6
- const Welcome = () => {
7
- const {
8
- identity,
9
- getPermission
10
- } = useSecurity();
11
- if (!identity) {
12
- return null;
13
- }
14
- const widgets = plugins.byType("admin-welcome-screen-widget").filter(pl => {
15
- if (pl.permission) {
16
- return getPermission(pl.permission);
17
- }
18
- return true;
19
- });
20
- const canSeeAnyWidget = widgets.length > 0;
21
- return /*#__PURE__*/React.createElement("div", {
22
- className: "wby-my-xxl"
23
- }, /*#__PURE__*/React.createElement("div", {
24
- className: "wby-mb-3xl"
25
- }, /*#__PURE__*/React.createElement(Heading, {
26
- level: 3
27
- }, `Hi ${identity.displayName}, what are we doing today?`)), /*#__PURE__*/React.createElement(Grid, {
28
- gap: "spacious"
29
- }, /*#__PURE__*/React.createElement(Grid.Column, {
30
- span: 5
31
- }, !canSeeAnyWidget && /*#__PURE__*/React.createElement(MissingPermissionsWidget, null), /*#__PURE__*/React.createElement("div", {
32
- className: "wby-flex wby-flex-col wby-gap-lg"
33
- }, widgets.map(pl => /*#__PURE__*/React.createElement(ApplicationWidget, {
34
- key: pl.name,
35
- cta: pl.widget.cta,
36
- description: pl.widget.description,
37
- icon: pl.widget.icon,
38
- name: pl.name,
39
- title: pl.widget.title
40
- })))), /*#__PURE__*/React.createElement(Grid.Column, {
41
- span: 7
42
- }, /*#__PURE__*/React.createElement("div", {
43
- className: "wby-flex wby-flex-col wby-gap-lg"
44
- }, /*#__PURE__*/React.createElement(AssistanceWidget, null), /*#__PURE__*/React.createElement(CommunityWidget, null)))));
3
+ import { useAdminConfig, useSecurity } from "@webiny/app-admin";
4
+ const Welcome = ()=>{
5
+ const { identity } = useSecurity();
6
+ const { widgets } = useAdminConfig();
7
+ return /*#__PURE__*/ react.createElement("div", {
8
+ className: "my-xxl"
9
+ }, /*#__PURE__*/ react.createElement("div", {
10
+ className: "mb-3xl"
11
+ }, /*#__PURE__*/ react.createElement(Heading, {
12
+ level: 3
13
+ }, `Hi ${identity.displayName}, what are we doing today?`)), /*#__PURE__*/ react.createElement(Grid, {
14
+ gap: "spacious",
15
+ className: "max-w-[1200px]"
16
+ }, /*#__PURE__*/ react.createElement(Grid.Column, {
17
+ span: 6
18
+ }, /*#__PURE__*/ react.createElement("div", {
19
+ className: "flex flex-col gap-lg"
20
+ }, widgets.filter((w)=>"left" === w.column).map((widget)=>/*#__PURE__*/ react.createElement(react.Fragment, {
21
+ key: widget.name
22
+ }, widget.element)))), /*#__PURE__*/ react.createElement(Grid.Column, {
23
+ span: 6
24
+ }, /*#__PURE__*/ react.createElement("div", {
25
+ className: "flex flex-col gap-lg"
26
+ }, widgets.filter((w)=>"right" === w.column).map((widget)=>/*#__PURE__*/ react.createElement(react.Fragment, {
27
+ key: widget.name
28
+ }, widget.element))))));
45
29
  };
46
- export default Welcome;
30
+ const Dashboard_Welcome = Welcome;
31
+ export default Dashboard_Welcome;
47
32
 
48
33
  //# sourceMappingURL=Welcome.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Grid","Heading","useSecurity","plugins","ApplicationWidget","AssistanceWidget","CommunityWidget","MissingPermissionsWidget","Welcome","identity","getPermission","widgets","byType","filter","pl","permission","canSeeAnyWidget","length","createElement","className","level","displayName","gap","Column","span","map","key","name","cta","widget","description","icon","title"],"sources":["Welcome.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid, Heading } from \"@webiny/admin-ui\";\nimport { useSecurity } from \"@webiny/app-security/hooks/useSecurity\";\nimport { plugins } from \"@webiny/plugins\";\nimport type { AdminWelcomeScreenWidgetPlugin } from \"@webiny/app-plugin-admin-welcome-screen/types\";\nimport {\n ApplicationWidget,\n AssistanceWidget,\n CommunityWidget,\n MissingPermissionsWidget\n} from \"./components\";\n\nconst Welcome = () => {\n const { identity, getPermission } = useSecurity();\n\n if (!identity) {\n return null;\n }\n\n const widgets = plugins\n .byType<AdminWelcomeScreenWidgetPlugin>(\"admin-welcome-screen-widget\")\n .filter(pl => {\n if (pl.permission) {\n return getPermission(pl.permission);\n }\n return true;\n });\n\n const canSeeAnyWidget = widgets.length > 0;\n\n return (\n <div className={\"wby-my-xxl\"}>\n <div className={\"wby-mb-3xl\"}>\n <Heading\n level={3}\n >{`Hi ${identity.displayName}, what are we doing today?`}</Heading>\n </div>\n <Grid gap={\"spacious\"}>\n <Grid.Column span={5}>\n {!canSeeAnyWidget && <MissingPermissionsWidget />}\n <div className={\"wby-flex wby-flex-col wby-gap-lg\"}>\n {widgets.map(pl => (\n <ApplicationWidget\n key={pl.name}\n cta={pl.widget.cta}\n description={pl.widget.description}\n icon={pl.widget.icon}\n name={pl.name}\n title={pl.widget.title}\n />\n ))}\n </div>\n </Grid.Column>\n <Grid.Column span={7}>\n <div className={\"wby-flex wby-flex-col wby-gap-lg\"}>\n <AssistanceWidget />\n <CommunityWidget />\n </div>\n </Grid.Column>\n </Grid>\n </div>\n );\n};\n\nexport default Welcome;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,OAAO,QAAQ,kBAAkB;AAChD,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,OAAO,QAAQ,iBAAiB;AAEzC,SACIC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe,EACfC,wBAAwB;AAG5B,MAAMC,OAAO,GAAGA,CAAA,KAAM;EAClB,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGR,WAAW,CAAC,CAAC;EAEjD,IAAI,CAACO,QAAQ,EAAE;IACX,OAAO,IAAI;EACf;EAEA,MAAME,OAAO,GAAGR,OAAO,CAClBS,MAAM,CAAiC,6BAA6B,CAAC,CACrEC,MAAM,CAACC,EAAE,IAAI;IACV,IAAIA,EAAE,CAACC,UAAU,EAAE;MACf,OAAOL,aAAa,CAACI,EAAE,CAACC,UAAU,CAAC;IACvC;IACA,OAAO,IAAI;EACf,CAAC,CAAC;EAEN,MAAMC,eAAe,GAAGL,OAAO,CAACM,MAAM,GAAG,CAAC;EAE1C,oBACIlB,KAAA,CAAAmB,aAAA;IAAKC,SAAS,EAAE;EAAa,gBACzBpB,KAAA,CAAAmB,aAAA;IAAKC,SAAS,EAAE;EAAa,gBACzBpB,KAAA,CAAAmB,aAAA,CAACjB,OAAO;IACJmB,KAAK,EAAE;EAAE,GACX,MAAMX,QAAQ,CAACY,WAAW,4BAAsC,CACjE,CAAC,eACNtB,KAAA,CAAAmB,aAAA,CAAClB,IAAI;IAACsB,GAAG,EAAE;EAAW,gBAClBvB,KAAA,CAAAmB,aAAA,CAAClB,IAAI,CAACuB,MAAM;IAACC,IAAI,EAAE;EAAE,GAChB,CAACR,eAAe,iBAAIjB,KAAA,CAAAmB,aAAA,CAACX,wBAAwB,MAAE,CAAC,eACjDR,KAAA,CAAAmB,aAAA;IAAKC,SAAS,EAAE;EAAmC,GAC9CR,OAAO,CAACc,GAAG,CAACX,EAAE,iBACXf,KAAA,CAAAmB,aAAA,CAACd,iBAAiB;IACdsB,GAAG,EAAEZ,EAAE,CAACa,IAAK;IACbC,GAAG,EAAEd,EAAE,CAACe,MAAM,CAACD,GAAI;IACnBE,WAAW,EAAEhB,EAAE,CAACe,MAAM,CAACC,WAAY;IACnCC,IAAI,EAAEjB,EAAE,CAACe,MAAM,CAACE,IAAK;IACrBJ,IAAI,EAAEb,EAAE,CAACa,IAAK;IACdK,KAAK,EAAElB,EAAE,CAACe,MAAM,CAACG;EAAM,CAC1B,CACJ,CACA,CACI,CAAC,eACdjC,KAAA,CAAAmB,aAAA,CAAClB,IAAI,CAACuB,MAAM;IAACC,IAAI,EAAE;EAAE,gBACjBzB,KAAA,CAAAmB,aAAA;IAAKC,SAAS,EAAE;EAAmC,gBAC/CpB,KAAA,CAAAmB,aAAA,CAACb,gBAAgB,MAAE,CAAC,eACpBN,KAAA,CAAAmB,aAAA,CAACZ,eAAe,MAAE,CACjB,CACI,CACX,CACL,CAAC;AAEd,CAAC;AAED,eAAeE,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"Dashboard/Welcome.js","sources":["../../src/Dashboard/Welcome.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid, Heading } from \"@webiny/admin-ui\";\nimport { useSecurity } from \"@webiny/app-admin\";\nimport { useAdminConfig } from \"@webiny/app-admin\";\n\nconst Welcome = () => {\n const { identity } = useSecurity();\n const { widgets } = useAdminConfig();\n\n return (\n <div className={\"my-xxl\"}>\n <div className={\"mb-3xl\"}>\n <Heading\n level={3}\n >{`Hi ${identity!.displayName}, what are we doing today?`}</Heading>\n </div>\n <Grid gap={\"spacious\"} className={\"max-w-[1200px]\"}>\n <Grid.Column span={6}>\n <div className={\"flex flex-col gap-lg\"}>\n {widgets\n .filter(w => w.column === \"left\")\n .map(widget => (\n <React.Fragment key={widget.name}>{widget.element}</React.Fragment>\n ))}\n </div>\n </Grid.Column>\n <Grid.Column span={6}>\n <div className={\"flex flex-col gap-lg\"}>\n {widgets\n .filter(w => w.column === \"right\")\n .map(widget => (\n <React.Fragment key={widget.name}>{widget.element}</React.Fragment>\n ))}\n </div>\n </Grid.Column>\n </Grid>\n </div>\n );\n};\n\nexport default Welcome;\n"],"names":["Welcome","identity","useSecurity","widgets","useAdminConfig","Heading","Grid","w","widget","React"],"mappings":";;;AAKA,MAAMA,UAAU;IACZ,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACC,SAAOA;QACJ,OAAO;OACT,CAAC,GAAG,EAAEJ,SAAU,WAAW,CAAC,0BAA0B,CAAC,kBAE7D,oBAACK,MAAIA;QAAC,KAAK;QAAY,WAAW;qBAC9B,oBAACA,KAAK,MAAM;QAAC,MAAM;qBACf,oBAAC;QAAI,WAAW;OACXH,QACI,MAAM,CAACI,CAAAA,IAAKA,AAAa,WAAbA,EAAE,MAAM,EACpB,GAAG,CAACC,CAAAA,SAAAA,WAAAA,GACD,oBAACC,MAAAA,QAAc;YAAC,KAAKD,OAAO,IAAI;WAAGA,OAAO,OAAO,oBAIjE,oBAACF,KAAK,MAAM;QAAC,MAAM;qBACf,oBAAC;QAAI,WAAW;OACXH,QACI,MAAM,CAACI,CAAAA,IAAKA,AAAa,YAAbA,EAAE,MAAM,EACpB,GAAG,CAACC,CAAAA,SAAAA,WAAAA,GACD,oBAACC,MAAAA,QAAc;YAAC,KAAKD,OAAO,IAAI;WAAGA,OAAO,OAAO;AAOjF;AAEA,0BAAeR"}
@@ -1,59 +1,54 @@
1
- import React from "react";
2
- import { Heading, Icon, Link as AdminLink, Text } from "@webiny/admin-ui";
3
- import { ReactComponent as HelpIcon } from "@webiny/icons/help_outline.svg";
4
- import { Link } from "@webiny/react-router";
5
- export const AssistanceWidget = () => {
6
- return /*#__PURE__*/React.createElement("div", {
7
- className: "wby-bg-neutral-light wby-rounded-xl wby-p-lg"
8
- }, /*#__PURE__*/React.createElement("div", {
9
- className: "wby-flex wby-items-center wby-gap-sm wby-mb-md"
10
- }, /*#__PURE__*/React.createElement(Icon, {
11
- icon: /*#__PURE__*/React.createElement(HelpIcon, null),
12
- label: "Need some assistance?",
13
- size: "md",
14
- color: "accent"
15
- }), /*#__PURE__*/React.createElement(Heading, {
16
- level: 6
17
- }, "Need some assistance?")), /*#__PURE__*/React.createElement("div", {
18
- className: "wby-bg-neutral-base wby-rounded-sm wby-px-md wby-py-sm-extra wby-mb-md"
19
- }, /*#__PURE__*/React.createElement(Link, {
20
- to: "https://www.webiny.com/docs",
21
- target: "_blank",
22
- rel: "noopener noreferrer",
23
- className: "!wby-no-underline"
24
- }, /*#__PURE__*/React.createElement(Text, {
25
- as: "div",
26
- className: "wby-font-semibold !wby-text-neutral-primary"
27
- }, "Documentation"), /*#__PURE__*/React.createElement(Text, {
28
- size: "sm",
29
- className: "!wby-text-neutral-strong"
30
- }, "Explore the Webiny documentation and check out code examples and guides."))), /*#__PURE__*/React.createElement("div", {
31
- className: "wby-bg-neutral-base wby-rounded-sm wby-px-md wby-py-sm-extra"
32
- }, /*#__PURE__*/React.createElement(Text, {
33
- as: "div",
34
- className: "wby-font-semibold"
35
- }, "Contact us"), /*#__PURE__*/React.createElement(Text, {
36
- size: "sm",
37
- className: "wby-text-neutral-strong"
38
- }, /*#__PURE__*/React.createElement(AdminLink, {
39
- to: "https://www.webiny.com/forms/product-demo",
40
- target: "_blank",
41
- rel: "noopener noreferrer",
42
- variant: "secondary",
43
- underline: true
44
- }, "Contact Sales"), ",", " ", /*#__PURE__*/React.createElement(AdminLink, {
45
- to: "https://www.webiny.com/partners",
46
- target: "_blank",
47
- rel: "noopener noreferrer",
48
- variant: "secondary",
49
- underline: true
50
- }, "Explore Partnerships"), " ", "or", " ", /*#__PURE__*/React.createElement(AdminLink, {
51
- to: "https://www.webiny.com/slack",
52
- target: "_blank",
53
- rel: "noopener noreferrer",
54
- variant: "secondary",
55
- underline: true
56
- }, "Slack us"), ".")));
57
- };
1
+ import react from "react";
2
+ import { Link, List, Text, Widget } from "@webiny/admin-ui";
3
+ import { ReactComponent } from "@webiny/icons/help_outline.svg";
4
+ import { ReactComponent as arrow_forward_svg_ReactComponent } from "@webiny/icons/arrow_forward.svg";
5
+ import { SimpleLink } from "@webiny/app-admin";
6
+ const AssistanceWidget = ()=>/*#__PURE__*/ react.createElement(Widget, {
7
+ variant: "light",
8
+ title: "Need some assistance?",
9
+ icon: /*#__PURE__*/ react.createElement(Widget.Icon, {
10
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
11
+ label: "Need some assistance?"
12
+ }),
13
+ padding: "md"
14
+ }, /*#__PURE__*/ react.createElement(List, {
15
+ variant: "container",
16
+ className: "flex flex-col gap-y-sm"
17
+ }, /*#__PURE__*/ react.createElement(List.Item, {
18
+ title: "Documentation",
19
+ description: "Explore the Webiny documentation and check out code examples and guides.",
20
+ actions: /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(SimpleLink, {
21
+ to: "https://www.webiny.com/docs",
22
+ target: "_blank",
23
+ rel: "noopener noreferrer"
24
+ }, /*#__PURE__*/ react.createElement(List.Item.Action, {
25
+ icon: /*#__PURE__*/ react.createElement(arrow_forward_svg_ReactComponent, null)
26
+ })))
27
+ }), /*#__PURE__*/ react.createElement(List.Item, {
28
+ title: "Contact us",
29
+ description: /*#__PURE__*/ react.createElement(Text, {
30
+ size: "sm",
31
+ className: "text-neutral-strong"
32
+ }, /*#__PURE__*/ react.createElement(Link, {
33
+ to: "https://www.webiny.com/forms/product-demo",
34
+ target: "_blank",
35
+ rel: "noopener noreferrer",
36
+ variant: "secondary",
37
+ underline: true
38
+ }, "Contact Sales"), ",", " ", /*#__PURE__*/ react.createElement(Link, {
39
+ to: "https://www.webiny.com/partners",
40
+ target: "_blank",
41
+ rel: "noopener noreferrer",
42
+ variant: "secondary",
43
+ underline: true
44
+ }, "Explore Partnerships"), " ", "or", " ", /*#__PURE__*/ react.createElement(Link, {
45
+ to: "https://www.webiny.com/slack",
46
+ target: "_blank",
47
+ rel: "noopener noreferrer",
48
+ variant: "secondary",
49
+ underline: true
50
+ }, "Slack us"), ".")
51
+ })));
52
+ export { AssistanceWidget };
58
53
 
59
54
  //# sourceMappingURL=AssistanceWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Heading","Icon","Link","AdminLink","Text","ReactComponent","HelpIcon","AssistanceWidget","createElement","className","icon","label","size","color","level","to","target","rel","as","variant","underline"],"sources":["AssistanceWidget.tsx"],"sourcesContent":["import React from \"react\";\nimport { Heading, Icon, Link as AdminLink, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as HelpIcon } from \"@webiny/icons/help_outline.svg\";\nimport { Link } from \"@webiny/react-router\";\n\nexport const AssistanceWidget = () => {\n return (\n <div className={\"wby-bg-neutral-light wby-rounded-xl wby-p-lg\"}>\n <div className={\"wby-flex wby-items-center wby-gap-sm wby-mb-md\"}>\n <Icon\n icon={<HelpIcon />}\n label={\"Need some assistance?\"}\n size={\"md\"}\n color={\"accent\"}\n />\n <Heading level={6}>{\"Need some assistance?\"}</Heading>\n </div>\n <div\n className={\"wby-bg-neutral-base wby-rounded-sm wby-px-md wby-py-sm-extra wby-mb-md\"}\n >\n <Link\n to=\"https://www.webiny.com/docs\"\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n className={\"!wby-no-underline\"}\n >\n <Text as={\"div\"} className={\"wby-font-semibold !wby-text-neutral-primary\"}>\n {\"Documentation\"}\n </Text>\n <Text size={\"sm\"} className={\"!wby-text-neutral-strong\"}>\n {\"Explore the Webiny documentation and check out code examples and guides.\"}\n </Text>\n </Link>\n </div>\n\n <div className={\"wby-bg-neutral-base wby-rounded-sm wby-px-md wby-py-sm-extra\"}>\n <Text as={\"div\"} className={\"wby-font-semibold\"}>\n {\"Contact us\"}\n </Text>\n <Text size={\"sm\"} className={\"wby-text-neutral-strong\"}>\n <AdminLink\n to={\"https://www.webiny.com/forms/product-demo\"}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n variant={\"secondary\"}\n underline\n >\n Contact Sales\n </AdminLink>\n ,{\" \"}\n <AdminLink\n to={\"https://www.webiny.com/partners\"}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n variant={\"secondary\"}\n underline\n >\n Explore Partnerships\n </AdminLink>{\" \"}\n or{\" \"}\n <AdminLink\n to={\"https://www.webiny.com/slack\"}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n variant={\"secondary\"}\n underline\n >\n Slack us\n </AdminLink>\n .\n </Text>\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,EAAEC,IAAI,EAAEC,IAAI,IAAIC,SAAS,EAAEC,IAAI,QAAQ,kBAAkB;AACzE,SAASC,cAAc,IAAIC,QAAQ,QAAQ,gCAAgC;AAC3E,SAASJ,IAAI,QAAQ,sBAAsB;AAE3C,OAAO,MAAMK,gBAAgB,GAAGA,CAAA,KAAM;EAClC,oBACIR,KAAA,CAAAS,aAAA;IAAKC,SAAS,EAAE;EAA+C,gBAC3DV,KAAA,CAAAS,aAAA;IAAKC,SAAS,EAAE;EAAiD,gBAC7DV,KAAA,CAAAS,aAAA,CAACP,IAAI;IACDS,IAAI,eAAEX,KAAA,CAAAS,aAAA,CAACF,QAAQ,MAAE,CAAE;IACnBK,KAAK,EAAE,uBAAwB;IAC/BC,IAAI,EAAE,IAAK;IACXC,KAAK,EAAE;EAAS,CACnB,CAAC,eACFd,KAAA,CAAAS,aAAA,CAACR,OAAO;IAACc,KAAK,EAAE;EAAE,GAAE,uBAAiC,CACpD,CAAC,eACNf,KAAA,CAAAS,aAAA;IACIC,SAAS,EAAE;EAAyE,gBAEpFV,KAAA,CAAAS,aAAA,CAACN,IAAI;IACDa,EAAE,EAAC,6BAA6B;IAChCC,MAAM,EAAE,QAAS;IACjBC,GAAG,EAAE,qBAAsB;IAC3BR,SAAS,EAAE;EAAoB,gBAE/BV,KAAA,CAAAS,aAAA,CAACJ,IAAI;IAACc,EAAE,EAAE,KAAM;IAACT,SAAS,EAAE;EAA8C,GACrE,eACC,CAAC,eACPV,KAAA,CAAAS,aAAA,CAACJ,IAAI;IAACQ,IAAI,EAAE,IAAK;IAACH,SAAS,EAAE;EAA2B,GACnD,0EACC,CACJ,CACL,CAAC,eAENV,KAAA,CAAAS,aAAA;IAAKC,SAAS,EAAE;EAA+D,gBAC3EV,KAAA,CAAAS,aAAA,CAACJ,IAAI;IAACc,EAAE,EAAE,KAAM;IAACT,SAAS,EAAE;EAAoB,GAC3C,YACC,CAAC,eACPV,KAAA,CAAAS,aAAA,CAACJ,IAAI;IAACQ,IAAI,EAAE,IAAK;IAACH,SAAS,EAAE;EAA0B,gBACnDV,KAAA,CAAAS,aAAA,CAACL,SAAS;IACNY,EAAE,EAAE,2CAA4C;IAChDC,MAAM,EAAE,QAAS;IACjBC,GAAG,EAAE,qBAAsB;IAC3BE,OAAO,EAAE,WAAY;IACrBC,SAAS;EAAA,GACZ,eAEU,CAAC,KACX,EAAC,GAAG,eACLrB,KAAA,CAAAS,aAAA,CAACL,SAAS;IACNY,EAAE,EAAE,iCAAkC;IACtCC,MAAM,EAAE,QAAS;IACjBC,GAAG,EAAE,qBAAsB;IAC3BE,OAAO,EAAE,WAAY;IACrBC,SAAS;EAAA,GACZ,sBAEU,CAAC,EAAC,GAAG,EAAC,IACf,EAAC,GAAG,eACNrB,KAAA,CAAAS,aAAA,CAACL,SAAS;IACNY,EAAE,EAAE,8BAA+B;IACnCC,MAAM,EAAE,QAAS;IACjBC,GAAG,EAAE,qBAAsB;IAC3BE,OAAO,EAAE,WAAY;IACrBC,SAAS;EAAA,GACZ,UAEU,CAAC,KAEV,CACL,CACJ,CAAC;AAEd,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Dashboard/components/AssistanceWidget.js","sources":["../../../src/Dashboard/components/AssistanceWidget.tsx"],"sourcesContent":["import React from \"react\";\nimport { Widget, List, Link, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as HelpIcon } from \"@webiny/icons/help_outline.svg\";\nimport { ReactComponent as ArrowForwardIcon } from \"@webiny/icons/arrow_forward.svg\";\nimport { SimpleLink } from \"@webiny/app-admin\";\n\nexport const AssistanceWidget = () => {\n return (\n <Widget\n variant=\"light\"\n title=\"Need some assistance?\"\n icon={<Widget.Icon icon={<HelpIcon />} label={\"Need some assistance?\"} />}\n padding=\"md\"\n >\n <List variant=\"container\" className=\"flex flex-col gap-y-sm\">\n <List.Item\n title=\"Documentation\"\n description=\"Explore the Webiny documentation and check out code examples and guides.\"\n actions={\n <>\n <SimpleLink\n to=\"https://www.webiny.com/docs\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <List.Item.Action icon={<ArrowForwardIcon />} />\n </SimpleLink>\n </>\n }\n />\n <List.Item\n title=\"Contact us\"\n description={\n <Text size={\"sm\"} className={\"text-neutral-strong\"}>\n <Link\n to={\"https://www.webiny.com/forms/product-demo\"}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n variant={\"secondary\"}\n underline\n >\n Contact Sales\n </Link>\n ,{\" \"}\n <Link\n to={\"https://www.webiny.com/partners\"}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n variant={\"secondary\"}\n underline\n >\n Explore Partnerships\n </Link>{\" \"}\n or{\" \"}\n <Link\n to={\"https://www.webiny.com/slack\"}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n variant={\"secondary\"}\n underline\n >\n Slack us\n </Link>\n .\n </Text>\n }\n />\n </List>\n </Widget>\n );\n};\n"],"names":["AssistanceWidget","Widget","HelpIcon","List","SimpleLink","ArrowForwardIcon","Text","Link"],"mappings":";;;;;AAMO,MAAMA,mBAAmB,IACrB,WAAP,GACI,oBAACC,QAAMA;QACH,SAAQ;QACR,OAAM;QACN,oBAAM,oBAACA,OAAO,IAAI;YAAC,oBAAM,oBAACC,gBAAQA;YAAK,OAAO;;QAC9C,SAAQ;qBAER,oBAACC,MAAIA;QAAC,SAAQ;QAAY,WAAU;qBAChC,oBAACA,KAAK,IAAI;QACN,OAAM;QACN,aAAY;QACZ,uBACI,wDACI,oBAACC,YAAUA;YACP,IAAG;YACH,QAAO;YACP,KAAI;yBAEJ,oBAACD,KAAK,IAAI,CAAC,MAAM;YAAC,oBAAM,oBAACE,kCAAgBA;;sBAKzD,oBAACF,KAAK,IAAI;QACN,OAAM;QACN,2BACI,oBAACG,MAAIA;YAAC,MAAM;YAAM,WAAW;yBACzB,oBAACC,MAAIA;YACD,IAAI;YACJ,QAAQ;YACR,KAAK;YACL,SAAS;YACT;WACH,kBAEM,KACL,mBACF,oBAACA,MAAIA;YACD,IAAI;YACJ,QAAQ;YACR,KAAK;YACL,SAAS;YACT;WACH,yBAEO,KAAI,MACT,mBACH,oBAACA,MAAIA;YACD,IAAI;YACJ,QAAQ;YACR,KAAK;YACL,SAAS;YACT;WACH,aAEM"}