create-swdg-frontend 0.1.7 → 0.2.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/README.md +31 -13
- package/bin/index.js +3 -244
- package/lib/argv.js +43 -0
- package/lib/cli.js +141 -0
- package/lib/constants.js +24 -0
- package/lib/gis.js +92 -0
- package/lib/manifest.js +23 -0
- package/lib/prompts.js +55 -0
- package/lib/scaffold.js +118 -0
- package/package.json +6 -2
- package/scripts/sync-template.js +120 -0
- package/scripts/validate-template.mjs +74 -0
- package/stubs/tsconfig.node.json +11 -0
- package/stubs/types-env.d.ts +9 -0
- package/stubs/vite.config.ts +64 -0
- package/template/.env.example +6 -0
- package/template/.github/workflows/ci.yml +23 -0
- package/template/.github/workflows/release.yml +69 -0
- package/template/.stylelintrc.json +7 -1
- package/template/README.md +95 -32
- package/template/auto-imports.d.ts +10 -0
- package/template/docs/MAINTAINER.md +77 -0
- package/template/docs/ONBOARDING.md +284 -0
- package/template/docs/TESTING.md +104 -0
- package/template/package.json +48 -41
- package/template/pnpm-lock.yaml +6360 -0
- package/template/scripts/gen-api.cjs +20 -7
- package/template/scripts/release.mjs +22 -28
- package/template/scripts/set-release-version.mjs +46 -0
- package/template/scripts/test-pipeline.mjs +85 -0
- package/template/scripts/test-scaffold.mjs +197 -0
- package/template/scripts/test-template.mjs +52 -0
- package/template/scripts/verify.mjs +28 -0
- package/template/scripts/vite-plugin-cesium-dev.ts +56 -0
- package/template/src/api/README.md +4 -0
- package/template/src/components/Body/index.vue +65 -35
- package/template/src/components/CesiumViewer/index.vue +36 -0
- package/template/src/components/Header/index.vue +16 -5
- package/template/src/components/OnboardingDeck/index.vue +449 -0
- package/template/src/data/onboardingSlides.ts +208 -0
- package/template/src/main.ts +1 -0
- package/template/src/router/index.ts +20 -14
- package/template/src/router/routeUtils.ts +13 -0
- package/template/src/styles/shell.css +232 -0
- package/template/src/utils/axios-middleware.js +1 -1
- package/template/src/utils/cesium/index.ts +71 -0
- package/template/src/utils/composables/useFeatureGis.ts +24 -0
- package/template/src/views/examples/cesium/index.vue +85 -0
- package/template/src/views/examples/guide/index.vue +42 -0
- package/template/src/views/examples/test/index.vue +63 -0
- package/template/src/views/index.vue +2 -3
- package/template/tests/README.md +1 -0
- package/template/tests/unit/onboardingSlides.test.ts +20 -0
- package/template/tests/unit/router.utils.test.ts +21 -0
- package/template/tests/unit/scaffold.lib.test.ts +44 -0
- package/template/tests/unit/useFeatureGis.test.ts +14 -0
- package/template/tsconfig.json +17 -17
- package/template/tsconfig.node.json +1 -1
- package/template/types/env.d.ts +13 -0
- package/template/vite.config.ts +26 -5
- package/template/vitest.config.ts +13 -0
- package/template/.env +0 -1
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -438
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1012
- package/template/public/Cesium1.119/Assets/Images/bing_maps_credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Images/cesium_credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Images/google_earth_credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Images/ion-credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/airfield.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/airport.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/america-football.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/art-gallery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bakery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bank.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bar.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/baseball.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/basketball.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/beer.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bicycle.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/building.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bus.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cafe.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/camera.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/campsite.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/car.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cemetery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cesium.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/chemist.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cinema.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/circle-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/circle.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/city.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/clothing-store.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/college.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/commercial.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cricket.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cross.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/dam.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/danger.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/disability.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/dog-park.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/embassy.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/entrance.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/farm.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/fast-food.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/ferry.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/fire-station.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/fuel.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/garden.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/gift.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/golf.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/grocery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/hairdresser.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/harbor.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/heart.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/heliport.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/hospital.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/ice-cream.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/industrial.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/land-use.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/laundry.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/library.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/lighthouse.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/lodging.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/logging.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/london-underground.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/marker-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/marker.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/minefield.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/mobilephone.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/monument.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/museum.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/music.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/oil-well.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/park.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/park2.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/parking-garage.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/parking.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/pharmacy.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/pitch.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/place-of-worship.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/playground.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/police.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/polling-place.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/post.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/prison.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-above.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-light.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-metro.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-underground.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/religious-christian.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/religious-jewish.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/religious-muslim.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/restaurant.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/roadblock.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rocket.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/school.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/scooter.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/shop.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/skiing.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/soccer.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/square-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/square.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/star-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/star.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/suitcase.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/swimming.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/telephone.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/tennis.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/theatre.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/toilets.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/town-hall.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/town.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/triangle.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/village.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/warehouse.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/waste-basket.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/water.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/wetland.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/zoo.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/moonSmall.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/pin.svg +0 -1
- package/template/public/Cesium1.119/Assets/Textures/waterNormals.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/template/public/Cesium1.119/Assets/approximateTerrainHeights.json +0 -10924
- package/template/public/Cesium1.119/Cesium.js +0 -185772
- package/template/public/Cesium1.119/ThirdParty/Workers/package.json +0 -3
- package/template/public/Cesium1.119/ThirdParty/Workers/pako_deflate.min.js +0 -1681
- package/template/public/Cesium1.119/ThirdParty/Workers/pako_inflate.min.js +0 -1489
- package/template/public/Cesium1.119/ThirdParty/Workers/z-worker-pako.js +0 -1070
- package/template/public/Cesium1.119/ThirdParty/basis_transcoder.wasm +0 -0
- package/template/public/Cesium1.119/ThirdParty/draco_decoder.wasm +0 -0
- package/template/public/Cesium1.119/ThirdParty/google-earth-dbroot-parser.js +0 -11424
- package/template/public/Cesium1.119/Widgets/Animation/Animation.css +0 -127
- package/template/public/Cesium1.119/Widgets/Animation/lighter.css +0 -78
- package/template/public/Cesium1.119/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -112
- package/template/public/Cesium1.119/Widgets/BaseLayerPicker/lighter.css +0 -28
- package/template/public/Cesium1.119/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -104
- package/template/public/Cesium1.119/Widgets/CesiumInspector/CesiumInspector.css +0 -115
- package/template/public/Cesium1.119/Widgets/CesiumWidget/CesiumWidget.css +0 -119
- package/template/public/Cesium1.119/Widgets/CesiumWidget/lighter.css +0 -14
- package/template/public/Cesium1.119/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/template/public/Cesium1.119/Widgets/Geocoder/Geocoder.css +0 -72
- package/template/public/Cesium1.119/Widgets/Geocoder/lighter.css +0 -17
- package/template/public/Cesium1.119/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/template/public/Cesium1.119/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/TimelineIcons.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/info-loading.gif +0 -0
- package/template/public/Cesium1.119/Widgets/InfoBox/InfoBox.css +0 -94
- package/template/public/Cesium1.119/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/template/public/Cesium1.119/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -95
- package/template/public/Cesium1.119/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/template/public/Cesium1.119/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/template/public/Cesium1.119/Widgets/ProjectionPicker/ProjectionPicker.css +0 -46
- package/template/public/Cesium1.119/Widgets/SceneModePicker/SceneModePicker.css +0 -72
- package/template/public/Cesium1.119/Widgets/SelectionIndicator/SelectionIndicator.css +0 -22
- package/template/public/Cesium1.119/Widgets/Timeline/Timeline.css +0 -103
- package/template/public/Cesium1.119/Widgets/Timeline/lighter.css +0 -18
- package/template/public/Cesium1.119/Widgets/VRButton/VRButton.css +0 -8
- package/template/public/Cesium1.119/Widgets/Viewer/Viewer.css +0 -107
- package/template/public/Cesium1.119/Widgets/VoxelInspector/VoxelInspector.css +0 -18
- package/template/public/Cesium1.119/Widgets/lighter.css +0 -246
- package/template/public/Cesium1.119/Widgets/lighterShared.css +0 -46
- package/template/public/Cesium1.119/Widgets/shared.css +0 -103
- package/template/public/Cesium1.119/Widgets/widgets.css +0 -1376
- package/template/public/Cesium1.119/Workers/chunk-3C7WC463.js +0 -611
- package/template/public/Cesium1.119/Workers/chunk-3JW36LZF.js +0 -166
- package/template/public/Cesium1.119/Workers/chunk-4BTGX3WJ.js +0 -264
- package/template/public/Cesium1.119/Workers/chunk-4WRMLZA7.js +0 -128
- package/template/public/Cesium1.119/Workers/chunk-7Z5IIKOJ.js +0 -8046
- package/template/public/Cesium1.119/Workers/chunk-ABGXSJNX.js +0 -341
- package/template/public/Cesium1.119/Workers/chunk-AMQUWUD4.js +0 -269
- package/template/public/Cesium1.119/Workers/chunk-ATPDRNKI.js +0 -28
- package/template/public/Cesium1.119/Workers/chunk-BMHPVZ4H.js +0 -199
- package/template/public/Cesium1.119/Workers/chunk-CBEO3SHS.js +0 -1102
- package/template/public/Cesium1.119/Workers/chunk-CV7DLCWG.js +0 -485
- package/template/public/Cesium1.119/Workers/chunk-DQO6B4EQ.js +0 -76
- package/template/public/Cesium1.119/Workers/chunk-ED3TLP6D.js +0 -91
- package/template/public/Cesium1.119/Workers/chunk-EFZKO5RU.js +0 -42
- package/template/public/Cesium1.119/Workers/chunk-F5IHREXR.js +0 -2678
- package/template/public/Cesium1.119/Workers/chunk-FKRG4HDY.js +0 -516
- package/template/public/Cesium1.119/Workers/chunk-FYOYUPXG.js +0 -399
- package/template/public/Cesium1.119/Workers/chunk-GFN7NNSJ.js +0 -65
- package/template/public/Cesium1.119/Workers/chunk-HEEMUCG6.js +0 -92
- package/template/public/Cesium1.119/Workers/chunk-HSWA4OEL.js +0 -672
- package/template/public/Cesium1.119/Workers/chunk-IAC5XVZV.js +0 -287
- package/template/public/Cesium1.119/Workers/chunk-II4VNKYR.js +0 -50
- package/template/public/Cesium1.119/Workers/chunk-ILGBPNP6.js +0 -28
- package/template/public/Cesium1.119/Workers/chunk-IRH46BDL.js +0 -124
- package/template/public/Cesium1.119/Workers/chunk-IUA6FAOZ.js +0 -31
- package/template/public/Cesium1.119/Workers/chunk-K4ASOM65.js +0 -331
- package/template/public/Cesium1.119/Workers/chunk-KCIZBVXL.js +0 -258
- package/template/public/Cesium1.119/Workers/chunk-KF5NF354.js +0 -162
- package/template/public/Cesium1.119/Workers/chunk-KRKI6AAO.js +0 -773
- package/template/public/Cesium1.119/Workers/chunk-KZNJOCYU.js +0 -162
- package/template/public/Cesium1.119/Workers/chunk-O5IJ3OGP.js +0 -857
- package/template/public/Cesium1.119/Workers/chunk-OO23RBLX.js +0 -183
- package/template/public/Cesium1.119/Workers/chunk-P37AI2DW.js +0 -85
- package/template/public/Cesium1.119/Workers/chunk-PDMQLSBL.js +0 -108
- package/template/public/Cesium1.119/Workers/chunk-PEYJTJPE.js +0 -73
- package/template/public/Cesium1.119/Workers/chunk-POASMU2N.js +0 -2372
- package/template/public/Cesium1.119/Workers/chunk-PXCJYT2S.js +0 -73
- package/template/public/Cesium1.119/Workers/chunk-Q6L7X3LP.js +0 -538
- package/template/public/Cesium1.119/Workers/chunk-QB3MDM4J.js +0 -1670
- package/template/public/Cesium1.119/Workers/chunk-R6KGAEF6.js +0 -392
- package/template/public/Cesium1.119/Workers/chunk-RXTBM4OI.js +0 -57
- package/template/public/Cesium1.119/Workers/chunk-SB224QGV.js +0 -72
- package/template/public/Cesium1.119/Workers/chunk-T6BE4RZK.js +0 -37
- package/template/public/Cesium1.119/Workers/chunk-TAMCUKAR.js +0 -814
- package/template/public/Cesium1.119/Workers/chunk-TMSETF7M.js +0 -579
- package/template/public/Cesium1.119/Workers/chunk-TOGHF3VN.js +0 -376
- package/template/public/Cesium1.119/Workers/chunk-UH2WFNTA.js +0 -111
- package/template/public/Cesium1.119/Workers/chunk-V7JEDBOE.js +0 -573
- package/template/public/Cesium1.119/Workers/chunk-VBIROZR5.js +0 -633
- package/template/public/Cesium1.119/Workers/chunk-W23CU777.js +0 -271
- package/template/public/Cesium1.119/Workers/chunk-X5IHHI6X.js +0 -173
- package/template/public/Cesium1.119/Workers/chunk-XHX2UPDO.js +0 -217
- package/template/public/Cesium1.119/Workers/combineGeometry.js +0 -53
- package/template/public/Cesium1.119/Workers/createBoxGeometry.js +0 -45
- package/template/public/Cesium1.119/Workers/createBoxOutlineGeometry.js +0 -189
- package/template/public/Cesium1.119/Workers/createCircleGeometry.js +0 -148
- package/template/public/Cesium1.119/Workers/createCircleOutlineGeometry.js +0 -105
- package/template/public/Cesium1.119/Workers/createCoplanarPolygonGeometry.js +0 -293
- package/template/public/Cesium1.119/Workers/createCoplanarPolygonOutlineGeometry.js +0 -143
- package/template/public/Cesium1.119/Workers/createCorridorGeometry.js +0 -830
- package/template/public/Cesium1.119/Workers/createCorridorOutlineGeometry.js +0 -417
- package/template/public/Cesium1.119/Workers/createCylinderGeometry.js +0 -47
- package/template/public/Cesium1.119/Workers/createCylinderOutlineGeometry.js +0 -170
- package/template/public/Cesium1.119/Workers/createEllipseGeometry.js +0 -58
- package/template/public/Cesium1.119/Workers/createEllipseOutlineGeometry.js +0 -51
- package/template/public/Cesium1.119/Workers/createEllipsoidGeometry.js +0 -46
- package/template/public/Cesium1.119/Workers/createEllipsoidOutlineGeometry.js +0 -45
- package/template/public/Cesium1.119/Workers/createFrustumGeometry.js +0 -45
- package/template/public/Cesium1.119/Workers/createFrustumOutlineGeometry.js +0 -164
- package/template/public/Cesium1.119/Workers/createGeometry.js +0 -159
- package/template/public/Cesium1.119/Workers/createGroundPolylineGeometry.js +0 -911
- package/template/public/Cesium1.119/Workers/createPlaneGeometry.js +0 -185
- package/template/public/Cesium1.119/Workers/createPlaneOutlineGeometry.js +0 -93
- package/template/public/Cesium1.119/Workers/createPolygonGeometry.js +0 -884
- package/template/public/Cesium1.119/Workers/createPolygonOutlineGeometry.js +0 -359
- package/template/public/Cesium1.119/Workers/createPolylineGeometry.js +0 -349
- package/template/public/Cesium1.119/Workers/createPolylineVolumeGeometry.js +0 -262
- package/template/public/Cesium1.119/Workers/createPolylineVolumeOutlineGeometry.js +0 -177
- package/template/public/Cesium1.119/Workers/createRectangleGeometry.js +0 -787
- package/template/public/Cesium1.119/Workers/createRectangleOutlineGeometry.js +0 -299
- package/template/public/Cesium1.119/Workers/createSimplePolylineGeometry.js +0 -294
- package/template/public/Cesium1.119/Workers/createSphereGeometry.js +0 -84
- package/template/public/Cesium1.119/Workers/createSphereOutlineGeometry.js +0 -83
- package/template/public/Cesium1.119/Workers/createTaskProcessorWorker.js +0 -28
- package/template/public/Cesium1.119/Workers/createVectorTileClampedPolylines.js +0 -289
- package/template/public/Cesium1.119/Workers/createVectorTileGeometries.js +0 -258
- package/template/public/Cesium1.119/Workers/createVectorTilePoints.js +0 -79
- package/template/public/Cesium1.119/Workers/createVectorTilePolygons.js +0 -275
- package/template/public/Cesium1.119/Workers/createVectorTilePolylines.js +0 -176
- package/template/public/Cesium1.119/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -375
- package/template/public/Cesium1.119/Workers/createVerticesFromHeightmap.js +0 -1772
- package/template/public/Cesium1.119/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -425
- package/template/public/Cesium1.119/Workers/createWallGeometry.js +0 -320
- package/template/public/Cesium1.119/Workers/createWallOutlineGeometry.js +0 -229
- package/template/public/Cesium1.119/Workers/decodeDraco.js +0 -227
- package/template/public/Cesium1.119/Workers/decodeGoogleEarthEnterprisePacket.js +0 -1836
- package/template/public/Cesium1.119/Workers/decodeI3S.js +0 -924
- package/template/public/Cesium1.119/Workers/transcodeKTX2.js +0 -3180
- package/template/public/Cesium1.119/Workers/transferTypedArrayTest.js +0 -34
- package/template/public/Cesium1.119/Workers/upsampleQuantizedTerrainMesh.js +0 -534
- package/template/public/Cesium1.119/index.cjs +0 -185632
- package/template/public/Cesium1.119/index.js +0 -182874
- package/template/src/views/Test/index.vue +0 -56
- package/template/tests/unit/example.test.ts +0 -7
|
@@ -1,50 +1,80 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<main class="shell-main">
|
|
3
|
+
<OnboardingDeck />
|
|
4
|
+
|
|
5
|
+
<section v-if="showDevLinks" class="shell-examples">
|
|
6
|
+
<h3 class="shell-examples__title">开发示例</h3>
|
|
7
|
+
<div class="shell-grid">
|
|
8
|
+
<router-link class="shell-card" to="/examples/guide">
|
|
9
|
+
<span class="shell-card__icon">📖</span>
|
|
10
|
+
<h3 class="shell-card__title">全屏阅读指南</h3>
|
|
11
|
+
<p class="shell-card__desc">PPT 式翻页,适合 onboarding 演示。</p>
|
|
12
|
+
<span class="shell-card__arrow">全屏打开 →</span>
|
|
13
|
+
</router-link>
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
<router-link class="shell-card" to="/examples/test">
|
|
16
|
+
<span class="shell-card__icon">🧪</span>
|
|
17
|
+
<h3 class="shell-card__title">Store / Alert</h3>
|
|
18
|
+
<p class="shell-card__desc">Pinia 计数、全局 Alert、路由返回首页。</p>
|
|
19
|
+
<span class="shell-card__arrow">打开示例 →</span>
|
|
20
|
+
</router-link>
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
<router-link v-if="hasGis" class="shell-card" to="/examples/cesium">
|
|
23
|
+
<span class="shell-card__icon">🌍</span>
|
|
24
|
+
<h3 class="shell-card__title">Cesium 三维地图</h3>
|
|
25
|
+
<p class="shell-card__desc">
|
|
26
|
+
OpenStreetMap 底图,npm 集成 Workers / Assets。
|
|
27
|
+
</p>
|
|
28
|
+
<span class="shell-card__arrow">打开地图 →</span>
|
|
29
|
+
</router-link>
|
|
30
|
+
|
|
31
|
+
<div v-else class="shell-card shell-card--disabled">
|
|
32
|
+
<span class="shell-card__icon">🌍</span>
|
|
33
|
+
<h3 class="shell-card__title">Cesium(未启用)</h3>
|
|
34
|
+
<p class="shell-card__desc">
|
|
35
|
+
在 <code>.env</code> 设置 <code>VITE_FEATURE_GIS=true</code> 后重启
|
|
36
|
+
dev。
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</section>
|
|
41
|
+
</main>
|
|
42
|
+
</template>
|
|
16
43
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import OnboardingDeck from '@components/OnboardingDeck/index.vue';
|
|
46
|
+
import { useFeatureGis } from '@composables/useFeatureGis';
|
|
47
|
+
|
|
48
|
+
const showDevLinks = import.meta.env.DEV;
|
|
49
|
+
const { hasGis } = useFeatureGis();
|
|
20
50
|
</script>
|
|
21
51
|
|
|
22
52
|
<style scoped>
|
|
23
|
-
|
|
24
|
-
margin-top:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
.shell-examples {
|
|
54
|
+
margin-top: 28px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.shell-examples__title {
|
|
58
|
+
margin: 0 0 14px;
|
|
59
|
+
font-size: 15px;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
color: #94a3b8;
|
|
31
62
|
}
|
|
32
63
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
border:
|
|
38
|
-
background-color: #f0f0f0;
|
|
39
|
-
color: #333;
|
|
40
|
-
cursor: pointer;
|
|
64
|
+
.shell-card--disabled {
|
|
65
|
+
opacity: 0.72;
|
|
66
|
+
cursor: default;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
border-style: dashed;
|
|
41
69
|
}
|
|
42
70
|
|
|
43
|
-
|
|
44
|
-
|
|
71
|
+
.shell-card--disabled:hover {
|
|
72
|
+
transform: none;
|
|
73
|
+
box-shadow: var(--shell-shadow);
|
|
74
|
+
border-color: var(--shell-border);
|
|
45
75
|
}
|
|
46
76
|
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
.shell-card--disabled code {
|
|
78
|
+
font-size: 12px;
|
|
49
79
|
}
|
|
50
80
|
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="containerRef" class="cesium-viewer-host" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { onBeforeUnmount, onMounted, ref, shallowRef } from 'vue';
|
|
7
|
+
import type { Viewer } from 'cesium';
|
|
8
|
+
import { createViewer, destroyViewer } from '@utils/cesium';
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
options?: Viewer.ConstructorOptions;
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const containerRef = ref<HTMLDivElement | null>(null);
|
|
15
|
+
const viewer = shallowRef<Viewer | null>(null);
|
|
16
|
+
|
|
17
|
+
onMounted(() => {
|
|
18
|
+
if (!containerRef.value) return;
|
|
19
|
+
viewer.value = createViewer(containerRef.value, props.options);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
onBeforeUnmount(() => {
|
|
23
|
+
destroyViewer(viewer.value);
|
|
24
|
+
viewer.value = null;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
defineExpose({ viewer });
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
.cesium-viewer-host {
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
min-height: 320px;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
2
|
+
<header class="shell-header">
|
|
3
|
+
<div class="shell-header__brand">
|
|
4
|
+
<h1 class="shell-header__title">SWDG 前端模板</h1>
|
|
5
|
+
<span class="shell-header__tag">Vue 3 · Vite · TypeScript</span>
|
|
6
|
+
</div>
|
|
7
|
+
<router-link v-if="showHomeLink" class="shell-btn shell-btn--ghost" to="/">
|
|
8
|
+
首页
|
|
9
|
+
</router-link>
|
|
10
|
+
</header>
|
|
5
11
|
</template>
|
|
6
|
-
<script setup lang="ts"></script>
|
|
7
12
|
|
|
8
|
-
<
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import { computed } from 'vue';
|
|
15
|
+
import { useRoute } from 'vue-router';
|
|
16
|
+
|
|
17
|
+
const route = useRoute();
|
|
18
|
+
const showHomeLink = computed(() => route.path !== '/' && route.path !== '');
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
ref="deckRef"
|
|
4
|
+
class="onboarding-deck"
|
|
5
|
+
:class="{ 'onboarding-deck--fullscreen': fullscreen }"
|
|
6
|
+
tabindex="0"
|
|
7
|
+
@keydown="onKeydown"
|
|
8
|
+
>
|
|
9
|
+
<header v-if="showHeader" class="onboarding-deck__header">
|
|
10
|
+
<div>
|
|
11
|
+
<span class="shell-badge">使用指南</span>
|
|
12
|
+
<p class="onboarding-deck__progress-text">
|
|
13
|
+
第 {{ current + 1 }} / {{ total }} 页 · 方向键翻页
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
<button
|
|
17
|
+
v-if="fullscreen"
|
|
18
|
+
type="button"
|
|
19
|
+
class="shell-btn shell-btn--ghost onboarding-deck__exit"
|
|
20
|
+
@click="goHome"
|
|
21
|
+
>
|
|
22
|
+
退出全屏
|
|
23
|
+
</button>
|
|
24
|
+
</header>
|
|
25
|
+
|
|
26
|
+
<div :key="currentSlide.id" class="onboarding-deck__stage">
|
|
27
|
+
<article class="onboarding-slide">
|
|
28
|
+
<p v-if="currentSlide.tagline" class="onboarding-slide__tagline">
|
|
29
|
+
{{ currentSlide.tagline }}
|
|
30
|
+
</p>
|
|
31
|
+
<h2 class="onboarding-slide__title">{{ currentSlide.title }}</h2>
|
|
32
|
+
|
|
33
|
+
<div class="onboarding-slide__body">
|
|
34
|
+
<template v-for="(block, index) in currentSlide.blocks" :key="index">
|
|
35
|
+
<p v-if="block.type === 'p'" class="onboarding-slide__p">
|
|
36
|
+
{{ block.text }}
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<ul v-else-if="block.type === 'ul'" class="onboarding-slide__ul">
|
|
40
|
+
<li v-for="(item, i) in block.items" :key="i">{{ item }}</li>
|
|
41
|
+
</ul>
|
|
42
|
+
|
|
43
|
+
<pre
|
|
44
|
+
v-else-if="block.type === 'code'"
|
|
45
|
+
class="onboarding-slide__code"
|
|
46
|
+
><code>{{ block.text }}</code></pre>
|
|
47
|
+
|
|
48
|
+
<div
|
|
49
|
+
v-else-if="block.type === 'table'"
|
|
50
|
+
class="onboarding-slide__table-wrap"
|
|
51
|
+
>
|
|
52
|
+
<table class="onboarding-slide__table">
|
|
53
|
+
<thead>
|
|
54
|
+
<tr>
|
|
55
|
+
<th v-for="(h, hi) in block.headers" :key="hi">{{ h }}</th>
|
|
56
|
+
</tr>
|
|
57
|
+
</thead>
|
|
58
|
+
<tbody>
|
|
59
|
+
<tr v-for="(row, ri) in block.rows" :key="ri">
|
|
60
|
+
<td v-for="(cell, ci) in row" :key="ci">{{ cell }}</td>
|
|
61
|
+
</tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div
|
|
67
|
+
v-else-if="block.type === 'links'"
|
|
68
|
+
class="onboarding-slide__links"
|
|
69
|
+
>
|
|
70
|
+
<router-link
|
|
71
|
+
v-for="(link, li) in block.items"
|
|
72
|
+
:key="li"
|
|
73
|
+
class="onboarding-slide__link"
|
|
74
|
+
:to="link.to"
|
|
75
|
+
>
|
|
76
|
+
{{ link.label }}
|
|
77
|
+
</router-link>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
</div>
|
|
81
|
+
</article>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<footer class="onboarding-deck__footer">
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
class="shell-btn shell-btn--ghost onboarding-deck__nav-btn"
|
|
88
|
+
:disabled="current === 0"
|
|
89
|
+
aria-label="上一页"
|
|
90
|
+
@click="prev"
|
|
91
|
+
>
|
|
92
|
+
← 上一页
|
|
93
|
+
</button>
|
|
94
|
+
|
|
95
|
+
<div class="onboarding-deck__dots" role="tablist">
|
|
96
|
+
<button
|
|
97
|
+
v-for="(slide, index) in slides"
|
|
98
|
+
:key="slide.id"
|
|
99
|
+
type="button"
|
|
100
|
+
class="onboarding-deck__dot"
|
|
101
|
+
:class="{ 'onboarding-deck__dot--active': index === current }"
|
|
102
|
+
:aria-label="`第 ${index + 1} 页`"
|
|
103
|
+
:aria-selected="index === current"
|
|
104
|
+
@click="goTo(index)"
|
|
105
|
+
/>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<button
|
|
109
|
+
v-if="current < total - 1"
|
|
110
|
+
type="button"
|
|
111
|
+
class="shell-btn shell-btn--primary onboarding-deck__nav-btn"
|
|
112
|
+
@click="next"
|
|
113
|
+
>
|
|
114
|
+
下一页 →
|
|
115
|
+
</button>
|
|
116
|
+
<router-link
|
|
117
|
+
v-else
|
|
118
|
+
class="shell-btn shell-btn--primary onboarding-deck__nav-btn onboarding-deck__nav-btn--link"
|
|
119
|
+
to="/"
|
|
120
|
+
>
|
|
121
|
+
完成
|
|
122
|
+
</router-link>
|
|
123
|
+
</footer>
|
|
124
|
+
</section>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<script setup lang="ts">
|
|
128
|
+
import { computed, onMounted, ref, watch } from 'vue';
|
|
129
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
130
|
+
import {
|
|
131
|
+
onboardingSlides,
|
|
132
|
+
type OnboardingSlide,
|
|
133
|
+
} from '@/data/onboardingSlides';
|
|
134
|
+
|
|
135
|
+
const props = withDefaults(
|
|
136
|
+
defineProps<{
|
|
137
|
+
slides?: OnboardingSlide[];
|
|
138
|
+
fullscreen?: boolean;
|
|
139
|
+
showHeader?: boolean;
|
|
140
|
+
initialSlide?: number;
|
|
141
|
+
}>(),
|
|
142
|
+
{
|
|
143
|
+
slides: () => onboardingSlides,
|
|
144
|
+
fullscreen: false,
|
|
145
|
+
showHeader: true,
|
|
146
|
+
initialSlide: 0,
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
const route = useRoute();
|
|
151
|
+
const router = useRouter();
|
|
152
|
+
const deckRef = ref<HTMLElement | null>(null);
|
|
153
|
+
const current = ref(Math.min(props.initialSlide, props.slides.length - 1));
|
|
154
|
+
|
|
155
|
+
const total = computed(() => props.slides.length);
|
|
156
|
+
const currentSlide = computed(
|
|
157
|
+
() => props.slides[current.value] ?? props.slides[0]
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
function syncFromQuery() {
|
|
161
|
+
const raw = route.query.slide;
|
|
162
|
+
const n = typeof raw === 'string' ? parseInt(raw, 10) : NaN;
|
|
163
|
+
if (!Number.isNaN(n) && n >= 0 && n < props.slides.length) {
|
|
164
|
+
current.value = n;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function updateQuery() {
|
|
169
|
+
if (!props.fullscreen) return;
|
|
170
|
+
const slide = String(current.value);
|
|
171
|
+
if (route.query.slide !== slide) {
|
|
172
|
+
router.replace({ query: { ...route.query, slide } });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function prev() {
|
|
177
|
+
if (current.value > 0) current.value -= 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function next() {
|
|
181
|
+
if (current.value < total.value - 1) current.value += 1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function goTo(index: number) {
|
|
185
|
+
current.value = index;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function goHome() {
|
|
189
|
+
router.push('/');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function onKeydown(e: KeyboardEvent) {
|
|
193
|
+
if (e.key === 'ArrowLeft' || e.key === 'PageUp') {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
prev();
|
|
196
|
+
} else if (e.key === 'ArrowRight' || e.key === 'PageDown' || e.key === ' ') {
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
next();
|
|
199
|
+
} else if (e.key === 'Home') {
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
goTo(0);
|
|
202
|
+
} else if (e.key === 'End') {
|
|
203
|
+
e.preventDefault();
|
|
204
|
+
goTo(total.value - 1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
watch(current, updateQuery);
|
|
209
|
+
|
|
210
|
+
onMounted(() => {
|
|
211
|
+
syncFromQuery();
|
|
212
|
+
updateQuery();
|
|
213
|
+
deckRef.value?.focus();
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
watch(
|
|
217
|
+
() => route.query.slide,
|
|
218
|
+
() => syncFromQuery()
|
|
219
|
+
);
|
|
220
|
+
</script>
|
|
221
|
+
|
|
222
|
+
<style scoped>
|
|
223
|
+
.onboarding-deck {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
gap: 16px;
|
|
227
|
+
outline: none;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.onboarding-deck--fullscreen {
|
|
231
|
+
min-height: calc(100vh - 52px);
|
|
232
|
+
padding: 24px;
|
|
233
|
+
background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.onboarding-deck__header {
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: flex-start;
|
|
239
|
+
justify-content: space-between;
|
|
240
|
+
gap: 12px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.onboarding-deck__progress-text {
|
|
244
|
+
margin: 8px 0 0;
|
|
245
|
+
font-size: 13px;
|
|
246
|
+
color: var(--shell-muted);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.onboarding-deck__exit {
|
|
250
|
+
background: #f1f5f9 !important;
|
|
251
|
+
color: var(--shell-text) !important;
|
|
252
|
+
flex-shrink: 0;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.onboarding-deck__stage {
|
|
256
|
+
flex: 1;
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: stretch;
|
|
259
|
+
min-height: 320px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.onboarding-deck--fullscreen .onboarding-deck__stage {
|
|
263
|
+
min-height: min(520px, calc(100vh - 200px));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.onboarding-slide {
|
|
267
|
+
flex: 1;
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: column;
|
|
270
|
+
padding: 28px 32px;
|
|
271
|
+
border-radius: var(--shell-radius);
|
|
272
|
+
background: var(--shell-surface);
|
|
273
|
+
box-shadow: var(--shell-shadow);
|
|
274
|
+
animation: slide-in 0.28s ease-out;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes slide-in {
|
|
278
|
+
from {
|
|
279
|
+
opacity: 0;
|
|
280
|
+
transform: translateX(12px);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
to {
|
|
284
|
+
opacity: 1;
|
|
285
|
+
transform: translateX(0);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.onboarding-slide__tagline {
|
|
290
|
+
margin: 0 0 4px;
|
|
291
|
+
font-size: 13px;
|
|
292
|
+
font-weight: 600;
|
|
293
|
+
color: var(--shell-accent);
|
|
294
|
+
text-transform: uppercase;
|
|
295
|
+
letter-spacing: 0.06em;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.onboarding-slide__title {
|
|
299
|
+
margin: 0 0 20px;
|
|
300
|
+
font-size: clamp(22px, 4vw, 32px);
|
|
301
|
+
font-weight: 700;
|
|
302
|
+
color: var(--shell-text);
|
|
303
|
+
line-height: 1.2;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.onboarding-slide__body {
|
|
307
|
+
flex: 1;
|
|
308
|
+
display: flex;
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
gap: 14px;
|
|
311
|
+
overflow: auto;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.onboarding-slide__p {
|
|
315
|
+
margin: 0;
|
|
316
|
+
line-height: 1.65;
|
|
317
|
+
color: #334155;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.onboarding-slide__ul {
|
|
321
|
+
margin: 0;
|
|
322
|
+
padding-left: 1.25rem;
|
|
323
|
+
line-height: 1.75;
|
|
324
|
+
color: #334155;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.onboarding-slide__code {
|
|
328
|
+
margin: 0;
|
|
329
|
+
padding: 16px 18px;
|
|
330
|
+
border-radius: 10px;
|
|
331
|
+
background: #0f172a;
|
|
332
|
+
color: #e2e8f0;
|
|
333
|
+
font-size: 13px;
|
|
334
|
+
line-height: 1.55;
|
|
335
|
+
overflow-x: auto;
|
|
336
|
+
white-space: pre-wrap;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.onboarding-slide__table-wrap {
|
|
340
|
+
overflow-x: auto;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.onboarding-slide__table {
|
|
344
|
+
width: 100%;
|
|
345
|
+
border-collapse: collapse;
|
|
346
|
+
font-size: 14px;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.onboarding-slide__table th,
|
|
350
|
+
.onboarding-slide__table td {
|
|
351
|
+
padding: 10px 12px;
|
|
352
|
+
text-align: left;
|
|
353
|
+
border-bottom: 1px solid var(--shell-border);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.onboarding-slide__table th {
|
|
357
|
+
font-weight: 600;
|
|
358
|
+
color: var(--shell-muted);
|
|
359
|
+
background: #f8fafc;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.onboarding-slide__table td:first-child {
|
|
363
|
+
font-family: ui-monospace, monospace;
|
|
364
|
+
font-size: 13px;
|
|
365
|
+
color: #0f172a;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.onboarding-slide__links {
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-wrap: wrap;
|
|
371
|
+
gap: 12px;
|
|
372
|
+
margin-top: 4px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.onboarding-slide__link {
|
|
376
|
+
font-weight: 500;
|
|
377
|
+
color: var(--shell-accent);
|
|
378
|
+
text-decoration: none;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.onboarding-slide__link:hover {
|
|
382
|
+
text-decoration: underline;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.onboarding-deck__footer {
|
|
386
|
+
display: flex;
|
|
387
|
+
align-items: center;
|
|
388
|
+
justify-content: space-between;
|
|
389
|
+
gap: 12px;
|
|
390
|
+
flex-wrap: wrap;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.onboarding-deck__nav-btn {
|
|
394
|
+
min-width: 108px;
|
|
395
|
+
justify-content: center;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.onboarding-deck__nav-btn--link {
|
|
399
|
+
text-decoration: none;
|
|
400
|
+
display: inline-flex;
|
|
401
|
+
align-items: center;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.onboarding-deck__nav-btn:disabled {
|
|
405
|
+
opacity: 0.4;
|
|
406
|
+
cursor: not-allowed;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.onboarding-deck:not(.onboarding-deck--fullscreen)
|
|
410
|
+
.onboarding-deck__nav-btn.shell-btn--ghost {
|
|
411
|
+
background: #f1f5f9;
|
|
412
|
+
color: var(--shell-text);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.onboarding-deck:not(.onboarding-deck--fullscreen)
|
|
416
|
+
.onboarding-deck__nav-btn.shell-btn--ghost:hover:not(:disabled) {
|
|
417
|
+
background: #e2e8f0;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.onboarding-deck__dots {
|
|
421
|
+
display: flex;
|
|
422
|
+
flex-wrap: wrap;
|
|
423
|
+
justify-content: center;
|
|
424
|
+
gap: 8px;
|
|
425
|
+
flex: 1;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.onboarding-deck__dot {
|
|
429
|
+
width: 10px;
|
|
430
|
+
height: 10px;
|
|
431
|
+
padding: 0;
|
|
432
|
+
border: none;
|
|
433
|
+
border-radius: 999px;
|
|
434
|
+
background: #cbd5e1;
|
|
435
|
+
cursor: pointer;
|
|
436
|
+
transition:
|
|
437
|
+
transform 0.15s ease,
|
|
438
|
+
background 0.15s ease;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.onboarding-deck__dot:hover {
|
|
442
|
+
background: #94a3b8;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.onboarding-deck__dot--active {
|
|
446
|
+
background: var(--shell-accent);
|
|
447
|
+
transform: scale(1.15);
|
|
448
|
+
}
|
|
449
|
+
</style>
|