@panoramax/web-viewer 4.4.0-develop-3839b5a4 → 4.4.0-develop-f91f6758
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/{src → build}/components/core/Basic.js +22 -16
- package/{src → build}/components/core/CoverageMap.js +19 -14
- package/{src → build}/components/core/Editor.js +16 -16
- package/{src → build}/components/core/PhotoViewer.js +30 -29
- package/{src → build}/components/core/Viewer.js +21 -20
- package/build/components/core/index.js +10 -0
- package/build/components/index.js +11 -0
- package/build/components/index_photoviewer.js +6 -0
- package/{src → build}/components/layout/BottomDrawer.js +4 -4
- package/{src → build}/components/layout/CorneredGrid.js +1 -1
- package/{src → build}/components/layout/Mini.js +5 -4
- package/{src → build}/components/layout/Tabs.js +1 -1
- package/build/components/layout/index.js +9 -0
- package/{src → build}/components/menus/LocationPrecisionDoc.js +4 -6
- package/{src → build}/components/menus/MapBackground.js +4 -6
- package/{src → build}/components/menus/MapFilters.js +16 -21
- package/{src → build}/components/menus/MapLayers.js +20 -24
- package/{src → build}/components/menus/MapLegend.js +3 -4
- package/{src → build}/components/menus/MiniPictureLegend.js +3 -4
- package/{src → build}/components/menus/PictureLegend.js +10 -15
- package/{src → build}/components/menus/PictureMetadata.js +12 -19
- package/{src → build}/components/menus/PlayerOptions.js +5 -7
- package/{src → build}/components/menus/QualityScoreDoc.js +3 -4
- package/{src → build}/components/menus/ReportForm.js +8 -9
- package/{src → build}/components/menus/SemanticsDoc.js +3 -4
- package/{src → build}/components/menus/SemanticsDownload.js +3 -3
- package/{src → build}/components/menus/SemanticsFilters.js +7 -8
- package/{src → build}/components/menus/SemanticsList.js +11 -18
- package/{src → build}/components/menus/SemanticsMetadata.js +8 -11
- package/{src → build}/components/menus/Share.js +6 -7
- package/build/components/menus/index.js +22 -0
- package/build/components/menus/index_photoviewer.js +11 -0
- package/{src → build}/components/styles.js +0 -2
- package/{src → build}/components/ui/AnnotationsSwitch.js +6 -8
- package/{src → build}/components/ui/Button.js +1 -1
- package/{src → build}/components/ui/ButtonGroup.js +2 -1
- package/{src → build}/components/ui/CopyButton.js +4 -6
- package/{src → build}/components/ui/Grade.js +5 -5
- package/{src → build}/components/ui/GradeFilter.js +3 -3
- package/{src → build}/components/ui/IconSwitch.js +1 -1
- package/{src → build}/components/ui/LinkButton.js +1 -1
- package/{src → build}/components/ui/ListGroup.js +3 -3
- package/{src → build}/components/ui/ListItem.js +1 -1
- package/{src → build}/components/ui/Loader.js +8 -7
- package/{src → build}/components/ui/Map.js +38 -26
- package/{src → build}/components/ui/MapMore.js +7 -7
- package/{src → build}/components/ui/Photo.js +29 -27
- package/{src → build}/components/ui/Popup.js +4 -4
- package/{src → build}/components/ui/QualityScore.js +4 -4
- package/{src → build}/components/ui/SearchBar.js +6 -7
- package/{src → build}/components/ui/SemanticsEditor.js +14 -15
- package/{src → build}/components/ui/SemanticsTable.js +4 -5
- package/{src → build}/components/ui/Switch.js +1 -1
- package/{src → build}/components/ui/TogglableGroup.js +4 -4
- package/build/components/ui/index.js +29 -0
- package/build/components/ui/index_photoviewer.js +21 -0
- package/{src → build}/components/ui/widgets/CopyCoordinates.js +5 -5
- package/{src → build}/components/ui/widgets/GeoSearch.js +10 -10
- package/{src → build}/components/ui/widgets/Legend.js +9 -8
- package/{src → build}/components/ui/widgets/LevelSelect.js +9 -7
- package/{src → build}/components/ui/widgets/MapFiltersButton.js +5 -5
- package/{src → build}/components/ui/widgets/MapLayersButton.js +5 -5
- package/{src → build}/components/ui/widgets/OSMEditors.js +8 -8
- package/{src → build}/components/ui/widgets/PictureLegendActions.js +4 -4
- package/{src → build}/components/ui/widgets/Player.js +6 -7
- package/{src → build}/components/ui/widgets/SemanticsFiltersButton.js +6 -7
- package/{src → build}/components/ui/widgets/Zoom.js +6 -6
- package/build/components/ui/widgets/index.js +16 -0
- package/build/components/ui/widgets/index_photoviewer.js +7 -0
- package/build/editor.html +94 -10
- package/{src → build}/img/arrow_triangle.svg +0 -1
- package/{src → build}/img/arrow_turn.svg +0 -1
- package/build/index.html +111 -1
- package/build/index.js +6 -95
- package/build/index_photoviewer.js +4 -0
- package/build/map.html +97 -1
- package/build/package.json +141 -0
- package/build/photo.html +85 -1
- package/build/servers.js +3 -4
- package/{src → build}/utils/API.js +33 -33
- package/{src → build}/utils/InitParameters.js +11 -9
- package/{src → build}/utils/MapStyleComposer.js +39 -37
- package/{src → build}/utils/PhotoAdapter.js +1 -0
- package/{src → build}/utils/PresetsManager.js +4 -4
- package/{src → build}/utils/SemanticsMapProtocol.js +3 -4
- package/{src → build}/utils/URLHandler.js +16 -14
- package/{src → build}/utils/geocoder.js +5 -5
- package/{src → build}/utils/i18n.js +21 -20
- package/build/utils/index.js +17 -0
- package/build/utils/index_photoviewer.js +14 -0
- package/{src → build}/utils/indoor.js +9 -5
- package/{src → build}/utils/map.js +15 -11
- package/{src → build}/utils/picture.js +22 -17
- package/{src → build}/utils/semantics.js +9 -5
- package/{src → build}/utils/utils.js +8 -4
- package/{src → build}/utils/widgets.js +2 -2
- package/build/viewer.html +120 -35
- package/build/viewer_indoor.html +90 -8
- package/build/widgets.html +410 -1
- package/package.json +81 -204
- package/.dockerignore +0 -7
- package/.gitlab-ci.yml +0 -78
- package/CHANGELOG.md +0 -853
- package/CODE_OF_CONDUCT.md +0 -134
- package/Dockerfile +0 -14
- package/build/index.css +0 -36
- package/build/index.css.map +0 -1
- package/build/index.js.map +0 -1
- package/build/photoviewer.css +0 -36
- package/build/photoviewer.css.map +0 -1
- package/build/photoviewer.js +0 -86
- package/build/photoviewer.js.map +0 -1
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff2 +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff2 +0 -0
- package/config/env.js +0 -104
- package/config/getHttpsConfig.js +0 -69
- package/config/getPackageJson.js +0 -25
- package/config/jest/babelTransform.js +0 -29
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -40
- package/config/jest/mocks.js +0 -230
- package/config/modules.js +0 -134
- package/config/paths.js +0 -76
- package/config/pnpTs.js +0 -35
- package/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
- package/config/webpack.config.js +0 -825
- package/config/webpackDevServer.config.js +0 -131
- package/docs/03_URL_settings.md +0 -218
- package/docs/05_Compatibility.md +0 -83
- package/docs/09_Develop.md +0 -141
- package/docs/90_Releases.md +0 -27
- package/docs/images/class_diagram.drawio +0 -144
- package/docs/images/class_diagram.jpg +0 -0
- package/docs/images/comparative_3drender.jpg +0 -0
- package/docs/images/indoor_level.png +0 -0
- package/docs/images/screenshot.jpg +0 -0
- package/docs/index.md +0 -159
- package/docs/reference/components/core/Basic.md +0 -211
- package/docs/reference/components/core/CoverageMap.md +0 -220
- package/docs/reference/components/core/Editor.md +0 -252
- package/docs/reference/components/core/PhotoViewer.md +0 -320
- package/docs/reference/components/core/Viewer.md +0 -398
- package/docs/reference/components/layout/BottomDrawer.md +0 -35
- package/docs/reference/components/layout/CorneredGrid.md +0 -29
- package/docs/reference/components/layout/Mini.md +0 -45
- package/docs/reference/components/layout/Tabs.md +0 -46
- package/docs/reference/components/menus/LocationPrecisionDoc.md +0 -15
- package/docs/reference/components/menus/MapBackground.md +0 -32
- package/docs/reference/components/menus/MapFilters.md +0 -37
- package/docs/reference/components/menus/MapLayers.md +0 -15
- package/docs/reference/components/menus/MapLegend.md +0 -32
- package/docs/reference/components/menus/MiniPictureLegend.md +0 -15
- package/docs/reference/components/menus/PictureLegend.md +0 -45
- package/docs/reference/components/menus/PictureMetadata.md +0 -32
- package/docs/reference/components/menus/PlayerOptions.md +0 -15
- package/docs/reference/components/menus/QualityScoreDoc.md +0 -15
- package/docs/reference/components/menus/ReportForm.md +0 -15
- package/docs/reference/components/menus/SemanticsDoc.md +0 -15
- package/docs/reference/components/menus/SemanticsDownload.md +0 -15
- package/docs/reference/components/menus/SemanticsFilters.md +0 -33
- package/docs/reference/components/menus/SemanticsList.md +0 -97
- package/docs/reference/components/menus/SemanticsMetadata.md +0 -15
- package/docs/reference/components/menus/ShareMenu.md +0 -32
- package/docs/reference/components/ui/AnnotationsSwitch.md +0 -32
- package/docs/reference/components/ui/Button.md +0 -40
- package/docs/reference/components/ui/ButtonGroup.md +0 -36
- package/docs/reference/components/ui/CopyButton.md +0 -41
- package/docs/reference/components/ui/Grade.md +0 -32
- package/docs/reference/components/ui/GradeFilter.md +0 -42
- package/docs/reference/components/ui/IconSwitch.md +0 -53
- package/docs/reference/components/ui/LinkButton.md +0 -45
- package/docs/reference/components/ui/ListGroup.md +0 -22
- package/docs/reference/components/ui/ListItem.md +0 -39
- package/docs/reference/components/ui/Loader.md +0 -56
- package/docs/reference/components/ui/Map.md +0 -150
- package/docs/reference/components/ui/MapMore.md +0 -150
- package/docs/reference/components/ui/Photo.md +0 -495
- package/docs/reference/components/ui/Popup.md +0 -56
- package/docs/reference/components/ui/ProgressBar.md +0 -32
- package/docs/reference/components/ui/QualityScore.md +0 -45
- package/docs/reference/components/ui/SearchBar.md +0 -63
- package/docs/reference/components/ui/SemanticsEditor.md +0 -113
- package/docs/reference/components/ui/SemanticsTable.md +0 -32
- package/docs/reference/components/ui/Switch.md +0 -49
- package/docs/reference/components/ui/TogglableGroup.md +0 -39
- package/docs/reference/components/ui/widgets/CopyCoordinates.md +0 -32
- package/docs/reference/components/ui/widgets/GeoSearch.md +0 -36
- package/docs/reference/components/ui/widgets/Legend.md +0 -58
- package/docs/reference/components/ui/widgets/LevelSelect.md +0 -16
- package/docs/reference/components/ui/widgets/MapFiltersButton.md +0 -37
- package/docs/reference/components/ui/widgets/MapLayersButton.md +0 -15
- package/docs/reference/components/ui/widgets/OSMEditors.md +0 -15
- package/docs/reference/components/ui/widgets/PictureLegendActions.md +0 -32
- package/docs/reference/components/ui/widgets/Player.md +0 -34
- package/docs/reference/components/ui/widgets/SemanticsFiltersButton.md +0 -15
- package/docs/reference/components/ui/widgets/Zoom.md +0 -15
- package/docs/reference/utils/API.md +0 -389
- package/docs/reference/utils/InitParameters.md +0 -68
- package/docs/reference/utils/MapStyleComposer.md +0 -408
- package/docs/reference/utils/PanoraMapProtocol.md +0 -28
- package/docs/reference/utils/PresetsManager.md +0 -43
- package/docs/reference/utils/SemanticsMapProtocol.md +0 -43
- package/docs/reference/utils/URLHandler.md +0 -114
- package/docs/reference.md +0 -99
- package/docs/shortcuts.md +0 -11
- package/docs/tutorials/aerial_imagery.md +0 -21
- package/docs/tutorials/authentication.md +0 -10
- package/docs/tutorials/custom_widgets.md +0 -59
- package/docs/tutorials/indoor_maps.md +0 -50
- package/docs/tutorials/map_style.md +0 -83
- package/docs/tutorials/migrate_v4.md +0 -153
- package/docs/tutorials/migrate_v5.md +0 -103
- package/docs/tutorials/semantics_overlays.md +0 -74
- package/docs/tutorials/synced_coverage.md +0 -43
- package/mkdocs.yml +0 -131
- package/public/editor.html +0 -53
- package/public/index.html +0 -70
- package/public/map.html +0 -55
- package/public/photo.html +0 -43
- package/public/servers.js +0 -15
- package/public/viewer.html +0 -79
- package/public/viewer_indoor.html +0 -48
- package/public/widgets.html +0 -366
- package/scripts/build.js +0 -217
- package/scripts/doc.js +0 -79
- package/scripts/start.js +0 -172
- package/scripts/test.js +0 -52
- package/src/components/core/index.js +0 -12
- package/src/components/index.js +0 -13
- package/src/components/index_photoviewer.js +0 -8
- package/src/components/layout/index.js +0 -9
- package/src/components/menus/index.js +0 -22
- package/src/components/menus/index_photoviewer.js +0 -13
- package/src/components/ui/index.js +0 -29
- package/src/components/ui/index_photoviewer.js +0 -23
- package/src/components/ui/widgets/index.js +0 -16
- package/src/components/ui/widgets/index_photoviewer.js +0 -9
- package/src/index.js +0 -8
- package/src/index_photoviewer.js +0 -6
- package/src/utils/index.js +0 -17
- package/src/utils/index_photoviewer.js +0 -16
- package/tests/components/core/Basic.test.js +0 -168
- package/tests/components/core/BasicMock.js +0 -25
- package/tests/components/core/CoverageMap.test.js +0 -20
- package/tests/components/core/Editor.test.js +0 -20
- package/tests/components/core/PhotoViewer.test.js +0 -57
- package/tests/components/core/Viewer.test.js +0 -85
- package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +0 -96
- package/tests/components/core/__snapshots__/Viewer.test.js.snap +0 -188
- package/tests/components/ui/CopyButton.test.js +0 -52
- package/tests/components/ui/Loader.test.js +0 -55
- package/tests/components/ui/Map.test.js +0 -145
- package/tests/components/ui/Photo.test.js +0 -437
- package/tests/components/ui/Popup.test.js +0 -26
- package/tests/components/ui/QualityScore.test.js +0 -18
- package/tests/components/ui/SearchBar.test.js +0 -110
- package/tests/components/ui/__snapshots__/CopyButton.test.js.snap +0 -33
- package/tests/components/ui/__snapshots__/Loader.test.js.snap +0 -56
- package/tests/components/ui/__snapshots__/Map.test.js.snap +0 -16
- package/tests/components/ui/__snapshots__/Photo.test.js.snap +0 -263
- package/tests/components/ui/__snapshots__/Popup.test.js.snap +0 -29
- package/tests/components/ui/__snapshots__/QualityScore.test.js.snap +0 -11
- package/tests/components/ui/__snapshots__/SearchBar.test.js.snap +0 -65
- package/tests/data/Map_geocoder_ban.json +0 -36
- package/tests/data/Map_geocoder_nominatim.json +0 -41
- package/tests/data/Viewer_pictures_1.json +0 -148
- package/tests/setupTests.js +0 -5
- package/tests/utils/API.test.js +0 -752
- package/tests/utils/InitParameters.test.js +0 -599
- package/tests/utils/MapStyleComposer.test.js +0 -697
- package/tests/utils/PresetsManager.test.js +0 -123
- package/tests/utils/URLHandler.test.js +0 -587
- package/tests/utils/__snapshots__/API.test.js.snap +0 -40
- package/tests/utils/__snapshots__/MapStyleComposer.test.js.snap +0 -767
- package/tests/utils/__snapshots__/URLHandler.test.js.snap +0 -21
- package/tests/utils/__snapshots__/geocoder.test.js.snap +0 -37
- package/tests/utils/__snapshots__/map.test.js.snap +0 -1249
- package/tests/utils/__snapshots__/picture.test.js.snap +0 -327
- package/tests/utils/__snapshots__/widgets.test.js.snap +0 -19
- package/tests/utils/geocoder.test.js +0 -37
- package/tests/utils/i18n.test.js +0 -111
- package/tests/utils/map.test.js +0 -200
- package/tests/utils/picture.test.js +0 -745
- package/tests/utils/semantics.test.js +0 -174
- package/tests/utils/utils.test.js +0 -358
- package/tests/utils/widgets.test.js +0 -31
- /package/{src → build}/components/core/Basic.css +0 -0
- /package/{src → build}/components/core/CoverageMap.css +0 -0
- /package/{src → build}/components/core/Editor.css +0 -0
- /package/{src → build}/components/core/PhotoViewer.css +0 -0
- /package/{src → build}/components/core/Viewer.css +0 -0
- /package/{src → build}/components/ui/ButtonGroup.css +0 -0
- /package/{src → build}/components/ui/Map.css +0 -0
- /package/{src → build}/components/ui/Photo.css +0 -0
- /package/{src → build}/components/ui/ProgressBar.js +0 -0
- /package/{src → build}/components/ui/widgets/GeoSearch.css +0 -0
- /package/{src → build}/components/ui/widgets/LevelSelect.css +0 -0
- /package/{src → build}/components/ui/widgets/Player.css +0 -0
- /package/{public → build}/favicon.ico +0 -0
- /package/{src → build}/img/arrow_360.svg +0 -0
- /package/{src → build}/img/arrow_flat.svg +0 -0
- /package/{src → build}/img/bg_aerial.jpg +0 -0
- /package/{src → build}/img/bg_streets.jpg +0 -0
- /package/{src → build}/img/loader_base.jpg +0 -0
- /package/{src → build}/img/logo_dead.svg +0 -0
- /package/{src → build}/img/marker.svg +0 -0
- /package/{src → build}/img/marker_blue.svg +0 -0
- /package/{src → build}/img/osm.svg +0 -0
- /package/{src → build}/img/panoramax.svg +0 -0
- /package/{src → build}/img/switch_big.svg +0 -0
- /package/{src → build}/img/switch_mini.svg +0 -0
- /package/{src → build}/img/wd.svg +0 -0
- /package/{src → build}/translations/ar.json +0 -0
- /package/{src → build}/translations/be.json +0 -0
- /package/{src → build}/translations/br.json +0 -0
- /package/{src → build}/translations/cy.json +0 -0
- /package/{src → build}/translations/da.json +0 -0
- /package/{src → build}/translations/de.json +0 -0
- /package/{src → build}/translations/en.json +0 -0
- /package/{src → build}/translations/eo.json +0 -0
- /package/{src → build}/translations/es.json +0 -0
- /package/{src → build}/translations/fi.json +0 -0
- /package/{src → build}/translations/fr.json +0 -0
- /package/{src → build}/translations/hu.json +0 -0
- /package/{src → build}/translations/it.json +0 -0
- /package/{src → build}/translations/ja.json +0 -0
- /package/{src → build}/translations/ko.json +0 -0
- /package/{src → build}/translations/nl.json +0 -0
- /package/{src → build}/translations/nn.json +0 -0
- /package/{src → build}/translations/pl.json +0 -0
- /package/{src → build}/translations/pt.json +0 -0
- /package/{src → build}/translations/pt_BR.json +0 -0
- /package/{src → build}/translations/sv.json +0 -0
- /package/{src → build}/translations/ti.json +0 -0
- /package/{src → build}/translations/tr.json +0 -0
- /package/{src → build}/translations/uk.json +0 -0
- /package/{src → build}/translations/zh_Hant.json +0 -0
- /package/{src → build}/utils/PanoraMapProtocol.js +0 -0
- /package/{src → build}/utils/services.js +0 -0
package/public/widgets.html
DELETED
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
6
|
-
<title>Panoramax Widgets</title>
|
|
7
|
-
<style>
|
|
8
|
-
body {
|
|
9
|
-
font-family: sans-serif;
|
|
10
|
-
padding-bottom: 100px;
|
|
11
|
-
}
|
|
12
|
-
h1, h2, p, nav { text-align: center; }
|
|
13
|
-
.test-bench {
|
|
14
|
-
display: flex;
|
|
15
|
-
width: 100%;
|
|
16
|
-
max-width: 600px;
|
|
17
|
-
margin: 7px auto;
|
|
18
|
-
justify-content: space-between;
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
21
|
-
.test-bench h3 { margin: 0; }
|
|
22
|
-
hr.test-sep {
|
|
23
|
-
width: 100%;
|
|
24
|
-
max-width: 600px;
|
|
25
|
-
}
|
|
26
|
-
</style>
|
|
27
|
-
</head>
|
|
28
|
-
<body>
|
|
29
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
30
|
-
<h1>Panoramax widgets</h1>
|
|
31
|
-
<p>Test page for common Panoramax viewer widgets</p>
|
|
32
|
-
<nav>
|
|
33
|
-
<a href="#button">Button</a>
|
|
34
|
-
<a href="#link-button">Link Button</a>
|
|
35
|
-
<a href="#copy-button">Copy button</a>
|
|
36
|
-
<a href="#button-group">Button Group</a>
|
|
37
|
-
<a href="#5stars">5-stars grade</a>
|
|
38
|
-
<a href="#quality-score">Quality Score</a>
|
|
39
|
-
<a href="#search-bar">Search bar</a>
|
|
40
|
-
<a href="#progress-bar">Progress bar</a>
|
|
41
|
-
<a href="#tabs">Tabs</a>
|
|
42
|
-
<a href="#semantics-editor">Semantics Editor</a>
|
|
43
|
-
<a href="#switch">Switch</a>
|
|
44
|
-
</nav>
|
|
45
|
-
|
|
46
|
-
<h2 id="button">Button</h2>
|
|
47
|
-
<div class="test-bench"><h3>Text + click</h3><pnx-button onclick="alert('Stuff')">Click to do stuff</pnx-button></div>
|
|
48
|
-
<div class="test-bench"><h3>Icon</h3><pnx-button>⚙️ Settings</pnx-button></div>
|
|
49
|
-
<div class="test-bench"><h3>Active</h3><pnx-button active="true">Settings</pnx-button></div>
|
|
50
|
-
<div class="test-bench">
|
|
51
|
-
<h3>CSS override</h3>
|
|
52
|
-
<div style="width: 50%; display: flex; gap: 5px; max-width: 300px">
|
|
53
|
-
<pnx-button style="width: 50%;">⚙️ Settings</pnx-button>
|
|
54
|
-
<pnx-button style="width: 50%;">🖨️ Print</pnx-button>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<hr class="test-sep" />
|
|
58
|
-
<div class="test-bench"><h3>Full</h3><pnx-button kind="full">⚙️ Settings</pnx-button></div>
|
|
59
|
-
<div class="test-bench"><h3>Full active</h3><pnx-button kind="full" active>⚙️ Settings</pnx-button></div>
|
|
60
|
-
<div class="test-bench"><h3>Full L</h3><pnx-button kind="full" size="l">⚙️</pnx-button></div>
|
|
61
|
-
<div class="test-bench"><h3>Full XXL</h3><pnx-button kind="full" size="xxl">⚙️</pnx-button></div>
|
|
62
|
-
<div class="test-bench"><h3>Outline</h3><pnx-button kind="outline">⚙️ Settings</pnx-button></div>
|
|
63
|
-
<div class="test-bench"><h3>Outline active</h3><pnx-button kind="outline" active>⚙️ Settings</pnx-button></div>
|
|
64
|
-
<div class="test-bench"><h3>Outline L</h3><pnx-button kind="outline" size="l">⚙️</pnx-button></div>
|
|
65
|
-
<div class="test-bench"><h3>Outline XXL</h3><pnx-button kind="outline" size="xxl">⚙️</pnx-button></div>
|
|
66
|
-
<div class="test-bench"><h3>Inline</h3><pnx-button kind="inline">⚙️ Settings</pnx-button></div>
|
|
67
|
-
<div class="test-bench"><h3>Inline active</h3><pnx-button kind="inline" active>⚙️ Settings</pnx-button></div>
|
|
68
|
-
<div class="test-bench"><h3>Inline L</h3><pnx-button kind="inline" size="l">⚙️</pnx-button></div>
|
|
69
|
-
<div class="test-bench"><h3>Inline XXL</h3><pnx-button kind="inline" size="xxl">⚙️</pnx-button></div>
|
|
70
|
-
<div class="test-bench"><h3>Superinline</h3><pnx-button kind="superinline">⚙️ Settings</pnx-button></div>
|
|
71
|
-
<div class="test-bench"><h3>Superinline active</h3><pnx-button kind="superinline" active>⚙️ Settings</pnx-button></div>
|
|
72
|
-
<div class="test-bench"><h3>Superinline L</h3><pnx-button kind="superinline" size="l">⚙️</pnx-button></div>
|
|
73
|
-
<div class="test-bench"><h3>Superinline XXL</h3><pnx-button kind="superinline" size="xxl">⚙️</pnx-button></div>
|
|
74
|
-
<div class="test-bench"><h3>Flat</h3><pnx-button kind="flat">⚙️ Settings</pnx-button></div>
|
|
75
|
-
<div class="test-bench"><h3>Flat active</h3><pnx-button kind="flat" active>⚙️ Settings</pnx-button></div>
|
|
76
|
-
<div class="test-bench"><h3>Flat L</h3><pnx-button kind="flat" size="l">⚙️</pnx-button></div>
|
|
77
|
-
<div class="test-bench"><h3>Flat XXL</h3><pnx-button kind="flat" size="xxl">⚙️</pnx-button></div>
|
|
78
|
-
<div class="test-bench"><h3>Superflat</h3><pnx-button kind="superflat">⚙️ Settings</pnx-button></div>
|
|
79
|
-
<div class="test-bench"><h3>Superflat active</h3><pnx-button kind="superflat" active>⚙️ Settings</pnx-button></div>
|
|
80
|
-
<div class="test-bench"><h3>Superflat L</h3><pnx-button kind="superflat" size="l">⚙️</pnx-button></div>
|
|
81
|
-
<div class="test-bench"><h3>Superflat XXL</h3><pnx-button kind="superflat" size="xxl">⚙️</pnx-button></div>
|
|
82
|
-
|
|
83
|
-
<h2 id="link-button">Link Button</h2>
|
|
84
|
-
<div class="test-bench"><h3>None set</h3><pnx-link-button>Click for nothing</pnx-link-button></div>
|
|
85
|
-
<div class="test-bench"><h3>All set</h3><pnx-link-button target="_blank" href="https://panoramax.fr" title="Do stuff">Click to do stuff</pnx-link-button></div>
|
|
86
|
-
|
|
87
|
-
<h2 id="copy-button">Copy button</h2>
|
|
88
|
-
<div class="test-bench"><h3>Default + text</h3><pnx-copy-button text="copypasta1"></pnx-copy-button></div>
|
|
89
|
-
<div class="test-bench"><h3>Custom + text</h3><pnx-copy-button text="copypasta2">🌐 Share URL</pnx-copy-button></div>
|
|
90
|
-
<div class="test-bench">
|
|
91
|
-
<h3>Default + input</h3>
|
|
92
|
-
<div style="display: flex; gap: 5px; align-items: center;">
|
|
93
|
-
<input type="text" value="copypasta3" id="copy-input-1" />
|
|
94
|
-
<pnx-copy-button input="copy-input-1"></pnx-copy-button>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<h2 id="button-group">Button Group</h2>
|
|
99
|
-
<div class="test-bench">
|
|
100
|
-
<h3>Full Row x2</h3>
|
|
101
|
-
<div>
|
|
102
|
-
<pnx-button-group dir="row">
|
|
103
|
-
<pnx-button>☹️</pnx-button>
|
|
104
|
-
<pnx-button>🙂</pnx-button>
|
|
105
|
-
</pnx-button-group>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="test-bench">
|
|
109
|
-
<h3>Full Row x3</h3>
|
|
110
|
-
<div>
|
|
111
|
-
<pnx-button-group dir="row">
|
|
112
|
-
<pnx-button>☹️</pnx-button>
|
|
113
|
-
<pnx-button>😐</pnx-button>
|
|
114
|
-
<pnx-button>🙂</pnx-button>
|
|
115
|
-
</pnx-button-group>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
<div class="test-bench">
|
|
119
|
-
<h3>Full Row mixed</h3>
|
|
120
|
-
<div>
|
|
121
|
-
<pnx-button-group dir="row">
|
|
122
|
-
<pnx-button>☹️</pnx-button>
|
|
123
|
-
<pnx-link-button>😐</pnx-link-button>
|
|
124
|
-
<pnx-copy-button>🙂</pnx-copy-button>
|
|
125
|
-
</pnx-button-group>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
<div class="test-bench">
|
|
129
|
-
<h3>Full Column x2</h3>
|
|
130
|
-
<div>
|
|
131
|
-
<pnx-button-group dir="column">
|
|
132
|
-
<pnx-button>☹️</pnx-button>
|
|
133
|
-
<pnx-button>🙂</pnx-button>
|
|
134
|
-
</pnx-button-group>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
<div class="test-bench">
|
|
138
|
-
<h3>Full Column x3</h3>
|
|
139
|
-
<div>
|
|
140
|
-
<pnx-button-group dir="column">
|
|
141
|
-
<pnx-button>☹️</pnx-button>
|
|
142
|
-
<pnx-button>😐</pnx-button>
|
|
143
|
-
<pnx-button>🙂</pnx-button>
|
|
144
|
-
</pnx-button-group>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
<div class="test-bench">
|
|
148
|
-
<h3>Full Column mixed</h3>
|
|
149
|
-
<div>
|
|
150
|
-
<pnx-button-group dir="column">
|
|
151
|
-
<pnx-button>☹️</pnx-button>
|
|
152
|
-
<pnx-link-button>😐</pnx-link-button>
|
|
153
|
-
<pnx-copy-button>🙂</pnx-copy-button>
|
|
154
|
-
</pnx-button-group>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
<hr class="test-sep" />
|
|
158
|
-
<div class="test-bench">
|
|
159
|
-
<h3>Outline Row x2</h3>
|
|
160
|
-
<div>
|
|
161
|
-
<pnx-button-group dir="row">
|
|
162
|
-
<pnx-button kind="outline">☹️</pnx-button>
|
|
163
|
-
<pnx-button kind="outline">🙂</pnx-button>
|
|
164
|
-
</pnx-button-group>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
<div class="test-bench">
|
|
168
|
-
<h3>Outline Row x3</h3>
|
|
169
|
-
<div>
|
|
170
|
-
<pnx-button-group dir="row">
|
|
171
|
-
<pnx-button kind="outline">☹️</pnx-button>
|
|
172
|
-
<pnx-button kind="outline">😐</pnx-button>
|
|
173
|
-
<pnx-button kind="outline">🙂</pnx-button>
|
|
174
|
-
</pnx-button-group>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
<div class="test-bench">
|
|
178
|
-
<h3>Outline Column x2</h3>
|
|
179
|
-
<div>
|
|
180
|
-
<pnx-button-group dir="column">
|
|
181
|
-
<pnx-button kind="outline">☹️</pnx-button>
|
|
182
|
-
<pnx-button kind="outline">🙂</pnx-button>
|
|
183
|
-
</pnx-button-group>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
<div class="test-bench">
|
|
187
|
-
<h3>Outline Column x3</h3>
|
|
188
|
-
<div>
|
|
189
|
-
<pnx-button-group dir="column">
|
|
190
|
-
<pnx-button kind="outline">☹️</pnx-button>
|
|
191
|
-
<pnx-button kind="outline">😐</pnx-button>
|
|
192
|
-
<pnx-button kind="outline">🙂</pnx-button>
|
|
193
|
-
</pnx-button-group>
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
<hr class="test-sep" />
|
|
197
|
-
<div class="test-bench">
|
|
198
|
-
<h3>Flat Row x2</h3>
|
|
199
|
-
<div>
|
|
200
|
-
<pnx-button-group dir="row">
|
|
201
|
-
<pnx-button kind="flat">☹️</pnx-button>
|
|
202
|
-
<pnx-button kind="flat">🙂</pnx-button>
|
|
203
|
-
</pnx-button-group>
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
<div class="test-bench">
|
|
207
|
-
<h3>Flat Row x3</h3>
|
|
208
|
-
<div>
|
|
209
|
-
<pnx-button-group dir="row">
|
|
210
|
-
<pnx-button kind="flat">☹️</pnx-button>
|
|
211
|
-
<pnx-button kind="flat">😐</pnx-button>
|
|
212
|
-
<pnx-button kind="flat">🙂</pnx-button>
|
|
213
|
-
</pnx-button-group>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
216
|
-
<div class="test-bench">
|
|
217
|
-
<h3>Flat Column x2</h3>
|
|
218
|
-
<div>
|
|
219
|
-
<pnx-button-group dir="column">
|
|
220
|
-
<pnx-button kind="flat">☹️</pnx-button>
|
|
221
|
-
<pnx-button kind="flat">🙂</pnx-button>
|
|
222
|
-
</pnx-button-group>
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
225
|
-
<div class="test-bench">
|
|
226
|
-
<h3>Flat Column x3</h3>
|
|
227
|
-
<div>
|
|
228
|
-
<pnx-button-group dir="column">
|
|
229
|
-
<pnx-button kind="flat">☹️</pnx-button>
|
|
230
|
-
<pnx-button kind="flat">😐</pnx-button>
|
|
231
|
-
<pnx-button kind="flat">🙂</pnx-button>
|
|
232
|
-
</pnx-button-group>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
<hr class="test-sep" />
|
|
236
|
-
<div class="test-bench">
|
|
237
|
-
<h3>Row XL</h3>
|
|
238
|
-
<div>
|
|
239
|
-
<pnx-button-group size="xl" dir="row">
|
|
240
|
-
<pnx-button kind="flat">☹️</pnx-button>
|
|
241
|
-
<pnx-button kind="flat">😐</pnx-button>
|
|
242
|
-
<pnx-button kind="flat">🙂</pnx-button>
|
|
243
|
-
</pnx-button-group>
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
<div class="test-bench">
|
|
247
|
-
<h3>Column XL</h3>
|
|
248
|
-
<div>
|
|
249
|
-
<pnx-button-group size="xl" dir="column">
|
|
250
|
-
<pnx-button kind="flat">☹️</pnx-button>
|
|
251
|
-
<pnx-button kind="flat">😐</pnx-button>
|
|
252
|
-
<pnx-button kind="flat">🙂</pnx-button>
|
|
253
|
-
</pnx-button-group>
|
|
254
|
-
</div>
|
|
255
|
-
</div>
|
|
256
|
-
|
|
257
|
-
<h2 id="5stars">5-stars grade</h2>
|
|
258
|
-
<div class="test-bench"><h3>With a grade</h3><pnx-grade stars="5" /></div>
|
|
259
|
-
<div class="test-bench"><h3>Without a grade</h3><pnx-grade /></div>
|
|
260
|
-
|
|
261
|
-
<h2 id="quality-score">Quality Score</h2>
|
|
262
|
-
<div class="test-bench"><h3>Classic no grade</h3><pnx-quality-score /></div>
|
|
263
|
-
<div class="test-bench"><h3>Classic 1/5</h3><pnx-quality-score grade="1" /></div>
|
|
264
|
-
<div class="test-bench"><h3>Classic 2/5</h3><pnx-quality-score grade="2" /></div>
|
|
265
|
-
<div class="test-bench"><h3>Classic 3/5</h3><pnx-quality-score grade="3" /></div>
|
|
266
|
-
<div class="test-bench"><h3>Classic 4/5</h3><pnx-quality-score grade="4" /></div>
|
|
267
|
-
<div class="test-bench"><h3>Classic 5/5</h3><pnx-quality-score grade="5" /></div>
|
|
268
|
-
<hr class="test-sep" />
|
|
269
|
-
<div class="test-bench"><h3>Input</h3><pnx-quality-score input="qs" /></div>
|
|
270
|
-
<div class="test-bench"><h3>Input 1/5</h3><pnx-quality-score input="qs" grade="1" /></div>
|
|
271
|
-
<div class="test-bench"><h3>Input 2/5</h3><pnx-quality-score input="qs" grade="2" /></div>
|
|
272
|
-
<div class="test-bench"><h3>Input 3/5</h3><pnx-quality-score input="qs" grade="3" /></div>
|
|
273
|
-
<div class="test-bench"><h3>Input 4/5</h3><pnx-quality-score input="qs" grade="4" /></div>
|
|
274
|
-
<div class="test-bench"><h3>Input 5/5</h3><pnx-quality-score input="qs" grade="5" /></div>
|
|
275
|
-
<div class="test-bench"><h3>Input many</h3><pnx-quality-score input="qs" grade="1,3,5" /></div>
|
|
276
|
-
|
|
277
|
-
<h2 id="search-bar">Search bar</h2>
|
|
278
|
-
<div class="test-bench"><h3>Simple</h3><pnx-search-bar placeholder="Start your search"></pnx-search-bar></div>
|
|
279
|
-
<div class="test-bench"><h3>With pre</h3><pnx-search-bar placeholder="Look for a place"><span slot="pre">🗺️</span></pnx-search-bar></div>
|
|
280
|
-
<div class="test-bench">
|
|
281
|
-
<h3>Reduced</h3>
|
|
282
|
-
<pnx-search-bar reduceable reduced placeholder="Look for a place"></pnx-search-bar>
|
|
283
|
-
</div>
|
|
284
|
-
<hr class="test-sep" />
|
|
285
|
-
<div class="test-bench"><h3>Size md full</h3><pnx-search-bar size="md" placeholder="Look for a place"><span slot="pre">🗺️</span></pnx-search-bar></div>
|
|
286
|
-
<div class="test-bench"><h3>Size md reduced</h3><pnx-search-bar size="md" reduceable reduced placeholder="Look for a place"></pnx-search-bar></div>
|
|
287
|
-
<div class="test-bench"><h3>Size xxl full</h3><pnx-search-bar size="xxl" placeholder="Look for a place"><span slot="pre">🗺️</span></pnx-search-bar></div>
|
|
288
|
-
<div class="test-bench"><h3>Size xxl reduced</h3><pnx-search-bar size="xxl" reduceable reduced placeholder="Look for a place"></pnx-search-bar></div>
|
|
289
|
-
|
|
290
|
-
<h2 id="progress-bar">Progress bar</h2>
|
|
291
|
-
<div class="test-bench"><h3>Half</h3><pnx-progress-bar value="42"></pnx-progress-bar></div>
|
|
292
|
-
<div class="test-bench"><h3>Indeterminate</h3><pnx-progress-bar></pnx-progress-bar></div>
|
|
293
|
-
<div class="test-bench"><h3>Full</h3><pnx-progress-bar value="100"></pnx-progress-bar></div>
|
|
294
|
-
|
|
295
|
-
<h2 id="tabs">Tabs</h2>
|
|
296
|
-
<div class="test-bench">
|
|
297
|
-
<h3>Many</h3>
|
|
298
|
-
<pnx-tabs>
|
|
299
|
-
<h4 slot="title">Tab 1</h4>
|
|
300
|
-
<div slot="content">Tab 1 content</div>
|
|
301
|
-
<h4 slot="title">Tab 2</h4>
|
|
302
|
-
<div slot="content">Tab 2 content</div>
|
|
303
|
-
<h4 slot="title">Tab 3</h4>
|
|
304
|
-
<div slot="content">Tab 3 content</div>
|
|
305
|
-
</pnx-tabs>
|
|
306
|
-
</div>
|
|
307
|
-
|
|
308
|
-
<h2 id="semantics-editor">Semantics editor</h2>
|
|
309
|
-
<script>
|
|
310
|
-
window.addEventListener("load", () => {
|
|
311
|
-
const semeditors = document.getElementsByTagName("pnx-semantics-editor");
|
|
312
|
-
for(let i=0; i < semeditors.length; i++) {
|
|
313
|
-
const semeditor = semeditors[i];
|
|
314
|
-
const div = semeditor.nextSibling;
|
|
315
|
-
semeditor.addEventListener("change", e => {
|
|
316
|
-
console.log("Semantics change > evt =", e.detail, "| attr =", semeditor.getAttribute("semantics"));
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
</script>
|
|
321
|
-
<div class="test-bench">
|
|
322
|
-
<h3>Empty</h3>
|
|
323
|
-
<pnx-semantics-editor _t='{"pnx": {"semantics_editor_error": "La syntaxe est invalide. Vos attributs doivent avoir cette forme:\nclé=valeur\npréfixe|clé=valeur\npréfixe|clé[qualif_clé=qualif_val]=valeur\n\nLongueur max des clés : 256 caractères, max des valeurs 2048 caractères.","semantics_editor_example": "clé=valeur\npréfixe|clé=valeur"}}'></pnx-semantics-editor>
|
|
324
|
-
</div>
|
|
325
|
-
<div class="test-bench">
|
|
326
|
-
<h3>Filled</h3>
|
|
327
|
-
<pnx-semantics-editor semantics="[{key: 'osm|traffic_sign', value: 'FR:A14b'}]"></pnx-semantics-editor>
|
|
328
|
-
</div>
|
|
329
|
-
<div class="test-bench">
|
|
330
|
-
<h3>Many rows</h3>
|
|
331
|
-
<pnx-semantics-editor rows="5" semantics="[{key: 'osm|traffic_sign', value: 'FR:A14b'}]"></pnx-semantics-editor>
|
|
332
|
-
</div>
|
|
333
|
-
<div class="test-bench">
|
|
334
|
-
<h3>Custom style</h3>
|
|
335
|
-
<style>#pnx-sem-ed3::part(text) { color: blue; }</style>
|
|
336
|
-
<pnx-semantics-editor id="pnx-sem-ed3" semantics="[{key: 'osm|traffic_sign', value: 'FR:A14b'}]"></pnx-semantics-editor>
|
|
337
|
-
</div>
|
|
338
|
-
|
|
339
|
-
<h2 id="switch">Switch</h2>
|
|
340
|
-
<div class="test-bench">
|
|
341
|
-
<h3>Classic</h3>
|
|
342
|
-
<pnx-switch name="sw1">Label text</pnx-switch>
|
|
343
|
-
</div>
|
|
344
|
-
<div class="test-bench">
|
|
345
|
-
<h3>Switched</h3>
|
|
346
|
-
<pnx-switch name="sw2" checked="true">Label text</pnx-switch>
|
|
347
|
-
</div>
|
|
348
|
-
<div class="test-bench">
|
|
349
|
-
<h3>Disabled</h3>
|
|
350
|
-
<pnx-switch name="sw3" disabled="true">Label text</pnx-switch>
|
|
351
|
-
</div>
|
|
352
|
-
<div class="test-bench">
|
|
353
|
-
<h3>Switched disabled</h3>
|
|
354
|
-
<pnx-switch name="sw4" checked="true" disabled="true">Label text</pnx-switch>
|
|
355
|
-
</div>
|
|
356
|
-
<div class="test-bench">
|
|
357
|
-
<h3>Icon switch</h3>
|
|
358
|
-
<pnx-icon-switch name="isw1">
|
|
359
|
-
<span slot="icon-left">⏪</span>
|
|
360
|
-
<span slot="label-left">Left</span>
|
|
361
|
-
<span slot="icon-right">⏩</span>
|
|
362
|
-
<span slot="label-right">Right</span>
|
|
363
|
-
</pnx-icon-switch>
|
|
364
|
-
</div>
|
|
365
|
-
</body>
|
|
366
|
-
</html>
|
package/scripts/build.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Do this as the first thing so that any code reading it knows the right env.
|
|
4
|
-
process.env.BABEL_ENV = 'production';
|
|
5
|
-
process.env.NODE_ENV = 'production';
|
|
6
|
-
|
|
7
|
-
// Makes the script crash on unhandled rejections instead of silently
|
|
8
|
-
// ignoring them. In the future, promise rejections that are not handled will
|
|
9
|
-
// terminate the Node.js process with a non-zero exit code.
|
|
10
|
-
process.on('unhandledRejection', err => {
|
|
11
|
-
throw err;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Ensure environment variables are read.
|
|
15
|
-
require('../config/env');
|
|
16
|
-
|
|
17
|
-
const path = require('path');
|
|
18
|
-
const chalk = require('react-dev-utils/chalk');
|
|
19
|
-
const fs = require('fs-extra');
|
|
20
|
-
const bfj = require('bfj');
|
|
21
|
-
const webpack = require('webpack');
|
|
22
|
-
const configFactory = require('../config/webpack.config');
|
|
23
|
-
const paths = require('../config/paths');
|
|
24
|
-
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
|
25
|
-
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
26
|
-
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
|
|
27
|
-
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
|
|
28
|
-
const printBuildError = require('react-dev-utils/printBuildError');
|
|
29
|
-
|
|
30
|
-
const measureFileSizesBeforeBuild =
|
|
31
|
-
FileSizeReporter.measureFileSizesBeforeBuild;
|
|
32
|
-
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
|
|
33
|
-
const useYarn = fs.existsSync(paths.yarnLockFile);
|
|
34
|
-
|
|
35
|
-
// These sizes are pretty large. We'll warn for bundles exceeding them.
|
|
36
|
-
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
|
|
37
|
-
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
|
|
38
|
-
|
|
39
|
-
const isInteractive = process.stdout.isTTY;
|
|
40
|
-
|
|
41
|
-
// Warn and crash if required files are missing
|
|
42
|
-
if (!checkRequiredFiles([paths.appHtml, paths.appHtmlMap])) {
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const argv = process.argv.slice(2);
|
|
47
|
-
const writeStatsJson = argv.indexOf('--stats') !== -1;
|
|
48
|
-
|
|
49
|
-
// Generate configuration
|
|
50
|
-
const config = configFactory('production');
|
|
51
|
-
|
|
52
|
-
// We require that you explicitly set browsers and do not fall back to
|
|
53
|
-
// browserslist defaults.
|
|
54
|
-
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
|
|
55
|
-
checkBrowsers(paths.appPath, isInteractive)
|
|
56
|
-
.then(() => {
|
|
57
|
-
// First, read the current file sizes in build directory.
|
|
58
|
-
// This lets us display how much they changed later.
|
|
59
|
-
return measureFileSizesBeforeBuild(paths.appBuild);
|
|
60
|
-
})
|
|
61
|
-
.then(previousFileSizes => {
|
|
62
|
-
// Remove all content but keep the directory so that
|
|
63
|
-
// if you're in it, you don't end up in Trash
|
|
64
|
-
fs.emptyDirSync(paths.appBuild);
|
|
65
|
-
// Merge with the public folder
|
|
66
|
-
//copyPublicFolder();
|
|
67
|
-
// Start the webpack build
|
|
68
|
-
return build(previousFileSizes);
|
|
69
|
-
})
|
|
70
|
-
.then(
|
|
71
|
-
({ stats, previousFileSizes, warnings }) => {
|
|
72
|
-
if (warnings.length) {
|
|
73
|
-
console.log(chalk.yellow('Compiled with warnings.\n'));
|
|
74
|
-
console.log(warnings.join('\n\n'));
|
|
75
|
-
console.log(
|
|
76
|
-
'\nSearch for the ' +
|
|
77
|
-
chalk.underline(chalk.yellow('keywords')) +
|
|
78
|
-
' to learn more about each warning.'
|
|
79
|
-
);
|
|
80
|
-
console.log(
|
|
81
|
-
'To ignore, add ' +
|
|
82
|
-
chalk.cyan('// eslint-disable-next-line') +
|
|
83
|
-
' to the line before.\n'
|
|
84
|
-
);
|
|
85
|
-
} else {
|
|
86
|
-
console.log(chalk.green('Compiled successfully.\n'));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
console.log('File sizes after gzip:\n');
|
|
90
|
-
printFileSizesAfterBuild(
|
|
91
|
-
stats,
|
|
92
|
-
previousFileSizes,
|
|
93
|
-
paths.appBuild,
|
|
94
|
-
WARN_AFTER_BUNDLE_GZIP_SIZE,
|
|
95
|
-
WARN_AFTER_CHUNK_GZIP_SIZE
|
|
96
|
-
);
|
|
97
|
-
console.log();
|
|
98
|
-
|
|
99
|
-
const appPackage = require(paths.appPackageJson);
|
|
100
|
-
const publicUrl = paths.publicUrlOrPath;
|
|
101
|
-
const publicPath = config.output.publicPath;
|
|
102
|
-
const buildFolder = path.relative(process.cwd(), paths.appBuild);
|
|
103
|
-
printHostingInstructions(
|
|
104
|
-
appPackage,
|
|
105
|
-
publicUrl,
|
|
106
|
-
publicPath,
|
|
107
|
-
buildFolder,
|
|
108
|
-
useYarn
|
|
109
|
-
);
|
|
110
|
-
},
|
|
111
|
-
err => {
|
|
112
|
-
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
|
|
113
|
-
if (tscCompileOnError) {
|
|
114
|
-
console.log(
|
|
115
|
-
chalk.yellow(
|
|
116
|
-
'Compiled with the following type errors (you may want to check these before deploying your app):\n'
|
|
117
|
-
)
|
|
118
|
-
);
|
|
119
|
-
printBuildError(err);
|
|
120
|
-
} else {
|
|
121
|
-
console.log(chalk.red('Failed to compile.\n'));
|
|
122
|
-
printBuildError(err);
|
|
123
|
-
process.exit(1);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
.catch(err => {
|
|
128
|
-
if (err && err.message) {
|
|
129
|
-
console.log(err.message);
|
|
130
|
-
}
|
|
131
|
-
process.exit(1);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// Create the production build and print the deployment instructions.
|
|
135
|
-
function build(previousFileSizes) {
|
|
136
|
-
console.log('Creating an optimized production build...');
|
|
137
|
-
|
|
138
|
-
const compiler = webpack(config);
|
|
139
|
-
return new Promise((resolve, reject) => {
|
|
140
|
-
compiler.run((err, stats) => {
|
|
141
|
-
let messages;
|
|
142
|
-
if (err) {
|
|
143
|
-
if (!err.message) {
|
|
144
|
-
return reject(err);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
let errMessage = err.message;
|
|
148
|
-
|
|
149
|
-
// Add additional information for postcss errors
|
|
150
|
-
if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
|
|
151
|
-
errMessage +=
|
|
152
|
-
'\nCompileError: Begins at CSS selector ' +
|
|
153
|
-
err['postcssNode'].selector;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
messages = formatWebpackMessages({
|
|
157
|
-
errors: [errMessage],
|
|
158
|
-
warnings: [],
|
|
159
|
-
});
|
|
160
|
-
} else {
|
|
161
|
-
messages = formatWebpackMessages(
|
|
162
|
-
stats.toJson({ all: false, warnings: true, errors: true })
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
if (messages.errors.length) {
|
|
166
|
-
// Only keep the first error. Others are often indicative
|
|
167
|
-
// of the same problem, but confuse the reader with noise.
|
|
168
|
-
if (messages.errors.length > 1) {
|
|
169
|
-
messages.errors.length = 1;
|
|
170
|
-
}
|
|
171
|
-
return reject(new Error(messages.errors.join('\n\n')));
|
|
172
|
-
}
|
|
173
|
-
if (
|
|
174
|
-
process.env.CI &&
|
|
175
|
-
(typeof process.env.CI !== 'string' ||
|
|
176
|
-
process.env.CI.toLowerCase() !== 'false') &&
|
|
177
|
-
messages.warnings.length
|
|
178
|
-
) {
|
|
179
|
-
// Ignore sourcemap warnings in CI builds. See #8227 for more info.
|
|
180
|
-
const filteredWarnings = messages.warnings.filter(
|
|
181
|
-
w => !/Failed to parse source map/.test(w)
|
|
182
|
-
);
|
|
183
|
-
if (filteredWarnings.length) {
|
|
184
|
-
console.log(
|
|
185
|
-
chalk.yellow(
|
|
186
|
-
'\nTreating warnings as errors because process.env.CI = true.\n' +
|
|
187
|
-
'Most CI servers set it automatically.\n'
|
|
188
|
-
)
|
|
189
|
-
);
|
|
190
|
-
return reject(new Error(filteredWarnings.join('\n\n')));
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
const resolveArgs = {
|
|
195
|
-
stats,
|
|
196
|
-
previousFileSizes,
|
|
197
|
-
warnings: messages.warnings,
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
if (writeStatsJson) {
|
|
201
|
-
return bfj
|
|
202
|
-
.write(paths.appBuild + '/bundle-stats.json', stats.toJson())
|
|
203
|
-
.then(() => resolve(resolveArgs))
|
|
204
|
-
.catch(error => reject(new Error(error)));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return resolve(resolveArgs);
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function copyPublicFolder() {
|
|
213
|
-
fs.copySync(paths.appPublic, paths.appBuild, {
|
|
214
|
-
dereference: true,
|
|
215
|
-
filter: file => ![paths.appHtml, paths.appHtmlMap].includes(file),
|
|
216
|
-
});
|
|
217
|
-
}
|
package/scripts/doc.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Widely based on https://github.com/jsdoc2md/jsdoc-to-markdown/wiki/How-to-create-one-output-file-per-class
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const jsdoc2md = require("jsdoc-to-markdown");
|
|
6
|
-
const fs = require("node:fs").promises;
|
|
7
|
-
const path = require("path");
|
|
8
|
-
|
|
9
|
-
const SRC_FOLDER = path.resolve(__dirname, "..", "src");
|
|
10
|
-
const OUTPUT_FOLDER = path.resolve(__dirname, "..", "docs", "reference");
|
|
11
|
-
const MD_LINK_RGX = /\[([^\]]+)\]\(#([^+)]+)\+?([^)]+)?\)/g;
|
|
12
|
-
|
|
13
|
-
// Remove all stuff in docs/reference/ folder
|
|
14
|
-
async function cleanupDocFolder(folder) {
|
|
15
|
-
await fs.rm(folder, {recursive: true, force: true});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Create subfolders in docs/reference/ to match JS files folder tree
|
|
19
|
-
async function createSubFolders(fullFolder) {
|
|
20
|
-
const relPath = path.relative(SRC_FOLDER, fullFolder);
|
|
21
|
-
const docPath = path.join(OUTPUT_FOLDER, relPath);
|
|
22
|
-
await fs.mkdir(docPath, {recursive: true});
|
|
23
|
-
return docPath;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Replace links in generated Markdown to go to relative file instead of same file
|
|
27
|
-
function cleanupMdLinks(clid, md) {
|
|
28
|
-
return md.replace(MD_LINK_RGX, (match, text, link, plus) => {
|
|
29
|
-
if(link == clid || link == `new_${clid}_new` || link.startsWith(clid+".")) { return match; }
|
|
30
|
-
|
|
31
|
-
const linkClassPath = link.split("+")[0].split(".").slice(1);
|
|
32
|
-
const currentClassPath = clid.split(".").slice(1);
|
|
33
|
-
const relPath = path.relative(
|
|
34
|
-
path.dirname(currentClassPath.join("/")+".md"),
|
|
35
|
-
linkClassPath.join("/")+".md"
|
|
36
|
-
);
|
|
37
|
-
return `[${text}](${relPath}/#${link}${plus ? "+"+plus : ""})`;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Create MD file for a single JS file
|
|
42
|
-
async function writeDocs(templateData) {
|
|
43
|
-
const classes = templateData.filter(i => i.kind === "class" && i.name !== "exports");
|
|
44
|
-
for(let cl of classes) {
|
|
45
|
-
console.log("Generating doc for", cl.name);
|
|
46
|
-
const docPath = await createSubFolders(cl.meta.path);
|
|
47
|
-
const template = `{{#class name="${cl.name}"}}{{>docs}}{{/class}}`;
|
|
48
|
-
let output = await jsdoc2md.render({ data: templateData, template: template });
|
|
49
|
-
output = cleanupMdLinks(cl.id, output);
|
|
50
|
-
if(!output.startsWith("ERROR")) {
|
|
51
|
-
await fs.writeFile(path.resolve(docPath, `${cl.name}.md`), output);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Recursive load of JS files
|
|
57
|
-
async function readSingleFolder(folder) {
|
|
58
|
-
console.log("Searching in folder", path.basename(folder));
|
|
59
|
-
let jsfiles = [];
|
|
60
|
-
const files = await fs.readdir(folder);
|
|
61
|
-
for(let file of files) {
|
|
62
|
-
const filepath = path.join(folder, file);
|
|
63
|
-
const stat = await fs.stat(filepath);
|
|
64
|
-
|
|
65
|
-
if(stat.isDirectory()) {
|
|
66
|
-
jsfiles = jsfiles.concat(await readSingleFolder(filepath));
|
|
67
|
-
}
|
|
68
|
-
else if(stat.isFile() && path.extname(filepath) === ".js") {
|
|
69
|
-
jsfiles.push(filepath);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return jsfiles;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Main code execution
|
|
76
|
-
cleanupDocFolder(OUTPUT_FOLDER)
|
|
77
|
-
.then(() => readSingleFolder(SRC_FOLDER))
|
|
78
|
-
.then(files => jsdoc2md.getTemplateData({ files }))
|
|
79
|
-
.then(writeDocs);
|