@backstage/plugin-techdocs-module-addons-contrib 1.1.19 → 1.1.20-next.0
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/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @backstage/plugin-techdocs-module-addons-contrib
|
2
2
|
|
3
|
+
## 1.1.20-next.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- b664b2a: Internal refactor for safer handling of possible null value.
|
8
|
+
- Updated dependencies
|
9
|
+
- @backstage/core-components@0.16.2
|
10
|
+
- @backstage/core-plugin-api@1.10.2
|
11
|
+
- @backstage/integration@1.16.0
|
12
|
+
- @backstage/integration-react@1.2.2
|
13
|
+
- @backstage/plugin-techdocs-react@1.2.12
|
14
|
+
|
3
15
|
## 1.1.19
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -43,13 +43,13 @@ const LightBoxAddon = () => {
|
|
43
43
|
};
|
44
44
|
});
|
45
45
|
}
|
46
|
-
lightbox
|
46
|
+
lightbox?.loadAndOpen(index, dataSourceImages);
|
47
47
|
return false;
|
48
48
|
};
|
49
49
|
});
|
50
50
|
lightbox.init();
|
51
51
|
return () => {
|
52
|
-
lightbox
|
52
|
+
lightbox?.destroy();
|
53
53
|
lightbox = null;
|
54
54
|
};
|
55
55
|
}, [images]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LightBox.esm.js","sources":["../../src/LigthBox/LightBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect } from 'react';\nimport { useShadowRootElements } from '@backstage/plugin-techdocs-react';\n// @ts-ignore\nimport PhotoSwipeLightbox, { DataSource, ZoomLevel } from 'photoswipe/lightbox';\nimport PhotoSwipe from 'photoswipe';\nimport 'photoswipe/style.css';\nimport './lightbox.css';\n\nexport const LightBoxAddon = () => {\n const images = useShadowRootElements<HTMLImageElement>(['img']);\n\n useEffect(() => {\n let dataSourceImages: DataSource | null = null;\n\n let lightbox = new PhotoSwipeLightbox({\n pswpModule: PhotoSwipe,\n initialZoomLevel: 1,\n secondaryZoomLevel: (zoomLevelObject: ZoomLevel) => {\n // photoswipe/lightbox won't zoom the image further then the given width and height.\n // therefore we need to calculate the zoom factor needed to fit the complete image in the viewport manually.\n const imageWidth = zoomLevelObject.elementSize.x;\n const imageHeight = zoomLevelObject.elementSize.y;\n const viewportWidth = zoomLevelObject.panAreaSize.x;\n const viewportHeight = zoomLevelObject.panAreaSize.y;\n\n const widthScale = viewportWidth / imageWidth;\n const heightScale = viewportHeight / imageHeight;\n\n const scaleFactor = Math.min(widthScale, heightScale);\n return scaleFactor;\n },\n wheelToZoom: true,\n arrowPrevSVG:\n '<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"ArrowBackIosIcon\" aria-label=\"fontSize large\"><path d=\"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z\"></path></svg>',\n arrowNextSVG:\n '<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"ArrowForwardIosIcon\" aria-label=\"fontSize large\"><path d=\"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z\"></path></svg>',\n closeSVG:\n '<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"CloseIcon\" aria-label=\"fontSize large\"><path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"></path></svg>',\n zoomSVG: `<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"ZoomIcon\" aria-label=\"fontSize large\">\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"></path><path d=\"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z\" id=\"photoswipe-zoom-icon-zoomin-path\"></path><path d=\"M12 10H 7 V 9 H 12 Z\" id=\"photoswipe-zoom-icon-zoomout-path\">\n </svg>`,\n });\n\n images.forEach((image, index) => {\n image.onclick = () => {\n if (dataSourceImages === null) {\n dataSourceImages = images.map(dataSourceImage => {\n return {\n element: dataSourceImage,\n src: dataSourceImage.src,\n msrc: dataSourceImage.src,\n alt: dataSourceImage.alt,\n width: dataSourceImage.clientWidth,\n height: dataSourceImage.clientHeight,\n };\n });\n }\n lightbox
|
1
|
+
{"version":3,"file":"LightBox.esm.js","sources":["../../src/LigthBox/LightBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect } from 'react';\nimport { useShadowRootElements } from '@backstage/plugin-techdocs-react';\n// @ts-ignore\nimport PhotoSwipeLightbox, { DataSource, ZoomLevel } from 'photoswipe/lightbox';\nimport PhotoSwipe from 'photoswipe';\nimport 'photoswipe/style.css';\nimport './lightbox.css';\n\nexport const LightBoxAddon = () => {\n const images = useShadowRootElements<HTMLImageElement>(['img']);\n\n useEffect(() => {\n let dataSourceImages: DataSource | null = null;\n\n let lightbox: PhotoSwipeLightbox | null = new PhotoSwipeLightbox({\n pswpModule: PhotoSwipe,\n initialZoomLevel: 1,\n secondaryZoomLevel: (zoomLevelObject: ZoomLevel) => {\n // photoswipe/lightbox won't zoom the image further then the given width and height.\n // therefore we need to calculate the zoom factor needed to fit the complete image in the viewport manually.\n const imageWidth = zoomLevelObject.elementSize.x;\n const imageHeight = zoomLevelObject.elementSize.y;\n const viewportWidth = zoomLevelObject.panAreaSize.x;\n const viewportHeight = zoomLevelObject.panAreaSize.y;\n\n const widthScale = viewportWidth / imageWidth;\n const heightScale = viewportHeight / imageHeight;\n\n const scaleFactor = Math.min(widthScale, heightScale);\n return scaleFactor;\n },\n wheelToZoom: true,\n arrowPrevSVG:\n '<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"ArrowBackIosIcon\" aria-label=\"fontSize large\"><path d=\"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z\"></path></svg>',\n arrowNextSVG:\n '<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"ArrowForwardIosIcon\" aria-label=\"fontSize large\"><path d=\"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z\"></path></svg>',\n closeSVG:\n '<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"CloseIcon\" aria-label=\"fontSize large\"><path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"></path></svg>',\n zoomSVG: `<svg class=\"MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-c1sh5i\" focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-testid=\"ZoomIcon\" aria-label=\"fontSize large\">\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"></path><path d=\"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z\" id=\"photoswipe-zoom-icon-zoomin-path\"></path><path d=\"M12 10H 7 V 9 H 12 Z\" id=\"photoswipe-zoom-icon-zoomout-path\">\n </svg>`,\n });\n\n images.forEach((image, index) => {\n image.onclick = () => {\n if (dataSourceImages === null) {\n dataSourceImages = images.map(dataSourceImage => {\n return {\n element: dataSourceImage,\n src: dataSourceImage.src,\n msrc: dataSourceImage.src,\n alt: dataSourceImage.alt,\n width: dataSourceImage.clientWidth,\n height: dataSourceImage.clientHeight,\n };\n });\n }\n lightbox?.loadAndOpen(index, dataSourceImages);\n return false;\n };\n });\n lightbox.init();\n\n return () => {\n lightbox?.destroy();\n lightbox = null;\n };\n }, [images]);\n\n return null;\n};\n"],"names":[],"mappings":";;;;;;AAwBO,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,MAAS,GAAA,qBAAA,CAAwC,CAAC,KAAK,CAAC,CAAA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gB,CAAA,WAAA;AAAA,cACvB,QAAQ,eAAgB,CAAA;AAAA,aAC1B;AAAA,WACD,CAAA;AAAA;AAEH,QAAU,QAAA,EAAA,WAAA,CAAY,OAAO,gBAAgB,CAAA;AAC7C,QAAO,OAAA,KAAA;AAAA,OACT;AAAA,KACD,CAAA;AACD,IAAA,QAAA,CAAS,IAAK,EAAA;AAEd,IAAA,OAAO,MAAM;AACX,MAAA,QAAA,EAAU,OAAQ,EAAA;AAClB,MAAW,QAAA,GAAA,IAAA;AAAA,KACb;AAAA,GACF,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAO,OAAA,IAAA;AACT;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@backstage/plugin-techdocs-module-addons-contrib",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.20-next.0",
|
4
4
|
"description": "Plugin module for contributed TechDocs Addons",
|
5
5
|
"backstage": {
|
6
6
|
"role": "frontend-plugin-module",
|
@@ -39,11 +39,11 @@
|
|
39
39
|
"test": "backstage-cli package test"
|
40
40
|
},
|
41
41
|
"dependencies": {
|
42
|
-
"@backstage/core-components": "
|
43
|
-
"@backstage/core-plugin-api": "
|
44
|
-
"@backstage/integration": "
|
45
|
-
"@backstage/integration-react": "
|
46
|
-
"@backstage/plugin-techdocs-react": "
|
42
|
+
"@backstage/core-components": "0.16.2",
|
43
|
+
"@backstage/core-plugin-api": "1.10.2",
|
44
|
+
"@backstage/integration": "1.16.0",
|
45
|
+
"@backstage/integration-react": "1.2.2",
|
46
|
+
"@backstage/plugin-techdocs-react": "1.2.12",
|
47
47
|
"@material-ui/core": "^4.12.2",
|
48
48
|
"@material-ui/icons": "^4.9.1",
|
49
49
|
"@react-hookz/web": "^24.0.0",
|
@@ -51,9 +51,9 @@
|
|
51
51
|
"photoswipe": "^5.3.7"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@backstage/cli": "
|
55
|
-
"@backstage/plugin-techdocs-addons-test-utils": "
|
56
|
-
"@backstage/test-utils": "
|
54
|
+
"@backstage/cli": "0.29.5-next.0",
|
55
|
+
"@backstage/plugin-techdocs-addons-test-utils": "1.0.43",
|
56
|
+
"@backstage/test-utils": "1.7.3",
|
57
57
|
"@testing-library/dom": "^10.0.0",
|
58
58
|
"@testing-library/jest-dom": "^6.0.0",
|
59
59
|
"@testing-library/react": "^16.0.0",
|