@internetarchive/modal-manager 2.0.3 → 2.0.4-alpha-webdev7960.1

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 (73) hide show
  1. package/.editorconfig +29 -29
  2. package/.eslintrc.js +14 -14
  3. package/.github/workflows/ci.yml +30 -30
  4. package/.github/workflows/gh-pages-main.yml +42 -42
  5. package/.github/workflows/pr-preview.yml +40 -40
  6. package/LICENSE +661 -661
  7. package/README.md +139 -139
  8. package/custom-elements.json +170 -170
  9. package/dist/index.d.ts +7 -7
  10. package/dist/index.js +5 -5
  11. package/dist/src/assets/arrow-left-icon.d.ts +2 -2
  12. package/dist/src/assets/arrow-left-icon.js +2 -2
  13. package/dist/src/assets/ia-logo-icon.d.ts +2 -2
  14. package/dist/src/assets/ia-logo-icon.js +2 -2
  15. package/dist/src/modal-config.d.ts +104 -104
  16. package/dist/src/modal-config.js +24 -24
  17. package/dist/src/modal-manager-host-bridge-interface.d.ts +12 -12
  18. package/dist/src/modal-manager-host-bridge-interface.js +1 -1
  19. package/dist/src/modal-manager-host-bridge.d.ts +34 -34
  20. package/dist/src/modal-manager-host-bridge.js +62 -62
  21. package/dist/src/modal-manager-interface.d.ts +27 -27
  22. package/dist/src/modal-manager-interface.js +1 -1
  23. package/dist/src/modal-manager-mode.d.ts +10 -10
  24. package/dist/src/modal-manager-mode.js +11 -11
  25. package/dist/src/modal-manager.d.ts +137 -127
  26. package/dist/src/modal-manager.js +212 -197
  27. package/dist/src/modal-manager.js.map +1 -1
  28. package/dist/src/modal-template.d.ts +41 -41
  29. package/dist/src/modal-template.js +115 -115
  30. package/dist/src/shoelace/active-elements.d.ts +15 -15
  31. package/dist/src/shoelace/active-elements.js +27 -27
  32. package/dist/src/shoelace/modal.d.ts +24 -24
  33. package/dist/src/shoelace/modal.js +131 -131
  34. package/dist/src/shoelace/tabbable.d.ts +9 -9
  35. package/dist/src/shoelace/tabbable.js +169 -169
  36. package/dist/test/modal-config.test.d.ts +1 -1
  37. package/dist/test/modal-config.test.js +69 -69
  38. package/dist/test/modal-manager.test.d.ts +1 -1
  39. package/dist/test/modal-manager.test.js +275 -240
  40. package/dist/test/modal-manager.test.js.map +1 -1
  41. package/dist/test/modal-template.test.d.ts +1 -1
  42. package/dist/test/modal-template.test.js +156 -156
  43. package/dist/vite.config.d.ts +2 -2
  44. package/dist/vite.config.js +22 -22
  45. package/docs/assets/css/main.css +2678 -2678
  46. package/docs/classes/_src_modal_config_.modalconfig.html +429 -429
  47. package/docs/classes/_src_modal_manager_.modalmanager.html +7702 -7702
  48. package/docs/classes/_src_modal_manager_host_bridge_.modalmanagerhostbridge.html +409 -409
  49. package/docs/classes/_src_modal_template_.modaltemplate.html +7096 -7096
  50. package/docs/enums/_src_modal_manager_mode_.modalmanagermode.html +196 -196
  51. package/docs/globals.html +150 -150
  52. package/docs/index.html +252 -252
  53. package/docs/interfaces/_src_modal_manager_host_bridge_interface_.modalmanagerhostbridgeinterface.html +210 -210
  54. package/docs/interfaces/_src_modal_manager_interface_.modalmanagerinterface.html +7095 -7095
  55. package/docs/modules/_index_.html +208 -208
  56. package/docs/modules/_src_modal_config_.html +146 -146
  57. package/docs/modules/_src_modal_manager_.html +146 -146
  58. package/docs/modules/_src_modal_manager_host_bridge_.html +146 -146
  59. package/docs/modules/_src_modal_manager_host_bridge_interface_.html +146 -146
  60. package/docs/modules/_src_modal_manager_interface_.html +146 -146
  61. package/docs/modules/_src_modal_manager_mode_.html +146 -146
  62. package/docs/modules/_src_modal_template_.html +146 -146
  63. package/docs/modules/_test_modal_config_test_.html +106 -106
  64. package/docs/modules/_test_modal_manager_test_.html +106 -106
  65. package/docs/modules/_test_modal_template_test_.html +106 -106
  66. package/index.html +300 -300
  67. package/karma.conf.js +24 -24
  68. package/package.json +85 -85
  69. package/renovate.json +7 -7
  70. package/src/modal-manager.ts +22 -0
  71. package/src/shoelace/LICENSE.md +6 -6
  72. package/test/modal-manager.test.ts +52 -6
  73. package/tsconfig.json +21 -21
