From 1cb5e0a17008d4591741e49b623af966aacff1b1 Mon Sep 17 00:00:00 2001 From: "rothwell.andy@gmail.com" Date: Tue, 26 Nov 2024 11:10:20 -0500 Subject: [PATCH] more changes for vue3 --- package-lock.json | 229 +++++++++++++++++- package.json | 3 +- .../{legendControls.js => legendControl.js} | 36 +-- src/main.js | 75 +++--- 4 files changed, 259 insertions(+), 84 deletions(-) rename src/general/{legendControls.js => legendControl.js} (58%) diff --git a/package-lock.json b/package-lock.json index 67c7c61..57f430e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,10 @@ "name": "free-meals-resource-finder", "version": "0.0.0", "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.7.1", "@fortawesome/pro-regular-svg-icons": "^6.6.0", "@phila/phila-ui-core": "^1.0.18", - "@phila/pinboard": "^2.0.55", + "@phila/pinboard": "^2.0.61", "unplugin-auto-import": "^0.18.3", "unplugin-vue-router": "^0.10.8" }, @@ -1031,16 +1032,24 @@ } }, "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "6.6.0", - "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-svg-core/-/6.6.0/fontawesome-svg-core-6.6.0.tgz", - "integrity": "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg==", + "version": "6.7.1", + "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-svg-core/-/6.7.1/fontawesome-svg-core-6.7.1.tgz", + "integrity": "sha512-8dBIHbfsKlCk2jHQ9PoRBg2Z+4TwyE3vZICSnoDlnsHA6SiMlTwfmW6yX0lHsRmWJugkeb92sA0hZdkXJhuz+g==", "dependencies": { - "@fortawesome/fontawesome-common-types": "6.6.0" + "@fortawesome/fontawesome-common-types": "6.7.1" }, "engines": { "node": ">=6" } }, + "node_modules/@fortawesome/fontawesome-svg-core/node_modules/@fortawesome/fontawesome-common-types": { + "version": "6.7.1", + "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-common-types/-/6.7.1/fontawesome-common-types-6.7.1.tgz", + "integrity": "sha512-gbDz3TwRrIPT3i0cDfujhshnXO9z03IT1UKRIVi/VEjpNHtSBIP2o5XSm+e816FzzCFEzAxPw09Z13n20PaQJQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/@fortawesome/free-solid-svg-icons": { "version": "6.6.0", "resolved": "https://npm.fontawesome.com/@fortawesome/free-solid-svg-icons/-/6.6.0/free-solid-svg-icons-6.6.0.tgz", @@ -1766,6 +1775,16 @@ "vue": "^3.3.8" } }, + "node_modules/@phila/phila-ui-modal": { + "version": "0.0.13", + "resolved": "https://registry.npmjs.org/@phila/phila-ui-modal/-/phila-ui-modal-0.0.13.tgz", + "integrity": "sha512-antCfQ3jX7JA8lx33VHp8c5N73zqVHoHbB5z6IP28q4TDtEkLlUrY7uyoCYNfAW5acLvAxbdt/seb/x2EGorpQ==", + "dependencies": { + "@phila/phila-ui-core": "^1.0.18", + "bulma": "^0.9.4", + "vue": "^3.3.8" + } + }, "node_modules/@phila/phila-ui-nav-link": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/@phila/phila-ui-nav-link/-/phila-ui-nav-link-0.0.6.tgz", @@ -1818,9 +1837,9 @@ } }, "node_modules/@phila/pinboard": { - "version": "2.0.55", - "resolved": "https://registry.npmjs.org/@phila/pinboard/-/pinboard-2.0.55.tgz", - "integrity": "sha512-M1jCErDiN/SOd/wIiQsARsh6GEla2VZD7jV40I0IV2mYkL6IEfgbcnaaOoevhQKVojtC9NS868nGuVc13KCr7g==", + "version": "2.0.61", + "resolved": "https://registry.npmjs.org/@phila/pinboard/-/pinboard-2.0.61.tgz", + "integrity": "sha512-CFc9VV3yzAqOHzBePFXWpb2yP1KZnwBnhWODphVEYIr0lmGCFNGJ8oAG+KRbfOshAj/1tBOdCrh9sH/GiiA3QA==", "dependencies": { "@creativebulma/bulma-tooltip": "^1.2.0", "@fortawesome/fontawesome-pro": "^6.6.0", @@ -1835,6 +1854,7 @@ "@phila/phila-ui-dropdown": "^0.0.1", "@phila/phila-ui-lang-selector": "^0.0.7", "@phila/phila-ui-mobile-nav": "^0.0.6", + "@phila/phila-ui-modal": "^0.0.13", "@phila/phila-ui-nav-link": "^0.0.6", "@phila/phila-ui-radio": "^0.0.5", "@phila/phila-ui-textbox": "^0.0.2", @@ -1859,6 +1879,7 @@ "maplibre-gl": "^4.1.3", "pinia": "^2.2.4", "proj4": "^2.12.1", + "qs": "^6.13.1", "unplugin-auto-import": "^0.18.3", "unplugin-vue-router": "^0.10.8", "vue": "^3.5.12", @@ -2943,6 +2964,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3197,6 +3236,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -3261,6 +3316,25 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -3713,6 +3787,14 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/fuse.js": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz", @@ -3735,6 +3817,24 @@ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==" }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -3810,6 +3910,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -3825,6 +3936,50 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hookable": { "version": "5.5.3", "resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz", @@ -4492,6 +4647,17 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", @@ -4768,6 +4934,20 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4973,6 +5153,22 @@ "node": ">=10" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4994,6 +5190,23 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", diff --git a/package.json b/package.json index 6a014af..867669c 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,10 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" }, "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.7.1", "@fortawesome/pro-regular-svg-icons": "^6.6.0", "@phila/phila-ui-core": "^1.0.18", - "@phila/pinboard": "^2.0.55", + "@phila/pinboard": "^2.0.61", "unplugin-auto-import": "^0.18.3", "unplugin-vue-router": "^0.10.8" }, diff --git a/src/general/legendControls.js b/src/general/legendControl.js similarity index 58% rename from src/general/legendControls.js rename to src/general/legendControl.js index 3b3017c..be0721e 100644 --- a/src/general/legendControls.js +++ b/src/general/legendControl.js @@ -1,33 +1,17 @@ export default { - // water: { - // options: { - // topics: [ 'water' ], - // showWithBaseMapOnly: false, - // }, - // // TODO give these an id instead of using the label as a key - // data: { - // 'Roof': { - // 'background-color': '#FEFF7F', - // }, - // 'Other Impervious Surface': { - // 'background-color': '#F2DCFF', - // }, - // }, - // }, legend: { options: { showWithBaseMapOnly: true, shape: 'circle', }, data: { - // TODO give these an id instead of using the label as a key 'Food sites': { 'border-color': 'black', 'border-style': 'solid', 'border-weight': '0px', 'width': '15px', 'height': '15px', - 'font-size': '10px', + 'font-size': '12px', 'background-color': '#0F4D90', }, 'General meal sites': { @@ -36,7 +20,7 @@ export default { 'border-weight': '0px', 'width': '15px', 'height': '15px', - 'font-size': '10px', + 'font-size': '12px', 'background-color': '#506D0A', }, 'Older adult meal sites': { @@ -45,9 +29,8 @@ export default { 'border-weight': '0px', 'width': '15px', 'height': '15px', - 'font-size': '10px', + 'font-size': '12px', 'background-color': '#a86518', - // 'background-color': '#D67D00', }, 'Student meal sites': { 'border-color': 'black', @@ -55,25 +38,16 @@ export default { 'border-weight': '0px', 'width': '15px', 'height': '15px', - 'font-size': '10px', + 'font-size': '12px', 'background-color': '#721817', }, - // 'Community Refrigerators': { - // 'border-color': 'black', - // 'border-style': 'solid', - // 'border-weight': '0px', - // 'width': '15px', - // 'height': '15px', - // 'font-size': '10px', - // 'background-color': '#444444', - // }, 'Food assistance and benefits': { 'border-color': 'black', 'border-style': 'solid', 'border-weight': '0px', 'width': '15px', 'height': '15px', - 'font-size': '10px', + 'font-size': '12px', 'background-color': '#444444', }, }, diff --git a/src/main.js b/src/main.js index 6b5be65..8786710 100644 --- a/src/main.js +++ b/src/main.js @@ -22,24 +22,17 @@ import { faMinus as farMinus } from '@fortawesome/pro-regular-svg-icons'; import { markRaw } from 'vue'; library.add(faExclamationTriangle, faHandHoldingHeart, farAngleDown, farAngleUp, farTimes, farPlus, farMinus); -import pinboard from '@phila/pinboard'; -// import pinboard from '../node_modules/@phila/pinboard/src/main.js'; +// import pinboard from '@phila/pinboard'; +import pinboard from '../node_modules/@phila/pinboard/src/main.js'; if (import.meta.env.VITE_DEBUG) console.log('test pinboard:', pinboard); import '../node_modules/@phila/pinboard/dist/style.css'; // import greeting from './general/greeting'; -import legendControls from './general/legendControls'; +import legendControl from './general/legendControl'; // data-sources -// import seniorSites from './data-sources/senior-sites'; -// import distributionSites from './data-sources/distribution-sites'; -// import schoolMealSites from './data-sources/school-meal-sites'; -// import youthActivitySites from './data-sources/youth-activity-sites'; -// import parksSites from './data-sources/parks-sites.js'; -// import compiled from './data-sources/compiled'; import covidFreeMealSites from './data-sources/covid-free-meal-sites'; -// var BASE_CONFIG_URL = 'https://cdn.jsdelivr.net/gh/cityofphiladelphia/mapboard-default-base-config@6126861722cee9384694742363d1661e771493b9/config.js'; import expandCollapseContent from './components/ExpandCollapseContent.vue'; import customGreeting from './components/customGreeting.vue'; @@ -72,6 +65,10 @@ let $config = { searchTypes: [ 'address', 'zipcode' ], searchDistance: 1, }, + fieldsUsed: { + section: 'category_type', + subsection: 'category', + }, locationInfo: { siteNameField: 'site_name', siteName: function(item) { return item.properties.site_name }, @@ -495,8 +492,7 @@ let $config = { size: 16, mobileSize: 20, }, - legendControls, - // baseConfig: BASE_CONFIG_URL, + legendControl, // cyclomedia: { // enabled: false, // measurementAllowed: false, @@ -508,19 +504,10 @@ let $config = { // }, dataSources: { covidFreeMealSites, - // parksSites, - // compiled, }, router: { enabled: false, }, - // projection: function(item) { - // if (item._featureId.includes('covidFreeMealSites')) { - // return '3857'; - // } else if (item._featureId.includes('parksSites')) { - // return '2272'; - // } - // }, projection: '3857', geocoder: { url(input) { @@ -531,29 +518,6 @@ let $config = { include_units: true, }, }, - footer: [ - { - type: "native", - href: "https://www.phila.gov/", - attrs: { - target: "_blank", - }, - text: "app.cityOfPhiladelphia", - }, - { - type: "native", - href: "https://www.phila.gov/food/", - text: "app.about", - }, - { - type: "native", - href: "https://www.phila.gov/feedback/", - attrs: { - target: "_blank", - }, - text: "app.feedback", - }, - ], sections: { foodSites: { title: 'Food sites', @@ -660,6 +624,29 @@ let $config = { 'circle-stroke-color': 'white', }, }, + footer: [ + { + type: "native", + href: "https://www.phila.gov/", + attrs: { + target: "_blank", + }, + text: "app.cityOfPhiladelphia", + }, + { + type: "native", + href: "https://www.phila.gov/food/", + text: "app.about", + }, + { + type: "native", + href: "https://www.phila.gov/feedback/", + attrs: { + target: "_blank", + }, + text: "app.feedback", + }, + ], }; pinboard($config);