Compare commits

..
436 Commits
Author SHA1 Message Date
HarelM 4d9c3127fb deploy: 648831ac67 2026-11-26 21:10:09 +00:00
HarelM 0cef6166d1 deploy: 1a2c3363ce 2026-11-25 08:43:49 +00:00
HarelM f209ae024c deploy: 129111357c 2026-11-24 21:25:59 +00:00
HarelM cb5ebfecb0 deploy: 54f0ba140a 2026-11-24 08:07:45 +00:00
HarelM be57c5523c deploy: 997f3445b5 2026-11-03 15:47:29 +00:00
HarelM 89edc996dc deploy: 2ff1a62d19 2026-11-03 15:23:49 +00:00
HarelM 3a82417592 deploy: 3f3ca9a13b 2026-11-03 06:17:29 +00:00
HarelM 74897c18e4 deploy: 28917685f7 2026-10-11 14:07:09 +00:00
HarelM ee7ab4a32d deploy: 68c81fc7a3 2026-10-05 12:50:28 +00:00
HarelM af1962d16b deploy: 560478410a 2026-09-27 17:06:04 +00:00
HarelM 404faedd0d deploy: 2384adf517 2026-09-27 13:45:02 +00:00
HarelM fc8854a50a deploy: a3e9c91ce0 2026-09-14 16:06:04 +00:00
HarelM 26aabaee74 deploy: 95bf5f2c55 2026-09-14 05:34:24 +00:00
HarelM 418c853615 deploy: 80c0d08179 2026-09-09 15:05:14 +00:00
HarelM 439d8f62a3 deploy: 1301dc03e7 2026-09-08 18:33:50 +00:00
HarelM 32cae0f957 deploy: c0f76dfff8 2026-09-05 21:13:03 +00:00
HarelM 2061f9e4b1 deploy: 64b4e5a67c 2026-09-05 16:24:20 +00:00
HarelM e00ff18623 deploy: d1ddd91172 2026-09-04 19:08:52 +00:00
HarelM 2aef030f21 deploy: 936b801000 2026-08-28 14:43:14 +00:00
HarelM ff50972c0d deploy: 4424276073 2026-08-19 22:09:54 +00:00
HarelM daa992f6f9 deploy: a2a13b5fcc 2026-08-19 12:33:55 +00:00
HarelM 810a926916 deploy: f075bf6661 2026-07-30 05:17:50 +00:00
HarelM 8c87f027fb deploy: cf54b6fdeb 2026-07-14 11:15:20 +00:00
HarelM f8ee3d61a5 deploy: f14eeae38b 2026-07-12 12:47:24 +00:00
HarelM dd56da30c1 deploy: 9c1499b805 2026-07-12 11:08:21 +00:00
HarelM 2d057544ba deploy: 2e0b7cdb8c 2026-07-10 18:19:42 +00:00
HarelM cd2497332d deploy: be9456d11b 2026-07-09 08:41:22 +00:00
HarelM 27dfe9026b deploy: fadf01a51d 2026-07-07 20:28:51 +00:00
HarelM 087d35d0e0 deploy: f175749fb7 2026-07-07 19:55:00 +00:00
HarelM 4b705df0f0 deploy: 66377f5dcf 2026-07-06 12:29:42 +00:00
HarelM f971a00d0b deploy: 00b20af1d9 2026-05-17 07:27:09 +00:00
HarelM 2b5f5da7be deploy: 47a42b3e2f 2026-05-17 07:20:02 +00:00
HarelM 75a046e3d0 deploy: 3d061882f3 2026-05-12 12:55:43 +00:00
HarelM ac8a3ee050 deploy: 58c84f510b 2026-05-06 14:13:14 +00:00
HarelM 8e1a419909 deploy: 93596b3540 2026-05-06 14:12:36 +00:00
HarelM 2c71412e49 deploy: a62e5014ee 2026-04-02 10:56:24 +00:00
HarelM bc7f27d15a deploy: cb9b7beb32 2026-03-03 12:15:46 +00:00
HarelM b3812fa927 deploy: 738ce853ae 2026-03-03 11:24:19 +00:00
HarelM b6f569ad96 deploy: 4157d2ee08 2026-03-03 10:36:54 +00:00
HarelM 9ebd6d84d9 deploy: c629e10af7 2026-01-21 21:05:36 +00:00
HarelM 6010c6810a deploy: f24031dd5c 2026-01-20 05:46:30 +00:00
HarelM 7943252400 deploy: c3a35354f7 2025-12-17 08:28:29 +00:00
HarelM 72b9e624a7 deploy: c168e65d86 2025-12-03 11:40:13 +00:00
HarelM 4c847faaae deploy: 74a21e1b77 2025-12-02 10:04:09 +00:00
HarelM 7089ca1b5c deploy: 9d19ab8606 2025-12-02 09:34:09 +00:00
HarelM 2cd6019cb2 deploy: 522815b4c5 2025-11-20 10:56:01 +00:00
HarelM 775b5f4a39 deploy: 7a93d592ff 2025-11-09 21:58:08 +00:00
HarelM 93baf3d5e2 deploy: 876a3d70df 2025-11-09 11:03:19 +00:00
HarelM 74f44a49af deploy: 0fbba4b362 2025-11-06 14:32:20 +00:00
HarelM 6310d6f11e deploy: 4ba09144e9 2025-11-06 12:19:37 +00:00
HarelM 8153050d38 deploy: 5b34a3791f 2025-11-04 07:12:13 +00:00
HarelM 917da6bc7d deploy: 696e43b474 2025-11-02 13:38:53 +00:00
HarelM 5f0ea7be24 deploy: fe2571addb 2025-10-17 23:43:49 +00:00
HarelM 8db5842e85 deploy: 7e784f80f6 2025-10-17 20:17:50 +00:00
HarelM 5a8effb363 deploy: 8cd5e28f3a 2025-10-10 13:41:06 +00:00
HarelM 236058e95b deploy: 39d63ec7b1 2025-10-05 13:39:07 +00:00
HarelM 2da67c7963 deploy: 1730e9cb1c 2025-09-17 17:52:33 +00:00
HarelM f67704c545 deploy: 3c3fcadbb6 2025-09-16 13:43:10 +00:00
HarelM 83b96e8f80 deploy: b42afd0027 2025-09-15 05:15:59 +00:00
birkskyum 59cf0fc47c deploy: 5312d61598 2025-09-14 09:49:28 +00:00
HarelM bc8f9fd685 deploy: 56cdfd23df 2025-09-14 09:13:23 +00:00
HarelM 542e7777d8 deploy: 69143ea5d6 2025-09-14 08:14:50 +00:00
HarelM 12c5dd912b deploy: a322afdcee 2025-09-13 22:47:26 +00:00
HarelM 95dbed3f69 deploy: c6f599cc61 2025-09-13 20:12:13 +00:00
HarelM 3acf7ccf5b deploy: 42e1273241 2025-09-11 17:44:17 +00:00
HarelM 6c4758c89c deploy: d81316435b 2025-09-11 10:10:22 +00:00
HarelM 9bfea8f868 deploy: c3c6118df1 2025-09-10 11:45:37 +00:00
HarelM 2d2a4739f1 deploy: 9c85883b8a 2025-09-10 11:38:22 +00:00
HarelM fd218db356 deploy: 3725f83b48 2025-09-09 22:53:51 +00:00
HarelM bc2b08ed92 deploy: 7bfc3188f7 2025-09-09 22:47:57 +00:00
HarelM 9af15e5359 deploy: 25d6e9693d 2025-09-09 22:18:15 +00:00
HarelM 669781ccca deploy: 7fc334ad85 2025-09-09 14:33:27 +00:00
HarelM 18da95d2a6 deploy: 55a487d0c8 2025-09-08 19:09:30 +00:00
HarelM b47d105e1f deploy: abe6230932 2025-09-08 12:23:28 +00:00
HarelM 5f9c21cf2b deploy: 6f4c34b29a 2025-09-07 14:43:38 +00:00
HarelM 956d24c524 deploy: 54c1b761fd 2025-09-07 14:30:51 +00:00
HarelM 4e02c6e12d deploy: 4d5c74f4ee 2025-09-07 10:06:13 +00:00
HarelM e9966e5a20 deploy: e2e29d7f5e 2025-08-17 08:07:25 +00:00
birkskyum 3deb491306 deploy: 727bc7dfae 2025-08-07 18:35:15 +00:00
louwers 34572dc3f0 deploy: b2fa703ceb 2025-07-10 04:07:56 +00:00
louwers 6bf79c2121 deploy: 3ddb55aec7 2025-07-05 18:31:48 +00:00
louwers a925995f89 deploy: 2fef0467b6 2025-07-05 12:47:58 +00:00
louwers c674575fbc deploy: eb985f4d95 2025-07-05 11:59:23 +00:00
louwers b030a2a707 deploy: c486aa2139 2025-07-05 11:56:00 +00:00
louwers 74aa3b48db deploy: 533f647c71 2025-07-05 09:33:30 +00:00
louwers a399df0adc deploy: 4b977fd33e 2025-07-04 21:50:06 +00:00
louwers 1282062b32 deploy: e58b92b0cd 2025-07-04 20:22:52 +00:00
louwers bb243db63c deploy: 599240033a 2025-07-04 08:28:00 +00:00
HarelM 45c1281490 deploy: 851e4bad21 2025-06-13 04:20:07 +00:00
nyurik 40e452d547 deploy: 19389ca3d3 2025-05-28 18:39:19 +00:00
HarelM 2e62b1802a deploy: 4f52df7c3b 2025-05-04 04:40:44 +00:00
HarelM ea4c3f4e3e deploy: b6afbb0321 2025-04-21 19:45:41 +00:00
HarelM 19c538a29e deploy: d691d49538 2025-03-28 13:34:48 +00:00
HarelM d379d462f2 deploy: 699241b691 2025-03-14 20:35:35 +00:00
nyurik 8eb9fe062f deploy: 9540686b40 2025-02-25 10:02:16 +00:00
HarelM 9ca274805c deploy: da361509d2 2025-02-04 06:36:51 +00:00
birkskyum fc507c7e79 deploy: abf3bd1fa0 2025-01-28 12:58:40 +00:00
HarelM 66453a46ca deploy: b87c8fb5c3 2025-01-25 07:25:28 +00:00
HarelM 96b0c53fd2 deploy: 5af2cc2f9e 2025-01-23 09:00:05 +00:00
birkskyum 663034b749 deploy: dcdbac35ff 2025-01-22 11:43:15 +00:00
birkskyum c82696d268 deploy: 2852fa62ff 2025-01-22 10:39:26 +00:00
birkskyum 7d987cf68b deploy: 87cd79e86f 2025-01-21 21:39:06 +00:00
birkskyum 075437555a deploy: cd7d607f13 2025-01-21 15:22:33 +00:00
HarelM 654dc9c31b deploy: b429bb16d7 2025-01-21 14:26:07 +00:00
birkskyum 2c8bc5aa04 deploy: a21efcc4d5 2025-01-21 13:48:26 +00:00
HarelM 07bee66764 deploy: 3e6994084c 2025-01-21 13:25:16 +00:00
HarelM f675c7ff7b deploy: 69e4888d71 2025-01-21 12:25:50 +00:00
HarelM ad85fd8f12 deploy: 2a3e7ea4bb 2025-01-21 12:09:54 +00:00
HarelM 634d664e46 deploy: a97287a66e 2025-01-21 12:09:04 +00:00
HarelM 0046122c87 deploy: 9a866179b7 2025-01-21 12:01:16 +00:00
HarelM c0f798a6f6 deploy: 84e9a73d86 2025-01-21 12:00:58 +00:00
HarelM 47941e3738 deploy: 53fbc1ffe9 2025-01-21 11:57:51 +00:00
HarelM 237457a159 deploy: b357e1f352 2025-01-21 11:57:31 +00:00
HarelM d9dad5614e deploy: c5f6d51ea1 2025-01-21 11:54:31 +00:00
HarelM f18a594131 deploy: 117f37139e 2025-01-21 11:53:25 +00:00
HarelM fde3d8fc18 deploy: 39aef39b72 2025-01-21 11:52:48 +00:00
HarelM a493d6df52 deploy: 1657aa4676 2025-01-21 11:50:24 +00:00
HarelM 7e8eca6f97 deploy: b09d41e41d 2025-01-21 11:49:20 +00:00
HarelM c3764b65d9 deploy: f17f529ede 2025-01-21 11:48:57 +00:00
HarelM 56e151329d deploy: f12af91a55 2025-01-21 11:48:16 +00:00
HarelM 28d6589928 deploy: e87e122067 2025-01-21 11:47:53 +00:00
birkskyum 7adf516383 deploy: 6af3165418 2025-01-21 10:23:43 +00:00
birkskyum 9a1385823e deploy: b1d4b53548 2025-01-21 09:51:57 +00:00
HarelM 2fc5ab4509 deploy: 69124d0752 2025-01-21 08:49:52 +00:00
HarelM 3108b88e59 deploy: 405b8aa951 2025-01-16 21:54:38 +00:00
HarelM b910e4fdb6 deploy: d50ea76347 2025-01-09 16:55:36 +00:00
louwers 907c09a927 deploy: c6174a57d9 2024-11-25 11:41:18 +00:00
HarelM 16fb99d9b1 deploy: af01346279 2024-11-14 21:54:28 +00:00
HarelM a364176a3e deploy: 687f9abaf2 2024-10-31 19:04:51 +00:00
HarelM 48164f5a9d deploy: 172d4d5278 2024-10-15 07:13:06 +00:00
HarelM 046b1b3bb2 deploy: b03af2c039 2024-09-29 13:10:39 +00:00
HarelM f33e09df62 deploy: 6089cde302 2024-09-29 12:02:38 +00:00
HarelM 7333eb6378 deploy: 25cf61a825 2024-09-25 07:23:54 +00:00
HarelM ffdc04b3aa deploy: 0f1000c5b0 2024-09-18 04:02:23 +00:00
louwers 223809dda5 deploy: fa4ece22cf 2024-09-16 23:39:50 +00:00
HarelM 744ad0f917 deploy: 00f431c50e 2024-09-03 05:25:36 +00:00
HarelM 2f324c695b deploy: 60785f53bc 2024-09-02 09:45:51 +00:00
HarelM dd4cbb1b3d deploy: 32fa02d289 2024-09-01 06:59:24 +00:00
HarelM e61aa393c6 deploy: 482e6ec545 2024-08-29 19:15:18 +00:00
HarelM e9c24d5ac9 deploy: 4dd34e99fd 2024-08-29 17:23:36 +00:00
HarelM a7ed7cdb45 deploy: 66c5a5c953 2024-08-29 14:08:36 +00:00
HarelM dea98ad7b6 deploy: 8184ac8393 2024-08-21 05:58:07 +00:00
HarelM 987c3cd31e deploy: 6a0d2e8ee5 2024-08-21 04:18:41 +00:00
HarelM 6d970fe73f deploy: 58edd262b0 2024-08-19 09:44:12 +00:00
nyurik 9cfd0ced73 deploy: 35840409b8 2024-07-26 02:51:28 +00:00
HarelM 1464a337e3 deploy: d0f6e0fadb 2024-07-12 18:19:25 +00:00
HarelM 1eaba084ed deploy: 0de304ca3e 2024-06-24 05:10:30 +00:00
HarelM 37ba7457d5 deploy: c82c6158e6 2024-05-29 07:48:23 +00:00
HarelM 43a7c058fd deploy: 41cd7dfad1 2024-05-20 11:44:06 +00:00
HarelM 87c7c7ff93 deploy: 7591b031ce 2024-04-16 05:27:23 +00:00
HarelM 8c8241b13b deploy: f34529ef06 2024-04-03 17:27:41 +00:00
HarelM c187f02c27 deploy: a73b11805d 2024-03-26 23:13:29 +00:00
HarelM 617adcdc48 deploy: ff15b77b7f 2024-03-21 20:52:33 +00:00
HarelM e71c49e38c deploy: 355b663e7e 2024-03-14 19:03:54 +00:00
HarelM 9572eefd48 deploy: 3c043fd5e0 2024-03-13 20:49:07 +00:00
HarelM 3303a25737 deploy: 5f54dd0ccf 2024-03-09 21:04:29 +00:00
HarelM 49f91a69f1 deploy: 3727f5da48 2024-02-21 05:18:43 +00:00
HarelM c853c754b1 deploy: bc5ecfade6 2024-02-07 08:33:35 +00:00
HarelM 1b5596052c deploy: c84c7a7b96 2024-02-04 14:39:01 +00:00
HarelM 1c1b5cd208 deploy: cb77c6b4e2 2024-02-04 09:38:30 +00:00
HarelM c948814efc deploy: ea42f434eb 2024-02-04 08:02:30 +00:00
HarelM 7b9d3512c6 deploy: 6f82c12861 2024-02-04 07:19:30 +00:00
HarelM edf3a58ea6 deploy: 3b95b25777 2024-01-13 12:40:08 +00:00
HarelM 5a4b5fb9e9 deploy: 1da65f2116 2024-01-12 16:47:24 +00:00
HarelM 6f9f53add6 deploy: a62db148cd 2024-01-12 09:01:06 +00:00
HarelM e0199c9ce7 deploy: 6ed10a862f 2024-01-11 20:58:23 +00:00
Harel M e1ed42f16f Fix static files reference 2024-01-11 20:00:59 +00:00
Harel M 104c3c0c10 another attempt to fix base-href 2024-01-11 19:53:30 +00:00
Harel M f4a1aa4729 Add base tag to html 2024-01-11 19:48:33 +00:00
Harel M fda7fac260 Publish the current version of maputnik 2024-01-11 19:45:24 +00:00
Harel M 87cf81d1c9 Prepare for on boarding (#858)
I believe this solves most of the missing checkboxes:
- https://github.com/maplibre/maplibre/issues/352

Let me know if there's anything else missing.
Other configuration can be done after the repo has been migrated I
believe.
2024-01-11 17:08:42 +02:00
8e35ed97e6 Improve drivers (#856)
Co-authored-by: shelly_goldblit <shelly_goldblit@dell.com>
Co-authored-by: HarelM <harel.mazor@gmail.com>
2024-01-02 12:12:06 +02:00
Harel M 124ae98bf3 E2E: Improve tests, lint, and add more drivers (#855)
This PR introduces lint to cypress code, adds drivers to try and
abstract the usage of cypress as much as possible.
Nothing very interesting, mainly to try out the driver pattern for the
e2e tests.
2023-12-27 20:58:24 +02:00
Harel MandYuri Astrakhan b784bf2b84 Improve tests (#854)
Recover commented out tests, 
Improve usage of helper in driver, 
Added data-wd-key for test to use instead of classes
Moved all non tsx file to a single folder (lib) instead of lib and utils

---------

Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
2023-12-27 10:19:59 +02:00
MaxandHarel M 09a1f3f87b Use nginx to serve built files (#808)
Resolves #842
Better suited than python + handles sigterm better

Co-authored-by: Harel M <harel.mazor@gmail.com>
2023-12-26 23:28:17 +02:00
Harel MandYuri Astrakhan a22476cab2 Add lint to CI and fix errors (#853)
Adds lint to CI and fixes errors.
I'm not sure I'm fully proud of all the solutions there.
But there's no lint issues and the lint is being checked as part of the
CI.

---------

Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
2023-12-26 23:13:22 +02:00
a324ddb654 add code coverage (#852)
Add Cypress code coverage using Istanbul nyc

![image](https://github.com/maputnik/editor/assets/60476837/e7c364b7-7b54-4bf1-85aa-ee6fb19cc40c)

---------

Co-authored-by: shelly_goldblit <shelly_goldblit@dell.com>
Co-authored-by: Harel M <harel.mazor@gmail.com>
2023-12-26 12:04:43 +02:00
Harel M 656264f2bc Migration of jsx files to tsx 3 (#851)
This is in continue to:
- #850
- #848

The last files should be converted as part of this PR, there are only a
handful left.
2023-12-25 15:48:46 +02:00
Harel M 974dd7bfd9 Migration of jsx files to tsx 2 (#850)
This is to continue the work of migrating all the jsx files into tsx
files.
The MO is basically described here: #848.

About 7 files to go...
2023-12-22 23:32:25 +02:00
Harel M fa182e66fa Migration of jsx files to tsx 1 (#848)
In this PR I have changed some of the jsx files to tsx file.
I'm starting off with the "leafs" so that migration of the rest will be
easier, hopefully.

What I'm basically doing is taking a jsx file, copy paste it into:
https://mskelton.dev/ratchet

And after that I'm fixing the types as needed.
It's not a very long process.

Hopefully more PRs will follow and this will be over soon.
I don't plan to migrate the storybook as I generally don't understand
why is it useful, I'll open an issue to see if anyone thinks
differently.
2023-12-21 23:46:56 +02:00
Harel M 3bf0e510e6 Migrate all the non react components code to typescript (#847)
This completes the migration to typescript of all the non react
components code.
The only changes introduced besides types are the type checks using
`"something" in object` which narrows down types in typescript.
2023-12-21 00:07:53 +02:00
Harel M e8d07fa694 Initial migration to typescript (#845)
This migrates some utilities classes from javascript to typescript.
Nothing special about the migration, mainly added types and made sure
the code adheres to the strict mode.

I have picked some small files so git doesn't think they are the same
since they are "very different".
I hope that in later PRs, when migrating lager files this won't be an
issues.
2023-12-20 22:56:33 +02:00
4d1e2e6893 Refactor driver for E2E (#843)
This is basically the content of #841 with the code review changes and
relevant fixes to tests/driver code to pass the tests.
CC: @ShellyDCMS

After this we should lint the project and add the lint to the CI to make
sure it doesn't break.

---------

Co-authored-by: ShellyDCMS <60476837+ShellyDCMS@users.noreply.github.com>
Co-authored-by: shelly_goldblit <shelly_goldblit@dell.com>
2023-12-20 16:34:46 +02:00
Harel M f219ff1e17 Fix favicon (#844)
This PR fixes the missing facicon.
As part of the migration to vite, this issue was introduced.
- #836
2023-12-20 07:18:13 +02:00
Yuri Astrakhan 8eabfa5519 Fix incorrect CI tag filter (#838) 2023-12-18 06:21:43 +02:00
Harel M ad69cbdb20 Vite + TypeScript (#836)
Resolves #803

This is an initial commit to allow migrating to typescript bit by bit.
It introduces vite.
It removes all the webpack configuration (which I have no clue what all
the profiling are needed for, and couldn't find anything in the readme).
It also changes a single file from javascript to typescript:
`urlopen.js` -> `urlopen.ts`
Which was done manually, later on I'll see if I can automate most of the
migration.
For now, everything seems to work as expected.
I also upgrades storybook to use vite and renames the stories to jsx (I
honestly don't know why this complexity is needed here, but I'll keep it
for now).

cc: @damianstasik
2023-12-17 22:52:19 -05:00
Yuri AstrakhanandHarel M 17eaa3f204 Rename primary branch to main (#837)
Co-authored-by: Harel M <harel.mazor@gmail.com>
2023-12-18 00:09:10 +02:00
Harel MandYuri Astrakhan 1df2e36dbb Replace WebDriverIO with Cypress (#831)
This does the following:
1. Moves the WDIO code from javascript to typescript
2. Moves to use files that are `cy.ts` instead of `index.js`
3. Replace e2e to use cypress
4. Introduce back some skipped tests

This is in continue to the conversation here:
https://github.com/HarelM/editor/pull/3

Before:
```
 "spec" Reporter:
------------------------------------------------------------------
[chrome 120.0.6099.71 linux #0-0] Running: chrome (v120.0.6099.71) on linux
[chrome 120.0.6099.71 linux #0-0] Session ID: ee9a87bcfce007ac7721929c6e6234d0
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0] » /test/functional/index.js
[chrome 120.0.6099.71 linux #0-0] maputnik
[chrome 120.0.6099.71 linux #0-0]     history
[chrome 120.0.6099.71 linux #0-0]        - undo/redo
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]     layers
[chrome 120.0.6099.71 linux #0-0]         ops
[chrome 120.0.6099.71 linux #0-0]            ✓ delete
[chrome 120.0.6099.71 linux #0-0]            ✓ duplicate
[chrome 120.0.6099.71 linux #0-0]            ✓ hide
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         background
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]             modify
[chrome 120.0.6099.71 linux #0-0]                 layer
[chrome 120.0.6099.71 linux #0-0]                    - expand/collapse
[chrome 120.0.6099.71 linux #0-0]                    ✓ id
[chrome 120.0.6099.71 linux #0-0]                    ✓ min-zoom
[chrome 120.0.6099.71 linux #0-0]                    ✓ max-zoom
[chrome 120.0.6099.71 linux #0-0]                    ✓ comments
[chrome 120.0.6099.71 linux #0-0]                    - color
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]                 filter
[chrome 120.0.6099.71 linux #0-0]                    - expand/collapse
[chrome 120.0.6099.71 linux #0-0]                    - compound filter
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]                 paint
[chrome 120.0.6099.71 linux #0-0]                    - expand/collapse
[chrome 120.0.6099.71 linux #0-0]                    - color
[chrome 120.0.6099.71 linux #0-0]                    - pattern
[chrome 120.0.6099.71 linux #0-0]                    - opacity
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]                 json-editor
[chrome 120.0.6099.71 linux #0-0]                    - expand/collapse
[chrome 120.0.6099.71 linux #0-0]                    - modify
[chrome 120.0.6099.71 linux #0-0]                    - parse error
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         fill
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]            - change source
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         line
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]            - groups
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         symbol
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         raster
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         circle
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         fill extrusion
[chrome 120.0.6099.71 linux #0-0]            ✓ add
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         groups
[chrome 120.0.6099.71 linux #0-0]            ✓ simple
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]     map
[chrome 120.0.6099.71 linux #0-0]         zoom level
[chrome 120.0.6099.71 linux #0-0]            - via url
[chrome 120.0.6099.71 linux #0-0]            - via map controls
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]     modals
[chrome 120.0.6099.71 linux #0-0]         open
[chrome 120.0.6099.71 linux #0-0]            ✓ close
[chrome 120.0.6099.71 linux #0-0]            - upload
[chrome 120.0.6099.71 linux #0-0]            ✓ load from url
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         shortcuts
[chrome 120.0.6099.71 linux #0-0]            ✓ open/close
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         export
[chrome 120.0.6099.71 linux #0-0]            ✓ close
[chrome 120.0.6099.71 linux #0-0]            - download
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         sources
[chrome 120.0.6099.71 linux #0-0]            - active sources
[chrome 120.0.6099.71 linux #0-0]            - public source
[chrome 120.0.6099.71 linux #0-0]            - add new source
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         inspect
[chrome 120.0.6099.71 linux #0-0]            ✓ toggle
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         style settings
[chrome 120.0.6099.71 linux #0-0]            ✓ name
[chrome 120.0.6099.71 linux #0-0]            ✓ owner
[chrome 120.0.6099.71 linux #0-0]            ✓ sprite url
[chrome 120.0.6099.71 linux #0-0]            ✓ glyphs url
[chrome 120.0.6099.71 linux #0-0]            ✓ maptiler access token
[chrome 120.0.6099.71 linux #0-0]            ✓ thunderforest access token
[chrome 120.0.6099.71 linux #0-0]            ✓ style renderer
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]         sources
[chrome 120.0.6099.71 linux #0-0]            - toggle
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]     screenshots
[chrome 120.0.6099.71 linux #0-0]        ✓ front_page
[chrome 120.0.6099.71 linux #0-0]        ✓ open
[chrome 120.0.6099.71 linux #0-0]        ✓ export
[chrome 120.0.6099.71 linux #0-0]        ✓ sources
[chrome 120.0.6099.71 linux #0-0]        ✓ style settings
[chrome 120.0.6099.71 linux #0-0]        ✓ inspect
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]     accessibility
[chrome 120.0.6099.71 linux #0-0]         skip links
[chrome 120.0.6099.71 linux #0-0]            ✓ skip link to layer list
[chrome 120.0.6099.71 linux #0-0]            ✓ skip link to layer editor
[chrome 120.0.6099.71 linux #0-0]            ✓ skip link to map view
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0]     keyboard
[chrome 120.0.6099.71 linux #0-0]         shortcuts
[chrome 120.0.6099.71 linux #0-0]            ✓ ESC should unfocus
[chrome 120.0.6099.71 linux #0-0]            ✓ '?' should show shortcuts modal
[chrome 120.0.6099.71 linux #0-0]            ✓ 'o' should show open modal
[chrome 120.0.6099.71 linux #0-0]            ✓ 'e' should show export modal
[chrome 120.0.6099.71 linux #0-0]            ✓ 'd' should show sources modal
[chrome 120.0.6099.71 linux #0-0]            ✓ 's' should show settings modal
[chrome 120.0.6099.71 linux #0-0]            - 'i' should change map to inspect mode
[chrome 120.0.6099.71 linux #0-0]            ✓ 'm' should focus map
[chrome 120.0.6099.71 linux #0-0]            ✓ '!' should show debug modal
[chrome 120.0.6099.71 linux #0-0]
[chrome 120.0.6099.71 linux #0-0] 44 passing (58.8s)
[chrome 120.0.6099.71 linux #0-0] 23 skipped
```

After:
```
accessibility
    skip links
      - skip link to layer list
      - skip link to layer editor
      - skip link to map view

history
    ✓ undo/redo (4894ms)

keyboard
    shortcuts
      ✓ ESC should unfocus (1912ms)
      ✓ '?' should show shortcuts modal (458ms)
      ✓ 'o' should show open modal (710ms)
      ✓ 'e' should show export modal (692ms)
      ✓ 'd' should show sources modal (588ms)
      ✓ 's' should show settings modal (894ms)
      ✓ 'i' should change map to inspect mode (804ms)
      ✓ 'm' should focus map (837ms)
      ✓ '!' should show debug modal (607ms)

layers
    ops
      ✓ delete (4313ms)
      ✓ duplicate (1780ms)
      ✓ hide (1862ms)
    background
      ✓ add (1675ms)
      modify
        layer
          - expand/collapse
          ✓ id (3735ms)
          ✓ min-zoom (2209ms)
          ✓ max-zoom (2127ms)
          ✓ comments (2515ms)
          ✓ color (2022ms)
        filter
          - expand/collapse
          - compound filter
        paint
          - expand/collapse
          - color
          - pattern
          - opacity
        json-editor
          - expand/collapse
          - modify
          - parse error
    fill
      ✓ add (1831ms)
      - change source
    line
      ✓ add (1844ms)
      ✓ groups (687ms)
    symbol
      ✓ add (2035ms)
    raster
      ✓ add (1814ms)
    circle
      ✓ add (1867ms)
    fill extrusion
      ✓ add (1963ms)
    groups
      ✓ simple (2653ms)

map
    zoom level
      ✓ via url (2279ms)
      ✓ via map controls (733ms)

modals
    open
      ✓ close (2519ms)
      - upload
      ✓ load from url (1557ms)
    shortcuts
      ✓ open/close (1136ms)
    export
      ✓ close (755ms)
      - download
    sources
      - active sources
      - public source
      - add new source
    inspect
      ✓ toggle (1020ms)
    style settings
      ✓ name (1085ms)
      ✓ owner (1060ms)
      ✓ sprite url (1214ms)
      ✓ glyphs url (1553ms)
      ✓ maptiler access token (1111ms)
      ✓ thunderforest access token (1102ms)
      ✓ style renderer (922ms)
    sources
      - toggle



      Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  accessibility.cy.ts                       52ms        3        -        -        3        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  history.cy.ts                            00:06        1        1        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  keyboard.cy.ts                           00:10        9        9        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  layers.cy.ts                             00:39       28       17        -       11        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  map.cy.ts                                00:04        2        2        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  modals.cy.ts                             00:16       18       12        -        6        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        01:18       61       41        -       20        -  
```

---------

Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
2023-12-17 21:49:23 +02:00
Birk Skyum 0c46affda9 Add dependabot (#826)
It has a low limit on how many PRs it's allowed to open at a time, so it
should not flood the repo.
2023-12-17 01:16:47 -05:00
Harel M 18f45e932b Use driver pattern for e2e tests (#829)
I've moved all the logic relevant to WBIO into a single file in order to
be able to replace it.
I have tried to upgrade WDIO in order to use the latest version and it
got stuck on my computer.
Furthermore, I was not able to run it locally which made this whole
cycle very long.
After this will be merged I will replace WDIO with cypress.
This doesn't change anything, only moves some code in the tests to a
single file, removes unneeded files and uses the driver pattern, which
will later allow switching the underline WDIO with Cypress.

cc: @nyurik
2023-12-17 01:14:23 -05:00
Yuri Astrakhan 31d56c9fae Bump CI versions (#830) 2023-12-17 00:49:34 -05:00
Birk Skyum b7838ad6e1 Use latest firefox (#825) 2023-10-23 08:06:02 +02:00
Birk Skyum c92fd12854 Bump to node 18 (#824) 2023-10-22 22:11:06 +02:00
Birk Skyum eb55796461 Merge pull request #823 from birkskyum/new-webdriver
Chrome new headless
2023-10-22 20:20:26 +02:00
Yuri Astrakhan 4b97f82980 Revert "Revert "Resolve #821 (#822)""
This reverts commit e4d559f953.
2023-10-21 18:33:48 -04:00
Yuri Astrakhan 5d0b6e3201 Revert "Revert "Added checkbox for cluster attribute (#810)""
This reverts commit 52f949e152.
2023-10-21 18:33:46 -04:00
Birk Skyum 5ab9be9fdb update node version 2023-10-22 00:27:41 +02:00
Birk Skyum 9659d41b83 chrome new headless 2023-10-22 00:20:55 +02:00
Yuri Astrakhan 52f949e152 Revert "Added checkbox for cluster attribute (#810)"
This reverts commit 393f4a38b9.
2023-10-21 18:19:24 -04:00
Yuri Astrakhan e4d559f953 Revert "Resolve #821 (#822)"
This reverts commit 577663f706.
2023-10-21 18:19:21 -04:00
zstadler 577663f706 Resolve #821 (#822)
Please see code analysis at
https://github.com/maputnik/editor/issues/821#issuecomment-1772360990
2023-10-20 11:01:20 -04:00
Eliav-Bandshimon 393f4a38b9 Added checkbox for cluster attribute (#810)
* Added additional checkbox to set the cluster attribute when adding a GeoJson source

* Fixed default source function in the 'geojson_json' case

---------

Co-authored-by: shimon <ruisuhsh100@gmail.com>
2023-10-20 10:54:40 -04:00
Kevin Schaul 3727c9ad5e 814/remove mapbox references (#816)
Fixes #814

* fix: remove outdated references to mapbox
* docs: fix references in readme
* chore: fix mapbox references in tests
* chore: fix mapbox references in stories, webpack config
* chore: remove empty array
2023-08-28 22:17:49 -04:00
Yuri Astrakhan a99cbc00ba Merge pull request #812 from kevinschaul/switch-to-maplibre-ks
Convert from Mapbox GL to MapLibre
2023-07-18 23:32:11 +02:00
Kevin Schaul fe5f7e8b8c upgrade to setup-go@v3 2023-07-18 15:16:29 -05:00
Kevin Schaul 3ed4b8f2d7 add GOBIN to CI 2023-07-18 11:31:01 -05:00
Kevin Schaul f17c2e8112 reenable go modules in CI 2023-07-18 10:50:48 -05:00
Kevin Schaul 2be447f105 downgrade to node 16 to avoid ssl issue (for now) 2023-07-18 10:10:08 -05:00
Kevin Schaul 2fe6fa2be6 Update workflow to latest desktop, drop old node 2023-07-18 09:52:29 -05:00
Kevin Schaul 83dd21414b Merge branch 'master' into switch-to-maplibre-ks 2023-07-13 14:48:38 -05:00
Kevin Schaul 56d96a248d Remove JSON.stringify in call to validate 2023-07-13 14:43:18 -05:00
Kevin Schaul 5b1ee7296b Fix Buffer is undefined error 2023-07-13 14:35:16 -05:00
Kevin Schaul 8e0546fba4 Get map rendering with maplibre 2023-07-12 16:37:19 -05:00
Yuri Astrakhan 2ff3d08bb0 Merge pull request #796 from maputnik/dependabot/npm_and_yarn/async-2.6.4
Bump async from 2.6.3 to 2.6.4
2022-12-15 15:14:51 -05:00
dependabot[bot] afe7a492a7 Bump async from 2.6.3 to 2.6.4
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-15 19:54:14 +00:00
Yuri Astrakhan 1f26ab707f Merge pull request #792 from maputnik/dependabot/npm_and_yarn/deep-object-diff-1.1.9
Bump deep-object-diff from 1.1.7 to 1.1.9
2022-12-15 14:53:11 -05:00
Yuri Astrakhan 233191e27c Merge pull request #793 from maputnik/dependabot/npm_and_yarn/loader-utils-1.4.2
Bump loader-utils from 1.4.1 to 1.4.2
2022-12-15 14:52:58 -05:00
Yuri Astrakhan 246f9a191d Merge pull request #795 from maputnik/dependabot/npm_and_yarn/decode-uri-component-0.2.2
Bump decode-uri-component from 0.2.0 to 0.2.2
2022-12-15 14:52:17 -05:00
dependabot[bot] 07f6efe45d Bump decode-uri-component from 0.2.0 to 0.2.2
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-07 23:57:21 +00:00
dependabot[bot] ccd0402eea Bump loader-utils from 1.4.1 to 1.4.2
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-18 00:36:06 +00:00
dependabot[bot] 8ccee0ba75 Bump deep-object-diff from 1.1.7 to 1.1.9
Bumps [deep-object-diff](https://github.com/mattphillips/deep-object-diff) from 1.1.7 to 1.1.9.
- [Release notes](https://github.com/mattphillips/deep-object-diff/releases)
- [Commits](https://github.com/mattphillips/deep-object-diff/commits)

---
updated-dependencies:
- dependency-name: deep-object-diff
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 23:59:29 +00:00
Yuri Astrakhan d6b67be7b2 Merge pull request #780 from maputnik/dependabot/npm_and_yarn/ejs-3.1.7
Bump ejs from 3.1.6 to 3.1.7
2022-11-09 14:52:11 -05:00
Yuri Astrakhan ac56ea4627 Merge pull request #791 from maputnik/dependabot/npm_and_yarn/loader-utils-1.4.1
Bump loader-utils from 1.4.0 to 1.4.1
2022-11-09 14:51:37 -05:00
dependabot[bot] b00cf66ea6 Bump loader-utils from 1.4.0 to 1.4.1
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-09 03:55:59 +00:00
Luke Seelenbinder 8e329a0ff9 Remove missed reference to mapbox-gl.
* Also removes specialized support for Mapbox URLs.
2022-11-01 10:24:05 +01:00
Luke Seelenbinder 74cacd5bdf Initial work to convert from Mapbox GL v1.13 to MapLibre v2.4.0. 2022-10-27 14:02:47 +02:00
pathmapper 7d5fb23130 Merge pull request #782 from maputnik/dependabot/npm_and_yarn/got-11.8.5
Bump got from 11.8.3 to 11.8.5
2022-08-14 09:25:13 +02:00
pathmapper 08bbd55f13 Merge pull request #784 from maputnik/dependabot/npm_and_yarn/terser-4.8.1
Bump terser from 4.8.0 to 4.8.1
2022-08-14 09:25:00 +02:00
dependabot[bot] d6d4930513 Bump terser from 4.8.0 to 4.8.1
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 03:45:50 +00:00
dependabot[bot] 6220e15723 Bump got from 11.8.3 to 11.8.5
Bumps [got](https://github.com/sindresorhus/got) from 11.8.3 to 11.8.5.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v11.8.3...v11.8.5)

---
updated-dependencies:
- dependency-name: got
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 14:02:05 +00:00
dependabot[bot] 72053a2dba Bump ejs from 3.1.6 to 3.1.7
Bumps [ejs](https://github.com/mde/ejs) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/mde/ejs/releases)
- [Changelog](https://github.com/mde/ejs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mde/ejs/compare/v3.1.6...v3.1.7)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-07 04:59:25 +00:00
pathmapper bf27a35ef5 Merge pull request #778 from propheel/feat/updateDependencies
Update dependencies
2022-05-07 06:57:58 +02:00
Filip Proborszcz 4705bf823a Use geckodriver 0.30 for firefox until 0.31 works 2022-05-02 15:13:42 +02:00
Filip Proborszcz a8f6208561 Fix layer drag&drop and init warning 2022-05-01 11:28:15 +02:00
Filip Proborszcz af2629be75 Make layer list sortable again 2022-04-10 22:22:16 +02:00
pathmapper 8bfad6c9fd Merge pull request #777 from maputnik/npm-ci
Use npm ci for workflow
2022-04-09 07:51:55 +02:00
Filip Proborszcz 5c3713da90 Use proper version of array-move 2022-04-08 04:14:58 +02:00
Filip Proborszcz 174eae1cf4 Use selenium standalone service to run tests 2022-04-08 03:37:40 +02:00
Filip Proborszcz d73add77e7 Fixes for breaking changes
- new webpack dev server options
- babel support for async functions in hooks
- new uuid import style
- automatically open browser for testing
2022-04-08 02:23:43 +02:00
Filip Proborszcz ab00c9f426 Many dependency updates
@storybook 6.4.20 blocks most of others like: react 18, webpack 5,
and keeps lots of unnecessary dependencies due to chakra 2 dep.
2022-04-07 17:21:34 +02:00
pathmapper d6ab302815 Use npm ci for workflow
https://docs.npmjs.com/cli/v8/commands/npm-ci
2022-04-07 03:28:47 +02:00
pathmapper f5646f57d1 Merge pull request #776 from propheel/useNode16
Use node 16.x
2022-04-07 03:11:13 +02:00
Filip Proborszcz c77d8f6625 Use shared SHM for Docker image 2022-04-07 00:37:20 +02:00
Filip Proborszcz e34c1ca4be Use node 16.x
It required converting mocha tests code into async since [@wdio/sync is
deprecated](https://webdriver.io/docs/sync-vs-async/) starting with
node v16.
It removed the dependency on fibers and on [node-gyp + python](https://
webdriver.io/docs/sync-vs-async/#common-issues-in-sync-mode) indirectly
though which is a great thing.

Also moved away from node-sass to sass since [node-sass is deprecated]
(https://sass-lang.com/blog/libsass-is-deprecated).
2022-04-06 14:05:15 +02:00
Orange Mug 87745f1fc9 Merge pull request #752 from pathmapper/webpack_stats
Webpack stats
2021-08-06 17:59:46 +01:00
pathmapper 9ba0fd5f39 Remove yarn.lock 2021-08-04 09:44:33 +02:00
pathmapper 70decbb5c1 Change webpack-dev-server info 2021-08-04 09:36:37 +02:00
pathmapper 51fa4a4377 Merge pull request #739 from pathmapper/maputnik_tag
Request using 'maputnik' tag for SE questions
2020-10-10 20:16:33 +02:00
pathmapper fb6f4d73e2 Mention 'maputnik' tag in comment 2020-10-04 12:11:00 +02:00
pathmapper 63b14933ba Merge pull request #729 from orangemug/fix/issue-712-v2
Correctly upgrade old-style filter functions to expressions
2020-09-15 19:10:49 +02:00
Orange Mug a86c31cefa Merge pull request #727 from orangemug/feature/added-html-option-to-export
Added HTML export option to export modal.
2020-09-10 19:20:40 +01:00
orangemug 25e2554412 Another commit to force a rebuild 2020-09-10 18:07:47 +01:00
Orange Mug 34bb3bc0a7 Merge pull request #726 from orangemug/fix/issue-718
Fix to not change layer key while editing layer
2020-09-10 18:06:03 +01:00
orangemug 852243cd52 onChange -> onInput for <FieldId/> component. 2020-09-09 20:22:52 +01:00
Orange Mug 40faf86adf Merge pull request #725 from orangemug/fix/issue-710
Added 'base' to functions
2020-09-09 20:15:18 +01:00
Orange Mug bb69f143b8 Merge pull request #724 from orangemug/fix/issue-707
Remove key/value from style when editing style results in empty array
2020-09-09 20:14:58 +01:00
orangemug bb43200887 Move logic into checkIfSimpleFilter function and added FILTER_OPS check. 2020-09-09 16:12:18 +01:00
orangemug ae3f79f4ad Attempt to correctly upgrade old-style filter functions to expressions. 2020-09-09 15:55:20 +01:00
orangemug 731a315624 Merge remote-tracking branch 'upstream/master' into feature/added-html-option-to-export 2020-09-09 15:12:23 +01:00
orangemug 5e441454d5 Merge remote-tracking branch 'upstream/master' into fix/issue-718 2020-09-09 15:11:52 +01:00
orangemug a55716bbd9 Merge remote-tracking branch 'upstream/master' into fix/issue-710 2020-09-09 15:08:42 +01:00
orangemug 44aea3745e Merge remote-tracking branch 'upstream/master' into fix/issue-707 2020-09-09 15:07:35 +01:00
Orange Mug a572bc02a6 Merge pull request #728 from orangemug/fix/disable-host-check
Disable host check for codesandbox
2020-09-09 15:06:54 +01:00
orangemug 4dee95fa2e Added --disable-host-check 2020-09-09 15:02:14 +01:00
orangemug 381ff6292f Removed disableHostCheck from ./config/webpack.config.js 2020-09-09 14:56:39 +01:00
orangemug c12db1703b Changed start script for codesandbox. 2020-09-09 14:55:51 +01:00
orangemug 2676583833 Added start-sandbox script. 2020-09-09 14:55:12 +01:00
orangemug 6ca2af7f8a Change codesandbox check. 2020-09-09 14:46:09 +01:00
orangemug 553b17822d Try disable host check for codesandbox. 2020-09-09 14:19:06 +01:00
orangemug a6148e5f40 Added HTML export option to export modal. 2020-09-09 14:06:48 +01:00
orangemug 4f77629eb7 Fix to not change layer key while editing layer. 2020-09-08 17:58:33 +01:00
orangemug 9103d9560a Added 'base' to functions. 2020-09-08 16:50:29 +01:00
orangemug 06c63509f7 Remove key/value from style when editing style results in empty array 2020-09-08 16:12:41 +01:00
pathmapper bbe0af6c0e Merge pull request #716 from pathmapper/Use-desktop-v1.0.7
Use desktop v1.0.7 for CI workflow
2020-07-24 19:11:54 +02:00
pathmapper 7455ccc3b7 Use desktop v1.0.7 2020-07-24 18:41:11 +02:00
Orange Mug 8b766777ac Merge pull request #706 from orangemug/fix/input-label-a11y
Improved label accessibility
2020-06-30 10:50:37 +01:00
orangemug 8441abe907 Added padding to 'maputnik-doc-button' and removed cursor from doc label. 2020-06-30 10:30:26 +01:00
orangemug ca56951256 Fix styling in export model 2020-06-30 09:48:55 +01:00
orangemug 5981151b27 Added cursor pointer to SDK docs button 2020-06-30 09:43:24 +01:00
orangemug 21dbc6c4d9 Added back in https://github.com/maputnik/editor link 2020-06-30 09:42:05 +01:00
Orange Mug 6f060c2a0a Merge pull request #708 from pathmapper/update_mb_deps
Update mb-gl
2020-06-30 09:27:02 +01:00
pathmapper 24327541c5 Update mb-gl 2020-06-30 09:16:53 +02:00
orangemug 0d6b9ee9d4 Fixed source modal CSS for new block definitions. 2020-06-29 16:26:28 +01:00
orangemug 3ad487dce7 Removed isRequired from label incase null. 2020-06-29 16:18:04 +01:00
orangemug a46c834874 Fixed data functions. 2020-06-29 16:14:35 +01:00
orangemug 67bdea1827 Re-added info button and SDK docs to fields after refactor. 2020-06-29 16:03:59 +01:00
Orange Mug cc4133aac1 Merge pull request #703 from pathmapper/fix_674
Add again shouldComponentUpdate
2020-06-29 15:41:49 +01:00
orangemug 4a6f58d61c Changed heading sizes for modals. 2020-06-10 20:37:46 +01:00
orangemug e3dc98b76d <h2/> -> <h1/> 2020-06-10 20:37:08 +01:00
orangemug 09373dda44 Fixed changing between zoom/data functions. 2020-06-10 20:26:39 +01:00
orangemug c4b05b62b3 Remove logging. 2020-06-10 19:44:05 +01:00
orangemug 06bccfab10 Fix for checkboxes within non-clickable label 2020-06-10 19:21:29 +01:00
orangemug b83c9a1ad9 Fix block styling issues. 2020-06-10 19:20:18 +01:00
orangemug 0279daf7bd 'getApplicationNode' doesn't appear to be required as the modal is already a dialog 2020-06-10 18:17:25 +01:00
orangemug bfada7cace Added aria-label to things that are otherwise labelled in the UI. 2020-06-10 18:16:43 +01:00
orangemug 6c751fe1c4 Updated maputnik/design to diagnose axe accessibility checker issue with SVGs 2020-06-10 17:18:11 +01:00
orangemug 34299c94ee Fixed some 'axe' accessibility checker issues. 2020-06-10 16:22:13 +01:00
orangemug 5804b3c72a CSS outline fixes for keyboard users. 2020-06-10 13:04:04 +01:00
orangemug 8ae6e9fc61 Fix to ignore click suppression on inputs 2020-06-10 13:02:38 +01:00
orangemug 40579c3e0c Added back in action buttons to input label/fieldset 2020-06-10 10:59:44 +01:00
orangemug f3906c8dd8 A role="navigation" should not be on <ul/> as it changes how screen readers announce them. 2020-06-10 10:25:56 +01:00
orangemug f911ed3522 Fix <InputColor/> issues when trying to close picker. 2020-06-10 10:10:40 +01:00
orangemug 2cc179acc1 Fixed more input accessibility issues, also
- Added searchParams based router for easier testing
 - Added more stories to the storybook
2020-06-09 19:11:07 +01:00
Orange Mug 2912db6e32 Merge pull request #704 from pathmapper/update_omt_styles
Update Basic and Toner styles
2020-06-06 12:32:34 +01:00
pathmapper 70eb3e785a Trigger codesandbox 2020-06-06 12:48:34 +02:00
pathmapper 8f944d9973 Empty Commit to trigger codesanbox again 2020-06-06 12:46:53 +02:00
pathmapper 8faf841f3d Update Basic and Toner 2020-06-06 11:29:24 +02:00
pathmapper d8ba8fcbfb Add again shouldComponentUpdate 2020-06-05 15:11:49 +02:00
orangemug d6f31ec82e Block* -> Field* 2020-06-03 17:11:47 +01:00
Orange Mug b19eacf4f9 Merge pull request #699 from orangemug/maintenance/component-refactor
Tidy of components + added storybook.js
2020-06-03 16:18:04 +01:00
Orange Mug 3d158a791a Merge pull request #698 from pathmapper/issue_668
Integrate desktop builds in ci workflow
2020-06-03 14:53:06 +01:00
pathmapper 04b3b42524 Use desktop version instead of SHA 2020-06-03 15:37:17 +02:00
pathmapper af92aac7ec Remove tests 2020-06-03 13:45:59 +02:00
orangemug 90dfbf37e0 Added 'a11y' and 'source' addons to storybook as well as more stories 2020-06-03 09:52:54 +01:00
pathmapper e21f412933 Update ci.yml 2020-06-03 10:26:44 +02:00
pathmapper da297fe82c Checkout a particular SHA
https://github.com/maputnik/editor/pull/698#issuecomment-636748873
2020-06-03 10:12:32 +02:00
orangemug 624ccb5b00 Tidy of components
- Moved all components into a single directory like nextjs
 - Made component names consistent with each other
 - Made component names consistent with their export class names
 - Added storybook for a few components with the aim to extend this further.
2020-06-01 16:09:32 +01:00
pathmapper 9f0e5641ab Integrate desktop builds in ci workflow 2020-05-31 21:54:53 +02:00
Orange Mug d07b40ccef Merge pull request #696 from orangemug/feature/add-more-functional-tests
Added more webdriver tests
2020-05-31 16:05:28 +01:00
orangemug e0abd8251d Remove temp file 2020-05-31 15:57:23 +01:00
orangemug 324452e714 Disable undo/redo again. 2020-05-31 15:48:20 +01:00
orangemug 8d3ad6b1a1 Added more functional tests. 2020-05-31 15:33:09 +01:00
Orange Mug 3d4cc34a08 Merge pull request #695 from pathmapper/node_14
Add Node 14 to CI workflow
2020-05-28 11:48:59 +01:00
pathmapper ff351716b6 Update node-sass 2020-05-28 12:26:28 +02:00
Orange Mug c963a8cc59 Merge pull request #694 from pathmapper/issue_templates
Point users to https://gis.stackexchange.com/ in issue template
2020-05-28 09:39:53 +01:00
Orange Mug 52ad980aef Merge pull request #693 from pathmapper/update-mb-deps
Update GL JS and Style Spec
2020-05-28 09:38:56 +01:00
pathmapper fb04cce650 Update wdio deps 2020-05-28 08:56:23 +02:00
pathmapper 4b8acb10b0 Add Node 14 2020-05-28 08:39:57 +02:00
pathmapper 86d67389fc Update bug_report.md 2020-05-28 08:30:11 +02:00
pathmapper 9dad53e444 Point users to https://gis.stackexchange.com/ 2020-05-28 08:23:14 +02:00
pathmapper d5afeb14c1 Update bug_report.md 2020-05-28 08:04:15 +02:00
pathmapper 85bb1d4d40 Update MB dependencies 2020-05-28 07:29:55 +02:00
Orange Mug d95e25d185 Merge pull request #692 from orangemug/feature/codesandbox-ci
Added back in codesandbox CI config
2020-05-27 11:12:00 +01:00
Orange Mug a88f2bc0a3 Merge pull request #691 from orangemug/fix/readme-styling
Fixed README styling
2020-05-27 11:11:46 +01:00
orangemug 5a4254d300 Added back in codesandbox CI config. 2020-05-27 10:45:52 +01:00
orangemug 6bfe2aa364 Reordered header items in README. 2020-05-27 10:37:01 +01:00
orangemug 0acd1fec0a Fixed README styling, updated logo and removed broken badges. 2020-05-27 10:32:03 +01:00
pathmapper 3046fedb55 Merge pull request #690 from pathmapper/other_issue_template
Add other issue template
2020-05-27 11:26:23 +02:00
Orange Mug 1574b49b01 Merge pull request #687 from orangemug/feature/github-actions-ci
Added new CI workflow using GitHub actions
2020-05-27 10:20:21 +01:00
pathmapper 4417a2d8f1 Add other issue template 2020-05-27 11:18:27 +02:00
pathmapper 1f34e927e7 Merge pull request #689 from pathmapper/master
Add issue template for bug report
2020-05-27 10:58:00 +02:00
pathmapper 9af6a537ef Update issue templates
Add custom bug report
2020-05-27 10:48:54 +02:00
Orange Mug 6e07142f13 Merge pull request #546 from nyurik/dockerfile
Optimize docker image
2020-05-25 09:41:15 +01:00
orangemug d2853f34a4 Removed meta-demo-comment as it won't work from forked repos 2020-05-25 06:58:57 +01:00
orangemug 7faed0d27e Added firefox tests and fixed docker deploy 2020-05-24 12:56:52 +01:00
Orange Mug 22101f93ad Merge pull request #686 from orangemug/fix/issue-322
Added tip to JSON editor about how to unfocus
2020-05-24 12:04:35 +01:00
orangemug 0661899d54 Fixes for code review comments. 2020-05-24 11:46:47 +01:00
Orange Mug 862ac84464 Merge pull request #683 from orangemug/fix/a11y-issue-320
Fix some accessibility issues
2020-05-24 11:44:41 +01:00
Orange Mug 1e4aadbb6d Merge pull request #684 from orangemug/fix/issue-533
Fix for updating available sources cache when updating style
2020-05-24 11:42:15 +01:00
orangemug ce731e7d6b Added new CI workflow using GitHub actions.
Also

 - Fixed screenshot tests
 - Fixed code coverage
 - Removed appveyor
 - Removed circleci
 - Updated wdio related dependencies
 - Added docker image deploy to the GitHub registry
2020-05-24 11:13:16 +01:00
orangemug 5448cdbe4e Don't remember state when toggling <AddModal/> 2020-05-21 10:07:22 +01:00
orangemug 315a9b82c0 Fixed for initial focus of JSON editor message. 2020-05-21 09:22:42 +01:00
orangemug 9e1c0e4c82 Added aria-hidden to JSON editor message. 2020-05-21 09:20:47 +01:00
orangemug 7db675e0d1 Added ESC note to JSON editor. 2020-05-19 12:21:12 +01:00
orangemug 0aa629164a Fix for updating available sources when updating style. 2020-05-19 10:24:59 +01:00
orangemug c2ec77e869 Fixed lint errors. 2020-05-18 19:41:09 +01:00
orangemug b28407a4a0 Accessibility fixes
- Aria landmarks
 - Title attributes to all icon only buttons
 - <Multibutton/> now internally a radio group
 - Replaced 1 'skip navigation link' with UI group links
 - Added map specific shortcuts to the shortcut menu
 - Hidden layer list actions from tab index
2020-05-18 19:37:49 +01:00
Orange Mug e3e6647e03 Merge pull request #682 from orangemug/fix/issue-681
Fix open modal URL entry to use form submission
2020-05-14 15:32:09 +01:00
orangemug eb0f833d49 Fixed typo. 2020-05-14 13:33:57 +01:00
orangemug c5c1dd12b9 Added missing prop validation 2020-05-14 13:27:43 +01:00
orangemug b7e414a042 Fix URL entry to use form submission and improved errors if protocol isn't present. 2020-05-14 12:13:47 +01:00
Orange Mug 81a6f31803 Merge pull request #680 from pathmapper/mb_styles
Fix token input
2020-05-14 11:49:33 +01:00
pathmapper 65cd050a18 Fix token input 2020-05-05 09:40:43 +02:00
Orange Mug c426dd7349 Merge pull request #673 from pathmapper/update_mb_dependencies
Update MB deps
2020-05-02 09:33:10 +01:00
Orange Mug c5af645546 Merge pull request #675 from nspringer-trimble/feature/inspect-source-name
Add source name to inspect popup
2020-05-02 09:32:07 +01:00
pathmapper 1bf0abfb5a Update MB deps 2020-04-30 09:18:13 +02:00
Nick Springer 18338de21a Add source name to inspect popup 2020-04-27 15:30:07 -04:00
Orange Mug 857117eb71 Merge pull request #666 from orangemug/fix/issue-646
Fix to make layer list header visible at all times
2020-04-26 10:15:33 +01:00
Orange Mug 8d86bca8b3 Merge pull request #671 from pathmapper/update_readme
Remove v1.7.0-beta from readme
2020-04-26 10:02:51 +01:00
orangemug dc4e6a0925 Fix vertical align of view/select in toolbar 2020-04-26 09:58:21 +01:00
pathmapper e9d6119ac6 Remove v1.7.0-beta from readme 2020-04-26 10:58:01 +02:00
orangemug cbdf45c852 Fixed <select/> styling in firefox and improved in chrome. 2020-04-26 09:23:18 +01:00
Orange Mug a191c36f96 Merge pull request #667 from orangemug/fix/issue-656
Support multiple tiles URLs for source
2020-04-25 13:52:30 +01:00
orangemug 0a8d0974ca Fixed field spec for image/video. 2020-04-25 13:31:15 +01:00
orangemug 8e6c54564b Add <DynamicArrayInput/> to source tile urls to support multiple values. 2020-04-25 11:38:13 +01:00
orangemug 4bbe2ce1ea Fix to make layer list header visible at all times.
Also improved scrollbar styling/positioning for toolbar and layers list.
2020-04-25 11:05:34 +01:00
orangemug 1d48ab7ecf 1.7.0 2020-04-23 21:12:38 +01:00
Orange Mug d85ed36e70 Merge pull request #663 from nspringer-trimble/patch-1
Fix for desktop build
2020-04-22 20:30:00 +01:00
Nick Springer b554f4427b Fix for desktop build 2020-04-21 09:17:30 -04:00
orangemug 184bfeeaf8 1.7.0-beta4 2020-04-20 13:13:36 +01:00
orangemug e45f8d960d Added space for beta tag in logo/version header 2020-04-20 13:12:48 +01:00
Orange Mug 1fede3af3a Merge pull request #661 from orangemug/fix/issue-660-v2
Added JSON linting back into <SourceTypeEditor/>
2020-04-20 13:09:29 +01:00
orangemug 5ad74048bd Added JSON linting back into <SourceTypeEditor/> 2020-04-20 11:07:08 +01:00
orangemug a0a91474de 1.7.0-beta3 2020-04-19 08:45:18 +01:00
Orange Mug c3670701e5 Merge pull request #606 from orangemug/fix/issue-591
Added style formatting into the api store
2020-04-19 08:38:37 +01:00
Orange Mug 86923330d9 Merge pull request #658 from pathmapper/feature_id_inspect
Add feature id to FeaturePropertyPopup
2020-04-19 08:00:00 +01:00
pathmapper 4517148e5a Add underscore to label 2020-04-18 11:43:52 +02:00
pathmapper 0433d66f45 Add feature id to FeaturePropertyPopup 2020-04-18 11:25:54 +02:00
Orange Mug 0c592bacab Merge pull request #650 from orangemug/fix/issue-647
Fixed crash raised in issue #647
2020-04-14 21:15:59 +01:00
Orange Mug d98637cb12 Merge pull request #645 from orangemug/feature/add-support-for-identity-functions
Add support for identity functions
2020-04-14 09:12:35 +01:00
orangemug 1070209cb5 Another attempt and maputnik inspect crashing issue. 2020-04-14 09:11:09 +01:00
orangemug b6189f77c4 Added icons to buttons. 2020-04-14 08:31:55 +01:00
Orange Mug 25322a3952 Merge pull request #655 from orangemug/fix/issue-653
Added missing inline error for 'source' field
2020-04-13 10:57:01 +01:00
Orange Mug 5943c6f282 Merge pull request #654 from orangemug/fix/issue-649
Fixed default values for <FontInput/>
2020-04-13 10:56:47 +01:00
orangemug 090a26bb40 Added missing inline error for 'source' field. 2020-04-13 09:10:30 +01:00
orangemug af03b010a4 Fixed default values for <FontInput/> 2020-04-13 08:53:33 +01:00
orangemug 578a920b6d Fixed crash raised in issue #647 2020-04-13 08:39:23 +01:00
pathmapper 0858a16ffc Merge pull request #644 from orangemug/fix/remove-heavy-thunderforest-tiles
Remove notes from thunderforest sources
2020-04-12 21:04:35 +02:00
orangemug 7cfe0563bc Added support for identity functions. 2020-04-12 16:25:32 +01:00
orangemug ee72389534 Remove mentions of 'heavy' from thunderforest tiles. 2020-04-12 12:14:56 +01:00
pathmapper 8f722c59de Merge pull request #642 from pathmapper/upgrade_thunderforest
Upgrade Thunderforest tilesets from v1 to v2
2020-04-11 15:48:03 +02:00
pathmapper 94d2e958eb Add version to titles 2020-04-10 18:23:31 +02:00
pathmapper d931c7cb38 Upgrade Thunderforest tilesets 2020-04-10 18:13:23 +02:00
orangemug 6da83c4670 1.7.0-beta2 2020-04-06 16:57:02 +01:00
Orange Mug d26af16003 Merge pull request #639 from orangemug/fix/only-scroll-layer-list-if-item-not-in-view
Only scroll to selected item in <LayerList/> if not already in view.
2020-04-06 16:55:26 +01:00
Orange Mug d75b86c927 Merge pull request #638 from orangemug/maintenance/update-deps-20200406
Update all deps
2020-04-06 16:54:06 +01:00
orangemug a0cd087ccc Revert webdriverio version updates. 2020-04-06 15:47:12 +01:00
orangemug 313b639a5f Only scroll to selected item in <LayerList/> if not already in view. 2020-04-06 15:30:16 +01:00
orangemug 93c45d5340 Update all deps. 2020-04-06 15:14:21 +01:00
Orange Mug 3be6cb5926 Merge pull request #637 from orangemug/fix/console-errors-2020-04-06
Fix a bunch of errors/warnings from the console
2020-04-06 15:06:39 +01:00
Orange Mug 9d151fdc1f Merge pull request #636 from pathmapper/promote_beta
Promote v1.7.0-beta in readme
2020-04-06 14:32:29 +01:00
orangemug 44d1a7a6b0 {arrayMove} will no longer be included in 'react-sortable-hoc', move to array-move. 2020-04-06 14:18:41 +01:00
pathmapper 0e5676eae0 Promote v1.7.0-beta in readme 2020-04-06 15:14:42 +02:00
orangemug b8739915b2 Lots of smaller fixes found in the console logs during testing. 2020-04-06 13:59:08 +01:00
Orange Mug a1dedd1aa6 Merge pull request #634 from orangemug/fix/issue-630
Scroll selected <LayerListItem/> into view
2020-04-06 13:11:53 +01:00
Orange Mug 33b4a40c35 Merge pull request #635 from orangemug/fix/issue-633
Fixes for <NumberInput/>
2020-04-06 13:10:48 +01:00
orangemug a624909819 Reset dirtyValue on resetValue 2020-04-06 10:40:30 +01:00
orangemug d5d387f349 Removed placeholder on range (doesn't work) in favour 'default' value merged into 'value'. 2020-04-06 10:24:31 +01:00
orangemug c58ae0f895 Fix <NumberInput/> to allow for decimal numbers. 2020-04-06 09:55:07 +01:00
orangemug c9e360d675 Fix layer selection via <FeatureLayerPopup/> 2020-04-06 08:47:13 +01:00
orangemug 75ece350bd Merge remote-tracking branch 'upstream/master' into fix/issue-630 2020-04-04 15:48:52 +01:00
Orange Mug 45680151ef Merge pull request #632 from orangemug/fix/color-popup-swatch
Fix color in <FeatureLayerPopup/>
2020-04-04 15:48:35 +01:00
orangemug 87bae82b17 Merge remote-tracking branch 'upstream/master' into fix/issue-630 2020-04-04 15:44:29 +01:00
orangemug fcad636f85 Scroll selected <LayerListItem/> into view 2020-04-04 15:41:35 +01:00
orangemug bac8495b3c Made <FeatureLayerPopup/> swatch simplier because colors from features are already evaluated 2020-04-04 10:45:11 +01:00
orangemug df98cb9c7b Fix layer color swatch in <FeatureLayerPopup/> 2020-04-04 10:21:58 +01:00
Orange Mug 34c3015b42 Merge pull request #625 from orangemug/fix/invalid-style-with-duplicate-layer-ids
Fix UI when loading invalid style with duplicate layer ids
2020-03-30 20:38:25 +01:00
orangemug ca7bf9f4a7 Fixed lint errors. 2020-03-30 09:57:14 +01:00
orangemug 61ba399e1c Duplicate layer ids now show errors inline. 2020-03-30 09:47:46 +01:00
orangemug b5c09a4f17 Merge remote-tracking branch 'upstream/master' into fix/invalid-style-with-duplicate-layer-ids 2020-03-30 08:52:37 +01:00
orangemug 6f83839a4c Added missing file. 2020-03-28 11:06:45 +00:00
orangemug 74b47e7e74 Fix UI when loading invalid style with duplicate layer ids.
Also fix for throwing error when 2 layers exist with empty strings as ids.
2020-03-28 10:58:47 +00:00
orangemug 6b45dc8b4d Added style formatting into apistore 2020-01-19 20:05:11 +00:00
Yuri Astrakhan 2a832955c4 Updated docs, rm creds 2019-08-03 15:02:16 -04:00
Yuri Astrakhan 608b836fe0 fix readme 2019-08-03 12:37:19 -04:00
Yuri Astrakhan de9c4fcc4a Optimize docker image
* Use 2 stage docker building to produce a tiny python3-slim based docker image with just the compilation results.
2019-08-03 12:08:54 -04:00
194 changed files with 1223 additions and 31486 deletions

No files matched your search

-20
View File
@@ -1,20 +0,0 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"static-fs",
"react-hot-loader/babel",
"@babel/plugin-proposal-class-properties"
],
"env": {
"test": {
"plugins": [
["istanbul", {
"exclude": ["node_modules/**", "test/**"]
}]
]
}
}
}
-103
View File
@@ -1,103 +0,0 @@
version: 2
templates:
# Test the build **only** no webdriver
build-steps: &build-steps
- checkout
- run:
name: "Create artifacts directory"
command: mkdir /tmp/artifacts
- restore_cache:
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }}
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }}
- run: mkdir -p /tmp/artifacts/logs
- run: npm run build
- run: npm run lint-js
- run: npm run lint-css
- store_artifacts:
path: /tmp/artifacts
destination: /artifacts
# Test in webdriver
wdio-steps: &wdio-steps
- checkout
- run:
name: "Create artifacts directory"
command: mkdir /tmp/artifacts
- restore_cache:
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }}
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }}
- run: mkdir -p /tmp/artifacts/logs
- run: npm run build
- run: npm run profiling-build
- run: npm run lint-js
- run: npm run lint-css
- run: DOCKER_HOST=localhost npm test
- run: ./node_modules/.bin/istanbul report --include /tmp/artifacts/coverage/coverage.json --dir /tmp/artifacts/coverage html lcov
- store_artifacts:
path: /tmp/artifacts
destination: /artifacts
jobs:
build-linux-node-v10:
docker:
- image: node:10
- image: selenium/standalone-chrome:3.141.59
working_directory: ~/repo-linux-node-v10
steps: *wdio-steps
build-linux-node-v12:
docker:
- image: node:12
working_directory: ~/repo-linux-node-v12
steps: *build-steps
build-linux-node-v13:
docker:
- image: node:13
working_directory: ~/repo-linux-node-v13
steps: *build-steps
build-osx-node-v10:
macos:
xcode: "9.0"
dependencies:
override:
- brew install node@10
working_directory: ~/repo-osx-node-v10
steps: *build-steps
build-osx-node-v12:
macos:
xcode: "9.0"
dependencies:
override:
- brew install node@12
working_directory: ~/repo-osx-node-v12
steps: *build-steps
build-osx-node-v13:
macos:
xcode: "9.0"
dependencies:
override:
- brew install node@13
working_directory: ~/repo-osx-node-v13
steps: *build-steps
workflows:
version: 2
build:
jobs:
- build-linux-node-v10
- build-linux-node-v12
- build-linux-node-v13
- build-osx-node-v10
- build-osx-node-v12
- build-osx-node-v13
-14
View File
@@ -1,14 +0,0 @@
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,jsx,html,sass}]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
-1
View File
@@ -1 +0,0 @@
custom: "https://maputnik.github.io/donate"
-35
View File
@@ -1,35 +0,0 @@
# Logs
logs
*.log
*.swp
*.swo
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
# Ignore build files
public
/errorShots
/old
/build
View File
File renamed without changes.
-15
View File
@@ -1,15 +0,0 @@
{
"labels": {
"bug": 5,
"maintenance": 3,
"mentioned in the 1st survey": 2
},
"reactions": {
"+1": 2,
"-1": -1,
"laugh": 1,
"hooray": 2,
"confused": 1,
"heart": 2
}
}
-21
View File
@@ -1,21 +0,0 @@
FROM node:10-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
python \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 8888
ENV HOME /maputnik
RUN mkdir ${HOME}
COPY . ${HOME}/
WORKDIR ${HOME}
RUN npm install -d
RUN npm run build
WORKDIR ${HOME}/build/build
CMD python -m SimpleHTTPServer 8888
-22
View File
@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 Lukas Martinelli
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-170
View File
@@ -1,170 +0,0 @@
# Maputnik
[![Build Status](https://circleci.com/gh/maputnik/editor/tree/master.svg?style=shield)][circleci]
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/anelbgv6jdb3qnh9/branch/master?svg=true)][appveyor]
[![Dependency Status](https://david-dm.org/maputnik/editor.svg)][dm-prod]
[![Dev Dependency Status](https://david-dm.org/maputnik/editor/dev-status.svg)][dm-dev]
[![License](https://img.shields.io/badge/license-MIT-blue.svg)][license]
[circleci]: https://circleci.com/gh/maputnik/editor/tree/master
[appveyor]: https://ci.appveyor.com/project/lukasmartinelli/editor
[dm-prod]: https://david-dm.org/maputnik/editor
[dm-dev]: https://david-dm.org/maputnik/editor?type=dev
[license]: https://tldrlegal.com/license/mit-license
<img width="200" align="right" alt="Maputnik" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/src/img/maputnik.png" />
A free and open visual editor for the [Mapbox GL styles](https://www.mapbox.com/mapbox-gl-style-spec/)
targeted at developers and map designers.
- :link: Design your maps online at **<https://maputnik.github.io/editor/>** (all in local storage)
- :link: Use the [Maputnik CLI](https://github.com/maputnik/editor/wiki/Maputnik-CLI) for local style development
Mapbox has built one of the best and most amazing OSS ecosystems. A key component to ensure its longevity and independence is an OSS map designer.
## Donations
If you or your organisation has seen value from Maputnik, please consider donating at <https://maputnik.github.io/donate>
## Documentation
The documentation can be found in the [Wiki](https://github.com/maputnik/editor/wiki). You are welcome to collaborate!
- :link: **Study the [Maputnik Wiki](https://github.com/maputnik/editor/wiki)**
- :video_camera: Design a map from Scratch https://youtu.be/XoDh0gEnBQo
[![Design Map from Scratch](https://j.gifs.com/g5XMgl.gif)](https://youtu.be/XoDh0gEnBQo)
## Develop
Maputnik is written in ES6 and is using [React](https://github.com/facebook/react) and [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/).
We ensure building and developing Maputnik works with the [current active LTS Node.js version and above](https://github.com/nodejs/Release#release-schedule).
Install the deps, start the dev server and open the web browser on `http://localhost:8888/`.
```bash
# install dependencies
npm install
# start dev server
npm start
```
If you want Maputnik to be accessible externally use the [`--host` option](https://webpack.js.org/configuration/dev-server/#devserverhost):
```bash
# start externally accessible dev server
npm start -- --host 0.0.0.0
```
The build process will watch for changes to the filesystem, rebuild and autoreload the editor. However note this from the [webpack-dev-server docs](https://webpack.js.org/configuration/dev-server/):
> webpack uses the file system to get notified of file changes. In some cases this does not work. For example, when using Network File System (NFS). Vagrant also has a lot of problems with this. ([snippet source](https://webpack.js.org/configuration/dev-server/#devserverwatchoptions-))
To enable polling add `export WEBPACK_DEV_SERVER_POLLING=1` to your environment.
```
npm run build
```
Lint the JavaScript code.
```
# run linter
npm run lint
npm run lint-styles
```
## Tests
For testing we use [webdriverio](http://webdriver.io) and [selenium-standalone](https://github.com/vvo/selenium-standalone)
[selenium-standalone](https://github.com/vvo/selenium-standalone) starts a server that will launch browsers on your local machine. We use chrome so you **must** have chrome installed on your machine.
Now open a terminal and run the following. This will install the drivers on your local machine
```
./node_modules/.bin/selenium-standalone install
```
Now start the standalone server
```
./node_modules/.bin/selenium-standalone start
```
Then open another terminal and run
```
npm test
```
After some time you should see a browser launch which will be automated by the test runner.
## Related Projects
- [maputnik-dev-server](https://github.com/nycplanning/labs-maputnik-dev-server) - An express.js server that allows for quickly loading the style from any mapboxGL map into mapuntnik.
## Sponsors
Thanks to the supporters of the **[Kickstarter campaign](https://www.kickstarter.com/projects/174808720/maputnik-visual-map-editor-for-mapbox-gl)**. This project would not be possible without these commercial and individual sponsors.
### Gold
- [Wemap](https://getwemap.com/)
- [Orbicon Informatik](https://www.orbiconinformatik.dk/)
- [Terranodo](http://terranodo.io/)
<a href="https://getwemap.com/">
<img width="33%" alt="Wemap" style="display:inline" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/media/sponsors/wemap.jpg" />
</a>
<a href="http://terranodo.io/">
<img width="33%" alt="Terranodo" style="display:inline" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/media/sponsors/terranodo.png" />
</a>
<a href="https://www.orbiconinformatik.dk/">
<img width="32%" alt="Terranodo" style="display:inline" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/media/sponsors/orbicon_informatik.png" />
</a>
<br/>
### Silver
- [Klokan Technologies](https://www.klokantech.com/)
- [Geofabrik](http://www.geofabrik.de/)
- [Dreipol](https://www.dreipol.ch/)
<a href="https://www.klokantech.com/">
<img width="18%" alt="Klokan Technologies" style="display:inline-block" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/media/sponsors/klokantech.png" />
</a>
<a href="http://www.geofabrik.de/">
<img width="18%" alt="Geofabrik" style="display:inline-block" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/media/sponsors/geofabrik.png" />
</a>
<a href="https://www.dreipol.ch/">
<img width="18%" alt="Dreipol" style="display:inline-block" src="https://cdn.jsdelivr.net/gh/maputnik/editor@1.5.0/media/sponsors/dreipol.png" />
</a>
<br/>
### Individuals
**Influential Stakeholder**
Alan McConchie, Odi, Mats Norén, Uli [geOps](http://geops.ch/), Helge Fahrnberger ([Toursprung](http://www.toursprung.com/)), Kirusanth Poopalasingam
**Stakeholder**
Brian Flood, Vasile Coțovanu, Andreas Kalkbrenner, Christian Mäder, Gregor Wassmann, Lee Armstrong, Rafel, Jon Burgess, Lukas Lehmann, Joachim Ungar, Alois Ackermann, Zsolt Ero, Jordan Meek
**Supporter**
Sina Martinelli, Nicholas Doiron, Neil Cawse, Urs42, Benedikt Groß, Manuel Roth, Janko Mihelić, Moritz Stefaner, Sebastian Ahoi, Juerg Uhlmann, Tom Wider, Nadia Panchaud, Oliver Snowden, Stephan Heuel, Tobin Bradley, Adrian Herzog, Antti Lehto, Pascal Mages, Marc Gehling, Imre Samu, Lauri K., Visahavel Parthasarathy, Christophe Waterlot-Buisine, Max Galka, ubahnverleih, Wouter van Dam, Jakob Lobensteiner, Samuel Kurath, Brian Bancroft
## License
Maputnik is [licensed under MIT](LICENSE) and is Copyright (c) Lukas Martinelli and contributors.
**Disclaimer** This project is not affiliated with Mapbox or Mapbox Studio. It is an independent style editor for the
open source technology in the Mapbox GL ecosystem.
As contributor please take extra care of not violating any Mapbox trademarks. Do not get inspired by Mapbox Studio and make your own decisions for a good style editor.
-26
View File
@@ -1,26 +0,0 @@
image: Visual Studio 2019
environment:
matrix:
- nodejs_version: "10"
- nodejs_version: "12"
- nodejs_version: "13"
platform:
- x86
- x64
install:
# https://github.com/appveyor/ci/issues/2921#issuecomment-501016533
- ps: |
try {
Install-Product node $env:nodejs_version $env:platform
} catch {
echo "Unable to install node $env:nodejs_version, trying update..."
Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
}
- md public
- npm install --global windows-build-tools
- npm install
build_script:
- npm run build
test_script:
- npm run lint-js
- npm run lint-css
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+1
View File
@@ -0,0 +1 @@
html{background-color:#1c1f24}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{font-size:100%;font:inherit;vertical-align:baseline;border:0;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}@font-face{font-family:Roboto;src:url(/maputnik/assets/Roboto-Regular-B-HLW1rL.ttf)format("truetype");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:Roboto;src:url(/maputnik/assets/Roboto-Medium-C0z2xw0d.ttf)format("truetype");font-weight:700;font-style:normal;font-display:swap}html{color:#f0f0f0;box-sizing:border-box;font-size:14px}body{overflow:hidden}*,:before,:after{box-sizing:inherit}p{color:#a4a4a4;margin-top:5px;margin-bottom:5px;font-size:12px;line-height:1.3}h1{margin-bottom:10px;font-size:20px;font-weight:700}h2{margin-bottom:10px;font-size:18px;font-weight:700}h3{margin-bottom:10px;font-size:16px;font-weight:700}h4{margin-bottom:10px;font-size:14px}input:focus,textarea:focus,[role=button]:focus,button:focus,.maputnik-toolbar-link:focus,select:focus{color:#f0f0f0;outline:1px auto #8e8e8e}label:hover{color:#f0f0f0}.clearfix:after{content:"";clear:both;display:table}a{color:#fff}.hide{display:none!important}.maputnik-map__container{background:#fff;width:100%;height:100%;display:flex}.maputnik-map__container--error{justify-content:center;align-items:center}.maputnik-map__container__error-message{text-align:center;margin:16px}.maputnik-map__map{width:100%;height:100%}.maputnik-input-block:hover .maputnik-doc-button,.maputnik-filter-editor-compound-select:hover .maputnik-doc-button{opacity:1;pointer-events:all;cursor:pointer}.maputnik-doc-wrapper{box-sizing:border-box;-webkit-user-select:none;user-select:none;vertical-align:top;font-size:12px;line-height:2;display:inline-block;position:relative}.maputnik-doc-popup{color:#a4a4a4;z-index:10;pointer-events:none;background-color:#222429;width:120px;padding:5px;font-size:10px;display:none;position:absolute;top:20px;left:0}.maputnik-doc-button{opacity:0;pointer-events:none;color:#fff;background:#191b20;border:none;padding:4px}.maputnik-doc-button svg{pointer-events:none}.maputnik-doc-button--open{opacity:1;pointer-events:all}.maputnik-doc-inline{color:#a4a4a4;background-color:#222429;flex:1 0;margin-top:10px;padding:5px;font-size:12px;line-height:1.5}.maputnik-doc-target:hover .maputnik-doc-popup{text-align:left;display:block}.maputnik-button{cursor:pointer;color:#a4a4a4;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#303237;border-width:0;border-radius:2px;padding:5px;font-size:12px;text-decoration:none;display:inline-block}.maputnik-button:hover{color:#f0f0f0;background-color:#4d5058}.maputnik-button:disabled{color:#303237;cursor:not-allowed;background-color:#242629}.maputnik-big-button{margin-top:10px;padding:10px;font-size:14px;display:inline-block}.maputnik-wide-button{padding:5px 10px}.maputnik-green-button{color:#191b20;background-color:#53b972}.maputnik-white-button{color:#191b20;background-color:#f0f0f0}.maputnik-icon-button,.maputnik-icon-button:hover:not(:disabled){background-color:#0000}.maputnik-icon-button:hover:not(:disabled) label,.maputnik-icon-button:hover:not(:disabled) svg{cursor:pointer}.maputnik-icon-button:hover:not(:disabled) svg{fill:#f0f0f0}.maputnik-input-block{flex-wrap:wrap;margin:10px;display:flex}.maputnik-input-block-label{color:#a4a4a4;-webkit-user-select:none;user-select:none;vertical-align:top;width:32%;font-size:12px}.maputnik-input-block-action{color:#a4a4a4;-webkit-user-select:none;user-select:none;vertical-align:top;text-align:right;width:18%;font-size:12px}.maputnik-input-block-content{width:50%}.maputnik-action-block .maputnik-input-block-label{width:32%;margin-bottom:10px;display:inline-block}.maputnik-action-block .maputnik-input-block-action{vertical-align:top;width:18%;display:inline-block}.maputnik-action-block .maputnik-input-block-action>div{text-align:right}.maputnik-data-spec-block .maputnik-inline-error,.maputnik-zoom-spec-property .maputnik-inline-error{margin-left:32%}.maputnik-space{flex-grow:1}.maputnik-message-panel{padding:5px}.maputnik-message-panel-error{color:#cf4a4a}.maputnik-message-panel__switch-button{all:unset;cursor:pointer;text-decoration:underline}.maputnik-dialog__buttons{text-align:right}.map-state-menu{display:inline-block}.map-state-menu__menu{z-index:999999;background:#191b20;flex-direction:column;align-content:stretch;display:flex;positLine truncated
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"mappings":"+gDAWA,IAAIA,EAAqB,OAAO,IAAI,4BAA4B,EAC9DC,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAAyB,OAAO,IAAI,mBAAmB,EACvDC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAyB,OAAO,IAAI,mBAAmB,EACvDC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAAkB,OAAO,IAAI,YAAY,EACzCC,EAAkB,OAAO,IAAI,YAAY,EACzCC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAA6B,OAAO,IAAI,uBAAuB,EAC/DC,EAAwB,OAAO,SACjC,SAASC,EAAc,EAAe,CAKpC,OAJ2C,OAAOC,GAApB,WAAjBA,EAA2D,MACxE,EACGF,GAAyBE,EAAcF,IACxCE,EAAc,cACM,OAAOA,GAAtB,WAAsCA,EAAgB,KAC/D,CACA,IAAIC,EAAuB,CACvB,UAAW,UAAY,CACrB,MAAO,CAAC,CACV,EACA,mBAAoB,UAAY,CAAC,EACjC,oBAAqB,UAAY,CAAC,EAClC,gBAAiB,UAAY,CAAC,CAChC,EACAC,EAAS,OAAO,OAChBC,EAAc,CAAC,EACjB,SAASC,EAAU,EAAO,EAAS,EAAS,CAC1C,KAAK,MAAQC,EACb,KAAK,QAAUC,EACf,KAAK,KAAOH,EACZ,KAAK,QAAUI,GAAWN,CAC5B,CACA,EAAU,UAAU,iBAAmB,CAAC,EACxC,EAAU,UAAU,SAAW,SAAU,EAAc,EAAU,CAC/D,GACe,OAAOO,GAApB,UACe,OAAOA,GAAtB,YACQA,GAAR,KAEA,MAAM,MACJ,wGACF,EACF,KAAK,QAAQ,gBAAgB,KAAMA,EAAcC,EAAU,UAAU,CACvE,EACA,EAAU,UAAU,YAAc,SAAU,EAAU,CACpD,KAAK,QAAQ,mBAAmB,KAAMA,EAAU,aAAa,CAC/D,EACA,SAASC,GAAiB,CAAC,CAC3B,EAAe,UAAYN,EAAU,UACrC,SAASO,EAAc,EAAO,EAAS,EAAS,CAC9C,KAAK,MAAQN,EACb,KAAK,QAAUC,EACf,KAAK,KAAOH,EACZ,KAAK,QAAUI,GAAWN,CAC5B,CACA,IAAIW,EAA0B,EAAc,UAAY,IAAIF,EAC5D,EAAuB,YAAcC,EACrCT,EAAOU,EAAwBR,EAAU,SAAS,EAClD,EAAuB,qBAAuB,CAAC,EAC/C,IAAIS,EAAc,MAAM,QACxB,SAASC,GAAO,CAAC,CACjB,IAAIC,EAAuB,CAAE,EAAG,KAAM,EAAG,KAAM,EAAG,KAAM,EAAG,IAAK,EAC9DC,EAAiB,OAAO,UAAU,eACpC,SAASC,EAAa,EAAM,EAAK,EAAO,CACtC,IAAIC,EAAUb,EAAM,IACpB,MAAO,CACL,SAAUpB,EACJ,OACD,MACL,IAAgBiC,IAAX,IAAK,GAA0B,KAAVA,EACnB,OACT,CACF,CACA,SAASC,EAAmB,EAAY,EAAQ,CAC9C,OAAOF,EAAaG,EAAW,KAAMC,EAAQD,EAAW,KAAK,CAC/D,CACA,SAASE,EAAe,EAAQ,CAC9B,OACe,OAAOC,GAApB,YACSA,GACTA,EAAO,WAAatC,CAExB,CACA,SAASuC,EAAO,EAAK,CACnB,IAAIC,EAAgB,CAAE,IAAK,KAAM,IAAK,IAAK,EAC3C,MACE,IACAC,EAAI,QAAQ,QAAS,SAAU,EAAO,CACpC,OAAOD,EAAcE,EACvB,CAAC,CAEL,CACA,IAAIC,GAA6B,OACjC,SAASC,EAAc,EAAS,EAAO,CACrC,OAAoB,OAAOC,GAApB,UAAwCA,GAAmBA,EAAQ,KAAhB,KACtDN,EAAO,GAAKM,EAAQ,GAAG,EACvBC,EAAM,SAAS,EAAE,CACvB,CACA,SAASC,GAAgB,EAAU,CACjC,OAAQC,EAAS,OAAjB,CACE,IAAK,YACH,OAAOA,EAAS,MAClB,IAAK,WACH,MAAMA,EAAS,OACjB,QACE,OACgB,OAAOA,EAAS,QAA7B,SACGA,EAAS,KAAKnB,EAAMA,CAAI,GACtB,EAAS,OAAS,UACpBmB,EAAS,KACP,SAAU,EAAgB,CACVA,EAAS,SAAvB,YACI,EAAS,OAAS,YACnB,EAAS,MAAQC,EACtB,EACA,SAAU,EAAO,CACDD,EAAS,SAAvB,YACI,EAAS,OAAS,WAAc,EAAS,OAASE,EACxD,CACF,GACJF,EAAS,OAfX,CAiBE,IAAK,YACH,OAAOA,EAAS,MAClB,IAAK,WACH,MAAMA,EAAS,MACnB,CACJ,CACA,MAAMA,CACR,CACA,SAASG,GAAa,EAAU,EAAO,EAAe,EAAW,EAAU,CACzE,IAAIC,EAAO,OAAOC,GACED,IAAhB,aAAsCA,IAAd,aAAoB,EAAW,MAC3D,IAAIE,EAAiB,CAAC,EACtB,GAAaD,IAAT,KAAmB,EAAiB,CAAC,OAEvC,OAAQD,EAAR,CACE,IAAK,SACL,IAAK,SACL,IAAK,SACH,EAAiB,CAAC,EAClB,MACF,IAAK,SACH,OAAQC,EAAS,SAAjB,CACE,KAAKrD,EACL,KAAKC,EACH,EAAiB,CAAC,EAClB,MACF,KAAKS,EACH,MACG,GAAiB2C,EAAS,MAC3BF,GACEG,EAAeD,EAAS,QAAQ,EAChCE,EACAC,EACAC,EACAjC,CACF,CAEN,CACJ,CACF,GAAI8B,EACF,MACG,GAAW9B,EAAS6B,CAAQ,EAC5B,EACQI,IAAP,GAAmB,IAAMb,EAAcS,EAAU,CAAC,EAAII,EACxD7B,EAAYJ,CAAQ,GACd,EAAgB,GACV8B,GAAR,OACG,EACCA,EAAe,QAAQX,GAA4B,KAAK,EAAI,KAChEQ,GAAa3B,EAAU+B,EAAOC,EAAe,GAAI,SAAU,EAAG,CAC5D,OAAOE,CACT,CAAC,GACOlC,GAAR,OACCa,EAAeb,CAAQ,IACrB,EAAWU,EACVV,EACAgC,GACWhC,EAAS,KAAjB,MACA6B,GAAYA,EAAS,MAAQ7B,EAAS,IACnC,IACC,GAAKA,EAAS,KAAK,QAClBmB,GACA,KACF,EAAI,KACRW,CACJ,GACFC,EAAM,KAAK/B,CAAQ,GACvB,EAEJ,EAAiB,EACjB,IAAImC,EAAwBF,IAAP,GAAmB,IAAMA,EAAY,IAC1D,GAAI7B,EAAYyB,CAAQ,EACtB,IAAK,IAAIO,EAAI,EAAGA,EAAIP,EAAS,OAAQ,IACnC,EAAaA,EAASO,GACnB,EAAOD,EAAiBf,EAAca,EAAWG,CAAC,EAClD,GAAkBT,GACjBM,EACAF,EACAC,EACAJ,EACA5B,CACF,OACD,GAAM,EAAIV,EAAcuC,CAAQ,EAAmB,OAAOO,GAAtB,WACvC,IACE,EAAWA,EAAE,KAAKP,CAAQ,EAAG,EAAI,EACjC,EAAE,EAAYA,EAAS,KAAK,GAAG,MAG/B,EAAaI,EAAU,MACpB,EAAOE,EAAiBf,EAAca,EAAW,GAAG,EACpD,GAAkBN,GACjBM,EACAF,EACAC,EACAJ,EACA5B,CACF,OACD,GAAiB4B,IAAb,SAAmB,CAC1B,GAAmB,OAAOC,EAAS,MAA/B,WACF,OAAOF,GACLJ,GAAgBM,CAAQ,EACxBE,EACAC,EACAC,EACAjC,CACF,EAEF,KADA,GAAQ,OAAO6B,CAAQ,EACjB,MACJ,mDACyBE,IAAtB,kBACG,qBAAuB,OAAO,KAAKF,CAAQ,CAAC,CAAC,KAAK,IAAI,EAAI,IAC1DE,GACJ,2EACJ,CACF,CACA,OAAOD,CACT,CACA,SAASO,EAAY,EAAU,EAAM,EAAS,CAC5C,GAAYR,GAAR,KAAkB,OAAOA,EAC7B,IAAIS,EAAS,CAAC,EACZC,EAAQ,EAIV,OAHAZ,GAAaE,EAAUS,EAAQ,GAAI,GAAI,SAAU,EAAO,CACtD,OAAOE,EAAK,KAAK3C,EAAS4C,EAAO,GAAO,CAC1C,CAAC,EACMH,CACT,CACA,SAASI,EAAgB,EAAS,CAChC,GAAWC,EAAQ,UAAf,GAAwB,CAC1B,IAAIC,EAAOD,EAAQ,QACjBnB,EAAWoB,EAAK,EAClBpB,EAAS,KACP,SAAU,EAAc,EACZmB,EAAQ,UAAd,GAAgCA,EAAQ,UAAf,MAC3B,EAAS,QAAU,EAChB,EAAQ,QAAUE,EACRrB,EAAS,SAApB,IAAK,KACD,EAAS,OAAS,YACnB,EAAS,MAAQqB,GAC1B,EACA,SAAU,EAAO,EACLF,EAAQ,UAAd,GAAgCA,EAAQ,UAAf,MAC3B,EAAS,QAAU,EAChB,EAAQ,QAAUjB,EACRF,EAAS,SAApB,IAAK,KACD,EAAS,OAAS,WAAc,EAAS,OAASE,GAC5D,CACF,EACOiB,EAAQ,UAAf,KACI,EAAQ,QAAU,EAAK,EAAQ,QAAUnB,EAC/C,CACA,GAAUmB,EAAQ,UAAd,EAAuB,OAAOA,EAAQ,QAAQ,QAClD,MAAMA,EAAQ,OAChB,CACA,IAAIG,GACa,OAAO,aAAtB,WACI,YACA,SAAU,EAAO,CACf,GACe,OAAO,QAApB,UACe,OAAO,OAAO,YAA7B,WACA,CACA,IAAIC,EAAQ,IAAI,OAAO,WAAW,QAAS,CACzC,QAAS,CAAC,EACV,WAAY,CAAC,EACb,QACe,OAAOrB,GAApB,UACSA,GACI,OAAOA,EAAM,SAA1B,SACI,OAAOA,EAAM,OAAO,EACpLine truncated
File renamed without changes.
+11
View File
@@ -0,0 +1,11 @@
(function(){
/**
* MapLibre GL JS
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.19.0/LICENSE.txt
*/
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function l(e,t){this.x=e,this.y=t}l.prototype={clone(){return new l(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new l(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function u(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let n=e;for(let r=0;r<8;r++){let r=((o*n+a)*n+i)*n-e;if(Math.abs(r)<t)return((l*n+c)*n+s)*n;let u=(3*o*n+2*a)*n+i;if(Math.abs(u)<1e-6)break;n-=r/u}let r=0,u=1;n=e;for(let s=0;s<20;s++){let s=((o*n+a)*n+i)*n;if(Math.abs(s-e)<t)break;e>s?r=n:u=n,n=(r+u)*.5}return((l*n+c)*n+s)*n}}let d;function f(){return d??=typeof OffscreenCanvas<`u`&&!!new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,d}let p;function m(){if(p==null&&(p=!1,f())){let e=new OffscreenCanvas(5,5).getContext(`2d`,{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let n=t*4;e.fillStyle=`rgb(${n},${n+1},${n+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){p=!0;break}}}return p||!1}var h=typeof Float32Array<`u`?Float32Array:Array;function g(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function v(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}function y(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12Line truncated
/* @vite-ignore */
e);return}let t=await fetch(e,{credentials:`same-origin`});if(!t.ok)throw Error(`Failed to load ${e}: ${t.status}`);let n=await t.text();if(/^[ \t]*(import|export)\s/m.test(n)){let e=URL.createObjectURL(new Blob([n],{type:`text/javascript`}));try{await import(
/* @vite-ignore */
e)}finally{URL.revokeObjectURL(e)}}else globalThis.eval(n)}var yT=class{constructor(e){this.self=e,this.actor=new vs(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=/* @__PURE__ */ new Map,this.importedScripts=/* @__PURE__ */ new Map,this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=Qo,this.self.removeProtocol=$o,this.self.registerRTLTextPlugin=e=>{dg.setMethods(e)},this.self.makeRequest=os,this.self.setProjectionHandler=lT,this.actor.registerMessageHandler(`LDT`,(e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t)),this.actor.registerMessageHandler(`RDT`,async(e,t)=>{this._getDEMWorkerSource(e,t.source).removeTile(t)}),this.actor.registerMessageHandler(`GCEZ`,async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterExpansionZoom(t)),this.actor.registerMessageHandler(`GCC`,async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterChildren(t)),this.actor.registerMessageHandler(`GCL`,async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterLeaves(t)),this.actor.registerMessageHandler(`LD`,(e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t)),this.actor.registerMessageHandler(`LT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t)),this.actor.registerMessageHandler(`RT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t)),this.actor.registerMessageHandler(`AT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t)),this.actor.registerMessageHandler(`RMT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t)),this.actor.registerMessageHandler(`RS`,async(e,t)=>{if(!this.workerSources[e]?.[t.type]?.[t.source])return;let n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],n.removeSource!==void 0&&n.removeSource(t)}),this.actor.registerMessageHandler(`RM`,async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler(`SR`,async(e,t)=>{this.referrer=t}),this.actor.registerMessageHandler(`PI`,async()=>{}),this.actor.registerMessageHandler(`SRPS`,(e,t)=>this._syncRTLPluginState(e,t)),this.actor.registerMessageHandler(`IS`,(e,t)=>this._importScript(t)),this.actor.registerMessageHandler(`SI`,(e,t)=>this._setImages(e,t)),this.actor.registerMessageHandler(`UL`,async(e,t)=>{this._getLayerIndex(e).update(t.layers,t.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler(`UGS`,async(e,t)=>{let n=this._getGlobalState(e);for(let e in t)n[e]=t[e]}),this.actor.registerMessageHandler(`SL`,async(e,t)=>{this._getLayerIndex(e).replace(t,this._getGlobalState(e))})}async _importScript(e){let t=this.importedScripts.get(e);if(t)return t;let n=vT(e);this.importedScripts.set(e,n);try{await n}catch(t){throw this.importedScripts.delete(e),t}}_getGlobalState(e){let t=this.globalStates.get(e);return t||(t={},this.globalStates.set(e,t)),t}async _setImages(e,t){this.availableImages[e]=t;for(let n in this.workerSources[e]){let r=this.workerSources[e][n];for(let e in r)r[e].availableImages=t}}async _syncRTLPluginState(e,t){return await dg.syncState(t,e=>this._importScript(e))}_getAvailableImages(e){let t=this.availableImages[e];return t||=[],t}_getLayerIndex(e){let t=this.layerIndexes[e];return t||=this.layerIndexes[e]=new Gw,t}_getWorkerSource(e,t,n){if(this.workerSources[e]||={},this.workerSources[e][t]||={},!this.workerSources[e][t][n]){let r={sendAsync:(t,n)=>(t.targetMapId=e,this.actor.sendAsync(t,n))};switch(t){case`vector`:this.workerSources[e][t][n]=new nT(r,this._getLayerIndex(e),this._getAvailableImages(e));break;case`geojson`:this.workerSources[e][t][n]=new hT(r,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][n]=new this.externalWorkerSourceTypes[t](r,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][n]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||={},this.demWorkerSources[e][t]||=new rT,this.demWorkerSources[e][t]}};Oe(self)&&(self.worker=new yT(self))})();
//# sourceMappingURL=maplibre-gl-worker-DddZ4Wha.js.map
@@ -0,0 +1 @@
{"version":3,"file":"maplibre-gl-worker-DddZ4Wha.js","names":[],"sources":["../../node_modules/maplibre-gl/dist/maplibre-gl-worker.mjs"],"sourcesContent":["/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.19.0/LICENSE.txt\n*/\nvar e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function l(e,t){this.x=e,this.y=t}l.prototype={clone(){return new l(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new l(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function u(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let n=e;for(let r=0;r<8;r++){let r=((o*n+a)*n+i)*n-e;if(Math.abs(r)<t)return((l*n+c)*n+s)*n;let u=(3*o*n+2*a)*n+i;if(Math.abs(u)<1e-6)break;n-=r/u}let r=0,u=1;n=e;for(let s=0;s<20;s++){let s=((o*n+a)*n+i)*n;if(Math.abs(s-e)<t)break;e>s?r=n:u=n,n=(r+u)*.5}return((l*n+c)*n+s)*n}}let d;function f(){return d??=typeof OffscreenCanvas<`u`&&!!new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,d}let p;function m(){if(p==null&&(p=!1,f())){let e=new OffscreenCanvas(5,5).getContext(`2d`,{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let n=t*4;e.fillStyle=`rgb(${n},${n+1},${n+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){p=!0;break}}}return p||!1}var h=typeof Float32Array<`u`?Float32Array:Array;function g(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function v(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*Line truncated
+2
View File
@@ -0,0 +1,2 @@
var e=`基础`,t=`方位`,n=`取消`,r=`中心`,i=`关闭`,a=`聚合`,o=`折叠`,s=`注释`,c=`调试`,l=`默认`,u=`删除`,d=`复制`,f=`编码`,p=`展开`,m=`过滤器`,h=`函数`,g=`GeoJSON`,_=`帮助`,v=`隐藏`,y=`图像`,b=`检查`,x=`键`,S=`图层`,C=`图层`,w=`链接`,T=`正在加载`,E=`地图`,D=`名称`,O=`打开`,k=`选项`,A=`所有者`,j=`俯仰角`,M=`投影`,N=`翻滚角`,P=`保存`,F=`搜索`,I=`快捷键`,L=`显示`,R=`源`,z=`源列表`,B=`停靠点`,V=`类型`,H=`值`,U=`视频`,W=`视图`,G=`缩放`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`在 openstreetmap.org 打开当前视图`,"Achromatopsia filter":`全色盲滤镜`,"Active Sources":`激活的源`,"Add a new source to your style. You can only choose the source type and id at creation time!":`向您的样式添加新源。在创建时,您只能选择源类型和ID!`,"Add filter":`添加过滤器`,"Add Layer":`添加图层`,"Add New Source":`添加新源`,"Add one of the publicly available sources to your style.":`将公开可用的源之一添加到您的样式中。`,"Add Source":`添加源`,"Add stop":`添加停靠点`,"Add value":`添加值`,"Add Variable":`添加变量`,"any filter matches":`任何过滤器匹配`,"API key for Stadia Maps.":`Stadia Maps 的 API 密钥`,"Atmosphere blend":`大气混合`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`中心海拔`,"Choose Public Source":`选择公共源`,"Choose the default Maputnik renderer for this style.":`为这种样式选择默认的Maputnik渲染器。`,"Click to close the editor":`点击关闭编辑器`,Close:i,"Close modal":`关闭模态框`,"Close popup":`关闭弹出窗口`,Cluster:a,"Code Editor":`代码编辑器`,Collapse:o,"Color accessibility":`颜色可访问性`,"Comment...":`写注释...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`当前图层的注释。注意:这不是标准功能,可能与其他库不兼容。`,"Convert property into a elevation function":`将属性转换为高程函数`,"Convert property into a zoom function":`将属性转换为缩放函数`,"Convert property to data function":`将属性转换为数据函数`,"Convert to expression":`转换为表达式`,"Coord bottom left":`左下角坐标`,"Coord bottom right":`右下角坐标`,"Coord top left":`左上角坐标`,"Coord top right":`右上角坐标`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`CORS 策略不允许从 https 访问通过 http 提供的资源,请使用 <1>https://</1> 域名。`,"Create HTML":`创建HTML`,"Data Sources":`数据源`,"Data Sources modal":`数据源模态框`,"Data value":`数据值`,Debug:c,"Debug modal":`调试模态框`,"Decrease the pitch by 10 degrees.":`将俯仰角减少10度。`,"Decrease the rotation by 15 degrees.":`将旋转角度减少15度。`,"Decrease the zoom level by 1.":`将缩放级别减少1。`,"Decrease the zoom level by 2.":`将缩放级别减少2。`,Default:l,Delete:u,"Delete expression":`删除表达式`,"Delete filter block":`删除过滤器块`,"Deuteranopia filter":`绿色盲滤镜`,"Drag and drop a style JSON file here or click to browse":`将样式 JSON 文件拖放到此处或点击以浏览`,"Drag to resize the layer list":`拖动以调整图层列表大小`,"Drag to resize the sidebar":`拖动以调整侧边栏大小`,Duplicate:d,Encoding:f,"Enter URL...":`输入URL...`,"every filter matches":`每个过滤器都匹配`,Expand:p,"Export modal":`导出模态框`,Filter:m,"Focus map":`聚焦地图`,"Fog color":`雾颜色`,"Fog ground blend":`雾与地面混合`,"Font faces":`字体文件`,Function:h,"Gallery Styles":`画廊样式`,"General layout properties":`常规布局属性`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON格式)`,"GeoJSON (URL)":`GeoJSON (URL格式)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`全局状态`,"Global State Variables":`全局状态变量`,"Glyphs URL":`字形URL`,Help:_,Hide:v,"Horizon color":`地平线颜色`,"Horizon fog blend":`地平线与雾混合`,"Icon layout properties":`图标布局属性`,"Icon paint properties":`图标绘制属性`,"If the Map is in focused you can use the following shortcuts":`如果地图处于焦点状态,您可以使用以下快捷键`,Image:y,"Image URL":`图像URL`,"Increase the pitch by 10 degrees.":`将俯仰角增加10度。`,"Increase the rotation by 15 degrees.":`将旋转角度增加15度。`,"Increase the zoom level by 1.":`将缩放级别增加1。`,"Increase the zoom level by 2.":`将缩放级别增加2。`,"Input a data property to base styles off of.":`输入一个数据属性作为样式的基础。`,"Input value":`输入值`,Inspect:b,"JSON Editor":`JSON编辑器`,Key:`键`,Layer:S,"Layer editor":`图层编辑器`,"Layer ID already exists":`图层ID已存在`,Layers:C,"Layers list":`图层列表`,"Layout properties":`布局属性`,"Learn More":`了解更多`,"Light anchor":`光源锚点`,"Light color":`光 Line truncated
//# sourceMappingURL=translation-BAlB8LVo.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-BAlB8LVo.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`Basis`,t=`Ausrichtung`,n=`Abbrechen`,r=`Mittelpunkt`,i=`Schließen`,a=`Cluster`,o=`Einklappen`,s=`Kommentare`,c=`Debug`,l=`Standard`,u=`Löschen`,d=`Duplizieren`,f=`Kodierung`,p=`Ausklappen`,m=`Filter`,h=`Funktion`,g=`GeoJSON`,_=`Hilfe`,v=`Verstecken`,y=`Bild`,b=`Untersuchen`,x=`Schlüssel`,S=`Ebene`,C=`Ebenen`,w=`Links`,T=`Lädt`,E=`Karte`,D=`Name`,O=`Öffnen`,k=`Optionen`,A=`Besitzer`,j=`Neigung`,M=`Projektion`,N=`Rollwinkel`,P=`Speichern`,F=`Suche`,I=`Shortcuts`,L=`Anzeigen`,R=`Quelle`,z=`Quellen`,B=`Stopps`,V=`Typ`,H=`Wert`,U=`Video`,W=`Ansicht`,G=`Zoom`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>In OSM öffnen</0>. Öffnet die aktuelle Ansicht auf openstreetmap.org`,"Achromatopsia filter":`Achromatopsie-Filter`,"Active Sources":`Aktive Quellen`,"Add a new source to your style. You can only choose the source type and id at creation time!":`Füge eine neue Quelle zu deinem Stil hinzu. Du kannst den Quellentyp und die ID nur bei der Erstellung auswählen!`,"Add filter":`Filter hinzufügen`,"Add Layer":`Ebene hinzufügen`,"Add New Source":`Neue Quelle hinzufügen`,"Add one of the publicly available sources to your style.":`Füge eine der öffentlich verfügbaren Quellen zu deinem Stil hinzu.`,"Add Source":`Quelle hinzufügen`,"Add stop":`Stopp hinzufügen`,"Add value":`Wert hinzufügen`,"Add Variable":`Variable hinzufügen`,"any filter matches":`irgendein Filter passt`,"API key for Stadia Maps.":`API-Schlüssel für Stadia Maps.`,"Atmosphere blend":`Atmosphärenüberblendung`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`Höhe des Mittelpunkts`,"Choose Public Source":`Öffentliche Quelle auswählen`,"Choose the default Maputnik renderer for this style.":`Wähle den Standard-Renderer für diesen Stil aus.`,"Click to close the editor":`Klicken Sie hier, um den Editor zu schließen`,Close:i,"Close modal":`Modale Fenster schließen`,"Close popup":`Popup schließen`,Cluster:a,"Code Editor":`Code-Editor`,Collapse:o,"Color accessibility":`Farbzugänglichkeit`,"Comment...":`Dein Kommentar...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`Kommentare zur aktuellen Ebene. Das ist nicht standardmäßig und nicht in der Spezifikation.`,"Convert property into a elevation function":`Eigenschaft in eine Höhenfunktion umwandeln`,"Convert property into a zoom function":`Eigenschaft in eine Zoom-Funktion umwandeln`,"Convert property to data function":`Eigenschaft in eine Datenfunktion umwandeln`,"Convert to expression":`In Ausdruck umwandeln`,"Coord bottom left":`Koordinate unten links`,"Coord bottom right":`Koordinate unten rechts`,"Coord top left":`Koordinate oben links`,"Coord top right":`Koordinate oben rechts`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`Die CORS-Politik erlaubt es nicht, Ressourcen über http von https zu laden, benutze eine <1>https://</1>-Domain`,"Create HTML":`HTML erstellen`,"Data Sources":`Datenquellen`,"Data Sources modal":`Modale Datenquellen`,"Data value":`Datenwert`,Debug:c,"Debug modal":`Debug (modale Fenster)`,"Decrease the pitch by 10 degrees.":`Neigung um 10 Grad verringern.`,"Decrease the rotation by 15 degrees.":`Rotation um 15 Grad verringern.`,"Decrease the zoom level by 1.":`Zoom-Stufe um 1 verringern.`,"Decrease the zoom level by 2.":`Zoom-Stufe um 2 verringern.`,Default:l,Delete:u,"Delete expression":`Ausdruck löschen`,"Delete filter block":`Filterblock löschen`,"Deuteranopia filter":`Deuteranopie-Filter`,"Drag and drop a style JSON file here or click to browse":`Ziehen Sie eine Style-JSON-Datei hierher oder klicken Sie, um zu durchsuchen`,"Drag to resize the layer list":`Ziehen, um die Ebenenliste zu skalieren`,"Drag to resize the sidebar":`Ziehen, um die Seitenleiste zu skalieren`,Duplicate:d,Encoding:f,"Enter URL...":`URL eingeben...`,"every filter matches":`alle Filter passen`,Expand:p,"Export modal":`Modale Fenster exportieren`,Filter:m,"Focus map":`Karte fokussieren`,"Fog color":`Nebelfarbe`,"Fog ground blend":`Nebel-Boden-Überblendung`,"Font faces":`Schriftdateien`,Function:h,"Gallery Styles":`Galerie-Stile`,"General layout properties":`Allgemeine Layouteigenschaften`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`Globaler Zustand`,"Global State Variables":`Globale Zustandsvariablen`,"Glyphs URL":`Glyphen-URL`,Help:_,Hide:v,"Horizon color":`Horizontfarbe`,"Horizon fog blend":`Horizont-Nebel-Überblendung`,"Icon layout properties":`Icon-Layouteigenschaften`,"Icon paint properties":`Icon-Darstellungseigenschaften`,"If the Map is in focused you can use the following shortcuts":`Wenn die Karte fokussiert ist, kannst du die folgenden Shortcuts benutzen`,Image:y,"Image URL":`Bild-URL`,"Increase the pitch by 10 degrees.":`Neigung um 10 Grad erhöhen.`,"Increase the rotation by 15 degrees.":`Rotation um 15 Grad erhöhen.`,"Increase the zoom level by 1.":`Zoom-Stuf Line truncated
//# sourceMappingURL=translation-BFsW6ApC.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-BFsW6ApC.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`בסיס`,t=`כיוון`,n=`ביטול`,r=`מרכז`,i=`סגירה`,a=`קיבוץ`,o=`הקטנה`,s=`הערות`,c=`דיבאג`,l=`ברירת המחדל`,u=`מחיקה`,d=`שכפול`,f=`קידוד`,p=`הגדלה`,m=`סינון`,h=`פונקציה`,g=`GeoJSON`,_=`עזרה`,v=`הסתרה`,y=`תמונה`,b=`בדיקה`,x=`מפתח`,S=`שכבה`,C=`שכבות`,w=`קישורים`,T=`טוען`,E=`מפה`,D=`שם`,O=`פתיחה`,k=`אפשרויות`,A=`שייך ל`,j=`זווית`,M=`הטלה`,N=`גלגול`,P=`שמור`,F=`חיפוש`,I=`קיצורי דרך`,L=`הצגה`,R=`מקור`,z=`מקורות`,B=`עצירות`,V=`סוג`,H=`ערך`,U=`וידאו`,W=`תצוגה`,G=`זום`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>פתיחה ב-OSM</0>. פתיחה של התצוגה הנוכחית ב- openstreetmap.org`,"Achromatopsia filter":`Achromatopsia filter`,"Active Sources":`מקורות פעילים`,"Add a new source to your style. You can only choose the source type and id at creation time!":`הוספת מקור לסטייל, ביכולתכם לעשות זאת רק בזמן מסויים`,"Add filter":`הוספת סינון`,"Add Layer":`הוספת שכבה`,"Add New Source":`הוספת מקור חדש`,"Add one of the publicly available sources to your style.":`הוספת אחד המקורות הציבוריים הזמינים לסטייל שלך.`,"Add Source":`הוספת מקור`,"Add stop":`הוספת עצירה`,"Add value":`הוספת ערך`,"Add Variable":`הוסף משתנה`,"any filter matches":`אחד הסינוים מתאימים`,"API key for Stadia Maps.":`API key for Stadia Maps`,"Atmosphere blend":`מיזוג אטמוספרה`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`גובה המרכז`,"Choose Public Source":`בחירת מקור ציבורי`,"Choose the default Maputnik renderer for this style.":`בחירת צייר ברירת המחדל של מפוטניק עבור הסטייל הזה`,"Click to close the editor":`לחץ לסגירת העורך`,Close:i,"Close modal":`סגירת חלונית`,"Close popup":`סגירת החלון`,Cluster:a,"Code Editor":`עורך קוד`,Collapse:o,"Color accessibility":`נגישות צבעים`,"Comment...":`הערה...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`הערות על השכבה הנוכחית. זה לא חלק מהספסיפיקציות`,"Convert property into a elevation function":`המרה לפונקציית גובה`,"Convert property into a zoom function":`המרה לפונקציית זום`,"Convert property to data function":`המרה לפונקציית מידע`,"Convert to expression":`המחרה לביטוי`,"Coord bottom left":`מיקום שמאלי תחתון`,"Coord bottom right":`מיקום ימני תחתון`,"Coord top left":`מיקום שמאלי עליון`,"Coord top right":`מיקום ימני עליון`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain`,"Create HTML":`צור HTML`,"Data Sources":`מקורות מידע`,"Data Sources modal":`חלונית מקורות`,"Data value":`ערך מידע`,Debug:c,"Debug modal":`חלונית דיבאג`,"Decrease the pitch by 10 degrees.":`הורדה של 10 מעלות מהזווית`,"Decrease the rotation by 15 degrees.":`הורדת 15 מעלות לסיבוב`,"Decrease the zoom level by 1.":`הורדה של הזום ב-1`,"Decrease the zoom level by 2.":`הורדה של הזום ב-2`,Default:l,Delete:u,"Delete expression":`מחיקת ביטוי`,"Delete filter block":`מחיקת גוש מסנן`,"Deuteranopia filter":`Deuteranopia filter`,"Drag and drop a style JSON file here or click to browse":`גרור ושחרר כאן קובץ JSON של סגנון או לחץ כדי לעיין`,"Drag to resize the layer list":`יש לגרור כדי לשנות את גודל רשימת השכבות`,"Drag to resize the sidebar":`יש לגרור כדי לשנות את גודל סרגל הצד`,Duplicate:d,Encoding:f,"Enter URL...":`הכנסו כתובת`,"every filter matches":`כל הסינונים מתאימים`,Expand:p,"Export modal":`חלונית ייצוא`,Filter:m,"Focus map":`פיקוס המפה`,"Fog color":`צבע ערפל`,"Fog ground blend":`מיזוג ערפל עם הקרקע`,"Font faces":`קבצי גופנים`,Function:h,"Gallery Styles":`גלריית סטיילים`,"General layout properties":`תכונות פריסה כלליות`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`כתובת GeoJSON`,"Global State":`מצב גלובלי`,"Global State Variables":`משתני מצב גלובלי`,"Glyphs URL":`כתובת סמלילים`,Help:_,Hide:v,"Horizon color":`צבע האופק`,"Horizon fog blend":`מיזוג ערפל באופק`,"Icon layout properties":`תכונות פריסה של Line truncated
//# sourceMappingURL=translation-ByOUQOby.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-ByOUQOby.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`Base`,t=`Orientation`,n=`Annuler`,r=`Centre`,i=`Fermer`,a=`Cluster`,o=`Réduire`,s=`Commentaires`,c=`Déboguer`,l=`Par défaut`,u=`Supprimer`,d=`Dupliquer`,f=`Encodage`,p=`Développer`,m=`Filtre`,h=`Fonction`,g=`GeoJSON`,_=`Aide`,v=`Cacher`,y=`Image`,b=`Inspecter`,x=`Clé`,S=`Calque`,C=`Calques`,w=`Liens`,T=`Chargement`,E=`Carte`,D=`Nom`,O=`Ouvrir`,k=`Options`,A=`Propriétaire`,j=`Inclinaison`,M=`Projection`,N=`Roulis`,P=`Enregistrer`,F=`Recherche`,I=`Raccourcis`,L=`Afficher`,R=`Source`,z=`Sources`,B=`Arrêts`,V=`Type`,H=`Valeur`,U=`Vidéo`,W=`Vue`,G=`Zoom`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>Ouvrir dans OSM</0>. Ouvre la vue actuelle sur openstreetmap.org`,"Achromatopsia filter":`Filtre Achromatopsie`,"Active Sources":`Sources actives`,"Add a new source to your style. You can only choose the source type and id at creation time!":`Ajoutez une nouvelle source à votre style. Vous ne pouvez choisir le type et l'ID de la source qu'au moment de la création !`,"Add filter":`Ajouter un filtre`,"Add Layer":`Ajouter un calque`,"Add New Source":`Ajouter une nouvelle source`,"Add one of the publicly available sources to your style.":`Ajoutez l'une des sources publiques disponibles à votre style.`,"Add Source":`Ajouter une source`,"Add stop":`Ajouter un arrêt`,"Add value":`Ajouter une valeur`,"Add Variable":`Ajouter une variable`,"any filter matches":`l'un des filtres correspond`,"API key for Stadia Maps.":`Clé d'API pour Stadia Maps.`,"Atmosphere blend":`Fondu de l'atmosphère`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`Altitude du centre`,"Choose Public Source":`Choisir une source publique`,"Choose the default Maputnik renderer for this style.":`Choisissez le moteur de rendu Maputnik par défaut pour ce style.`,"Click to close the editor":`Cliquez pour fermer l'éditeur`,Close:i,"Close modal":`Fermer la fenêtre modale`,"Close popup":`Fermer la fenêtre`,Cluster:a,"Code Editor":`Éditeur de code`,Collapse:o,"Color accessibility":`Accessibilité des couleurs`,"Comment...":`Votre commentaire...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`Commentaires pour le calque actuel. Ceci n'est pas standard et n'est pas dans la spécification.`,"Convert property into a elevation function":`Convertir la propriété en fonction d'élévation`,"Convert property into a zoom function":`Convertir la propriété en fonction de zoom`,"Convert property to data function":`Convertir la propriété en fonction de données`,"Convert to expression":`Convertir en expression`,"Coord bottom left":`Coordonnée en bas à gauche`,"Coord bottom right":`Coordonnée en bas à droite`,"Coord top left":`Coordonnée en haut à gauche`,"Coord top right":`Coordonnée en haut à droite`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`La politique CORS ne permet pas de récupérer des ressources servies sur http depuis https, utilisez un protocole <1>https://</1>`,"Create HTML":`Créer le HTML`,"Data Sources":`Sources de données`,"Data Sources modal":`Sources de données (modale)`,"Data value":`Valeur des données`,Debug:c,"Debug modal":`Déboguer (modale)`,"Decrease the pitch by 10 degrees.":`Diminuer l'inclinaison de 10 degrés.`,"Decrease the rotation by 15 degrees.":`Diminuer l'angle de rotation de 15 degrés.`,"Decrease the zoom level by 1.":`Diminuer le niveau de zoom de 1.`,"Decrease the zoom level by 2.":`Diminuer le niveau de zoom de 2.`,Default:l,Delete:u,"Delete expression":`Supprimer l'expression`,"Delete filter block":`Supprimer le bloc de filtre`,"Deuteranopia filter":`Filtre Deutéranopie`,"Drag and drop a style JSON file here or click to browse":`Faites glisser un fichier JSON de style ici ou cliquez pour parcourir`,"Drag to resize the layer list":`Glisser pour redimensionner la liste des calques`,"Drag to resize the sidebar":`Glisser pour redimensionner la barre latérale`,Duplicate:d,Encoding:f,"Enter URL...":`Entrez l'URL...`,"every filter matches":`tous les filtres correspondent`,Expand:p,"Export modal":`Exporter (modale)`,Filter:m,"Focus map":`Focus sur la carte`,"Fog color":`Couleur du brouillard`,"Fog ground blend":`Fondu brouillard-sol`,"Font faces":`Fichiers de police`,Function:h,"Gallery Styles":`Styles de la galerie`,"General layout properties":`Propriétés générales de mise en page`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`URL GeoJSON`,"Global State":`État global`,"Global State Variables":`Variables d'état global`,"Glyphs URL":`URL des glyphes`,Help:_,Hide:v,"Horizon color":`Couleur de l'horizon`,"Horizon fog blend":`Fondu horizon-brouillard`,"Icon layout properties":`Propriétés de mise en page de l'icône`,"Icon paint properties":`Propriétés de peinture de l'icône`,"If the Map is in focused you can use the following shortcuts":`Si la carte a le focus, vous pouvez utiliser les raccourcis suivants`,Image:y,"Image Line truncated
//# sourceMappingURL=translation-C1kHjWZr.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-C1kHjWZr.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`Base`,t=`Direzione`,n=`Annulla`,r=`Centro`,i=`Chiudi`,a=`Cluster`,o=`Coprimi`,s=`Commenti`,c=`Debug`,l=`Predefinito`,u=`Elimina`,d=`Duplica`,f=`Codifica`,p=`Espandi`,m=`Filtro`,h=`Funzione`,g=`GeoJSON`,_=`Aiuto`,v=`Nascondi`,y=`Immagine`,b=`Esamina`,x=`Chiave`,S=`Livello`,C=`Livelli`,w=`Collegamenti`,T=`Caricamento`,E=`Mappa`,D=`Nome`,O=`Apri`,k=`Opzioni`,A=`Proprietario`,j=`Inclinazione`,M=`Proiezione`,N=`Rollio`,P=`Salva`,F=`Cerca`,I=`Scorciatoie`,L=`Mostra`,R=`Sorgente`,z=`Sorgenti`,B=`Fermate`,V=`Tipo`,H=`Valore`,U=`Video`,W=`Vista`,G=`Zoom`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>Apri in OSM</0>. Apre la vista corrente su openstreetmap.org`,"Achromatopsia filter":`Filtro acromatopsia`,"Active Sources":`Sorgenti attive`,"Add a new source to your style. You can only choose the source type and id at creation time!":`Aggiungi una nuova sorgente al tuo stile. Puoi scegliere il tipo di sorgente e l'ID solo al momento della creazione!`,"Add filter":`Aggiungi filtro`,"Add Layer":`Aggiungi Livello`,"Add New Source":`Aggiungi nuova sorgente`,"Add one of the publicly available sources to your style.":`Aggiungi una delle sorgente pubbliche disponibili al tuo stile.`,"Add Source":`Aggiungi sorgente`,"Add stop":`Aggiungi fermata`,"Add value":`Aggiungi valore`,"Add Variable":`Aggiungi variabile`,"any filter matches":`qualsiasi filtro corrisponde`,"API key for Stadia Maps.":`Chiave API per Stadia Maps.`,"Atmosphere blend":`Sfumatura dell'atmosfera`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`Altitudine del centro`,"Choose Public Source":`Scegli una sorgente pubblica`,"Choose the default Maputnik renderer for this style.":`Scegli il renderer predefinito di Maputnik per questo stile.`,"Click to close the editor":`Clicca per chiudere l'editor`,Close:i,"Close modal":`Chiudi finestra modale`,"Close popup":`Chiudi popup`,Cluster:a,"Code Editor":`Editor codice`,Collapse:o,"Color accessibility":`Accessibilità colori`,"Comment...":`Il tuo commento...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`Commenti per il livello attuale. Questo non è standard e non è nella specifica.`,"Convert property into a elevation function":`Converti proprietà in una funzione di elevazione`,"Convert property into a zoom function":`Converti proprietà in una funzione di zoom`,"Convert property to data function":`Converti proprietà in una funzione dati`,"Convert to expression":`Converti in espressione`,"Coord bottom left":`Coordinate in basso a sinistra`,"Coord bottom right":`Coordinate in basso a destra`,"Coord top left":`Coordinate in alto a sinistra`,"Coord top right":`Coordinate in alto a destra`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`La politica CORS non permette di caricare risorse tramite http da https, utilizza un dominio <1>https://</1>.`,"Create HTML":`Crea HTML`,"Data Sources":`Fonti dati`,"Data Sources modal":`Finestra modale sorgente dati`,"Data value":`Valore dei dati`,Debug:c,"Debug modal":`Finestra modale di debug`,"Decrease the pitch by 10 degrees.":`Aumenta la rotazione di 10 gradi.`,"Decrease the rotation by 15 degrees.":`Aumenta la rotazione di 15 gradi.`,"Decrease the zoom level by 1.":`Riduci il livello di zoom di 1.`,"Decrease the zoom level by 2.":`Riduci il livello di zoom di 1..`,Default:l,Delete:u,"Delete expression":`Elimina espressione`,"Delete filter block":`Elimina blocco filtro`,"Deuteranopia filter":`Filtro deuteranopia`,"Drag and drop a style JSON file here or click to browse":`Trascina e rilascia qui un file JSON dello stile o fai clic per sfogliare`,"Drag to resize the layer list":`Trascina per ridimensionare l'elenco dei livelli`,"Drag to resize the sidebar":`Trascina per ridimensionare la barra laterale`,Duplicate:d,Encoding:f,"Enter URL...":`Inserisci URL...`,"every filter matches":`tutti i filtri corrispondono`,Expand:p,"Export modal":`Esporta finestra modale`,Filter:m,"Focus map":`Metti a fuoco la mappa`,"Fog color":`Colore della nebbia`,"Fog ground blend":`Sfumatura nebbia-suolo`,"Font faces":`File dei font`,Function:h,"Gallery Styles":`Galleria degli stili`,"General layout properties":`Proprietà generali del layout`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`Stato globale`,"Global State Variables":`Variabili di stato globale`,"Glyphs URL":`URL Glyphs`,Help:_,Hide:v,"Horizon color":`Colore dell'orizzonte`,"Horizon fog blend":`Sfumatura orizzonte-nebbia`,"Icon layout properties":`Proprietà di layout dell'icona`,"Icon paint properties":`Proprietà di pittura dell'icona`,"If the Map is in focused you can use the following shortcuts":`Se la mappa è attiva, puoi utilizzare le seguenti scorciatoie:`,Image:y,"Image URL":`Indirizzo immagine`,"Increase the pitch by 10 degrees.":`Incrementa la rotazione di 10 gradi`,"Increase the rotation by 15 degrees.":`Incrementa la rotazione Line truncated
//# sourceMappingURL=translation-C6Qy_Ule.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-C6Qy_Ule.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`Temel`,t=`Yön`,n=`İptal`,r=`Merkez`,i=`Kapat`,a=`Küme`,o=`Daralt`,s=`Yorumlar`,c=`Hata Ayıklama`,l=`Varsayılan`,u=`Sil`,d=`Kopyala`,f=`Kodlama`,p=`Genişlet`,m=`Filtre`,h=`Fonksiyon`,g=`GeoJSON`,_=`Yardım`,v=`Gizle`,y=`Görsel`,b=`İncele`,x=`Anahtar`,S=`Katman`,C=`Katmanlar`,w=`Bağlantılar`,T=`Yükleniyor`,E=`Harita`,D=`Ad`,O=`Aç`,k=`Seçenekler`,A=`Sahip`,j=`Eğim`,M=`Projeksiyon`,N=`Yuvarlanma`,P=`Kaydet`,F=`Ara`,I=`Kısayollar`,L=`Göster`,R=`Kaynak`,z=`Kaynaklar`,B=`Duraklar`,V=`Tür`,H=`Değer`,U=`Video`,W=`Görünüm`,G=`Yakınlaştırma`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>OSM'de aç</0>. Mevcut görünümü openstreetmap.org üzerinde açar`,"Achromatopsia filter":`Akromatopsi filtresi`,"Active Sources":`Aktif Kaynaklar`,"Add a new source to your style. You can only choose the source type and id at creation time!":`Stilinize yeni bir kaynak ekleyin. Kaynak türünü ve kimliğini yalnızca oluşturma sırasında seçebilirsiniz!`,"Add filter":`Filtre ekle`,"Add Layer":`Katman Ekle`,"Add New Source":`Yeni Kaynak Ekle`,"Add one of the publicly available sources to your style.":`Stilinize herkese açık kaynaklardan birini ekleyin.`,"Add Source":`Kaynak Ekle`,"Add stop":`Durak ekle`,"Add value":`Değer ekle`,"Add Variable":`Değişken Ekle`,"any filter matches":`herhangi bir filtre eşleşirse`,"API key for Stadia Maps.":`Stadia Maps için API anahtarı.`,"Atmosphere blend":`Atmosfer karışımı`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`Merkez yüksekliği`,"Choose Public Source":`Herkese Açık Kaynak Seç`,"Choose the default Maputnik renderer for this style.":`Bu stil için varsayılan Maputnik işleyicisini seçin.`,"Click to close the editor":`Düzenleyiciyi kapatmak için tıklayın`,Close:i,"Close modal":`Modalı kapat`,"Close popup":`Açılır pencereyi kapat`,Cluster:a,"Code Editor":`Kod Düzenleyici`,Collapse:o,"Color accessibility":`Renk erişilebilirliği`,"Comment...":`Yorum...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`Mevcut katman için yorumlar. Bu standart dışıdır ve spesifikasyonda yoktur.`,"Convert property into a elevation function":`Özelliği bir yükseklik fonksiyonuna dönüştür`,"Convert property into a zoom function":`Özelliği bir yakınlaştırma fonksiyonuna dönüştür`,"Convert property to data function":`Özelliği veri fonksiyonuna dönüştür`,"Convert to expression":`İfadeye dönüştür`,"Coord bottom left":`Koordinat sol alt`,"Coord bottom right":`Koordinat sağ alt`,"Coord top left":`Koordinat sol üst`,"Coord top right":`Koordinat sağ üst`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`CORS politikası, https üzerinden http ile sunulan kaynakların alınmasına izin vermez; <1>https://</1> alan adı kullanın`,"Create HTML":`HTML Oluştur`,"Data Sources":`Veri Kaynakları`,"Data Sources modal":`Veri Kaynakları modalı`,"Data value":`Veri değeri`,Debug:c,"Debug modal":`Hata ayıklama modalı`,"Decrease the pitch by 10 degrees.":`Eğimi 10 derece azalt.`,"Decrease the rotation by 15 degrees.":`Dönüşü 15 derece azalt.`,"Decrease the zoom level by 1.":`Yakınlaştırma seviyesini 1 azalt.`,"Decrease the zoom level by 2.":`Yakınlaştırma seviyesini 2 azalt.`,Default:l,Delete:`Sil`,"Delete expression":`İfadeyi sil`,"Delete filter block":`Filtre bloğunu sil`,"Deuteranopia filter":`Döteranopi filtresi`,"Drag and drop a style JSON file here or click to browse":`Bir stil JSON dosyasını buraya sürükleyip bırakın veya göz atmak için tıklayın`,"Drag to resize the layer list":`Katman listesini yeniden boyutlandırmak için sürükleyin`,"Drag to resize the sidebar":`Kenar çubuğunu yeniden boyutlandırmak için sürükleyin`,Duplicate:d,Encoding:f,"Enter URL...":`URL girin...`,"every filter matches":`tüm filtreler eşleşirse`,Expand:p,"Export modal":`Dışa aktarma modalı`,Filter:m,"Focus map":`Haritaya odaklan`,"Fog color":`Sis rengi`,"Fog ground blend":`Sis-zemin karışımı`,"Font faces":`Yazı tipi dosyaları`,Function:h,"Gallery Styles":`Galeri Stilleri`,"General layout properties":`Genel yerleşim özellikleri`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`Genel Durum`,"Global State Variables":`Genel Durum Değişkenleri`,"Glyphs URL":`Glif URL'si`,Help:_,Hide:v,"Horizon color":`Ufuk rengi`,"Horizon fog blend":`Ufuk-sis karışımı`,"Icon layout properties":`Simge yerleşim özellikleri`,"Icon paint properties":`Simge boyama özellikleri`,"If the Map is in focused you can use the following shortcuts":`Harita odaktaysa aşağıdaki kısayolları kullanabilirsiniz`,Image:y,"Image URL":`Görsel URL'si`,"Increase the pitch by 10 degrees.":`Eğimi 10 derece artır.`,"Increase the rotation by 15 degrees.":`Dönüşü 15 derece artır.`,"Increase the zoom level by 1.":`Yakınlaştırma seviyesini Line truncated
//# sourceMappingURL=translation-DWbdltxS.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-DWbdltxS.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`ベース`,t=`方位`,n=`キャンセル`,r=`中央`,i=`閉じる`,a=`クラスタ`,o=`畳む`,s=`コメント`,c=`デバッグ`,l=`デフォルト`,u=`削除`,d=`複製`,f=`エンコーディング`,p=`展開`,m=`フィルタ`,h=`関数`,g=`GeoJSON`,_=`ヘルプ`,v=`非表示`,y=`画像`,b=`検査`,x=`キー`,S=`レイヤー`,C=`レイヤー`,w=`リンク`,T=`を読み込み中`,E=`地図`,D=`名前`,O=`開く`,k=`設定`,A=`所有者`,j=`ピッチ`,M=`投影`,N=`ロール`,P=`保存`,F=`検索`,I=`ショートカット`,L=`表示`,R=`ソース`,z=`ソース一覧`,B=`ストップ`,V=`タイプ`,H=`値`,U=`動画`,W=`表示`,G=`ズーム`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`現在のビューを <0>openstreetmap.org で開く</0>`,"Achromatopsia filter":`全色盲フィルタ`,"Active Sources":`使用中ソース`,"Add a new source to your style. You can only choose the source type and id at creation time!":`スタイルに新規ソースを追加します。注意: 作成時にソースタイプとIDのみを選択できます。`,"Add filter":`フィルタを追加`,"Add Layer":`レイヤー追加`,"Add New Source":`新規ソースを追加`,"Add one of the publicly available sources to your style.":`公開ソースをスタイルに追加しましょう`,"Add Source":`ソースを追加`,"Add stop":`ストップを追加`,"Add value":`値を追加する`,"Add Variable":`変数を追加`,"any filter matches":`いずれかのフィルタが一致`,"API key for Stadia Maps.":`Stadia Maps の API キー`,"Atmosphere blend":`大気のブレンド`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`中央の高度`,"Choose Public Source":`公開ソースから選択`,"Choose the default Maputnik renderer for this style.":`このスタイルのデフォルトの Maputnik レンダラを選択してください`,"Click to close the editor":`エディタを閉じるにはクリックしてください`,Close:i,"Close modal":`モーダルを閉じる`,"Close popup":`ポップアップを閉じる`,Cluster:a,"Code Editor":`コードエディタ`,Collapse:o,"Color accessibility":`色のアクセシビリティ`,"Comment...":`コメントを書く`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`現在のレイヤーのコメント。注意:この機能は標準ではないため、他のライブラリとの互換性状況はわかりません。`,"Convert property into a elevation function":`プロパティを標高関数に変換する`,"Convert property into a zoom function":`プロパティをズーム関数に変換する`,"Convert property to data function":`プロパティをデータ関数に変換する`,"Convert to expression":`フィルタ式に変換`,"Coord bottom left":`左下座標`,"Coord bottom right":`右下座標`,"Coord top left":`左上座標`,"Coord top right":`右上座標`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`CORS使用時は、http経由で提供されるリソースをhttpsから取得することはできません。<1>https://</1> ドメインを使用してください。`,"Create HTML":`HTMLを作成`,"Data Sources":`データソース`,"Data Sources modal":`データソースのモーダル`,"Data value":`データ値`,Debug:c,"Debug modal":`デバッグモーダル`,"Decrease the pitch by 10 degrees.":`ピッチを10度減らす`,"Decrease the rotation by 15 degrees.":`回転角度を15度減らす`,"Decrease the zoom level by 1.":`ズームレベルを1減らす`,"Decrease the zoom level by 2.":`ズームレベルを2減らす`,Default:l,Delete:u,"Delete expression":`式を削除`,"Delete filter block":`フィルタブロックを削除`,"Deuteranopia filter":`緑色盲フィルタ`,"Drag and drop a style JSON file here or click to browse":`ここにスタイルのJSONファイルをドラッグ&ドロップするか、クリックして参照してください`,"Drag to resize the layer list":`ドラッグしてレイヤーリストのサイズを変更`,"Drag to resize the sidebar":`ドラッグしてサイドバーのサイズを変更`,Duplicate:d,Encoding:f,"Enter URL...":`URLを入力`,"every filter matches":`全てのフィルタが一致`,Expand:p,"Export modal":`書き出しのモーダル`,Filter:m,"Focus map":`地図にフォーカス`,"Fog color":`霧の色`,"Fog ground blend":`霧と地面のブレンド`,"Font faces":`フォントファイル`,Function:h,"Gallery Styles":`ギャラリースタイル`,"General layout properties":`一般レイアウトプロパティ`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`グローバルステート`,"Global State Variables":`グローバルステート変数`,"Glyphs URL":`フォントグリフURL`,Help:_,Hide:v,"Horizon color":`地平線の色`,"Horizon fog blend":`地平線と霧のブレンド`,"IconLine truncated
//# sourceMappingURL=translation-DkRJB3n5.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-DkRJB3n5.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`베이스`,t=`방위각`,n=`취소`,r=`중심 좌표`,i=`닫기`,a=`클러스터`,o=`접기`,s=`주석`,c=`디버그`,l=`기본값`,u=`삭제`,d=`복제`,f=`인코딩`,p=`펼치기`,m=`필터`,h=`함수`,g=`GeoJSON`,_=`도움말`,v=`숨기기`,y=`이미지`,b=`검사`,x=`키`,S=`레이어`,C=`레이어`,w=`링크`,T=`로딩`,E=`맵`,D=`이름`,O=`열기`,k=`옵션`,A=`소유자`,j=`경사각`,M=`투영법`,N=`롤 각도`,P=`저장`,F=`검색`,I=`단축키`,L=`표시`,R=`소스`,z=`소스`,B=`기준점`,V=`유형`,H=`값`,U=`비디오`,W=`보기`,G=`줌`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>OSM에서 열기</0>. 현재 뷰를 openstreetmap.org에서 엽니다`,"Achromatopsia filter":`전색맹 필터`,"Active Sources":`활성 소스`,"Add a new source to your style. You can only choose the source type and id at creation time!":`스타일에 새 소스를 추가합니다. 소스 유형과 ID는 생성 시에만 선택할 수 있습니다!`,"Add filter":`필터 추가`,"Add Layer":`레이어 추가`,"Add New Source":`새 소스 추가`,"Add one of the publicly available sources to your style.":`공개적으로 사용 가능한 소스 중 하나를 스타일에 추가하세요.`,"Add Source":`소스 추가`,"Add stop":`기준점 추가`,"Add value":`값 추가`,"Add Variable":`변수 추가`,"any filter matches":`일부 필터 일치`,"API key for Stadia Maps.":`Stadia Maps용 API 키 입니다.`,"Atmosphere blend":`대기 블렌드`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`중심 고도`,"Choose Public Source":`공개 소스 선택`,"Choose the default Maputnik renderer for this style.":`이 스타일의 기본 Maputnik 렌더러를 선택하세요.`,"Click to close the editor":`편집기를 닫으려면 클릭하세요`,Close:i,"Close modal":`모달 닫기`,"Close popup":`팝업 닫기`,Cluster:a,"Code Editor":`코드 편집기`,Collapse:o,"Color accessibility":`색상 접근성`,"Comment...":`주석 입력...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`현재 레이어에 대한 설명입니다. 이것은 비표준이며 사양에 포함되지 않습니다.`,"Convert property into a elevation function":`속성을 고도 함수로 변환`,"Convert property into a zoom function":`속성을 줌 함수로 변환`,"Convert property to data function":`속성을 데이터 함수로 변환`,"Convert to expression":`표현식으로 변환`,"Coord bottom left":`좌하단 좌표`,"Coord bottom right":`우하단 좌표`,"Coord top left":`좌상단 좌표`,"Coord top right":`우상단 좌표`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`CORS 정책으로 인해 https에서 http 리소스를 가져올 수 없습니다. <1>https://</1> 도메인을 사용하세요`,"Create HTML":`HTML 생성`,"Data Sources":`데이터 소스`,"Data Sources modal":`데이터 소스 모달`,"Data value":`데이터 값`,Debug:c,"Debug modal":`디버그 모달`,"Decrease the pitch by 10 degrees.":`경사각을 10도 감소시킵니다.`,"Decrease the rotation by 15 degrees.":`회전을 15도 감소시킵니다.`,"Decrease the zoom level by 1.":`줌 레벨을 1 감소시킵니다.`,"Decrease the zoom level by 2.":`줌 레벨을 2 감소시킵니다.`,Default:l,Delete:u,"Delete expression":`표현식 삭제`,"Delete filter block":`필터 블록 삭제`,"Deuteranopia filter":`녹색맹 필터`,"Drag and drop a style JSON file here or click to browse":`여기에 스타일 JSON 파일을 끌어다 놓거나 클릭하여 찾아보세요`,"Drag to resize the layer list":`드래그하여 레이어 목록 크기 조정`,"Drag to resize the sidebar":`드래그하여 사이드바 크기 조정`,Duplicate:d,Encoding:f,"Enter URL...":`URL 입력...`,"every filter matches":`모든 필터 일치`,Expand:p,"Export modal":`모달 내보내기`,Filter:m,"Focus map":`포커스 맵`,"Fog color":`안개 색상`,"Fog ground blend":`안개-지면 블렌드`,"Font faces":`폰트 파일`,Function:h,"Gallery Styles":`갤러리 스타일`,"General layout properties":`일반 레이아웃 속성`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`전역 상태`,"Global State Variables":`전역 상태 변수`,"Glyphs URL":`글리프 URL`,Help:_,Hide:v,"Horizon color":`지평선 색상`,"Horizon fog blend":`지평선-안개 블렌드`,"Icon layout properties":`아이콘 레이아웃 속성`,"Icon paint properties":`아이콘 페인트 속성`,"If the Map is in focused you can use the following shortcuts":`맵에 포커스가 맞춰진 경우 다음 단축키를 사용할 수 있습니다`,Image:y,"Image URL":`이미지 URL`,"Increase the pitch by 10 degrees.":`경사각을 10도 증가시킵니다.`,"Increase the rotation by 15 degrees.":`회전을 15도 증가시킵니다.`,"Increase the zoom level by 1.":`줌 레벨을 1 증가시킵니다.`,"IncLine truncated
//# sourceMappingURL=translation-JlhmoUee.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-JlhmoUee.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e=`Baza`,t=`İstiqamət`,n=`Ləğv et`,r=`Mərkəz`,i=`Bağla`,a=`Klaster`,o=`Yığ`,s=`Şərhlər`,c=`Sazlama`,l=`Defolt`,u=`Sil`,d=`Dublikat et`,f=`Kodlaşdırma`,p=`Genişlət`,m=`Süzgəc`,h=`Funksiya`,g=`GeoJSON`,_=`Kömək`,v=`Gizlət`,y=`Şəkil`,b=`Yoxla`,x=`Açar`,S=`Qat`,C=`Qatlar`,w=`Keçidlər`,T=`Yüklənir`,E=`Xəritə`,D=`Ad`,O=`Aç`,k=`Seçimlər`,A=`Sahib`,j=`Meyl`,M=`Proyeksiya`,N=`Fırlanma`,P=`Yadda saxla`,F=`Axtar`,I=`Qısayollar`,L=`Göstər`,R=`Mənbə`,z=`Mənbələr`,B=`Dayanacaqlar`,V=`Növ`,H=`Dəyər`,U=`Video`,W=`Görünüş`,G=`Yaxınlaşma`,K={"<0>Open in OSM</0>. Opens the current view on openstreetmap.org":`<0>OSM-də aç</0>. Cari görünüşü openstreetmap.org saytında açır`,"Achromatopsia filter":`Axromatopsiya süzgəci`,"Active Sources":`Aktiv Mənbələr`,"Add a new source to your style. You can only choose the source type and id at creation time!":`Üslubunuza yeni mənbə əlavə edin. Mənbə növünü və ID-ni yalnız yaradılma zamanı seçə bilərsiniz!`,"Add filter":`Süzgəc əlavə et`,"Add Layer":`Qat Əlavə Et`,"Add New Source":`Yeni Mənbə Əlavə Et`,"Add one of the publicly available sources to your style.":`Üslubunuza ictimai mənbələrdən birini əlavə edin.`,"Add Source":`Mənbə Əlavə Et`,"Add stop":`Dayanacaq əlavə et`,"Add value":`Dəyər əlavə et`,"Add Variable":`Dəyişən Əlavə Et`,"any filter matches":`istənilən süzgəc uyğun gəlirsə`,"API key for Stadia Maps.":`Stadia Maps üçün API açarı.`,"Atmosphere blend":`Atmosfer qarışığı`,Base:e,Bearing:t,Cancel:n,Center:r,"Center altitude":`Mərkəzin hündürlüyü`,"Choose Public Source":`İctimai Mənbə Seç`,"Choose the default Maputnik renderer for this style.":`Bu üslub üçün defolt Maputnik renderer-ini seçin.`,"Click to close the editor":`Redaktoru bağlamaq üçün klikləyin`,Close:i,"Close modal":`Modalı bağla`,"Close popup":`Popapı bağla`,Cluster:a,"Code Editor":`Kod Redaktoru`,Collapse:o,"Color accessibility":`Rəng əlçatanlığı`,"Comment...":`Şərh...`,Comments:s,"Comments for the current layer. This is non-standard and not in the spec.":`Cari qat üçün şərhlər. Bu, standart deyil və spesifikasiyada yoxdur.`,"Convert property into a elevation function":`Xassəni hündürlük funksiyasına çevir`,"Convert property into a zoom function":`Xassəni yaxınlaşma funksiyasına çevir`,"Convert property to data function":`Xassəni məlumat funksiyasına çevir`,"Convert to expression":`İfadəyə çevir`,"Coord bottom left":`Koordinat aşağı sol`,"Coord bottom right":`Koordinat aşağı sağ`,"Coord top left":`Koordinat yuxarı sol`,"Coord top right":`Koordinat yuxarı sağ`,"CORS policy won't allow fetching resources served over http from https, use a <1>https://</1> domain":`CORS siyasəti https-dən http üzərindən verilən resursların alınmasına icazə vermir, <1>https://</1> domenindən istifadə edin`,"Create HTML":`HTML Yarat`,"Data Sources":`Məlumat Mənbələri`,"Data Sources modal":`Məlumat Mənbələri modalı`,"Data value":`Məlumat dəyəri`,Debug:c,"Debug modal":`Sazlama modalı`,"Decrease the pitch by 10 degrees.":`Meyli 10 dərəcə azalt.`,"Decrease the rotation by 15 degrees.":`Fırlanmanı 15 dərəcə azalt.`,"Decrease the zoom level by 1.":`Yaxınlaşma səviyyəsini 1 azalt.`,"Decrease the zoom level by 2.":`Yaxınlaşma səviyyəsini 2 azalt.`,Default:l,Delete:`Sil`,"Delete expression":`İfadəni sil`,"Delete filter block":`Süzgəc blokunu sil`,"Deuteranopia filter":`Deuteranopiya süzgəci`,"Drag and drop a style JSON file here or click to browse":`Üslub JSON faylını buraya sürükləyib buraxın və ya seçmək üçün klikləyin`,"Drag to resize the layer list":`Qat siyahısının ölçüsünü dəyişmək üçün sürükləyin`,"Drag to resize the sidebar":`Yan panelin ölçüsünü dəyişmək üçün sürükləyin`,Duplicate:d,Encoding:f,"Enter URL...":`URL daxil edin...`,"every filter matches":`bütün süzgəclər uyğun gəlirsə`,Expand:p,"Export modal":`İxrac modalı`,Filter:m,"Focus map":`Xəritəyə fokuslan`,"Fog color":`Duman rəngi`,"Fog ground blend":`Duman-yer qarışığı`,"Font faces":`Şrift faylları`,Function:h,"Gallery Styles":`Qalereya Üslubları`,"General layout properties":`Ümumi düzülüş xassələri`,GeoJSON:g,"GeoJSON (JSON)":`GeoJSON (JSON)`,"GeoJSON (URL)":`GeoJSON (URL)`,"GeoJSON URL":`GeoJSON URL`,"Global State":`Qlobal Vəziyyət`,"Global State Variables":`Qlobal Vəziyyət Dəyişənləri`,"Glyphs URL":`Şriftlər URL-i`,Help:_,Hide:v,"Horizon color":`Üfüq rəngi`,"Horizon fog blend":`Üfüq-duman qarışığı`,"Icon layout properties":`İkon düzülüş xassələri`,"Icon paint properties":`İkon boyama xassələri`,"If the Map is in focused you can use the following shortcuts":`Xəritə fokusdadırsa aşağıdakı qısayollardan istifadə edə bilərsiniz`,Image:y,"Image URL":`Şəkil URL-i`,"Increase the pitch by 10 degrees.":`Meyli 10 dərəcə artır.`Line truncated
//# sourceMappingURL=translation-KgmhpOlS.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-KgmhpOlS.js","names":["Base","Bearing","Cancel","Center","Close","Cluster","Collapse","Comments","Debug","Default","Delete","Duplicate","Encoding","Expand","Filter","Function","GeoJSON","Help","Hide","Image","Inspect","Key","Layer","Layers","Links","Loading","Map","Name","Open","Options","Owner","Pitch","Projection","Roll","Save","Search","Shortcuts","Show","Source","Sources","Stops","Type","Value","Video","View","Zoom","translation_default"],"sources":[],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
var e={"Drag and drop a style JSON file here or click to browse":`Drag and drop a style JSON file here or click to browse`};export{e as default};
//# sourceMappingURL=translation-kg7OItc9.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"translation-kg7OItc9.js","names":["translation_default"],"sources":[],"mappings":""}
-291
View File
@@ -1,291 +0,0 @@
var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server");
var webpackConfig = require("./webpack.config");
var testConfig = require("../test/config/specs");
var artifacts = require("../test/artifacts");
var isDocker = require("is-docker");
var server;
var SCREENSHOT_PATH = artifacts.pathSync("screenshots");
exports.config = {
//
// ====================
// Runner Configuration
// ====================
//
// WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
// on a remote machine).
runner: 'local',
//
// ==================
// Specify Test Files
// ==================
// Define which test specs should run. The pattern is relative to the directory
// from which `wdio` was called. Notice that, if you are calling `wdio` from an
// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
// directory is where your package.json resides, so `wdio` will be called from there.
//
specs: [
'./test/functional/index.js'
],
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
],
//
// ============
// Capabilities
// ============
// Define your capabilities here. WebdriverIO can run multiple capabilities at the same
// time. Depending on the number of capabilities, WebdriverIO launches several test
// sessions. Within your capabilities you can overwrite the spec and exclude options in
// order to group specific specs to a specific capability.
//
// First, you can define how many instances should be started at the same time. Let's
// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
// files and you set maxInstances to 10, all spec files will get tested at the same time
// and 30 processes will get spawned. The property handles how many capabilities
// from the same test should run tests.
//
maxInstances: 10,
//
// If you have trouble getting all important capabilities together, check out the
// Sauce Labs platform configurator - a great tool to configure your capabilities:
// https://docs.saucelabs.com/reference/platforms-configurator
//
capabilities: [{
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
// grid with only 5 firefox instances available you can make sure that not more than
// 5 instances get started at a time.
maxInstances: 5,
//
browserName: 'chrome',
// If outputDir is provided WebdriverIO can capture driver session logs
// it is possible to configure which logTypes to include/exclude.
// excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
// excludeDriverLogs: ['bugreport', 'server'],
}],
//
// ===================
// Test Configurations
// ===================
// Define all options that are relevant for the WebdriverIO instance here
//
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevel: 'info',
//
// Set specific log levels per logger
// loggers:
// - webdriver, webdriverio
// - @wdio/applitools-service, @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
// - @wdio/mocha-framework, @wdio/jasmine-framework
// - @wdio/local-runner, @wdio/lambda-runner
// - @wdio/sumologic-reporter
// - @wdio/cli, @wdio/config, @wdio/sync, @wdio/utils
// Level of logging verbosity: trace | debug | info | warn | error | silent
// logLevels: {
// webdriver: 'debug',
// '@wdio/applitools-service': 'info'
// },
//
// If you only want to run your tests until a specific amount of tests have failed use
// bail (default is 0 - don't bail, run all tests).
bail: 0,
//
screenshotPath: SCREENSHOT_PATH,
// Note: This is here because @orangemug currently runs Maputnik inside a docker container.
hostname: process.env.DOCKER_HOST || "0.0.0.0",
// Set a base URL in order to shorten url command calls. If your `url` parameter starts
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
// gets prepended directly.
baseUrl: 'http://localhost',
//
// Default timeout for all waitFor* commands.
waitforTimeout: 10000,
//
// Default timeout in milliseconds for request
// if Selenium Grid doesn't send response
connectionRetryTimeout: 90000,
//
// Default request retries count
connectionRetryCount: 3,
//
// Test runner services
// Services take over a specific job you don't want to take care of. They enhance
// your test setup with almost no effort. Unlike plugins, they don't add new
// commands. Instead, they hook themselves up into the test process.
//
// Framework you want to run your specs with.
// The following are supported: Mocha, Jasmine, and Cucumber
// see also: https://webdriver.io/docs/frameworks.html
//
// Make sure you have the wdio adapter package for the specific framework installed
// before running any tests.
framework: 'mocha',
//
// The number of times to retry the entire specfile when it fails as a whole
// specFileRetries: 1,
//
// Test reporter for stdout.
// The only one supported by default is 'dot'
// see also: https://webdriver.io/docs/dot-reporter.html
reporters: ['spec'],
//
// Options to be passed to Mocha.
// See the full list at http://mochajs.org/
mochaOpts: {
ui: 'bdd',
// Because we don't know how long the initial build will take...
timeout: 4*60*1000
},
onPrepare: function (config, capabilities) {
return new Promise(function(resolve, reject) {
var compiler = webpack(webpackConfig);
const serverHost = isDocker() ? "0.0.0.0" : "localhost";
server = new WebpackDevServer(compiler, {
host: serverHost,
stats: {
colors: true
}
});
server.listen(testConfig.port, serverHost, function(err) {
if(err) {
reject(err);
}
else {
resolve();
}
});
})
},
onComplete: function(exitCode) {
server.close()
}
//
// =====
// Hooks
// =====
// WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
// it and to build services around it. You can either apply a single function or an array of
// methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
// resolved to continue.
/**
* Gets executed once before all workers get launched.
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
*/
// onPrepare: function (config, capabilities) {
// },
/**
* Gets executed just before initialising the webdriver session and test framework. It allows you
* to manipulate configurations depending on the capability or spec.
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that are to be run
*/
// beforeSession: function (config, capabilities, specs) {
// },
/**
* Gets executed before test execution begins. At this point you can access to all global
* variables like `browser`. It is the perfect place to define custom commands.
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that are to be run
*/
// before: function (capabilities, specs) {
// },
/**
* Runs before a WebdriverIO command gets executed.
* @param {String} commandName hook command name
* @param {Array} args arguments that command would receive
*/
// beforeCommand: function (commandName, args) {
// },
/**
* Hook that gets executed before the suite starts
* @param {Object} suite suite details
*/
// beforeSuite: function (suite) {
// },
/**
* Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
* @param {Object} test test details
*/
// beforeTest: function (test) {
// },
/**
* Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
* beforeEach in Mocha)
*/
// beforeHook: function () {
// },
/**
* Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
* afterEach in Mocha)
*/
// afterHook: function () {
// },
/**
* Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
* @param {Object} test test details
*/
// afterTest: function (test) {
// },
/**
* Hook that gets executed after the suite has ended
* @param {Object} suite suite details
*/
// afterSuite: function (suite) {
// },
/**
* Runs after a WebdriverIO command gets executed
* @param {String} commandName hook command name
* @param {Array} args arguments that command would receive
* @param {Number} result 0 - command success, 1 - command error
* @param {Object} error error object if any
*/
// afterCommand: function (commandName, args, result, error) {
// },
/**
* Gets executed after all tests are done. You still have access to all global variables from
* the test.
* @param {Number} result 0 - test pass, 1 - test fail
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that ran
*/
// after: function (result, capabilities, specs) {
// },
/**
* Gets executed right after terminating the webdriver session.
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that ran
*/
// afterSession: function (config, capabilities, specs) {
// },
/**
* Gets executed after all workers got shut down and the process is about to exit. An error
* thrown in the onComplete hook will result in the test run failing.
* @param {Object} exitCode 0 - success, 1 - fail
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {<Object>} results object containing test results
*/
// onComplete: function(exitCode, config, capabilities, results) {
// },
/**
* Gets executed when a refresh happens.
* @param {String} oldSessionId session ID of the old session
* @param {String} newSessionId session ID of the new session
*/
//onReload: function(oldSessionId, newSessionId) {
//}
}
-75
View File
@@ -1,75 +0,0 @@
"use strict";
var webpack = require('webpack');
var path = require('path');
var rules = require('./webpack.rules');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackInlineSVGPlugin = require('html-webpack-inline-svg-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
const HOST = process.env.HOST || "127.0.0.1";
const PORT = process.env.PORT || "8888";
module.exports = {
target: 'web',
mode: 'development',
entry: [
`webpack-dev-server/client?http://${HOST}:${PORT}`,
`webpack/hot/only-dev-server`,
`./src/index.jsx` // Your appʼs entry point
],
devtool: process.env.WEBPACK_DEVTOOL || 'cheap-module-source-map',
output: {
path: path.join(__dirname, '..', 'public'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
noParse: [
/mapbox-gl\/dist\/mapbox-gl.js/
],
rules: rules
},
node: {
fs: "empty",
net: 'empty',
tls: 'empty'
},
devServer: {
contentBase: "./public",
// do not print bundle build stats
noInfo: true,
// enable HMR
hot: true,
// embed the webpack-dev-server runtime into the bundle
inline: true,
// serve index.html in place of 404 responses to allow HTML5 history
historyApiFallback: true,
port: PORT,
host: HOST,
watchOptions: {
// Disabled polling by default as it causes lots of CPU usage and hence drains laptop batteries. To enable polling add WEBPACK_DEV_SERVER_POLLING to your environment
// See <https://webpack.js.org/configuration/watch/#watchoptions-poll> for details
poll: (!!process.env.WEBPACK_DEV_SERVER_POLLING ? true : false),
watch: false
}
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
title: 'Maputnik',
template: './src/template.html'
}),
new HtmlWebpackInlineSVGPlugin({
runPreEmit: true,
}),
new CopyWebpackPlugin([
{
from: './src/manifest.json',
to: 'manifest.json'
}
])
]
};
-66
View File
@@ -1,66 +0,0 @@
var webpack = require('webpack');
var path = require('path');
var rules = require('./webpack.rules');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackInlineSVGPlugin = require('html-webpack-inline-svg-plugin');
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var CopyWebpackPlugin = require('copy-webpack-plugin');
var artifacts = require("../test/artifacts");
var OUTPATH = artifacts.pathSync("/build");
module.exports = {
entry: {
app: './src/index.jsx',
},
output: {
path: OUTPATH,
filename: '[name].[contenthash].js',
chunkFilename: '[contenthash].js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
noParse: [
/mapbox-gl\/dist\/mapbox-gl.js/
],
rules: rules
},
node: {
fs: "empty",
net: 'empty',
tls: 'empty'
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new WebpackCleanupPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new HtmlWebpackPlugin({
template: './src/template.html',
title: 'Maputnik'
}),
new HtmlWebpackInlineSVGPlugin({
runPreEmit: true,
}),
new CopyWebpackPlugin([
{
from: './src/manifest.json',
to: 'manifest.json'
}
]),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
defaultSizes: 'gzip',
openAnalyzer: false,
generateStatsFile: true,
reportFilename: 'bundle-stats.html',
statsFilename: 'bundle-stats.json',
})
]
};
-20
View File
@@ -1,20 +0,0 @@
const webpackProdConfig = require('./webpack.production.config');
const artifacts = require("../test/artifacts");
const OUTPATH = artifacts.pathSync("/profiling");
module.exports = {
...webpackProdConfig,
output: {
...webpackProdConfig.output,
path: OUTPATH,
},
resolve: {
...webpackProdConfig.resolve,
alias: {
...webpackProdConfig.resolve.alias,
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
}
}
};
-44
View File
@@ -1,44 +0,0 @@
const path = require("path");
module.exports = [
{
test: /\.jsx?$/,
exclude: [
path.resolve(__dirname, '../node_modules')
],
use: 'babel-loader'
},
{
test: /\.(eot|ttf|woff|woff2)$/,
use: 'file-loader?name=fonts/[name].[ext]'
},
{
test: /\.ico$/,
use: 'file-loader?name=[name].[ext]'
},
{
test: /\.(gif|jpg|png)$/,
use: 'file-loader?name=img/[name].[ext]'
},
{
test: /\.svg$/,
use: [
'svg-inline-loader'
]
},
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.scss$/,
use: [
'style-loader',
"css-loader",
"sass-loader"
]
},
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/,
use: [
'style-loader',
'css-loader'
]
}
];
+103
View File
@@ -0,0 +1,103 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Maputnik</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="/maputnik/assets/manifest-BrZzkYP9.json">
<link rel="icon" href="/maputnik/assets/favicon-DBn6BKLx.ico" type="image/x-icon" />
<style>html{background-color:#1c1f24}.loading{text-align:center;flex-direction:column;justify-content:center;align-items:center;width:100vw;height:100vh;display:flex;position:absolute;top:0;left:0}.loading__logo img{width:200px;height:200px}.loading__text{color:#fff;padding-bottom:2em;font-family:sans-serif;font-size:1.2em}</style>
<script type="module" crossorigin src="/maputnik/assets/index-m_3Yt9Cx.js"></script>
<link rel="stylesheet" crossorigin href="/maputnik/assets/index-hriR7F7_.css">
</head>
<body>
<!-- From <https://github.com/hail2u/color-blindness-emulation> -->
<svg
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
version="1.1">
<defs>
<filter id="protanopia">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.567, 0.433, 0, 0, 0
0.558, 0.442, 0, 0, 0
0, 0.242, 0.758, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="protanomaly">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.817, 0.183, 0, 0, 0
0.333, 0.667, 0, 0, 0
0, 0.125, 0.875, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="deuteranopia">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.625, 0.375, 0, 0, 0
0.7, 0.3, 0, 0, 0
0, 0.3, 0.7, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="deuteranomaly">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.8, 0.2, 0, 0, 0
0.258, 0.742, 0, 0, 0
0, 0.142, 0.858, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="tritanopia">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.95, 0.05, 0, 0, 0
0, 0.433, 0.567, 0, 0
0, 0.475, 0.525, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="tritanomaly">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.967, 0.033, 0, 0, 0
0, 0.733, 0.267, 0, 0
0, 0.183, 0.817, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="achromatopsia">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.299, 0.587, 0.114, 0, 0
0.299, 0.587, 0.114, 0, 0
0.299, 0.587, 0.114, 0, 0
0, 0, 0, 1, 0"/>
</filter>
<filter id="achromatomaly">
<feColorMatrix
in="SourceGraphic"
type="matrix"
values="0.618, 0.320, 0.062, 0, 0
0.163, 0.775, 0.062, 0, 0
0.163, 0.320, 0.516, 0, 0
0, 0, 0, 1, 0"/>
</filter>
</defs>
</svg>
<div id="app"></div>
<div class="loading">
<div class="loading__logo">
<img inline src="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='1200'%20height='1200'%20viewBox='0%200%20100%20100'%3e%3cstyle%3e@keyframes%20circle-anim{0%25,40%25{fill-opacity:0}60%25,to{fill-opacity:1}}.circle0,.circle1,.circle2,.circle3,.circle4,.circle5{stroke-opacity:0;animation-name:circle-anim;will-change:transform;animation-timing-function:east-in-out;animation-duration:800ms;animation-iteration-count:infinite;animation-direction:alternate}.circle0{animation-delay:100ms}.circle1{animation-delay:200ms}.circle2{animation-delay:300ms}.circle3{animation-delay:400ms}.circle4{animation-delay:500ms}.circle5{animation-delay:600ms}%3c/style%3e%3cg%20class='map'%20stroke='%23000'%3e%3cuse%20xlink:href='%23ref-1--map__main'%20fill='%234eba6f'%3e%3c/use%3e%3cuse%20xlink:href='%23ref-1--map__line1'%20fill='none'%3e%3c/use%3e%3cuse%20xlink:href='%23ref-1--map__line2'%20fill='none'%3e%3c/use%3e%3cuse%20xlink:href='%23ref-1--map__line3'%20fill='none'%3e%3c/use%3e%3c/g%3e%3cg%20class='palette'%3e%3cuse%20xlink:href='%23ref-1--palette__main'%20fill='%23fff'%20stroke='%23000'%3e%3c/use%3e%3cuse%20xlink:href='%23ref-1--palette__inner'%20fill='none'%20stroke='%23000'%3e%3c/use%3e%3cuse%20class='circle5'%20xlink:href='%23ref-1--palette__circle5'%20fill='%23f7c44c'%3e%3c/use%3e%3cuse%20class='circle4'%20xlink:href='%23ref-1--palette__circle4'%20fill='%234eba6f'%3e%3c/use%3e%3cuse%20class='circle3'%20xlink:href='%23ref-1--palette__circle3'%20fill='%23f7c44c'%3e%3c/use%3e%3cuse%20class='circle2'%20xlink:href='%23ref-1--palette__circle2'%20fill='%234eba6f'%3e%3c/use%3e%3cuse%20class='circle1'%20xlink:href='%23ref-1--palette__circle1'%20fill='%23f7c44c'%3e%3c/use%3e%3cuse%20class='circle0'%20xlink:href='%23ref-1--palette__circle0'%20fill='%234eba6f'%3e%3c/use%3e%3c/g%3e%3cg%20class='brush'%20stroke='%23000'%3e%3cuse%20xlink:href='%23ref-1--brush__bottom'%20fill='%23f7c44c'%3e%3c/use%3e%3cuse%20xlink:href='%23ref-1--brush__top'%20fill='%23fff'%3e%3c/use%3e%3c/g%3e%3cdefs%3e%3cpath%20id='ref-1--map__main'%20stroke-width='2.366'%20stroke-linejoin='round'%20d='M18.84%207.717l15.44%207.542%2015.75-7.762%2015.7%207.857L81.005%207.67%2096.31%2054.052%2073.598%2062.12%2050.93%2053.872l-25.1%208.066-22.668-8.066z'%3e%3c/path%3e%3cpath%20id='ref-1--map__line1'%20d='M65.556%2015.07l7.647%2046.838'%20stroke-width='1.104'%3e%3c/path%3e%3cpath%20id='ref-1--map__line2'%20d='M50.261%207.422l.717%2046.6'%20stroke-width='1.104'%3e%3c/path%3e%3cpath%20id='ref-1--map__line3'%20d='M34.011%2015.07l-8.603%2046.6'%20stroke-width='1.104'%3e%3c/path%3e%3cpath%20id='ref-1--palette__main'%20stroke-width='2.3'%20d='M47.352%2030.887c7.993.226%2016.934%209.725%2017.954%2015.25%201.02%205.527-.743%2011.125-4.298%2013.875-3.554%202.75-8.6%202.905-8.723%208.302-.097%204.237%208.457%208.5%208.088%2015.653-.406%207.857-15.508%2013.15-30.943%206.102-8.556-3.906-14.249-13.653-13.385-26.238C16.833%2052.334%2022.32%2043.658%2027.382%2039c5.977-5.503%2011.977-8.337%2019.97-8.112z'%3e%3c/path%3e%3ccircle%20id='ref-1--palette__inner'%20stroke-width='2.3'%20cx='41.873'%20cy='61.901'%20r='6.389'%3e%3c/circle%3e%3ccircle%20id='ref-1--palette__circle5'%20cy='44.56'%20cx='54.347'%20r='4.336'%3e%3c/circle%3e%3ccircle%20id='ref-1--palette__circle4'%20cx='40.443'%20cy='41.555'%20r='4.336'%3e%3c/circle%3e%3ccircle%20id='ref-1--palette__circle3'%20r='4.336'%20cy='51.102'%20cx='29.651'%3e%3c/circle%3e%3ccircle%20id='ref-1--palette__circle2'%20cx='25.293'%20cy='65.836'%20r='4.336'%3e%3c/circle%3e%3ccircle%20id='ref-1--palette__circle1'%20r='4.336'%20cy='79.326'%20cx='32.764'%3e%3c/circle%3e%3ccircle%20id='ref-1--palette__circle0'%20cx='46.669'%20cy='80.571'%20r='4.336'%3e%3c/circle%3e%3cpath%20id='ref-1--brush__bottom'%20d='M76.333%2089.333c-1.645-9.794-4.375-35.26-4.32-37.887.056-2.627%202.52-4.34%205.36-4.317%202.842.022%205.098%201.87%205.314%204.27.107%201.2-1.576%2028.06-2.318%2037.844-.332%204.374-3.31%204.413-4.036.09z'%20stroke-width='2.3'%20stroke-linejoin='round'%3e%3c/path%3e%3cpath%20id='ref-1--brush__top'%20stroke-linejoin='round'%20stroke-width='2.3'%20d='M77.184%2026.428s-5.621%207.02-5.621%2011.978c0%204.957%202.206%206.878%205.81%206.878%203.606%200%205.148-1.708%205.29-6.736.142-5.028-5.479-12.12-5.479-12.12z'%3e%3c/path%3e%3c/defs%3e%3c/svg%3e" />
</div>
<div class="loading__text">Loading&hellip;</div>
</div>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

-17525
View File
File diff suppressed because it is too large. Load diff
-158
View File
@@ -1,158 +0,0 @@
{
"name": "maputnik",
"version": "1.7.0-beta",
"description": "A MapboxGL visual style editor",
"main": "''",
"scripts": {
"stats": "webpack --config config/webpack.production.config.js --profile --json > stats.json",
"build": "webpack --config config/webpack.production.config.js --progress --profile --colors",
"profiling-build": "webpack --config config/webpack.profiling.config.js --progress --profile --colors",
"test": "cross-env NODE_ENV=test wdio config/wdio.conf.js",
"test-watch": "cross-env NODE_ENV=test wdio config/wdio.conf.js --watch",
"start": "webpack-dev-server --progress --profile --colors --config config/webpack.config.js",
"lint-js": "eslint --ext js --ext jsx src test",
"lint-css": "stylelint \"src/styles/*.scss\"",
"lint": "npm run lint-js && npm run lint-css"
},
"repository": {
"type": "git",
"url": "https://github.com/maputnik/editor"
},
"author": "Lukas Martinelli",
"license": "MIT",
"homepage": "https://github.com/maputnik/editor#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
"@mapbox/mapbox-gl-style-spec": "^13.12.0",
"@mdi/react": "^1.3.0",
"classnames": "^2.2.6",
"codemirror": "^5.52.0",
"color": "^3.1.2",
"detect-browser": "^5.0.0",
"file-saver": "^2.0.2",
"json-to-ast": "^2.1.0",
"jsonlint": "github:josdejong/jsonlint#85a19d7",
"lodash": "^4.17.15",
"lodash.capitalize": "^4.2.1",
"lodash.clamp": "^4.0.3",
"lodash.clonedeep": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.isequal": "^4.5.0",
"lodash.throttle": "^4.1.1",
"mapbox-gl": "^1.9.0",
"mapbox-gl-inspect": "^1.3.1",
"maputnik-design": "github:maputnik/design#f7a2b4d",
"ol": "^6.2.1",
"ol-mapbox-style": "^6.0.1",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-accessible-accordion": "^3.0.1",
"react-aria-menubutton": "^6.3.0",
"react-aria-modal": "^4.0.0",
"react-autobind": "^1.0.6",
"react-autocomplete": "^1.8.1",
"react-collapse": "^5.0.1",
"react-color": "^2.18.0",
"react-dom": "^16.12.0",
"react-file-reader-input": "^2.0.0",
"react-icon-base": "^2.1.2",
"react-icons": "^3.9.0",
"react-motion": "^0.5.2",
"react-sortable-hoc": "^1.11.0",
"reconnecting-websocket": "^4.4.0",
"slugify": "^1.3.6",
"url": "^0.11.0"
},
"jshintConfig": {
"esversion": 6
},
"stylelint": {
"extends": "stylelint-config-recommended-scss",
"rules": {
"no-descending-specificity": null,
"media-feature-name-no-unknown": [
true,
{
"ignoreMediaFeatureNames": [
"prefers-reduced-motion"
]
}
]
}
},
"eslintConfig": {
"plugins": [
"react"
],
"extends": [
"plugin:react/recommended"
],
"env": {
"browser": true,
"node": true,
"es6": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"experimentalObjectRestSpread": true,
"jsx": true
}
}
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.6.3",
"@mdi/js": "^5.0.45",
"@wdio/cli": "^6.0.5",
"@wdio/local-runner": "^6.0.5",
"@wdio/mocha-framework": "^6.0.4",
"@wdio/selenium-standalone-service": "^6.0.4",
"@wdio/spec-reporter": "^6.0.4",
"@wdio/sync": "^6.0.1",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.1.0",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-static-fs": "^3.0.0",
"copy-webpack-plugin": "^5.1.1",
"cors": "^2.8.5",
"cross-env": "^7.0.0",
"css-loader": "^3.4.2",
"eslint": "^6.8.0",
"eslint-plugin-react": "^7.18.3",
"express": "^4.17.1",
"file-loader": "^6.0.0",
"html-webpack-inline-svg-plugin": "^1.3.0",
"html-webpack-plugin": "^3.2.0",
"is-docker": "^2.0.0",
"istanbul": "^0.4.5",
"istanbul-lib-coverage": "^3.0.0",
"mkdirp": "^1.0.3",
"mocha": "^7.0.1",
"node-sass": "^4.13.1",
"react-hot-loader": "^4.12.19",
"sass-loader": "^8.0.2",
"selenium-standalone": "^6.17.0",
"style-loader": "^1.1.3",
"stylelint": "^13.2.0",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-scss": "^3.14.2",
"svg-inline-loader": "^0.8.2",
"transform-loader": "^0.2.4",
"uuid": "^7.0.2",
"webdriverio": "^6.0.5",
"webpack": "^4.41.6",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
}
}
-801
View File
@@ -1,801 +0,0 @@
import autoBind from 'react-autobind';
import React from 'react'
import cloneDeep from 'lodash.clonedeep'
import clamp from 'lodash.clamp'
import get from 'lodash.get'
import {unset} from 'lodash'
import {arrayMove} from 'react-sortable-hoc'
import url from 'url'
import MapboxGlMap from './map/MapboxGlMap'
import OpenLayersMap from './map/OpenLayersMap'
import LayerList from './layers/LayerList'
import LayerEditor from './layers/LayerEditor'
import Toolbar from './Toolbar'
import AppLayout from './AppLayout'
import MessagePanel from './MessagePanel'
import SettingsModal from './modals/SettingsModal'
import ExportModal from './modals/ExportModal'
import SourcesModal from './modals/SourcesModal'
import OpenModal from './modals/OpenModal'
import ShortcutsModal from './modals/ShortcutsModal'
import SurveyModal from './modals/SurveyModal'
import DebugModal from './modals/DebugModal'
import { downloadGlyphsMetadata, downloadSpriteMetadata } from '../libs/metadata'
import {latest, validate} from '@mapbox/mapbox-gl-style-spec'
import style from '../libs/style'
import { initialStyleUrl, loadStyleUrl, removeStyleQuerystring } from '../libs/urlopen'
import { undoMessages, redoMessages } from '../libs/diffmessage'
import { StyleStore } from '../libs/stylestore'
import { ApiStyleStore } from '../libs/apistore'
import { RevisionStore } from '../libs/revisions'
import LayerWatcher from '../libs/layerwatcher'
import tokens from '../config/tokens.json'
import isEqual from 'lodash.isequal'
import Debug from '../libs/debug'
import queryUtil from '../libs/query-util'
import MapboxGl from 'mapbox-gl'
// Similar functionality as <https://github.com/mapbox/mapbox-gl-js/blob/7e30aadf5177486c2cfa14fe1790c60e217b5e56/src/util/mapbox.js>
function normalizeSourceURL (url, apiToken="") {
const matches = url.match(/^mapbox:\/\/(.*)/);
if (matches) {
// mapbox://mapbox.mapbox-streets-v7
return `https://api.mapbox.com/v4/${matches[1]}.json?secure&access_token=${apiToken}`
}
else {
return url;
}
}
function setFetchAccessToken(url, mapStyle) {
const matchesTilehosting = url.match(/\.tilehosting\.com/);
const matchesMaptiler = url.match(/\.maptiler\.com/);
const matchesThunderforest = url.match(/\.thunderforest\.com/);
if (matchesTilehosting || matchesMaptiler) {
const accessToken = style.getAccessToken("openmaptiles", mapStyle, {allowFallback: true})
if (accessToken) {
return url.replace('{key}', accessToken)
}
}
else if (matchesThunderforest) {
const accessToken = style.getAccessToken("thunderforest", mapStyle, {allowFallback: true})
if (accessToken) {
return url.replace('{key}', accessToken)
}
}
else {
return url;
}
}
function updateRootSpec(spec, fieldName, newValues) {
return {
...spec,
$root: {
...spec.$root,
[fieldName]: {
...spec.$root[fieldName],
values: newValues
}
}
}
}
export default class App extends React.Component {
constructor(props) {
super(props)
autoBind(this);
this.revisionStore = new RevisionStore()
const params = new URLSearchParams(window.location.search.substring(1))
let port = params.get("localport")
if (port == null && (window.location.port != 80 && window.location.port != 443)) {
port = window.location.port
}
this.styleStore = new ApiStyleStore({
onLocalStyleChange: mapStyle => this.onStyleChanged(mapStyle, {save: false}),
port: port,
host: params.get("localhost")
})
const shortcuts = [
{
key: "?",
handler: () => {
this.toggleModal("shortcuts");
}
},
{
key: "o",
handler: () => {
this.toggleModal("open");
}
},
{
key: "e",
handler: () => {
this.toggleModal("export");
}
},
{
key: "d",
handler: () => {
this.toggleModal("sources");
}
},
{
key: "s",
handler: () => {
this.toggleModal("settings");
}
},
{
key: "i",
handler: () => {
this.setMapState(
this.state.mapState === "map" ? "inspect" : "map"
);
}
},
{
key: "m",
handler: () => {
document.querySelector(".mapboxgl-canvas").focus();
}
},
{
key: "!",
handler: () => {
this.toggleModal("debug");
}
},
]
document.body.addEventListener("keyup", (e) => {
if(e.key === "Escape") {
e.target.blur();
document.body.focus();
}
else if(this.state.isOpen.shortcuts || document.activeElement === document.body) {
const shortcut = shortcuts.find((shortcut) => {
return (shortcut.key === e.key)
})
if(shortcut) {
this.setModal("shortcuts", false);
shortcut.handler(e);
}
}
})
const styleUrl = initialStyleUrl()
if(styleUrl && window.confirm("Load style from URL: " + styleUrl + " and discard current changes?")) {
this.styleStore = new StyleStore()
loadStyleUrl(styleUrl, mapStyle => this.onStyleChanged(mapStyle))
removeStyleQuerystring()
} else {
if(styleUrl) {
removeStyleQuerystring()
}
this.styleStore.init(err => {
if(err) {
console.log('Falling back to local storage for storing styles')
this.styleStore = new StyleStore()
}
this.styleStore.latestStyle(mapStyle => this.onStyleChanged(mapStyle))
if(Debug.enabled()) {
Debug.set("maputnik", "styleStore", this.styleStore);
Debug.set("maputnik", "revisionStore", this.revisionStore);
}
})
}
if(Debug.enabled()) {
Debug.set("maputnik", "revisionStore", this.revisionStore);
Debug.set("maputnik", "styleStore", this.styleStore);
}
const queryObj = url.parse(window.location.href, true).query;
this.state = {
errors: [],
infos: [],
mapStyle: style.emptyStyle,
selectedLayerIndex: 0,
sources: {},
vectorLayers: {},
mapState: "map",
spec: latest,
mapView: {
zoom: 0,
center: {
lng: 0,
lat: 0,
},
},
isOpen: {
settings: false,
sources: false,
open: false,
shortcuts: false,
export: false,
// TODO: Disabled for now, this should be opened on the Nth visit to the editor
survey: false,
debug: false,
},
mapboxGlDebugOptions: {
showTileBoundaries: false,
showCollisionBoxes: false,
showOverdrawInspector: false,
},
openlayersDebugOptions: {
debugToolbox: false,
},
}
this.layerWatcher = new LayerWatcher({
onVectorLayersChange: v => this.setState({ vectorLayers: v })
})
}
handleKeyPress = (e) => {
if(navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
if(e.metaKey && e.shiftKey && e.keyCode === 90) {
e.preventDefault();
this.onRedo(e);
}
else if(e.metaKey && e.keyCode === 90) {
e.preventDefault();
this.onUndo(e);
}
}
else {
if(e.ctrlKey && e.keyCode === 90) {
e.preventDefault();
this.onUndo(e);
}
else if(e.ctrlKey && e.keyCode === 89) {
e.preventDefault();
this.onRedo(e);
}
}
}
componentDidMount() {
window.addEventListener("keydown", this.handleKeyPress);
}
componentWillUnmount() {
window.removeEventListener("keydown", this.handleKeyPress);
}
saveStyle(snapshotStyle) {
this.styleStore.save(snapshotStyle)
}
updateFonts(urlTemplate) {
const metadata = this.state.mapStyle.metadata || {}
const accessToken = metadata['maputnik:openmaptiles_access_token'] || tokens.openmaptiles
let glyphUrl = (typeof urlTemplate === 'string')? urlTemplate.replace('{key}', accessToken): urlTemplate;
downloadGlyphsMetadata(glyphUrl, fonts => {
this.setState({ spec: updateRootSpec(this.state.spec, 'glyphs', fonts)})
})
}
updateIcons(baseUrl) {
downloadSpriteMetadata(baseUrl, icons => {
this.setState({ spec: updateRootSpec(this.state.spec, 'sprite', icons)})
})
}
onChangeMetadataProperty = (property, value) => {
// If we're changing renderer reset the map state.
if (
property === 'maputnik:renderer' &&
value !== get(this.state.mapStyle, ['metadata', 'maputnik:renderer'], 'mbgljs')
) {
this.setState({
mapState: 'map'
});
}
const changedStyle = {
...this.state.mapStyle,
metadata: {
...this.state.mapStyle.metadata,
[property]: value
}
}
this.onStyleChanged(changedStyle)
}
onStyleChanged = (newStyle, opts={}) => {
opts = {
save: true,
addRevision: true,
...opts,
};
const errors = validate(newStyle, latest) || [];
const mappedErrors = errors.map(error => {
const layerMatch = error.message.match(/layers\[(\d+)\]\.(?:(\S+)\.)?(\S+): (.*)/);
if (layerMatch) {
const [matchStr, index, group, property, message] = layerMatch;
const key = (group && property) ? [group, property].join(".") : property;
return {
message: error.message,
parsed: {
type: "layer",
data: {
index,
key,
message
}
}
}
}
else {
return {
message: error.message,
};
}
})
let dirtyMapStyle = undefined;
if (errors.length > 0) {
dirtyMapStyle = cloneDeep(newStyle);
errors.forEach(error => {
const {message} = error;
if (message) {
try {
const objPath = message.split(":")[0];
// Errors can be deply nested for example 'layers[0].filter[1][1][0]' we only care upto the property 'layers[0].filter'
const unsetPath = objPath.match(/^\S+?\[\d+\]\.[^\[]+/)[0];
unset(dirtyMapStyle, unsetPath);
}
catch (err) {
console.warn(err);
}
}
});
}
if(newStyle.glyphs !== this.state.mapStyle.glyphs) {
this.updateFonts(newStyle.glyphs)
}
if(newStyle.sprite !== this.state.mapStyle.sprite) {
this.updateIcons(newStyle.sprite)
}
if (opts.addRevision) {
this.revisionStore.addRevision(newStyle);
}
if (opts.save) {
this.saveStyle(newStyle);
}
this.setState({
mapStyle: newStyle,
dirtyMapStyle: dirtyMapStyle,
errors: mappedErrors,
})
this.fetchSources();
}
onUndo = () => {
const activeStyle = this.revisionStore.undo()
const messages = undoMessages(this.state.mapStyle, activeStyle)
this.onStyleChanged(activeStyle, {addRevision: false});
this.setState({
infos: messages,
})
}
onRedo = () => {
const activeStyle = this.revisionStore.redo()
const messages = redoMessages(this.state.mapStyle, activeStyle)
this.onStyleChanged(activeStyle, {addRevision: false});
this.setState({
infos: messages,
})
}
onMoveLayer = (move) => {
let { oldIndex, newIndex } = move;
let layers = this.state.mapStyle.layers;
oldIndex = clamp(oldIndex, 0, layers.length-1);
newIndex = clamp(newIndex, 0, layers.length-1);
if(oldIndex === newIndex) return;
if (oldIndex === this.state.selectedLayerIndex) {
this.setState({
selectedLayerIndex: newIndex
});
}
layers = layers.slice(0);
layers = arrayMove(layers, oldIndex, newIndex);
this.onLayersChange(layers);
}
onLayersChange = (changedLayers) => {
const changedStyle = {
...this.state.mapStyle,
layers: changedLayers
}
this.onStyleChanged(changedStyle)
}
onLayerDestroy = (layerId) => {
let layers = this.state.mapStyle.layers;
const remainingLayers = layers.slice(0);
const idx = style.indexOfLayer(remainingLayers, layerId)
remainingLayers.splice(idx, 1);
this.onLayersChange(remainingLayers);
}
onLayerCopy = (layerId) => {
let layers = this.state.mapStyle.layers;
const changedLayers = layers.slice(0)
const idx = style.indexOfLayer(changedLayers, layerId)
const clonedLayer = cloneDeep(changedLayers[idx])
clonedLayer.id = clonedLayer.id + "-copy"
changedLayers.splice(idx, 0, clonedLayer)
this.onLayersChange(changedLayers)
}
onLayerVisibilityToggle = (layerId) => {
let layers = this.state.mapStyle.layers;
const changedLayers = layers.slice(0)
const idx = style.indexOfLayer(changedLayers, layerId)
const layer = { ...changedLayers[idx] }
const changedLayout = 'layout' in layer ? {...layer.layout} : {}
changedLayout.visibility = changedLayout.visibility === 'none' ? 'visible' : 'none'
layer.layout = changedLayout
changedLayers[idx] = layer
this.onLayersChange(changedLayers)
}
onLayerIdChange = (oldId, newId) => {
const changedLayers = this.state.mapStyle.layers.slice(0)
const idx = style.indexOfLayer(changedLayers, oldId)
changedLayers[idx] = {
...changedLayers[idx],
id: newId
}
this.onLayersChange(changedLayers)
}
onLayerChanged = (layer) => {
const changedLayers = this.state.mapStyle.layers.slice(0)
const idx = style.indexOfLayer(changedLayers, layer.id)
changedLayers[idx] = layer
this.onLayersChange(changedLayers)
}
setMapState = (newState) => {
this.setState({
mapState: newState
})
}
setDefaultValues = (styleObj) => {
const metadata = styleObj.metadata || {}
if(metadata['maputnik:renderer'] === undefined) {
const changedStyle = {
...styleObj,
metadata: {
...styleObj.metadata,
'maputnik:renderer': 'mbgljs'
}
}
return changedStyle
} else {
return styleObj
}
}
openStyle = (styleObj) => {
styleObj = this.setDefaultValues(styleObj)
this.onStyleChanged(styleObj)
}
fetchSources() {
const sourceList = {...this.state.sources};
for(let [key, val] of Object.entries(this.state.mapStyle.sources)) {
if(sourceList.hasOwnProperty(key)) {
continue;
}
sourceList[key] = {
type: val.type,
layers: []
};
if(!this.state.sources.hasOwnProperty(key) && val.type === "vector" && val.hasOwnProperty("url")) {
let url = val.url;
try {
url = normalizeSourceURL(url, MapboxGl.accessToken);
} catch(err) {
console.warn("Failed to normalizeSourceURL: ", err);
}
try {
url = setFetchAccessToken(url, this.state.mapStyle)
} catch(err) {
console.warn("Failed to setFetchAccessToken: ", err);
}
fetch(url, {
mode: 'cors',
})
.then((response) => {
return response.json();
})
.then((json) => {
if(!json.hasOwnProperty("vector_layers")) {
return;
}
// Create new objects before setState
const sources = Object.assign({}, this.state.sources);
for(let layer of json.vector_layers) {
sources[key].layers.push(layer.id)
}
console.debug("Updating source: "+key);
this.setState({
sources: sources
});
})
.catch((err) => {
console.error("Failed to process sources for '%s'", url, err);
})
}
}
if(!isEqual(this.state.sources, sourceList)) {
console.debug("Setting sources");
this.setState({
sources: sourceList
})
}
}
_getRenderer () {
const metadata = this.state.mapStyle.metadata || {};
return metadata['maputnik:renderer'] || 'mbgljs';
}
onMapChange = (mapView) => {
this.setState({
mapView,
});
}
mapRenderer() {
const {mapStyle, dirtyMapStyle} = this.state;
const metadata = this.state.mapStyle.metadata || {};
const mapProps = {
mapStyle: (dirtyMapStyle || mapStyle),
replaceAccessTokens: (mapStyle) => {
return style.replaceAccessTokens(mapStyle, {
allowFallback: true
});
},
onDataChange: (e) => {
this.layerWatcher.analyzeMap(e.map)
this.fetchSources();
},
}
const renderer = this._getRenderer();
let mapElement;
// Check if OL code has been loaded?
if(renderer === 'ol') {
mapElement = <OpenLayersMap
{...mapProps}
onChange={this.onMapChange}
debugToolbox={this.state.openlayersDebugOptions.debugToolbox}
onLayerSelect={this.onLayerSelect}
/>
} else {
mapElement = <MapboxGlMap {...mapProps}
onChange={this.onMapChange}
options={this.state.mapboxGlDebugOptions}
inspectModeEnabled={this.state.mapState === "inspect"}
highlightedLayer={this.state.mapStyle.layers[this.state.selectedLayerIndex]}
onLayerSelect={this.onLayerSelect} />
}
let filterName;
if(this.state.mapState.match(/^filter-/)) {
filterName = this.state.mapState.replace(/^filter-/, "");
}
const elementStyle = {};
if (filterName) {
elementStyle.filter = `url('#${filterName}')`;
};
return <div style={elementStyle} className="maputnik-map__container">
{mapElement}
</div>
}
onLayerSelect = (layerId) => {
const idx = style.indexOfLayer(this.state.mapStyle.layers, layerId)
this.setState({ selectedLayerIndex: idx })
}
setModal(modalName, value) {
if(modalName === 'survey' && value === false) {
localStorage.setItem('survey', '');
}
this.setState({
isOpen: {
...this.state.isOpen,
[modalName]: value
}
})
}
toggleModal(modalName) {
this.setModal(modalName, !this.state.isOpen[modalName]);
}
onChangeOpenlayersDebug = (key, value) => {
this.setState({
openlayersDebugOptions: {
...this.state.openlayersDebugOptions,
[key]: value,
}
});
}
onChangeMaboxGlDebug = (key, value) => {
this.setState({
mapboxGlDebugOptions: {
...this.state.mapboxGlDebugOptions,
[key]: value,
}
});
}
render() {
const layers = this.state.mapStyle.layers || []
const selectedLayer = layers.length > 0 ? layers[this.state.selectedLayerIndex] : null
const metadata = this.state.mapStyle.metadata || {}
const toolbar = <Toolbar
renderer={this._getRenderer()}
mapState={this.state.mapState}
mapStyle={this.state.mapStyle}
inspectModeEnabled={this.state.mapState === "inspect"}
sources={this.state.sources}
onStyleChanged={this.onStyleChanged}
onStyleOpen={this.onStyleChanged}
onSetMapState={this.setMapState}
onToggleModal={this.toggleModal.bind(this)}
/>
const layerList = <LayerList
onMoveLayer={this.onMoveLayer}
onLayerDestroy={this.onLayerDestroy}
onLayerCopy={this.onLayerCopy}
onLayerVisibilityToggle={this.onLayerVisibilityToggle}
onLayersChange={this.onLayersChange}
onLayerSelect={this.onLayerSelect}
selectedLayerIndex={this.state.selectedLayerIndex}
layers={layers}
sources={this.state.sources}
errors={this.state.errors}
/>
const layerEditor = selectedLayer ? <LayerEditor
key={selectedLayer.id}
layer={selectedLayer}
layerIndex={this.state.selectedLayerIndex}
isFirstLayer={this.state.selectedLayerIndex < 1}
isLastLayer={this.state.selectedLayerIndex === this.state.mapStyle.layers.length-1}
sources={this.state.sources}
vectorLayers={this.state.vectorLayers}
spec={this.state.spec}
onMoveLayer={this.onMoveLayer}
onLayerChanged={this.onLayerChanged}
onLayerDestroy={this.onLayerDestroy}
onLayerCopy={this.onLayerCopy}
onLayerVisibilityToggle={this.onLayerVisibilityToggle}
onLayerIdChange={this.onLayerIdChange}
errors={this.state.errors}
/> : null
const bottomPanel = (this.state.errors.length + this.state.infos.length) > 0 ? <MessagePanel
currentLayer={selectedLayer}
onLayerSelect={this.onLayerSelect}
mapStyle={this.state.mapStyle}
errors={this.state.errors}
infos={this.state.infos}
/> : null
const modals = <div>
<DebugModal
renderer={this._getRenderer()}
mapboxGlDebugOptions={this.state.mapboxGlDebugOptions}
openlayersDebugOptions={this.state.openlayersDebugOptions}
onChangeMaboxGlDebug={this.onChangeMaboxGlDebug}
onChangeOpenlayersDebug={this.onChangeOpenlayersDebug}
isOpen={this.state.isOpen.debug}
onOpenToggle={this.toggleModal.bind(this, 'debug')}
mapView={this.state.mapView}
/>
<ShortcutsModal
ref={(el) => this.shortcutEl = el}
isOpen={this.state.isOpen.shortcuts}
onOpenToggle={this.toggleModal.bind(this, 'shortcuts')}
/>
<SettingsModal
mapStyle={this.state.mapStyle}
onStyleChanged={this.onStyleChanged}
onChangeMetadataProperty={this.onChangeMetadataProperty}
isOpen={this.state.isOpen.settings}
onOpenToggle={this.toggleModal.bind(this, 'settings')}
openlayersDebugOptions={this.state.openlayersDebugOptions}
/>
<ExportModal
mapStyle={this.state.mapStyle}
onStyleChanged={this.onStyleChanged}
isOpen={this.state.isOpen.export}
onOpenToggle={this.toggleModal.bind(this, 'export')}
/>
<OpenModal
isOpen={this.state.isOpen.open}
onStyleOpen={this.openStyle}
onOpenToggle={this.toggleModal.bind(this, 'open')}
/>
<SourcesModal
mapStyle={this.state.mapStyle}
onStyleChanged={this.onStyleChanged}
isOpen={this.state.isOpen.sources}
onOpenToggle={this.toggleModal.bind(this, 'sources')}
/>
<SurveyModal
isOpen={this.state.isOpen.survey}
onOpenToggle={this.toggleModal.bind(this, 'survey')}
/>
</div>
return <AppLayout
toolbar={toolbar}
layerList={layerList}
layerEditor={layerEditor}
map={this.mapRenderer()}
bottom={bottomPanel}
modals={modals}
/>
}
}
-48
View File
@@ -1,48 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import ScrollContainer from './ScrollContainer'
class AppLayout extends React.Component {
static propTypes = {
toolbar: PropTypes.element.isRequired,
layerList: PropTypes.element.isRequired,
layerEditor: PropTypes.element,
map: PropTypes.element.isRequired,
bottom: PropTypes.element,
modals: PropTypes.node,
}
static childContextTypes = {
reactIconBase: PropTypes.object
}
getChildContext() {
return {
reactIconBase: { size: 14 }
}
}
render() {
return <div className="maputnik-layout">
{this.props.toolbar}
<div className="maputnik-layout-list">
<ScrollContainer>
{this.props.layerList}
</ScrollContainer>
</div>
<div className="maputnik-layout-drawer">
<ScrollContainer>
{this.props.layerEditor}
</ScrollContainer>
</div>
{this.props.map}
{this.props.bottom && <div className="maputnik-layout-bottom">
{this.props.bottom}
</div>
}
{this.props.modals}
</div>
}
}
export default AppLayout
-30
View File
@@ -1,30 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
class Button extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
"aria-label": PropTypes.string,
onClick: PropTypes.func,
style: PropTypes.object,
className: PropTypes.string,
children: PropTypes.node,
disabled: PropTypes.bool,
}
render() {
return <button
onClick={this.props.onClick}
disabled={this.props.disabled}
aria-label={this.props["aria-label"]}
className={classnames("maputnik-button", this.props.className)}
data-wd-key={this.props["data-wd-key"]}
style={this.props.style}
>
{this.props.children}
</button>
}
}
export default Button
-61
View File
@@ -1,61 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
class MessagePanel extends React.Component {
static propTypes = {
errors: PropTypes.array,
infos: PropTypes.array,
mapStyle: PropTypes.object,
onLayerSelect: PropTypes.func,
currentLayer: PropTypes.object,
}
static defaultProps = {
onLayerSelect: () => {},
}
render() {
const errors = this.props.errors.map((error, idx) => {
let content;
if (error.parsed && error.parsed.type === "layer") {
const {parsed} = error;
const {mapStyle, currentLayer} = this.props;
const layerId = mapStyle.layers[parsed.data.index].id;
content = (
<>
Layer <span>&apos;{layerId}&apos;</span>: {parsed.data.message}
{currentLayer.id !== layerId &&
<>
&nbsp;&mdash;&nbsp;
<button
className="maputnik-message-panel__switch-button"
onClick={() => this.props.onLayerSelect(layerId)}
>
switch to layer
</button>
</>
}
</>
);
}
else {
content = error.message;
}
return <p key={"error-"+idx} className="maputnik-message-panel-error">
{content}
</p>
})
const infos = this.props.infos.map((m, i) => {
return <p key={"info-"+i}>{m}</p>
})
return <div className="maputnik-message-panel">
{errors}
{infos}
</div>
}
}
export default MessagePanel
-16
View File
@@ -1,16 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
class ScrollContainer extends React.Component {
static propTypes = {
children: PropTypes.node
}
render() {
return <div className="maputnik-scroll-container">
{this.props.children}
</div>
}
}
export default ScrollContainer
-236
View File
@@ -1,236 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import {detect} from 'detect-browser';
import {MdFileDownload, MdOpenInBrowser, MdSettings, MdLayers, MdHelpOutline, MdFindInPage, MdAssignmentTurnedIn} from 'react-icons/md'
import logoImage from 'maputnik-design/logos/logo-color.svg'
import pkgJson from '../../package.json'
// This is required because of <https://stackoverflow.com/a/49846426>, there isn't another way to detect support that I'm aware of.
const browser = detect();
const colorAccessibilityFiltersEnabled = ['chrome', 'firefox'].indexOf(browser.name) > -1;
class IconText extends React.Component {
static propTypes = {
children: PropTypes.node,
}
render() {
return <span className="maputnik-icon-text">{this.props.children}</span>
}
}
class ToolbarLink extends React.Component {
static propTypes = {
className: PropTypes.string,
children: PropTypes.node,
href: PropTypes.string,
onToggleModal: PropTypes.func,
}
render() {
return <a
className={classnames('maputnik-toolbar-link', this.props.className)}
href={this.props.href}
rel="noopener noreferrer"
target="_blank"
>
{this.props.children}
</a>
}
}
class ToolbarLinkHighlighted extends React.Component {
static propTypes = {
className: PropTypes.string,
children: PropTypes.node,
href: PropTypes.string,
onToggleModal: PropTypes.func
}
render() {
return <a
className={classnames('maputnik-toolbar-link', "maputnik-toolbar-link--highlighted", this.props.className)}
href={this.props.href}
rel="noopener noreferrer"
target="_blank"
>
<span className="maputnik-toolbar-link-wrapper">
{this.props.children}
</span>
</a>
}
}
class ToolbarSelect extends React.Component {
static propTypes = {
children: PropTypes.node,
wdKey: PropTypes.string
}
render() {
return <div
className='maputnik-toolbar-select'
data-wd-key={this.props.wdKey}
>
{this.props.children}
</div>
}
}
class ToolbarAction extends React.Component {
static propTypes = {
children: PropTypes.node,
onClick: PropTypes.func,
wdKey: PropTypes.string
}
render() {
return <button
className='maputnik-toolbar-action'
data-wd-key={this.props.wdKey}
onClick={this.props.onClick}
>
{this.props.children}
</button>
}
}
export default class Toolbar extends React.Component {
static propTypes = {
mapStyle: PropTypes.object.isRequired,
inspectModeEnabled: PropTypes.bool.isRequired,
onStyleChanged: PropTypes.func.isRequired,
// A new style has been uploaded
onStyleOpen: PropTypes.func.isRequired,
// A dict of source id's and the available source layers
sources: PropTypes.object.isRequired,
children: PropTypes.node,
onToggleModal: PropTypes.func,
onSetMapState: PropTypes.func,
mapState: PropTypes.string,
renderer: PropTypes.string,
}
state = {
isOpen: {
settings: false,
sources: false,
open: false,
add: false,
export: false,
}
}
handleSelection(val) {
this.props.onSetMapState(val);
}
render() {
const views = [
{
id: "map",
title: "Map",
},
{
id: "inspect",
title: "Inspect",
disabled: this.props.renderer !== 'mbgljs',
},
{
id: "filter-deuteranopia",
title: "Map (deuteranopia)",
disabled: !colorAccessibilityFiltersEnabled,
},
{
id: "filter-protanopia",
title: "Map (protanopia)",
disabled: !colorAccessibilityFiltersEnabled,
},
{
id: "filter-tritanopia",
title: "Map (tritanopia)",
disabled: !colorAccessibilityFiltersEnabled,
},
{
id: "filter-achromatopsia",
title: "Map (achromatopsia)",
disabled: !colorAccessibilityFiltersEnabled,
},
];
const currentView = views.find((view) => {
return view.id === this.props.mapState;
});
return <div className='maputnik-toolbar'>
<div className="maputnik-toolbar__inner">
<div
className="maputnik-toolbar-logo-container"
>
<a className="maputnik-toolbar-skip" href="#skip-menu">
Skip navigation
</a>
<a
href="https://github.com/maputnik/editor"
rel="noopener noreferrer"
target="_blank"
className="maputnik-toolbar-logo"
>
<span dangerouslySetInnerHTML={{__html: logoImage}} />
<h1>
<span className="maputnik-toolbar-name">{pkgJson.name}</span>
<span className="maputnik-toolbar-version">v{pkgJson.version}</span>
</h1>
</a>
</div>
<div className="maputnik-toolbar__actions">
<ToolbarAction wdKey="nav:open" onClick={this.props.onToggleModal.bind(this, 'open')}>
<MdOpenInBrowser />
<IconText>Open</IconText>
</ToolbarAction>
<ToolbarAction wdKey="nav:export" onClick={this.props.onToggleModal.bind(this, 'export')}>
<MdFileDownload />
<IconText>Export</IconText>
</ToolbarAction>
<ToolbarAction wdKey="nav:sources" onClick={this.props.onToggleModal.bind(this, 'sources')}>
<MdLayers />
<IconText>Data Sources</IconText>
</ToolbarAction>
<ToolbarAction wdKey="nav:settings" onClick={this.props.onToggleModal.bind(this, 'settings')}>
<MdSettings />
<IconText>Style Settings</IconText>
</ToolbarAction>
<ToolbarSelect wdKey="nav:inspect">
<MdFindInPage />
<IconText>View </IconText>
<select onChange={(e) => this.handleSelection(e.target.value)} value={currentView.id}>
{views.map((item) => {
return (
<option key={item.id} value={item.id} disabled={item.disabled}>
{item.title}
</option>
);
})}
</select>
</ToolbarSelect>
<ToolbarLink href={"https://github.com/maputnik/editor/wiki"}>
<MdHelpOutline />
<IconText>Help</IconText>
</ToolbarLink>
<ToolbarLinkHighlighted href={"https://gregorywolanski.typeform.com/to/cPgaSY"}>
<MdAssignmentTurnedIn />
<IconText>Take the Maputnik Survey</IconText>
</ToolbarLinkHighlighted>
</div>
</div>
</div>
}
}
-133
View File
@@ -1,133 +0,0 @@
import React from 'react'
import Color from 'color'
import ChromePicker from 'react-color/lib/components/chrome/Chrome'
import PropTypes from 'prop-types'
import lodash from 'lodash';
function formatColor(color) {
const rgb = color.rgb
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${rgb.a})`
}
/*** Number fields with support for min, max and units and documentation*/
class ColorField extends React.Component {
static propTypes = {
onChange: PropTypes.func.isRequired,
name: PropTypes.string,
value: PropTypes.string,
doc: PropTypes.string,
style: PropTypes.object,
default: PropTypes.string,
}
state = {
pickerOpened: false
}
constructor () {
super();
this.onChangeNoCheck = lodash.throttle(this.onChangeNoCheck, 1000/30);
}
onChangeNoCheck (v) {
this.props.onChange(v);
}
//TODO: I much rather would do this with absolute positioning
//but I am too stupid to get it to work together with fixed position
//and scrollbars so I have to fallback to JavaScript
calcPickerOffset = () => {
const elem = this.colorInput
if(elem) {
const pos = elem.getBoundingClientRect()
return {
top: pos.top,
left: pos.left + 196,
}
} else {
return {
top: 160,
left: 555,
}
}
}
togglePicker = () => {
this.setState({ pickerOpened: !this.state.pickerOpened })
}
get color() {
// Catch invalid color.
try {
return Color(this.props.value).rgb()
}
catch(err) {
console.warn("Error parsing color: ", err);
return Color("rgb(255,255,255)");
}
}
onChange (v) {
this.props.onChange(v === "" ? undefined : v);
}
render() {
const offset = this.calcPickerOffset()
var currentColor = this.color.object()
currentColor = {
r: currentColor.r,
g: currentColor.g,
b: currentColor.b,
// Rename alpha -> a for ChromePicker
a: currentColor.alpha
}
const picker = <div
className="maputnik-color-picker-offset"
style={{
position: 'fixed',
zIndex: 1,
left: offset.left,
top: offset.top,
}}>
<ChromePicker
color={currentColor}
onChange={c => this.onChangeNoCheck(formatColor(c))}
/>
<div
className="maputnik-color-picker-offset"
onClick={this.togglePicker}
style={{
zIndex: -1,
position: 'fixed',
top: '0px',
right: '0px',
bottom: '0px',
left: '0px',
}}
/>
</div>
var swatchStyle = {
backgroundColor: this.props.value
};
return <div className="maputnik-color-wrapper">
{this.state.pickerOpened && picker}
<div className="maputnik-color-swatch" style={swatchStyle}></div>
<input
spellCheck="false"
className="maputnik-color"
ref={(input) => this.colorInput = input}
onClick={this.togglePicker}
style={this.props.style}
name={this.props.name}
placeholder={this.props.default}
value={this.props.value ? this.props.value : ""}
onChange={(e) => this.onChange(e.target.value)}
/>
</div>
}
}
export default ColorField
-63
View File
@@ -1,63 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import {MdInfoOutline, MdHighlightOff} from 'react-icons/md'
export default class DocLabel extends React.Component {
static propTypes = {
label: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string
]).isRequired,
fieldSpec: PropTypes.object.isRequired,
onToggleDoc: PropTypes.func.isRequired,
}
constructor (props) {
super(props);
this.state = {
open: false,
}
}
onToggleDoc = (open) => {
this.setState({
open,
}, () => {
if (this.props.onToggleDoc) {
this.props.onToggleDoc(this.state.open);
}
});
}
render() {
const {label, fieldSpec} = this.props;
const {doc} = fieldSpec || {};
if (doc) {
return <label className="maputnik-doc-wrapper">
<div className="maputnik-doc-target">
{label}
{'\xa0'}
<button
aria-label={this.state.open ? "close property documentation" : "open property documentation"}
className={`maputnik-doc-button maputnik-doc-button--${this.state.open ? 'open' : 'closed'}`}
onClick={() => this.onToggleDoc(!this.state.open)}
>
{this.state.open ? <MdHighlightOff /> : <MdInfoOutline />}
</button>
</div>
</label>
}
else if (label) {
return <label className="maputnik-doc-wrapper">
<div className="maputnik-doc-target">
{label}
</div>
</label>
}
else {
<div />
}
}
}
-333
View File
@@ -1,333 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import SpecProperty from './_SpecProperty'
import DataProperty from './_DataProperty'
import ZoomProperty from './_ZoomProperty'
import ExpressionProperty from './_ExpressionProperty'
import {function as styleFunction} from '@mapbox/mapbox-gl-style-spec';
function isLiteralExpression (value) {
return (Array.isArray(value) && value.length === 2 && value[0] === "literal");
}
function isZoomField(value) {
return (
typeof(value) === 'object' &&
value.stops &&
typeof(value.property) === 'undefined' &&
Array.isArray(value.stops) &&
value.stops.length > 1 &&
value.stops.every(stop => {
return (
Array.isArray(stop) &&
stop.length === 2
);
})
);
}
function isDataField(value) {
return (
typeof(value) === 'object' &&
value.stops &&
typeof(value.property) !== 'undefined' &&
value.stops.length > 1 &&
Array.isArray(value.stops) &&
value.stops.every(stop => {
return (
Array.isArray(stop) &&
stop.length === 2 &&
typeof(stop[0]) === 'object'
);
})
);
}
function isPrimative (value) {
const valid = ["string", "boolean", "number"];
return valid.includes(typeof(value));
}
function isArrayOfPrimatives (values) {
if (Array.isArray(values)) {
return values.every(isPrimative);
}
return false;
}
function getDataType (value, fieldSpec={}) {
if (value === undefined) {
return "value";
}
else if (isPrimative(value)) {
return "value";
}
else if (fieldSpec.type === "array" && isArrayOfPrimatives(value)) {
return "value";
}
else if (isZoomField(value)) {
return "zoom_function";
}
else if (isDataField(value)) {
return "data_function";
}
else {
return "expression";
}
}
/**
* If we don't have a default value just make one up
*/
function findDefaultFromSpec (spec) {
if (spec.hasOwnProperty('default')) {
return spec.default;
}
const defaults = {
'color': '#000000',
'string': '',
'boolean': false,
'number': 0,
'array': [],
}
return defaults[spec.type] || '';
}
/** Supports displaying spec field for zoom function objects
* https://www.mapbox.com/mapbox-gl-style-spec/#types-function-zoom-property
*/
export default class FunctionSpecProperty extends React.Component {
static propTypes = {
onChange: PropTypes.func.isRequired,
fieldName: PropTypes.string.isRequired,
fieldType: PropTypes.string.isRequired,
fieldSpec: PropTypes.object.isRequired,
errors: PropTypes.object,
value: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
PropTypes.number,
PropTypes.bool,
PropTypes.array
]),
}
constructor (props) {
super();
this.state = {
dataType: getDataType(props.value, props.fieldSpec),
isEditing: false,
}
}
static getDerivedStateFromProps(props, state) {
// Because otherwise when editing values we end up accidentally changing field type.
if (state.isEditing) {
return {};
}
else {
return {
isEditing: false,
dataType: getDataType(props.value, props.fieldSpec)
};
}
}
getFieldFunctionType(fieldSpec) {
if (fieldSpec.expression.interpolated) {
return "exponential"
}
if (fieldSpec.type === "number") {
return "interval"
}
return "categorical"
}
addStop = () => {
const stops = this.props.value.stops.slice(0)
const lastStop = stops[stops.length - 1]
if (typeof lastStop[0] === "object") {
stops.push([
{zoom: lastStop[0].zoom + 1, value: lastStop[0].value},
lastStop[1]
])
}
else {
stops.push([lastStop[0] + 1, lastStop[1]])
}
const changedValue = {
...this.props.value,
stops: stops,
}
this.props.onChange(this.props.fieldName, changedValue)
}
deleteExpression = () => {
const {fieldSpec, fieldName} = this.props;
this.props.onChange(fieldName, fieldSpec.default);
this.setState({
dataType: "value",
});
}
deleteStop = (stopIdx) => {
const stops = this.props.value.stops.slice(0)
stops.splice(stopIdx, 1)
let changedValue = {
...this.props.value,
stops: stops,
}
if(stops.length === 1) {
changedValue = stops[0][1]
}
this.props.onChange(this.props.fieldName, changedValue)
}
makeZoomFunction = () => {
const zoomFunc = {
stops: [
[6, this.props.value || findDefaultFromSpec(this.props.fieldSpec)],
[10, this.props.value || findDefaultFromSpec(this.props.fieldSpec)]
]
}
this.props.onChange(this.props.fieldName, zoomFunc)
}
undoExpression = () => {
const {value, fieldName} = this.props;
if (isLiteralExpression(value)) {
this.props.onChange(fieldName, value[1]);
this.setState({
dataType: "value",
});
}
}
canUndo = () => {
const {value, fieldSpec} = this.props;
return (
isLiteralExpression(value) ||
isPrimative(value) ||
(Array.isArray(value) && fieldSpec.type === "array")
);
}
makeExpression = () => {
const {value, fieldSpec} = this.props;
let expression;
if (typeof(value) === "object" && 'stops' in value) {
expression = styleFunction.convertFunction(value, fieldSpec);
}
else {
expression = ["literal", value || this.props.fieldSpec.default];
}
this.props.onChange(this.props.fieldName, expression);
}
makeDataFunction = () => {
const functionType = this.getFieldFunctionType(this.props.fieldSpec);
const stopValue = functionType === 'categorical' ? '' : 0;
const dataFunc = {
property: "",
type: functionType,
stops: [
[{zoom: 6, value: stopValue}, this.props.value || findDefaultFromSpec(this.props.fieldSpec)],
[{zoom: 10, value: stopValue}, this.props.value || findDefaultFromSpec(this.props.fieldSpec)]
]
}
this.props.onChange(this.props.fieldName, dataFunc)
}
onMarkEditing = () => {
this.setState({isEditing: true});
}
onUnmarkEditing = () => {
this.setState({isEditing: false});
}
render() {
const {dataType} = this.state;
const propClass = this.props.fieldSpec.default === this.props.value ? "maputnik-default-property" : "maputnik-modified-property"
let specField;
if (dataType === "expression") {
specField = (
<ExpressionProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this, this.props.fieldName)}
canUndo={this.canUndo}
onUndo={this.undoExpression}
onDelete={this.deleteExpression}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onFocus={this.onMarkEditing}
onBlur={this.onUnmarkEditing}
/>
);
}
else if (dataType === "zoom_function") {
specField = (
<ZoomProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this)}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onDeleteStop={this.deleteStop}
onAddStop={this.addStop}
onExpressionClick={this.makeExpression}
/>
)
}
else if (dataType === "data_function") {
specField = (
<DataProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this)}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onDeleteStop={this.deleteStop}
onAddStop={this.addStop}
onExpressionClick={this.makeExpression}
/>
)
}
else {
specField = (
<SpecProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this)}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onZoomClick={this.makeZoomFunction}
onDataClick={this.makeDataFunction}
onExpressionClick={this.makeExpression}
/>
)
}
return <div className={propClass} data-wd-key={"spec-field:"+this.props.fieldName}>
{specField}
</div>
}
}
-76
View File
@@ -1,76 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import FunctionSpecField from './FunctionSpecField'
const iconProperties = ['background-pattern', 'fill-pattern', 'line-pattern', 'fill-extrusion-pattern', 'icon-image']
/** Extract field spec by {@fieldName} from the {@layerType} in the
* style specification from either the paint or layout group */
function getFieldSpec(spec, layerType, fieldName) {
const groupName = getGroupName(spec, layerType, fieldName)
const group = spec[groupName + '_' + layerType]
const fieldSpec = group[fieldName]
if(iconProperties.indexOf(fieldName) >= 0) {
return {
...fieldSpec,
values: spec.$root.sprite.values
}
}
if(fieldName === 'text-font') {
return {
...fieldSpec,
values: spec.$root.glyphs.values
}
}
return fieldSpec
}
function getGroupName(spec, layerType, fieldName) {
const paint = spec['paint_' + layerType] || {}
if (fieldName in paint) {
return 'paint'
} else {
return 'layout'
}
}
export default class PropertyGroup extends React.Component {
static propTypes = {
layer: PropTypes.object.isRequired,
groupFields: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
spec: PropTypes.object.isRequired,
errors: PropTypes.object,
}
onPropertyChange = (property, newValue) => {
const group = getGroupName(this.props.spec, this.props.layer.type, property)
this.props.onChange(group , property, newValue)
}
render() {
const {errors} = this.props;
const fields = this.props.groupFields.map(fieldName => {
const fieldSpec = getFieldSpec(this.props.spec, this.props.layer.type, fieldName)
const paint = this.props.layer.paint || {}
const layout = this.props.layer.layout || {}
const fieldValue = fieldName in paint ? paint[fieldName] : layout[fieldName]
const fieldType = fieldName in paint ? 'paint' : 'layout';
return <FunctionSpecField
errors={errors}
onChange={this.onPropertyChange}
key={fieldName}
fieldName={fieldName}
value={fieldValue}
fieldType={fieldType}
fieldSpec={fieldSpec}
/>
})
return <div className="maputnik-property-group">
{fields}
</div>
}
}
-132
View File
@@ -1,132 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import ColorField from './ColorField'
import NumberInput from '../inputs/NumberInput'
import CheckboxInput from '../inputs/CheckboxInput'
import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput'
import MultiButtonInput from '../inputs/MultiButtonInput'
import ArrayInput from '../inputs/ArrayInput'
import DynamicArrayInput from '../inputs/DynamicArrayInput'
import FontInput from '../inputs/FontInput'
import IconInput from '../inputs/IconInput'
import EnumInput from '../inputs/EnumInput'
import capitalize from 'lodash.capitalize'
const iconProperties = ['background-pattern', 'fill-pattern', 'line-pattern', 'fill-extrusion-pattern', 'icon-image']
function labelFromFieldName(fieldName) {
let label = fieldName.split('-').slice(1).join(' ')
if(label.length > 0) {
label = label.charAt(0).toUpperCase() + label.slice(1);
}
return label
}
function optionsLabelLength(options) {
let sum = 0;
options.forEach(([_, label]) => {
sum += label.length
})
return sum
}
/** Display any field from the Mapbox GL style spec and
* choose the correct field component based on the @{fieldSpec}
* to display @{value}. */
export default class SpecField extends React.Component {
static propTypes = {
onChange: PropTypes.func.isRequired,
fieldName: PropTypes.string.isRequired,
fieldSpec: PropTypes.object.isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.array,
PropTypes.bool
]),
/** Override the style of the field */
style: PropTypes.object,
}
render() {
const commonProps = {
style: this.props.style,
value: this.props.value,
default: this.props.fieldSpec.default,
name: this.props.fieldName,
onChange: newValue => this.props.onChange(this.props.fieldName, newValue)
}
function childNodes() {
switch(this.props.fieldSpec.type) {
case 'number': return (
<NumberInput
{...commonProps}
min={this.props.fieldSpec.minimum}
max={this.props.fieldSpec.maximum}
/>
)
case 'enum':
const options = Object.keys(this.props.fieldSpec.values).map(v => [v, capitalize(v)])
return <EnumInput
{...commonProps}
options={options}
/>
case 'resolvedImage':
case 'formatted':
case 'string':
if(iconProperties.indexOf(this.props.fieldName) >= 0) {
return <IconInput
{...commonProps}
icons={this.props.fieldSpec.values}
/>
} else {
return <StringInput
{...commonProps}
/>
}
case 'color': return (
<ColorField
{...commonProps}
/>
)
case 'boolean': return (
<CheckboxInput
{...commonProps}
/>
)
case 'array':
if(this.props.fieldName === 'text-font') {
return <FontInput
{...commonProps}
fonts={this.props.fieldSpec.values}
/>
} else {
if (this.props.fieldSpec.length) {
return <ArrayInput
{...commonProps}
type={this.props.fieldSpec.value}
length={this.props.fieldSpec.length}
/>
} else {
return <DynamicArrayInput
{...commonProps}
fieldSpec={this.props.fieldSpec}
type={this.props.fieldSpec.value}
/>
}
}
default: return null
}
}
return (
<div data-wd-key={"spec-field:"+this.props.fieldName}>
{childNodes.call(this)}
</div>
);
}
}
-281
View File
@@ -1,281 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Button from '../Button'
import SpecField from './SpecField'
import NumberInput from '../inputs/NumberInput'
import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput'
import DocLabel from './DocLabel'
import InputBlock from '../inputs/InputBlock'
import docUid from '../../libs/document-uid'
import sortNumerically from '../../libs/sort-numerically'
import labelFromFieldName from './_labelFromFieldName'
import DeleteStopButton from './_DeleteStopButton'
function setStopRefs(props, state) {
// This is initialsed below only if required to improved performance.
let newRefs;
if(props.value && props.value.stops) {
props.value.stops.forEach((val, idx) => {
if(!state.refs.hasOwnProperty(idx)) {
if(!newRefs) {
newRefs = {...state};
}
newRefs[idx] = docUid("stop-");
}
})
}
return newRefs;
}
export default class DataProperty extends React.Component {
static propTypes = {
onChange: PropTypes.func,
onDeleteStop: PropTypes.func,
onAddStop: PropTypes.func,
onExpressionClick: PropTypes.func,
fieldName: PropTypes.string,
fieldType: PropTypes.string,
fieldSpec: PropTypes.object,
value: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
PropTypes.number,
PropTypes.bool,
PropTypes.array
]),
errors: PropTypes.object,
}
state = {
refs: {}
}
componentDidMount() {
const newRefs = setStopRefs(this.props, this.state);
if(newRefs) {
this.setState({
refs: newRefs
})
}
}
static getDerivedStateFromProps(props, state) {
const newRefs = setStopRefs(props, state);
if(newRefs) {
return {
refs: newRefs
};
}
return null;
}
getFieldFunctionType(fieldSpec) {
if (fieldSpec.expression.interpolated) {
return "exponential"
}
if (fieldSpec.type === "number") {
return "interval"
}
return "categorical"
}
getDataFunctionTypes(fieldSpec) {
if (fieldSpec.expression.interpolated) {
return ["categorical", "interval", "exponential"]
}
else {
return ["categorical", "interval"]
}
}
// Order the stops altering the refs to reflect their new position.
orderStopsByZoom(stops) {
const mappedWithRef = stops
.map((stop, idx) => {
return {
ref: this.state.refs[idx],
data: stop
}
})
// Sort by zoom
.sort((a, b) => sortNumerically(a.data[0].zoom, b.data[0].zoom));
// Fetch the new position of the stops
const newRefs = {};
mappedWithRef
.forEach((stop, idx) =>{
newRefs[idx] = stop.ref;
})
this.setState({
refs: newRefs
});
return mappedWithRef.map((item) => item.data);
}
changeStop(changeIdx, stopData, value) {
const stops = this.props.value.stops.slice(0)
const changedStop = stopData.zoom === undefined ? stopData.value : stopData
stops[changeIdx] = [changedStop, value]
const orderedStops = this.orderStopsByZoom(stops);
const changedValue = {
...this.props.value,
stops: orderedStops,
}
this.props.onChange(this.props.fieldName, changedValue)
}
changeDataProperty(propName, propVal) {
if (propVal) {
this.props.value[propName] = propVal
}
else {
delete this.props.value[propName]
}
this.props.onChange(this.props.fieldName, this.props.value)
}
render() {
const {fieldName, fieldType, errors} = this.props;
if (typeof this.props.value.type === "undefined") {
this.props.value.type = this.getFieldFunctionType(this.props.fieldSpec)
}
const dataFields = this.props.value.stops.map((stop, idx) => {
const zoomLevel = typeof stop[0] === 'object' ? stop[0].zoom : undefined;
const key = this.state.refs[idx];
const dataLevel = typeof stop[0] === 'object' ? stop[0].value : stop[0];
const value = stop[1]
const deleteStopBtn = <DeleteStopButton onClick={this.props.onDeleteStop.bind(this, idx)} />
const dataProps = {
label: "Data value",
value: dataLevel,
onChange: newData => this.changeStop(idx, { zoom: zoomLevel, value: newData }, value)
}
let dataInput;
if(this.props.value.type === "categorical") {
dataInput = <StringInput {...dataProps} />
}
else {
dataInput = <NumberInput {...dataProps} />
}
let zoomInput = null;
if(zoomLevel !== undefined) {
zoomInput = <div className="maputnik-data-spec-property-stop-edit">
<NumberInput
value={zoomLevel}
onChange={newZoom => this.changeStop(idx, {zoom: newZoom, value: dataLevel}, value)}
min={0}
max={22}
/>
</div>
}
const errorKeyStart = `${fieldType}.${fieldName}.stops[${idx}]`;
const foundErrors = Object.entries(errors).filter(([key, error]) => {
return key.startsWith(errorKeyStart);
});
const message = foundErrors.map(([key, error]) => {
return error.message;
}).join("");
const error = message ? {message} : undefined;
return <InputBlock
error={error}
key={key}
action={deleteStopBtn}
label=""
>
{zoomInput}
<div className="maputnik-data-spec-property-stop-data">
{dataInput}
</div>
<div className="maputnik-data-spec-property-stop-value">
<SpecField
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={value}
onChange={(_, newValue) => this.changeStop(idx, {zoom: zoomLevel, value: dataLevel}, newValue)}
/>
</div>
</InputBlock>
})
return <div className="maputnik-data-spec-block">
<div className="maputnik-data-spec-property">
<InputBlock
fieldSpec={this.props.fieldSpec}
label={labelFromFieldName(this.props.fieldName)}
>
<div className="maputnik-data-spec-property-group">
<DocLabel
label="Property"
/>
<div className="maputnik-data-spec-property-input">
<StringInput
value={this.props.value.property}
title={"Input a data property to base styles off of."}
onChange={propVal => this.changeDataProperty("property", propVal)}
/>
</div>
</div>
<div className="maputnik-data-spec-property-group">
<DocLabel
label="Type"
/>
<div className="maputnik-data-spec-property-input">
<SelectInput
value={this.props.value.type}
onChange={propVal => this.changeDataProperty("type", propVal)}
title={"Select a type of data scale (default is 'categorical')."}
options={this.getDataFunctionTypes(this.props.fieldSpec)}
/>
</div>
</div>
<div className="maputnik-data-spec-property-group">
<DocLabel
label="Default"
/>
<div className="maputnik-data-spec-property-input">
<SpecField
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value.default}
onChange={(_, propVal) => this.changeDataProperty("default", propVal)}
/>
</div>
</div>
</InputBlock>
</div>
{dataFields}
<Button
className="maputnik-add-stop"
onClick={this.props.onAddStop.bind(this)}
>
Add stop
</Button>
<Button
className="maputnik-add-stop"
onClick={this.props.onExpressionClick.bind(this)}
>
Convert to expression
</Button>
</div>
}
}
@@ -1,22 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Button from '../Button'
import {MdDelete} from 'react-icons/md'
export default class DeleteStopButton extends React.Component {
static propTypes = {
onClick: PropTypes.func,
}
render() {
return <Button
className="maputnik-delete-stop"
onClick={this.props.onClick}
title={"Remove zoom level stop."}
>
<MdDelete />
</Button>
}
}
@@ -1,135 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import InputBlock from '../inputs/InputBlock'
import Button from '../Button'
import {MdDelete, MdUndo} from 'react-icons/md'
import StringInput from '../inputs/StringInput'
import labelFromFieldName from './_labelFromFieldName'
import stringifyPretty from 'json-stringify-pretty-compact'
import JSONEditor from '../layers/JSONEditor'
export default class ExpressionProperty extends React.Component {
static propTypes = {
onDelete: PropTypes.func,
fieldName: PropTypes.string,
fieldType: PropTypes.string,
fieldSpec: PropTypes.object,
value: PropTypes.any,
errors: PropTypes.object,
onChange: PropTypes.func,
onUndo: PropTypes.func,
canUndo: PropTypes.func,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
}
static defaultProps = {
errors: {},
onFocus: () => {},
onBlur: () => {},
}
constructor (props) {
super();
this.state = {
jsonError: false,
};
}
onJSONInvalid = (err) => {
this.setState({
jsonError: true,
})
}
onJSONValid = () => {
this.setState({
jsonError: false,
})
}
render() {
const {errors, fieldName, fieldType, value, canUndo} = this.props;
const {jsonError} = this.state;
const undoDisabled = canUndo ? !canUndo() : true;
const deleteStopBtn = (
<>
{this.props.onUndo &&
<Button
key="undo_action"
onClick={this.props.onUndo}
disabled={undoDisabled}
className="maputnik-delete-stop"
>
<MdUndo />
</Button>
}
<Button
key="delete_action"
onClick={this.props.onDelete}
className="maputnik-delete-stop"
>
<MdDelete />
</Button>
</>
);
const fieldKey = fieldType === undefined ? fieldName : `${fieldType}.${fieldName}`;
const fieldError = errors[fieldKey];
const errorKeyStart = `${fieldKey}[`;
const foundErrors = [];
function getValue (data) {
return stringifyPretty(data, {indent: 2, maxLength: 38})
}
if (jsonError) {
foundErrors.push({message: "Invalid JSON"});
}
else {
Object.entries(errors)
.filter(([key, error]) => {
return key.startsWith(errorKeyStart);
})
.forEach(([key, error]) => {
return foundErrors.push(error);
})
if (fieldError) {
foundErrors.push(fieldError);
}
}
return <InputBlock
error={foundErrors}
fieldSpec={this.props.fieldSpec}
label={labelFromFieldName(this.props.fieldName)}
action={deleteStopBtn}
wideMode={true}
>
<JSONEditor
mode={{name: "mgl"}}
lint={{
context: "expression",
spec: this.props.fieldSpec,
}}
className="maputnik-expression-editor"
onFocus={this.props.onFocus}
onBlur={this.props.onBlur}
onJSONInvalid={this.onJSONInvalid}
onJSONValid={this.onJSONValid}
layer={value}
lineNumbers={false}
maxHeight={200}
lineWrapping={true}
getValue={getValue}
onChange={this.props.onChange}
/>
</InputBlock>
}
}
@@ -1,77 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Button from '../Button'
import {MdFunctions, MdInsertChart} from 'react-icons/md'
import {mdiFunctionVariant} from '@mdi/js';
/**
* So here we can't just check is `Array.isArray(value)` because certain
* properties accept arrays as values, for example `text-font`. So we must try
* and create an expression.
*/
function isExpression(value, fieldSpec={}) {
if (!Array.isArray(value)) {
return false;
}
try {
expression.createExpression(value, fieldSpec);
return true;
}
catch (err) {
return false;
}
}
export default class FunctionButtons extends React.Component {
static propTypes = {
fieldSpec: PropTypes.object,
onZoomClick: PropTypes.func,
onDataClick: PropTypes.func,
onExpressionClick: PropTypes.func,
}
render() {
let makeZoomButton, makeDataButton, expressionButton;
if (this.props.fieldSpec.expression.parameters.includes('zoom')) {
expressionButton = (
<Button
className="maputnik-make-zoom-function"
onClick={this.props.onExpressionClick}
>
<svg style={{width:"14px", height:"14px", verticalAlign: "middle"}} viewBox="0 0 24 24">
<path fill="currentColor" d={mdiFunctionVariant} />
</svg>
</Button>
);
makeZoomButton = <Button
className="maputnik-make-zoom-function"
onClick={this.props.onZoomClick}
title={"Turn property into a zoom function to enable a map feature to change with map's zoom level."}
>
<MdFunctions />
</Button>
if (this.props.fieldSpec['property-type'] === 'data-driven') {
makeDataButton = <Button
className="maputnik-make-data-function"
onClick={this.props.onDataClick}
title={"Turn property into a data function to enable a map feature to change according to data properties and the map's zoom level."}
>
<MdInsertChart />
</Button>
}
return <div>
{expressionButton}
{makeDataButton}
{makeZoomButton}
</div>
}
else {
return <div>{expressionButton}</div>
}
}
}
-49
View File
@@ -1,49 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import SpecField from './SpecField'
import FunctionButtons from './_FunctionButtons'
import InputBlock from '../inputs/InputBlock'
import labelFromFieldName from './_labelFromFieldName'
export default class SpecProperty extends React.Component {
static propTypes = {
onZoomClick: PropTypes.func.isRequired,
onDataClick: PropTypes.func.isRequired,
fieldName: PropTypes.string,
fieldType: PropTypes.string,
fieldSpec: PropTypes.object,
value: PropTypes.any,
errors: PropTypes.object,
onExpressionClick: PropTypes.func,
}
static defaultProps = {
errors: {},
}
render() {
const {errors, fieldName, fieldType} = this.props;
const functionBtn = <FunctionButtons
fieldSpec={this.props.fieldSpec}
onZoomClick={this.props.onZoomClick}
onDataClick={this.props.onDataClick}
value={this.props.value}
onExpressionClick={this.props.onExpressionClick}
/>
const error = errors[fieldType+"."+fieldName];
return <InputBlock
error={error}
fieldSpec={this.props.fieldSpec}
label={labelFromFieldName(this.props.fieldName)}
action={functionBtn}
>
<SpecField {...this.props} />
</InputBlock>
}
}
-189
View File
@@ -1,189 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Button from '../Button'
import SpecField from './SpecField'
import NumberInput from '../inputs/NumberInput'
import InputBlock from '../inputs/InputBlock'
import DeleteStopButton from './_DeleteStopButton'
import labelFromFieldName from './_labelFromFieldName'
import docUid from '../../libs/document-uid'
import sortNumerically from '../../libs/sort-numerically'
/**
* We cache a reference for each stop by its index.
*
* When the stops are reordered the references are also updated (see this.orderStops) this allows React to use the same key for the element and keep keyboard focus.
*/
function setStopRefs(props, state) {
// This is initialsed below only if required to improved performance.
let newRefs;
if(props.value && props.value.stops) {
props.value.stops.forEach((val, idx) => {
if(!state.refs.hasOwnProperty(idx)) {
if(!newRefs) {
newRefs = {...state};
}
newRefs[idx] = docUid("stop-");
}
})
}
return newRefs;
}
export default class ZoomProperty extends React.Component {
static propTypes = {
onChange: PropTypes.func,
onDeleteStop: PropTypes.func,
onAddStop: PropTypes.func,
onExpressionClick: PropTypes.func,
fieldType: PropTypes.string,
fieldName: PropTypes.string,
fieldSpec: PropTypes.object,
errors: PropTypes.object,
value: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
PropTypes.number,
PropTypes.bool,
PropTypes.array
]),
}
static defaultProps = {
errors: {},
}
state = {
refs: {}
}
componentDidMount() {
const newRefs = setStopRefs(this.props, this.state);
if(newRefs) {
this.setState({
refs: newRefs
})
}
}
static getDerivedStateFromProps(props, state) {
const newRefs = setStopRefs(props, state);
if(newRefs) {
return {
refs: newRefs
};
}
return null;
}
// Order the stops altering the refs to reflect their new position.
orderStopsByZoom(stops) {
const mappedWithRef = stops
.map((stop, idx) => {
return {
ref: this.state.refs[idx],
data: stop
}
})
// Sort by zoom
.sort((a, b) => sortNumerically(a.data[0], b.data[0]));
// Fetch the new position of the stops
const newRefs = {};
mappedWithRef
.forEach((stop, idx) =>{
newRefs[idx] = stop.ref;
})
this.setState({
refs: newRefs
});
return mappedWithRef.map((item) => item.data);
}
changeZoomStop(changeIdx, stopData, value) {
const stops = this.props.value.stops.slice(0);
stops[changeIdx] = [stopData, value];
const orderedStops = this.orderStopsByZoom(stops);
const changedValue = {
...this.props.value,
stops: orderedStops
}
this.props.onChange(this.props.fieldName, changedValue)
}
render() {
const {fieldName, fieldType, errors} = this.props;
const zoomFields = this.props.value.stops.map((stop, idx) => {
const zoomLevel = stop[0]
const key = this.state.refs[idx];
const value = stop[1]
const deleteStopBtn= <DeleteStopButton onClick={this.props.onDeleteStop.bind(this, idx)} />
const errorKeyStart = `${fieldType}.${fieldName}.stops[${idx}]`;
const foundErrors = Object.entries(errors).filter(([key, error]) => {
return key.startsWith(errorKeyStart);
});
const message = foundErrors.map(([key, error]) => {
return error.message;
}).join("");
const error = message ? {message} : undefined;
return <InputBlock
error={error}
key={key}
fieldSpec={this.props.fieldSpec}
label={labelFromFieldName(this.props.fieldName)}
action={deleteStopBtn}
>
<div>
<div className="maputnik-zoom-spec-property-stop-edit">
<NumberInput
value={zoomLevel}
onChange={changedStop => this.changeZoomStop(idx, changedStop, value)}
min={0}
max={22}
/>
</div>
<div className="maputnik-zoom-spec-property-stop-value">
<SpecField
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={value}
onChange={(_, newValue) => this.changeZoomStop(idx, zoomLevel, newValue)}
/>
</div>
</div>
</InputBlock>
});
return <div className="maputnik-zoom-spec-property">
{zoomFields}
<Button
className="maputnik-add-stop"
onClick={this.props.onAddStop.bind(this)}
>
Add stop
</Button>
<Button
className="maputnik-add-stop"
onClick={this.props.onExpressionClick.bind(this)}
>
Convert to expression
</Button>
</div>
}
}
@@ -1,13 +0,0 @@
import capitalize from 'lodash.capitalize'
export default function labelFromFieldName(fieldName) {
let label;
const parts = fieldName.split('-');
if (parts.length > 1) {
label = fieldName.split('-').slice(1).join(' ');
}
else {
label = fieldName;
}
return capitalize(label);
}
-309
View File
@@ -1,309 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import { combiningFilterOps } from '../../libs/filterops.js'
import {latest, validate, migrate} from '@mapbox/mapbox-gl-style-spec'
import DocLabel from '../fields/DocLabel'
import SelectInput from '../inputs/SelectInput'
import InputBlock from '../inputs/InputBlock'
import SingleFilterEditor from './SingleFilterEditor'
import FilterEditorBlock from './FilterEditorBlock'
import Button from '../Button'
import SpecDoc from '../inputs/SpecDoc'
import ExpressionProperty from '../fields/_ExpressionProperty';
import {mdiFunctionVariant} from '@mdi/js';
function combiningFilter (props) {
let filter = props.filter || ['all'];
if (!Array.isArray(filter)) {
return filter;
}
let combiningOp = filter[0];
let filters = filter.slice(1);
if(combiningFilterOps.indexOf(combiningOp) < 0) {
combiningOp = 'all';
filters = [filter.slice(0)];
}
return [combiningOp, ...filters];
}
function migrateFilter (filter) {
return migrate(createStyleFromFilter(filter)).layers[0].filter;
}
function createStyleFromFilter (filter) {
return {
"id": "tmp",
"version": 8,
"name": "Empty Style",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"tmp": {
"type": "geojson",
"data": {}
}
},
"sprite": "",
"glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
"layers": [
{
id: "tmp",
type: "fill",
source: "tmp",
filter: filter,
},
],
};
}
/**
* This is doing way more work than we need it to, however validating a whole
* style if the only thing that's exported from mapbox-gl-style-spec at the
* moment. Not really an issue though as it take ~0.1ms to calculate.
*/
function checkIfSimpleFilter (filter) {
if (!filter || !combiningFilterOps.includes(filter[0])) {
return false;
}
// Because "none" isn't supported by the next expression syntax we can test
// with ["none", ...] because it'll return false if it's a new style
// expression.
const moddedFilter = ["none", ...filter.slice(1)];
const tmpStyle = createStyleFromFilter(moddedFilter)
const errors = validate(tmpStyle);
return (errors.length < 1);
}
function hasCombiningFilter(filter) {
return combiningFilterOps.indexOf(filter[0]) >= 0
}
function hasNestedCombiningFilter(filter) {
if(hasCombiningFilter(filter)) {
const combinedFilters = filter.slice(1)
return filter.slice(1).map(f => hasCombiningFilter(f)).filter(f => f == true).length > 0
}
return false
}
export default class CombiningFilterEditor extends React.Component {
static propTypes = {
/** Properties of the vector layer and the available fields */
properties: PropTypes.object,
filter: PropTypes.array,
errors: PropTypes.object,
onChange: PropTypes.func.isRequired,
}
static defaultProps = {
filter: ["all"],
}
constructor (props) {
super();
this.state = {
showDoc: false,
displaySimpleFilter: checkIfSimpleFilter(combiningFilter(props)),
};
}
// Convert filter to combining filter
onFilterPartChanged(filterIdx, newPart) {
const newFilter = combiningFilter(this.props).slice(0)
newFilter[filterIdx] = newPart
this.props.onChange(newFilter)
}
deleteFilterItem(filterIdx) {
const newFilter = combiningFilter(this.props).slice(0)
newFilter.splice(filterIdx + 1, 1)
this.props.onChange(newFilter)
}
addFilterItem = () => {
const newFilterItem = combiningFilter(this.props).slice(0)
newFilterItem.push(['==', 'name', ''])
this.props.onChange(newFilterItem)
}
onToggleDoc = (val) => {
this.setState({
showDoc: val
});
}
makeFilter = () => {
this.setState({
displaySimpleFilter: true,
})
}
makeExpression = () => {
let filter = combiningFilter(this.props);
this.props.onChange(migrateFilter(filter));
this.setState({
displaySimpleFilter: false,
})
}
static getDerivedStateFromProps (props, currentState) {
const {filter} = props;
const displaySimpleFilter = checkIfSimpleFilter(combiningFilter(props));
// Upgrade but never downgrade
if (!displaySimpleFilter && currentState.displaySimpleFilter === true) {
return {
displaySimpleFilter: false,
valueIsSimpleFilter: false,
};
}
else if (displaySimpleFilter && currentState.displaySimpleFilter === false) {
return {
valueIsSimpleFilter: true,
}
}
else {
return {
valueIsSimpleFilter: false,
};
}
}
render() {
const {errors} = this.props;
const {displaySimpleFilter} = this.state;
const fieldSpec={
doc: latest.layer.filter.doc + " Combine multiple filters together by using a compound filter."
};
const defaultFilter = ["all"];
const isNestedCombiningFilter = displaySimpleFilter && hasNestedCombiningFilter(combiningFilter(this.props));
if (isNestedCombiningFilter) {
return <div className="maputnik-filter-editor-unsupported">
<p>
Nested filters are not supported.
</p>
<Button
onClick={this.makeExpression}
>
<svg style={{marginRight: "0.2em", width:"14px", height:"14px", verticalAlign: "middle"}} viewBox="0 0 24 24">
<path fill="currentColor" d={mdiFunctionVariant} />
</svg>
Upgrade to expression
</Button>
</div>
}
else if (displaySimpleFilter) {
const filter = combiningFilter(this.props);
let combiningOp = filter[0];
let filters = filter.slice(1)
const actions = (
<div>
<Button
onClick={this.makeExpression}
className="maputnik-make-zoom-function"
>
<svg style={{width:"14px", height:"14px", verticalAlign: "middle"}} viewBox="0 0 24 24">
<path fill="currentColor" d={mdiFunctionVariant} />
</svg>
</Button>
</div>
);
const editorBlocks = filters.map((f, idx) => {
const error = errors[`filter[${idx+1}]`];
return (
<>
<FilterEditorBlock key={idx} onDelete={this.deleteFilterItem.bind(this, idx)}>
<SingleFilterEditor
properties={this.props.properties}
filter={f}
onChange={this.onFilterPartChanged.bind(this, idx + 1)}
/>
</FilterEditorBlock>
{error &&
<div className="maputnik-inline-error">{error.message}</div>
}
</>
);
})
return (
<>
<InputBlock
key="top"
fieldSpec={fieldSpec}
label={"Filter"}
action={actions}
>
<SelectInput
value={combiningOp}
onChange={this.onFilterPartChanged.bind(this, 0)}
options={[["all", "every filter matches"], ["none", "no filter matches"], ["any", "any filter matches"]]}
/>
</InputBlock>
{editorBlocks}
<div
key="buttons"
className="maputnik-filter-editor-add-wrapper"
>
<Button
data-wd-key="layer-filter-button"
className="maputnik-add-filter"
onClick={this.addFilterItem}>
Add filter
</Button>
</div>
<div
key="doc"
className="maputnik-doc-inline"
style={{display: this.state.showDoc ? '' : 'none'}}
>
<SpecDoc fieldSpec={fieldSpec} />
</div>
</>
);
}
else {
let {filter} = this.props;
return (
<>
<ExpressionProperty
onDelete={() => {
this.setState({displaySimpleFilter: true});
this.props.onChange(defaultFilter);
}}
fieldName="filter"
fieldSpec={fieldSpec}
value={filter}
errors={errors}
onChange={this.props.onChange}
/>
{this.state.valueIsSimpleFilter &&
<div className="maputnik-expr-infobox">
You&apos;ve entered a old style filter,{' '}
<button
onClick={this.makeFilter}
className="maputnik-expr-infobox__button"
>
switch to filter editor
</button>
</div>
}
</>
);
}
}
}
@@ -1,29 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Button from '../Button'
import {MdDelete} from 'react-icons/md'
class FilterEditorBlock extends React.Component {
static propTypes = {
onDelete: PropTypes.func.isRequired,
children: PropTypes.element.isRequired,
}
render() {
return <div className="maputnik-filter-editor-block">
<div className="maputnik-filter-editor-block-action">
<Button
className="maputnik-delete-filter"
onClick={this.props.onDelete}
>
<MdDelete />
</Button>
</div>
<div className="maputnik-filter-editor-block-content">
{this.props.children}
</div>
</div>
}
}
export default FilterEditorBlock
@@ -1,93 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import { otherFilterOps } from '../../libs/filterops.js'
import StringInput from '../inputs/StringInput'
import AutocompleteInput from '../inputs/AutocompleteInput'
import SelectInput from '../inputs/SelectInput'
function tryParseInt(v) {
if (v === '') return v
if (isNaN(v)) return v
return parseFloat(v)
}
function tryParseBool(v) {
const isString = (typeof(v) === "string");
if(!isString) {
return v;
}
if(v.match(/^\s*true\s*$/)) {
return true;
}
else if(v.match(/^\s*false\s*$/)) {
return false;
}
else {
return v;
}
}
function parseFilter(v) {
v = tryParseInt(v);
v = tryParseBool(v);
return v;
}
class SingleFilterEditor extends React.Component {
static propTypes = {
filter: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
properties: PropTypes.object,
}
static defaultProps = {
properties: {},
}
onFilterPartChanged(filterOp, propertyName, filterArgs) {
let newFilter = [filterOp, propertyName, ...filterArgs.map(parseFilter)]
if(filterOp === 'has' || filterOp === '!has') {
newFilter = [filterOp, propertyName]
} else if(filterArgs.length === 0) {
newFilter = [filterOp, propertyName, '']
}
this.props.onChange(newFilter)
}
render() {
const f = this.props.filter
const filterOp = f[0]
const propertyName = f[1]
const filterArgs = f.slice(2)
return <div className="maputnik-filter-editor-single">
<div className="maputnik-filter-editor-property">
<AutocompleteInput
value={propertyName}
options={Object.keys(this.props.properties).map(propName => [propName, propName])}
onChange={newPropertyName => this.onFilterPartChanged(filterOp, newPropertyName, filterArgs)}
/>
</div>
<div className="maputnik-filter-editor-operator">
<SelectInput
value={filterOp}
onChange={newFilterOp => this.onFilterPartChanged(newFilterOp, propertyName, filterArgs)}
options={otherFilterOps}
/>
</div>
{filterArgs.length > 0 &&
<div className="maputnik-filter-editor-args">
<StringInput
value={filterArgs.join(',')}
onChange={ v=> this.onFilterPartChanged(filterOp, propertyName, v.split(','))}
/>
</div>
}
</div>
}
}
export default SingleFilterEditor
-15
View File
@@ -1,15 +0,0 @@
import React from 'react'
import IconBase from 'react-icon-base'
export default class BackgroundIcon extends React.Component {
render() {
return (
<IconBase viewBox="0 0 20 20" {...this.props}>
<path d="m 1.821019,10.255581 7.414535,5.020197 c 0.372277,0.25206 0.958697,0.239771 1.30985,-0.02745 L 17.539255,9.926162 C 17.89041,9.658941 17.873288,9.238006 17.501015,8.985946 L 10.08648,3.9657402 C 9.714204,3.7136802 9.127782,3.7259703 8.776627,3.9931918 L 1.782775,9.315365 c -0.3511551,0.267221 -0.3340331,0.688156 0.03824,0.940216 z" />
</IconBase>
)
}
}
-15
View File
@@ -1,15 +0,0 @@
import React from 'react'
import IconBase from 'react-icon-base'
export default class FillIcon extends React.Component {
render() {
return (
<IconBase viewBox="0 0 20 20" {...this.props}>
<path transform="translate(2 2)" d="M7.5,0C11.6422,0,15,3.3578,15,7.5S11.6422,15,7.5,15 S0,11.6422,0,7.5S3.3578,0,7.5,0z M7.5,1.6666c-3.2217,0-5.8333,2.6117-5.8333,5.8334S4.2783,13.3334,7.5,13.3334 s5.8333-2.6117,5.8333-5.8334S10.7217,1.6666,7.5,1.6666z"></path>
</IconBase>
)
}
}
-15
View File
@@ -1,15 +0,0 @@
import React from 'react'
import IconBase from 'react-icon-base'
export default class FillIcon extends React.Component {
render() {
return (
<IconBase viewBox="0 0 20 20" {...this.props}>
<path d="M 2.84978,9.763512 9.462149,4.7316391 16.47225,9.478015 9.859886,14.509879 2.84978,9.763512 m -1.028761,0.492069 7.414535,5.020197 c 0.372277,0.25206 0.958697,0.239771 1.30985,-0.02745 L 17.539255,9.926162 C 17.89041,9.658941 17.873288,9.238006 17.501015,8.985946 L 10.08648,3.9657402 C 9.714204,3.7136802 9.127782,3.7259703 8.776627,3.9931918 L 1.782775,9.315365 c -0.3511551,0.267221 -0.3340331,0.688156 0.03824,0.940216 l 0,0 z" />
</IconBase>
)
}
}
-34
View File
@@ -1,34 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import LineIcon from './LineIcon.jsx'
import FillIcon from './FillIcon.jsx'
import SymbolIcon from './SymbolIcon.jsx'
import BackgroundIcon from './BackgroundIcon.jsx'
import CircleIcon from './CircleIcon.jsx'
import MissingIcon from './MissingIcon.jsx'
class LayerIcon extends React.Component {
static propTypes = {
type: PropTypes.string.isRequired,
style: PropTypes.object,
}
render() {
const iconProps = { style: this.props.style }
switch(this.props.type) {
case 'fill-extrusion': return <BackgroundIcon {...iconProps} />
case 'raster': return <FillIcon {...iconProps} />
case 'hillshade': return <FillIcon {...iconProps} />
case 'heatmap': return <FillIcon {...iconProps} />
case 'fill': return <FillIcon {...iconProps} />
case 'background': return <BackgroundIcon {...iconProps} />
case 'line': return <LineIcon {...iconProps} />
case 'symbol': return <SymbolIcon {...iconProps} />
case 'circle': return <CircleIcon {...iconProps} />
default: return <MissingIcon {...iconProps} />
}
}
}
export default LayerIcon
-15
View File
@@ -1,15 +0,0 @@
import React from 'react'
import IconBase from 'react-icon-base'
export default class FillIcon extends React.Component {
render() {
return (
<IconBase viewBox="0 0 20 20" {...this.props}>
<path d="M 12.34,1.29 C 12.5114,1.1076 12.7497,1.0029 13,1 13.5523,1 14,1.4477 14,2 14.0047,2.2478 13.907,2.4866 13.73,2.66 9.785626,6.5516986 6.6148407,9.7551593 2.65,13.72 2.4793,13.8963 2.2453,13.9971 2,14 1.4477,14 1,13.5523 1,13 0.9953,12.7522 1.093,12.5134 1.27,12.34 4.9761967,8.7018093 9.0356422,4.5930579 12.34,1.29 Z" transform="translate(2,2)" />
</IconBase>
)
}
}
-11
View File
@@ -1,11 +0,0 @@
import React from 'react'
import {MdPriorityHigh} from 'react-icons/md'
export default class MissingIcon extends React.Component {
render() {
return (
<MdPriorityHigh {...this.props} />
)
}
}
-18
View File
@@ -1,18 +0,0 @@
import React from 'react'
import IconBase from 'react-icon-base'
export default class SymbolIcon extends React.Component {
render() {
return (
<IconBase viewBox="0 0 20 20" {...this.props}>
<g transform="matrix(1.2718518,0,0,1.2601269,16.559526,-7.4065264)">
<path d="m -9.7959773,11.060163 c -0.3734787,-0.724437 -0.3580577,-1.2147051 -0.00547,-1.8767873 l 8.6034029,-0.019416 c 0.39670292,0.6865644 0.38365934,1.4750693 -0.011097,1.8864953 l -3.1359613,-0.0033 -0.013695,7.1305 c -0.4055357,0.397083 -1.3146432,0.397083 -1.7769191,-0.02274 l 0.030226,-7.104422 z" />
</g>
</IconBase>
)
}
}
-109
View File
@@ -1,109 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import StringInput from './StringInput'
import NumberInput from './NumberInput'
class ArrayInput extends React.Component {
static propTypes = {
value: PropTypes.array,
type: PropTypes.string,
length: PropTypes.number,
default: PropTypes.array,
onChange: PropTypes.func,
}
static defaultProps = {
value: [],
default: [],
}
constructor (props) {
super(props);
this.state = {
value: this.props.value.slice(0),
// This is so we can compare changes in getDerivedStateFromProps
initialPropsValue: this.props.value.slice(0),
};
}
static getDerivedStateFromProps(props, state) {
const value = [];
const initialPropsValue = state.initialPropsValue.slice(0);
Array(props.length).fill(null).map((_, i) => {
if (props.value[i] === state.initialPropsValue[i]) {
value[i] = state.value[i];
}
else {
value[i] = state.value[i];
initialPropsValue[i] = state.value[i];
}
})
return {
value,
initialPropsValue,
};
}
isComplete (value) {
return Array(this.props.length).fill(null).every((_, i) => {
const val = value[i]
return !(val === undefined || val === "");
});
}
changeValue(idx, newValue) {
const value = this.state.value.slice(0);
value[idx] = newValue;
this.setState({
value,
}, () => {
if (this.isComplete(value)) {
this.props.onChange(value);
}
else {
// Unset until complete
this.props.onChange(undefined);
}
});
}
render() {
const {value} = this.state;
const containsValues = (
value.length > 0 &&
!value.every(val => {
return (val === "" || val === undefined)
})
);
const inputs = Array(this.props.length).fill(null).map((_, i) => {
if(this.props.type === 'number') {
return <NumberInput
key={i}
default={containsValues ? undefined : this.props.default[i]}
value={value[i]}
required={containsValues ? true : false}
onChange={this.changeValue.bind(this, i)}
/>
} else {
return <StringInput
key={i}
default={containsValues ? undefined : this.props.default[i]}
value={value[i]}
required={containsValues ? true : false}
onChange={this.changeValue.bind(this, i)}
/>
}
})
return <div className="maputnik-array">
{inputs}
</div>
}
}
export default ArrayInput
@@ -1,98 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Autocomplete from 'react-autocomplete'
const MAX_HEIGHT = 140;
class AutocompleteInput extends React.Component {
static propTypes = {
value: PropTypes.string,
options: PropTypes.array,
onChange: PropTypes.func,
keepMenuWithinWindowBounds: PropTypes.bool
}
state = {
maxHeight: MAX_HEIGHT
}
static defaultProps = {
onChange: () => {},
options: [],
}
calcMaxHeight() {
if(this.props.keepMenuWithinWindowBounds) {
const maxHeight = window.innerHeight - this.autocompleteMenuEl.getBoundingClientRect().top;
const limitedMaxHeight = Math.min(maxHeight, MAX_HEIGHT);
if(limitedMaxHeight != this.state.maxHeight) {
this.setState({
maxHeight: limitedMaxHeight
})
}
}
}
componentDidMount() {
this.calcMaxHeight();
}
componentDidUpdate() {
this.calcMaxHeight();
}
onChange (v) {
this.props.onChange(v === "" ? undefined : v);
}
render() {
return <div
ref={(el) => {
this.autocompleteMenuEl = el;
}}
>
<Autocomplete
menuStyle={{
position: "fixed",
overflow: "auto",
maxHeight: this.state.maxHeight,
zIndex: '998'
}}
wrapperProps={{
className: "maputnik-autocomplete",
style: null
}}
inputProps={{
className: "maputnik-string",
spellCheck: false
}}
value={this.props.value}
items={this.props.options}
getItemValue={(item) => item[0]}
onSelect={v => this.onChange(v)}
onChange={(e, v) => this.onChange(v)}
shouldItemRender={(item, value="") => {
if (typeof(value) === "string") {
return item[0].toLowerCase().indexOf(value.toLowerCase()) > -1
}
}}
renderItem={(item, isHighlighted) => (
<div
key={item[0]}
className={classnames({
"maputnik-autocomplete-menu-item": true,
"maputnik-autocomplete-menu-item-selected": isHighlighted,
})}
>
{item[1]}
</div>
)}
/>
</div>
}
}
export default AutocompleteInput
-35
View File
@@ -1,35 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
class CheckboxInput extends React.Component {
static propTypes = {
value: PropTypes.bool,
style: PropTypes.object,
onChange: PropTypes.func,
}
static defaultProps = {
value: false,
}
render() {
return <label className="maputnik-checkbox-wrapper">
<input
className="maputnik-checkbox"
type="checkbox"
style={this.props.style}
onChange={e => this.props.onChange(!this.props.value)}
checked={this.props.value}
/>
<div className="maputnik-checkbox-box">
<svg style={{
display: this.props.value ? 'inline' : 'none'
}} className="maputnik-checkbox-icon" viewBox='0 0 32 32'>
<path d='M1 14 L5 10 L13 18 L27 4 L31 8 L13 26 z' />
</svg>
</div>
</label>
}
}
export default CheckboxInput
-126
View File
@@ -1,126 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import StringInput from './StringInput'
import NumberInput from './NumberInput'
import Button from '../Button'
import {MdDelete} from 'react-icons/md'
import DocLabel from '../fields/DocLabel'
import EnumInput from '../inputs/SelectInput'
import capitalize from 'lodash.capitalize'
class DynamicArrayInput extends React.Component {
static propTypes = {
value: PropTypes.array,
type: PropTypes.string,
default: PropTypes.array,
onChange: PropTypes.func,
style: PropTypes.object,
fieldSpec: PropTypes.object,
}
changeValue(idx, newValue) {
console.log(idx, newValue)
const values = this.values.slice(0)
values[idx] = newValue
this.props.onChange(values)
}
get values() {
return this.props.value || this.props.default || []
}
addValue = () => {
const values = this.values.slice(0)
if (this.props.type === 'number') {
values.push(0)
}
else if (this.props.type === 'enum') {
const {fieldSpec} = this.props;
const defaultValue = Object.keys(fieldSpec.values)[0];
values.push(defaultValue);
} else {
values.push("")
}
this.props.onChange(values)
}
deleteValue(valueIdx) {
const values = this.values.slice(0)
values.splice(valueIdx, 1)
this.props.onChange(values)
}
render() {
const inputs = this.values.map((v, i) => {
const deleteValueBtn= <DeleteValueButton onClick={this.deleteValue.bind(this, i)} />
let input;
if (this.props.type === 'number') {
input = <NumberInput
value={v}
onChange={this.changeValue.bind(this, i)}
/>
}
else if (this.props.type === 'enum') {
const options = Object.keys(this.props.fieldSpec.values).map(v => [v, capitalize(v)]);
input = <EnumInput
options={options}
value={v}
onChange={this.changeValue.bind(this, i)}
/>
}
else {
input = <StringInput
value={v}
onChange={this.changeValue.bind(this, i)}
/>
}
return <div
style={this.props.style}
key={i}
className="maputnik-array-block"
>
<div className="maputnik-array-block-action">
{deleteValueBtn}
</div>
<div className="maputnik-array-block-content">
{input}
</div>
</div>
})
return <div className="maputnik-array">
{inputs}
<Button
className="maputnik-array-add-value"
onClick={this.addValue}
>
Add value
</Button>
</div>
}
}
class DeleteValueButton extends React.Component {
static propTypes = {
onClick: PropTypes.func,
}
render() {
return <Button
className="maputnik-delete-stop"
onClick={this.props.onClick}
>
<DocLabel
label={<MdDelete />}
doc={"Remove array entry."}
/>
</Button>
}
}
export default DynamicArrayInput
-45
View File
@@ -1,45 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import SelectInput from '../inputs/SelectInput'
import MultiButtonInput from '../inputs/MultiButtonInput'
function optionsLabelLength(options) {
let sum = 0;
options.forEach(([_, label]) => {
sum += label.length
})
return sum
}
class EnumInput extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
value: PropTypes.string,
style: PropTypes.object,
default: PropTypes.string,
onChange: PropTypes.func,
options: PropTypes.array,
}
render() {
const {options, value, onChange} = this.props;
if(options.length <= 3 && optionsLabelLength(options) <= 20) {
return <MultiButtonInput
options={options}
value={value || this.props.default}
onChange={onChange}
/>
} else {
return <SelectInput
options={options}
value={value || this.props.default}
onChange={onChange}
/>
}
}
}
export default EnumInput
-56
View File
@@ -1,56 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import AutocompleteInput from './AutocompleteInput'
class FontInput extends React.Component {
static propTypes = {
value: PropTypes.array.isRequired,
default: PropTypes.array,
fonts: PropTypes.array,
style: PropTypes.object,
onChange: PropTypes.func.isRequired,
}
static defaultProps = {
fonts: []
}
get values() {
const out = this.props.value || this.props.default.slice(1) || [""];
// Always put a "" in the last field to you can keep adding entries
if (out[out.length-1] !== ""){
return out.concat("");
}
else {
return out;
}
}
changeFont(idx, newValue) {
const changedValues = this.values.slice(0)
changedValues[idx] = newValue
const filteredValues = changedValues
.filter(v => v !== undefined)
.filter(v => v !== "")
this.props.onChange(filteredValues);
}
render() {
const inputs = this.values.map((value, i) => {
return <AutocompleteInput
key={i}
value={value}
options={this.props.fonts.map(f => [f, f])}
onChange={this.changeFont.bind(this, i)}
/>
})
return <div className="maputnik-font">
{inputs}
</div>
}
}
export default FontInput
-28
View File
@@ -1,28 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import AutocompleteInput from './AutocompleteInput'
class IconInput extends React.Component {
static propTypes = {
value: PropTypes.string,
icons: PropTypes.array,
style: PropTypes.object,
onChange: PropTypes.func.isRequired,
}
static defaultProps = {
icons: []
}
render() {
return <AutocompleteInput
value={this.props.value}
options={this.props.icons.map(f => [f, f])}
onChange={this.props.onChange}
wrapperStyle={this.props.style}
/>
}
}
export default IconInput
-95
View File
@@ -1,95 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import DocLabel from '../fields/DocLabel'
import SpecDoc from './SpecDoc'
/** Wrap a component with a label */
class InputBlock extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element,
]).isRequired,
action: PropTypes.element,
children: PropTypes.node.isRequired,
style: PropTypes.object,
onChange: PropTypes.func,
fieldSpec: PropTypes.object,
wideMode: PropTypes.bool,
error: PropTypes.array,
}
constructor (props) {
super(props);
this.state = {
showDoc: false,
}
}
onChange(e) {
const value = e.target.value
return this.props.onChange(value === "" ? undefined : value)
}
onToggleDoc = (val) => {
this.setState({
showDoc: val
});
}
render() {
const errors = [].concat(this.props.error || []);
return <div style={this.props.style}
data-wd-key={this.props["data-wd-key"]}
className={classnames({
"maputnik-input-block": true,
"maputnik-input-block--wide": this.props.wideMode,
"maputnik-action-block": this.props.action
})}
>
{this.props.fieldSpec &&
<div className="maputnik-input-block-label">
<DocLabel
label={this.props.label}
onToggleDoc={this.onToggleDoc}
fieldSpec={this.props.fieldSpec}
/>
</div>
}
{!this.props.fieldSpec &&
<label className="maputnik-input-block-label">
{this.props.label}
</label>
}
{this.props.action &&
<div className="maputnik-input-block-action">
{this.props.action}
</div>
}
<div className="maputnik-input-block-content">
{this.props.children}
</div>
{errors.length > 0 &&
<div className="maputnik-inline-error">
{[].concat(this.props.error).map((error, idx) => {
return <div key={idx}>{error.message}</div>
})}
</div>
}
{this.props.fieldSpec &&
<div
className="maputnik-doc-inline"
style={{display: this.state.showDoc ? '' : 'none'}}
>
<SpecDoc fieldSpec={this.props.fieldSpec} />
</div>
}
</div>
}
}
export default InputBlock
@@ -1,36 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Button from '../Button'
class MultiButtonInput extends React.Component {
static propTypes = {
value: PropTypes.string.isRequired,
options: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
}
render() {
let options = this.props.options
if(options.length > 0 && !Array.isArray(options[0])) {
options = options.map(v => [v, v])
}
const selectedValue = this.props.value || options[0][0]
const buttons = options.map(([val, label])=> {
return <Button
key={val}
onClick={e => this.props.onChange(val)}
className={classnames({"maputnik-button-selected": val === selectedValue})}
>
{label}
</Button>
})
return <div className="maputnik-multibutton">
{buttons}
</div>
}
}
export default MultiButtonInput
-208
View File
@@ -1,208 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
let IDX = 0;
class NumberInput extends React.Component {
static propTypes = {
value: PropTypes.number,
default: PropTypes.number,
min: PropTypes.number,
max: PropTypes.number,
onChange: PropTypes.func,
allowRange: PropTypes.bool,
rangeStep: PropTypes.number,
wdKey: PropTypes.string,
required: PropTypes.bool,
}
static defaultProps = {
rangeStep: 1
}
constructor(props) {
super(props)
this.state = {
uuid: IDX++,
editing: false,
value: props.value,
dirtyValue: props.value,
}
}
static getDerivedStateFromProps(props, state) {
if (!state.editing) {
return {
value: props.value,
dirtyValue: props.value,
};
}
return null;
}
changeValue(newValue) {
const value = (newValue === "" || newValue === undefined) ?
undefined :
parseFloat(newValue);
const hasChanged = this.props.value !== value;
if(this.isValid(value) && hasChanged) {
this.props.onChange(value)
this.setState({
dirtyValue: newValue,
});
}
this.setState({
value: newValue,
})
}
isValid(v) {
if (v === undefined) {
return true;
}
const value = parseFloat(v)
if(isNaN(value)) {
return false
}
if(!isNaN(this.props.min) && value < this.props.min) {
return false
}
if(!isNaN(this.props.max) && value > this.props.max) {
return false
}
return true
}
resetValue = () => {
this.setState({editing: false});
// Reset explicitly to default value if value has been cleared
if(this.state.value === "") {
return;
}
// If set value is invalid fall back to the last valid value from props or at last resort the default value
if(!this.isValid(this.state.value)) {
if(this.isValid(this.props.value)) {
this.changeValue(this.props.value)
} else {
this.changeValue(undefined);
}
}
}
onChangeRange = (e) => {
let value = parseFloat(e.target.value, 10);
const step = this.props.rangeStep;
let dirtyValue = value;
if(step) {
// Can't do this with the <input/> range step attribute else we won't be able to set a high precision value via the text input.
const snap = value % step;
// Round up/down to step
if (this._keyboardEvent) {
// If it's keyboard event we might get a low positive/negative value,
// for example we might go from 13 to 13.23, however because we know
// that came from a keyboard event we always want to increase by a
// single step value.
if (value < this.state.dirtyValue) {
value = this.state.value - step;
}
else {
value = this.state.value + step
}
dirtyValue = value;
}
else {
if (snap < step/2) {
value = value - snap;
}
else {
value = value + (step - snap);
};
}
}
this._keyboardEvent = false;
// Clamp between min/max
value = Math.max(this.props.min, Math.min(this.props.max, value));
this.setState({value, dirtyValue});
this.props.onChange(value);
}
render() {
if(
this.props.hasOwnProperty("min") && this.props.hasOwnProperty("max") &&
this.props.min !== undefined && this.props.max !== undefined &&
this.props.allowRange
) {
const dirtyValue = this.state.dirtyValue === undefined ? this.props.default : this.state.dirtyValue
const value = this.state.value === undefined ? "" : this.state.value;
return <div className="maputnik-number-container">
<input
className="maputnik-number-range"
key="range"
type="range"
max={this.props.max}
min={this.props.min}
step="any"
spellCheck="false"
value={dirtyValue}
aria-hidden="true"
onChange={this.onChangeRange}
onKeyDown={() => {
this._keyboardEvent = true;
}}
onPointerDown={() => {
this.setState({editing: true});
}}
onPointerUp={() => {
// Safari doesn't get onBlur event
this.setState({editing: false});
}}
onBlur={() => {
this.setState({editing: false});
}}
/>
<input
key="text"
type="text"
spellCheck="false"
className="maputnik-number"
placeholder={this.props.default}
value={value}
onChange={e => {
if (!this.state.editing) {
this.changeValue(e.target.value);
}
}}
onBlur={this.resetValue}
/>
</div>
}
else {
const value = this.state.value === undefined ? "" : this.state.value;
return <input
spellCheck="false"
className="maputnik-number"
placeholder={this.props.default}
value={value}
onChange={e => this.changeValue(e.target.value)}
onBlur={this.resetValue}
required={this.props.required}
/>
}
}
}
export default NumberInput
-34
View File
@@ -1,34 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
class SelectInput extends React.Component {
static propTypes = {
value: PropTypes.string.isRequired,
"data-wd-key": PropTypes.string,
options: PropTypes.array.isRequired,
style: PropTypes.object,
onChange: PropTypes.func.isRequired,
title: PropTypes.string,
}
render() {
let options = this.props.options
if(options.length > 0 && !Array.isArray(options[0])) {
options = options.map(v => [v, v])
}
return <select
className="maputnik-select"
data-wd-key={this.props["data-wd-key"]}
style={this.props.style}
title={this.props.title}
value={this.props.value}
onChange={e => this.props.onChange(e.target.value)}
>
{ options.map(([val, label]) => <option key={val} value={val}>{label}</option>) }
</select>
}
}
export default SelectInput
-83
View File
@@ -1,83 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
export default class SpecDoc extends React.Component {
static propTypes = {
fieldSpec: PropTypes.object.isRequired,
}
render () {
const {fieldSpec} = this.props;
const {doc, values} = fieldSpec;
const sdkSupport = fieldSpec['sdk-support'];
const headers = {
js: "JS",
android: "Android",
ios: "iOS",
macos: "macOS",
};
const renderValues = (
!!values &&
// HACK: Currently we merge additional values into the stylespec, so this is required
// See <https://github.com/maputnik/editor/blob/master/src/components/fields/PropertyGroup.jsx#L16>
!Array.isArray(values)
);
return (
<>
{doc &&
<div className="SpecDoc">
<div className="SpecDoc__doc">{doc}</div>
{renderValues &&
<ul className="SpecDoc__values">
{Object.entries(values).map(([key, value]) => {
return (
<li key={key}>
<code>{JSON.stringify(key)}</code>
<div>{value.doc}</div>
</li>
);
})}
</ul>
}
</div>
}
{sdkSupport &&
<div className="SpecDoc__sdk-support">
<table className="SpecDoc__sdk-support__table">
<thead>
<tr>
<th></th>
{Object.values(headers).map(header => {
return <th key={header}>{header}</th>;
})}
</tr>
</thead>
<tbody>
{Object.entries(sdkSupport).map(([key, supportObj]) => {
return (
<tr key={key}>
<td>{key}</td>
{Object.keys(headers).map(k => {
const value = supportObj[k];
if (supportObj.hasOwnProperty(k)) {
return <td key={k}>{supportObj[k]}</td>;
}
else {
return <td key={k}>no</td>;
}
})}
</tr>
);
})}
</tbody>
</table>
</div>
}
</>
);
}
}
-87
View File
@@ -1,87 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
class StringInput extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
value: PropTypes.string,
style: PropTypes.object,
default: PropTypes.string,
onChange: PropTypes.func,
onInput: PropTypes.func,
multi: PropTypes.bool,
required: PropTypes.bool,
disabled: PropTypes.bool,
spellCheck: PropTypes.bool,
}
static defaultProps = {
onInput: () => {},
}
constructor(props) {
super(props)
this.state = {
editing: false,
value: props.value || ''
}
}
static getDerivedStateFromProps(props, state) {
if (!state.editing) {
return {
value: props.value
};
}
}
render() {
let tag;
let classes;
if(!!this.props.multi) {
tag = "textarea"
classes = [
"maputnik-string",
"maputnik-string--multi"
]
}
else {
tag = "input"
classes = [
"maputnik-string"
]
}
if(!!this.props.disabled) {
classes.push("maputnik-string--disabled");
}
return React.createElement(tag, {
"data-wd-key": this.props["data-wd-key"],
spellCheck: this.props.hasOwnProperty("spellCheck") ? this.props.spellCheck : !(tag === "input"),
disabled: this.props.disabled,
className: classes.join(" "),
style: this.props.style,
value: this.state.value === undefined ? "" : this.state.value,
placeholder: this.props.default,
onChange: e => {
this.setState({
editing: true,
value: e.target.value
}, () => {
this.props.onInput(this.state.value);
});
},
onBlur: () => {
if(this.state.value!==this.props.value) {
this.setState({editing: false});
this.props.onChange(this.state.value);
}
},
required: this.props.required,
});
}
}
export default StringInput
-77
View File
@@ -1,77 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import StringInput from './StringInput'
import SmallError from '../util/SmallError'
function validate (url) {
let error;
const getProtocol = (url) => {
try {
const urlObj = new URL(url);
return urlObj.protocol;
}
catch (err) {
return undefined;
}
};
const protocol = getProtocol(url);
if (
protocol &&
protocol === "http:" &&
window.location.protocol === "https:"
) {
error = (
<SmallError>
CORS policy won&apos;t allow fetching resources served over http from https, use a <code>https://</code> domain
</SmallError>
);
}
return error;
}
class UrlInput extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
value: PropTypes.string,
style: PropTypes.object,
default: PropTypes.string,
onChange: PropTypes.func,
onInput: PropTypes.func,
multi: PropTypes.bool,
required: PropTypes.bool,
}
static defaultProps = {
onInput: () => {},
}
constructor (props) {
super(props);
this.state = {
error: validate(props.value)
};
}
onInput = (url) => {
this.setState({
error: validate(url)
});
this.props.onInput(url);
}
render () {
return (
<div>
<StringInput
{...this.props}
onInput={this.onInput}
/>
{this.state.error}
</div>
);
}
}
export default UrlInput
-34
View File
@@ -1,34 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Collapse from 'react-collapse'
import accessibility from '../../libs/accessibility'
export default class CollapseAlt extends React.Component {
static propTypes = {
isActive: PropTypes.bool.isRequired,
children: PropTypes.element.isRequired
}
static defaultProps = {
isActive: true
}
render() {
if (accessibility.reducedMotionEnabled()) {
return (
<div style={{display: this.props.isActive ? "block" : "none"}}>
{this.props.children}
</div>
)
}
else {
return (
<Collapse isOpened={this.props.isActive}>
{this.props.children}
</Collapse>
)
}
}
}
-20
View File
@@ -1,20 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import {MdArrowDropDown, MdArrowDropUp} from 'react-icons/md'
export default class Collapser extends React.Component {
static propTypes = {
isCollapsed: PropTypes.bool.isRequired,
style: PropTypes.object,
}
render() {
const iconStyle = {
width: 20,
height: 20,
...this.props.style,
}
return this.props.isCollapsed ? <MdArrowDropUp style={iconStyle}/> : <MdArrowDropDown style={iconStyle} />
}
}
-33
View File
@@ -1,33 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput'
class MetadataBlock extends React.Component {
static propTypes = {
value: PropTypes.string,
onChange: PropTypes.func.isRequired,
}
render() {
const fieldSpec = {
doc: "Comments for the current layer. This is non-standard and not in the spec."
};
return <InputBlock
label={"Comments"}
fieldSpec={fieldSpec}
data-wd-key="layer-comment"
>
<StringInput
multi={true}
value={this.props.value}
onChange={this.props.onChange}
default="Comment..."
/>
</InputBlock>
}
}
export default MetadataBlock
-161
View File
@@ -1,161 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames';
import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput'
import CodeMirror from 'codemirror';
import 'codemirror/mode/javascript/javascript'
import 'codemirror/addon/lint/lint'
import 'codemirror/addon/edit/matchbrackets'
import 'codemirror/lib/codemirror.css'
import 'codemirror/addon/lint/lint.css'
import jsonlint from 'jsonlint'
import stringifyPretty from 'json-stringify-pretty-compact'
import '../util/codemirror-mgl';
class JSONEditor extends React.Component {
static propTypes = {
layer: PropTypes.any.isRequired,
maxHeight: PropTypes.number,
onChange: PropTypes.func,
lineNumbers: PropTypes.bool,
lineWrapping: PropTypes.bool,
getValue: PropTypes.func,
gutters: PropTypes.array,
className: PropTypes.string,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
onJSONValid: PropTypes.func,
onJSONInvalid: PropTypes.func,
mode: PropTypes.object,
lint: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.object,
]),
}
static defaultProps = {
lineNumbers: true,
lineWrapping: false,
gutters: ["CodeMirror-lint-markers"],
getValue: (data) => {
return stringifyPretty(data, {indent: 2, maxLength: 40});
},
onFocus: () => {},
onBlur: () => {},
onJSONInvalid: () => {},
onJSONValid: () => {},
}
constructor(props) {
super(props)
this.state = {
isEditing: false,
prevValue: this.props.getValue(this.props.layer),
};
}
componentDidMount () {
this._doc = CodeMirror(this._el, {
value: this.props.getValue(this.props.layer),
mode: this.props.mode || {
name: "mgl",
},
lineWrapping: this.props.lineWrapping,
tabSize: 2,
theme: 'maputnik',
viewportMargin: Infinity,
lineNumbers: this.props.lineNumbers,
lint: this.props.lint || {
context: "layer"
},
matchBrackets: true,
gutters: this.props.gutters,
scrollbarStyle: "null",
});
this._doc.on('change', this.onChange);
this._doc.on('focus', this.onFocus);
this._doc.on('blur', this.onBlur);
}
onFocus = () => {
this.props.onFocus();
this.setState({
isEditing: true
});
}
onBlur = () => {
this.props.onBlur();
this.setState({
isEditing: false
});
}
componentWillUnMount () {
this._doc.off('change', this.onChange);
this._doc.off('focus', this.onFocus);
this._doc.off('blur', this.onBlur);
}
componentDidUpdate(prevProps) {
if (!this.state.isEditing && prevProps.layer !== this.props.layer) {
this._cancelNextChange = true;
this._doc.setValue(
this.props.getValue(this.props.layer),
)
}
}
onChange = (e) => {
if (this._cancelNextChange) {
this._cancelNextChange = false;
this.setState({
prevValue: this._doc.getValue(),
})
return;
}
const newCode = this._doc.getValue();
if (this.state.prevValue !== newCode) {
let parsedLayer, err;
try {
parsedLayer = JSON.parse(newCode);
} catch(_err) {
err = _err;
console.warn(_err)
}
if (err) {
this.props.onJSONInvalid();
}
else {
this.props.onChange(parsedLayer)
this.props.onJSONValid();
}
}
this.setState({
prevValue: newCode,
});
}
render() {
const style = {};
if (this.props.maxHeight) {
style.maxHeight = this.props.maxHeight;
}
return <div
className={classnames("codemirror-container", this.props.className)}
ref={(el) => this._el = el}
style={style}
/>
}
}
export default JSONEditor
Loaded 100 of 194 files, more files were not shown because too many files have changed in this diff. Show more