@@ -1,127 +1,137 @@
1
- import { LitElement, CSSResult, TemplateResult, PropertyValues } from 'lit';
2
- import Modal from './shoelace/modal';
3
- import './modal-template';
4
- import { ModalConfig } from './modal-config';
5
- import { ModalManagerInterface } from './modal-manager-interface';
6
- import { ModalManagerHostBridgeInterface } from './modal-manager-host-bridge-interface';
7
- import { ModalManagerMode } from './modal-manager-mode';
8
- export declare class ModalManager extends LitElement implements ModalManagerInterface {
9
- /**
10
- * The current mode of the ModalManager
11
- *
12
- * Current options are `modal` or `closed`
13
- *
14
- * @type {ModalManagerMode}
15
- * @memberof ModalManager
16
- */
17
- mode: ModalManagerMode;
18
- /**
19
- * Custom content to display in the modal's content slot
20
- *
21
- * @type {(TemplateResult | undefined)}
22
- * @memberof ModalManager
23
- */
24
- customModalContent?: TemplateResult;
25
- /**
26
- * This hostBridge handles environmental-specific interactions such as adding classes
27
- * to the body tag or event listeners needed to support the modal manager in the host environment.
28
- *
29
- * There is a default `ModalManagerHostBridge`, but consumers can override it with a custom
30
- * `ModalManagerHostBridgeInterface`
31
- *
32
- * @type {ModalManagerHostBridgeInterface}
33
- * @memberof ModalManager
34
- */
35
- hostBridge: ModalManagerHostBridgeInterface;
36
- /**
37
- * Reference to the ModalTemplate DOM element
38
- *
39
- * @private
40
- * @type {ModalTemplate}
41
- * @memberof ModalManager
42
- */
43
- private modalTemplate?;
44
- modal: Modal;
45
- firstUpdated(): Promise<void>;
46
- disconnectedCallback(): void;
47
- /** @inheritdoc */
48
- render(): TemplateResult;
49
- /** @inheritdoc */
50
- getMode(): ModalManagerMode;
51
- /** @inheritdoc */
52
- closeModal(): void;
53
- /**
54
- * Whether the modal should close if the user taps on the backdrop
55
- *
56
- * @private
57
- * @memberof ModalManager
58
- */
59
- private closeOnBackdropClick;
60
- /**
61
- * A callback if the user closes the modal
62
- *
63
- * @private
64
- * @memberof ModalManager
65
- */
66
- private userClosedModalCallback?;
67
- /**
68
- * A callback if the user presses the left nav button
69
- *
70
- * @private
71
- * @memberof ModalManager
72
- */
73
- private userPressedLeftNavButtonCallback?;
74
- /**
75
- * Call the userClosedModalCallback and reset it if it exists
76
- *
77
- * @private
78
- * @memberof ModalManager
79
- */
80
- private callUserClosedModalCallback;
81
- /**
82
- * Call the user pressed left nav button callback and reset it if it exists
83
- *
84
- * @private
85
- * @memberof ModalManager
86
- */
87
- private callUserPressedLeftNavButtonCallback;
88
- /** @inheritdoc */
89
- showModal(options: {
90
- config: ModalConfig;
91
- customModalContent?: TemplateResult;
92
- userClosedModalCallback?: () => void;
93
- userPressedLeftNavButtonCallback?: () => void;
94
- }): Promise<void>;
95
- /** @inheritdoc */
96
- updated(changed: PropertyValues): void;
97
- /**
98
- * Called when the backdrop is clicked
99
- *
100
- * @private
101
- * @memberof ModalManager
102
- */
103
- private backdropClicked;
104
- /**
105
- * Handle the mode change
106
- *
107
- * @private
108
- * @memberof ModalManager
109
- */
110
- private handleModeChange;
111
- /**
112
- * Emit a modeChange event
113
- *
114
- * @private
115
- * @memberof ModalManager
116
- */
117
- private emitModeChangeEvent;
118
- /**
119
- * Called when the modal close button is pressed. Closes the modal.
120
- *
121
- * @private
122
- * @memberof ModalManager
123
- */
124
- private closeButtonPressed;
125
- /** @inheritdoc */
126
- static get styles(): CSSResult;
127
- }
1
+ import { LitElement, CSSResult, TemplateResult, PropertyValues } from 'lit';
2
+ import Modal from './shoelace/modal';
3
+ import './modal-template';
4
+ import { ModalConfig } from './modal-config';
5
+ import { ModalManagerInterface } from './modal-manager-interface';
6
+ import { ModalManagerHostBridgeInterface } from './modal-manager-host-bridge-interface';
7
+ import { ModalManagerMode } from './modal-manager-mode';
8
+ export declare class ModalManager extends LitElement implements ModalManagerInterface {
9
+ /**
10
+ * The current mode of the ModalManager
11
+ *
12
+ * Current options are `modal` or `closed`
13
+ *
14
+ * @type {ModalManagerMode}
15
+ * @memberof ModalManager
16
+ */
17
+ mode: ModalManagerMode;
18
+ /**
19
+ * Custom content to display in the modal's content slot
20
+ *
21
+ * @type {(TemplateResult | undefined)}
22
+ * @memberof ModalManager
23
+ */
24
+ customModalContent?: TemplateResult;
25
+ /**
26
+ * This hostBridge handles environmental-specific interactions such as adding classes
27
+ * to the body tag or event listeners needed to support the modal manager in the host environment.
28
+ *
29
+ * There is a default `ModalManagerHostBridge`, but consumers can override it with a custom
30
+ * `ModalManagerHostBridgeInterface`
31
+ *
32
+ * @type {ModalManagerHostBridgeInterface}
33
+ * @memberof ModalManager
34
+ */
35
+ hostBridge: ModalManagerHostBridgeInterface;
36
+ /**
37
+ * Reference to the ModalTemplate DOM element
38
+ *
39
+ * @private
40
+ * @type {ModalTemplate}
41
+ * @memberof ModalManager
42
+ */
43
+ private modalTemplate?;
44
+ modal: Modal;
45
+ firstUpdated(): Promise<void>;
46
+ disconnectedCallback(): void;
47
+ /** @inheritdoc */
48
+ render(): TemplateResult;
49
+ /** @inheritdoc */
50
+ getMode(): ModalManagerMode;
51
+ /** @inheritdoc */
52
+ closeModal(): void;
53
+ /**
54
+ * Whether the modal should close if the user taps on the backdrop
55
+ *
56
+ * @private
57
+ * @memberof ModalManager
58
+ */
59
+ private closeOnBackdropClick;
60
+ /**
61
+ * The element that had focus when the modal was opened, so that we can return focus
62
+ * to it after the modal closes.
63
+ */
64
+ private triggeringElement?;
65
+ /**
66
+ * A callback if the user closes the modal
67
+ *
68
+ * @private
69
+ * @memberof ModalManager
70
+ */
71
+ private userClosedModalCallback?;
72
+ /**
73
+ * A callback if the user presses the left nav button
74
+ *
75
+ * @private
76
+ * @memberof ModalManager
77
+ */
78
+ private userPressedLeftNavButtonCallback?;
79
+ /**
80
+ * Call the userClosedModalCallback and reset it if it exists
81
+ *
82
+ * @private
83
+ * @memberof ModalManager
84
+ */
85
+ private callUserClosedModalCallback;
86
+ /**
87
+ * Call the user pressed left nav button callback and reset it if it exists
88
+ *
89
+ * @private
90
+ * @memberof ModalManager
91
+ */
92
+ private callUserPressedLeftNavButtonCallback;
93
+ /** @inheritdoc */
94
+ showModal(options: {
95
+ config: ModalConfig;
96
+ customModalContent?: TemplateResult;
97
+ userClosedModalCallback?: () => void;
98
+ userPressedLeftNavButtonCallback?: () => void;
99
+ }): Promise<void>;
100
+ /**
101
+ * Sets the triggering element to the one that is currently focused, as deep
102
+ * within Shadow DOM as possible.
103
+ */
104
+ private captureFocusedElement;
105
+ /** @inheritdoc */
106
+ updated(changed: PropertyValues): void;
107
+ /**
108
+ * Called when the backdrop is clicked
109
+ *
110
+ * @private
111
+ * @memberof ModalManager
112
+ */
113
+ private backdropClicked;
114
+ /**
115
+ * Handle the mode change
116
+ *
117
+ * @private
118
+ * @memberof ModalManager
119
+ */
120
+ private handleModeChange;
121
+ /**
122
+ * Emit a modeChange event
123
+ *
124
+ * @private
125
+ * @memberof ModalManager
126
+ */
127
+ private emitModeChangeEvent;
128
+ /**
129
+ * Called when the modal close button is pressed. Closes the modal.
130
+ *
131
+ * @private
132
+ * @memberof ModalManager
133
+ */
134
+ private closeButtonPressed;
135
+ /** @inheritdoc */
136
+ static get styles(): CSSResult;
137
+ }