mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-22 11:07:57 +01:00
55d57be7c5
Initialise preview panel as a Stimulus PreviewController Fix TypeScript issues in PreviewController Use Stimulus targets for preview device size inputs Use Stimulus target for preview panel new tab button Use Stimulus target for preview panel loading spinner Use Stimulus target for preview panel refresh button Use Stimulus target for preview panel mode select Use Stimulus target for preview panel iframe Also rename the id to w-preview-iframe to follow our new conventions for singleton elements Rely on Stimulus to replace the iframe target Because we copy all the attributes from the old iframe to the new one, this means that the new iframe will also become a target. When we remove the old iframe, the target is disconnected, and subsequent references to this.iframeTarget should point to the new one. Access the preview panel's parent side panel element via this.element.parentElement Bind preview device size inputs using Stimulus data-action Extract PreviewController.observePanelSize() method Extract PreviewController.restoreLastSavedPreferences() method Use Stimulus value for preview panel url Use Stimulus value for preview panel pending update state Move edit form and spinner timeout references into instance variables Extract PreviewController.finishUpdate() method Extract PreviewController.reloadIframe() method Extract PreviewController.clearPreviewData() and setPreviewData() methods Replace preview panel refresh button target with data-action Extract openPreviewInNewTab method and use it via data-action Do not close the preview tab if the data is not valid Use Stimulus values for preview panel auto update config Extract PreviewController.initAutoUpdate() method Extract handlePreviewModeChange method and use it via data-action Use Stimulus classes for preview panel unavailable and has-errors CSS classes Use Stimulus class for preview panel selected input size This removes the reliance of having a predefined set of classes for each device name, making it easier to add support for custom sizes later. The outline styles have also been updated to make use of focus-visible when available. Use hidden attribute for hiding preview panel spinner Replace PreviewController isUpdating value with an updatePromise instance variable Extract PreviewController.hasChanges() method Extract PreviewController.checkAndUpdatePreview() method Add default values for PreviewController values Use ProgressController outlet for preview panel refresh button This allows the use of the button-longrunning handling for the loading state. Also, turn the button into an icon-only button as there might not be enough space when the panel is resized to the smallest size Use cloneNode() instead of manually copying the attributes Extract PreviewController.replaceIframe() and use it as the iframe's action Extract PreviewController.sidePanelContainer instance attribute Extract PreviewController.checksSidePanel instance attribute Extract PreviewController.updateInterval instance attribute Clean up PreviewController event listeners on disconnect Extract preview panel device localStorage key into PreviewController Stimulus value Extract preview panel's width CSS property names into Stimulus values Disconnect preview panel ResizeObserver on controller disconnect Use an instance variable for tracking preview availability |
||
---|---|---|
.. | ||
components | ||
elements | ||
generic | ||
layouts | ||
overrides | ||
settings | ||
tools | ||
vendor | ||
_settings.scss | ||
_tools.scss | ||
core.scss |