Skip to content

Commit

Permalink
API token input
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLuisGJ committed Dec 3, 2022
1 parent a76ba3a commit bf88d42
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion dist/code.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/ui.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/ui.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Figmap",
"name": "figmap",
"version": "1.0.0",
"description": "This plugin template uses Typescript. If you are familiar with Javascript, Typescript will look very familiar. In fact, valid Javascript code is already valid Typescript code.",
"license": "ISC",
Expand All @@ -10,6 +10,7 @@
},
"dependencies": {
"gpxparser": "^3.0.8",
"mixpanel-figma": "^2.0.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-dropzone": "^14.2.2",
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/DrawMap.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from "react";
import { useEffect } from "react";
import * as mixpanel from "mixpanel-figma";

interface IMap {
username: any;
Expand Down Expand Up @@ -33,6 +34,7 @@ const DrawMap: React.FC<IMap> = ({
useEffect(() => {});

const onDrawMap = () => {
mixpanel.track("map-drown");
console.log("onDrawMap =>", stateMarkers);
let imurl = `https://api.mapbox.com/styles/v1/${
styleMode == "customMapboxStyle" ? username : "mapbox"
Expand Down
9 changes: 0 additions & 9 deletions src/app/components/FormPanel.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions src/app/components/MapMarkersForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect } from "react";
import Dropzone from "react-dropzone";
import gpxParser from "gpxParser";
import { WebMercatorViewport } from "react-map-gl";
import * as mixpanel from "mixpanel-figma";

interface IMap {
setMarkerImg: any;
Expand Down Expand Up @@ -35,7 +36,9 @@ const MapMarkerForm: React.FC<IMap> = ({

const onDropGPX = file => {
var reader = new FileReader();
mixpanel.track("file-dropped");
reader.onload = function(event) {
mixpanel.track("file-loaded");
let contents = event.target.result;
let gpx = new gpxParser();
gpx.parse("" + contents);
Expand Down
10 changes: 9 additions & 1 deletion src/app/components/MapStylesForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from "react";
import { useEffect } from "react";
import * as mixpanel from "mixpanel-figma";

interface IMap {
styleMode: String; // try not to use any.
Expand Down Expand Up @@ -39,6 +40,7 @@ const MapStylesForm: React.FC<IMap> = ({
defaultChecked={styleMode === "mapboxStyle"}
onClick={() => {
setStyleMode("mapboxStyle");
mixpanel.track("mapbox-default-styles");
}}
/>
<label htmlFor="mapboxStyle" className="mr-3">
Expand All @@ -53,6 +55,7 @@ const MapStylesForm: React.FC<IMap> = ({
defaultChecked={styleMode === "customMapboxStyle"}
onClick={() => {
setStyleMode("customMapboxStyle");
mixpanel.track("custom-mapbox-style");
}}
/>
<label htmlFor="customMapboxStyle"> Custom style</label>
Expand Down Expand Up @@ -91,7 +94,12 @@ const MapStylesForm: React.FC<IMap> = ({
<select
name="mapbox-styles"
id="mapbox-styles"
onChange={e => setMapboxStyle(e.currentTarget.value)}
onChange={e => {
setMapboxStyle(e.currentTarget.value);
mixpanel.track("mapbox-style-selected", {
value: e.currentTarget.value
});
}}
defaultValue={mapboxStyle}
>
<option value="streets-v11">Streets</option>
Expand Down
16 changes: 8 additions & 8 deletions yarn-error.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Arguments:
/usr/local/bin/node /usr/local/bin/yarn
/usr/local/bin/node /usr/local/bin/yarn add mixpanel-figma

PATH:
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/homebrew/sbin
Expand All @@ -8,13 +8,13 @@ Yarn version:
1.22.19

Node version:
16.17.1
14.21.1

Platform:
darwin arm64
darwin x64

Trace:
Error: EACCES: permission denied, unlink '/Users/josegonzalez/Documents/Jose/figmap/node_modules/.bin/acorn'
Error: EACCES: permission denied, unlink '/Users/josegonzalez/Documents/Jose/figmap/node_modules/.yarn-integrity'

npm manifest:
{
Expand Down Expand Up @@ -105,10 +105,10 @@ Lockfile:
dependencies:
regenerator-runtime "^0.13.4"

"@figma/plugin-typings@^1.15.0":
version "1.15.0"
resolved "https://registry.yarnpkg.com/@figma/plugin-typings/-/plugin-typings-1.15.0.tgz#7563639f2ee44b118a136be78d754fa2cc4f3ede"
integrity sha512-Lr6QShIKlQNW9qdnneGr5+TIXH+EvapyfDvaaZHj7rACqIEslkZmH1mV4AmQHEs9FK5rqJMmKfSkNUNM2fztPg==
"@figma/plugin-typings@^1.33.0":
version "1.55.1"
resolved "https://registry.yarnpkg.com/@figma/plugin-typings/-/plugin-typings-1.55.1.tgz#b974e929c2d1bdf051104ec89701b25c8ac2bcd7"
integrity sha512-gNyAFMA83oNJ8X4xrMjs49CCPwfRRdNepvZUx4gxS5/GBnZqV+rhEkM9crgJrynrE1VgxILLjQIPgUxxSNBWJQ==

"@mapbox/fusspot@^0.4.0":
version "0.4.0"
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
dependencies:
regenerator-runtime "^0.13.4"

"@figma/plugin-typings@^1.15.0":
version "1.15.0"
resolved "https://registry.yarnpkg.com/@figma/plugin-typings/-/plugin-typings-1.15.0.tgz#7563639f2ee44b118a136be78d754fa2cc4f3ede"
integrity sha512-Lr6QShIKlQNW9qdnneGr5+TIXH+EvapyfDvaaZHj7rACqIEslkZmH1mV4AmQHEs9FK5rqJMmKfSkNUNM2fztPg==
"@figma/plugin-typings@^1.33.0":
version "1.55.1"
resolved "https://registry.yarnpkg.com/@figma/plugin-typings/-/plugin-typings-1.55.1.tgz#b974e929c2d1bdf051104ec89701b25c8ac2bcd7"
integrity sha512-gNyAFMA83oNJ8X4xrMjs49CCPwfRRdNepvZUx4gxS5/GBnZqV+rhEkM9crgJrynrE1VgxILLjQIPgUxxSNBWJQ==

"@mapbox/fusspot@^0.4.0":
version "0.4.0"
Expand Down Expand Up @@ -3598,6 +3598,11 @@ mixin-deep@^1.2.0:
for-in "^1.0.2"
is-extendable "^1.0.1"

mixpanel-figma@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/mixpanel-figma/-/mixpanel-figma-2.0.1.tgz#3936f6fc133b848e22235f2275c341a73eb905fb"
integrity sha512-p+xWU/dA04IqpjEOzdf3eZGCh3yWCZSc5SsmW2WZU4zTFh4p2h6OJmt7pqozYlXjY4p3+7BXmRFdoAand3uArw==

mjolnir.js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/mjolnir.js/-/mjolnir.js-2.4.1.tgz#63cc66b7d1a52490904103cc1becc597be60c6cf"
Expand Down

0 comments on commit bf88d42

Please sign in to comment.