Steve Ruiz 4 лет назад
Родитель
Сommit
0158c79953
18 измененных файлов: 3790 добавлений и 24 удалений
  1. 1
    1
      components/editor.tsx
  2. 1
    1
      components/tools-panel/tools-panel.tsx
  3. 7
    0
      next.config.js
  4. 1
    0
      package.json
  5. 11
    1
      pages/_app.tsx
  6. 33
    1
      pages/_document.tsx
  7. Двоичные данные
      public/android-chrome-192x192.png
  8. Двоичные данные
      public/android-chrome-512x512.png
  9. Двоичные данные
      public/apple-touch-icon.png
  10. Двоичные данные
      public/favicon-16x16.png
  11. Двоичные данные
      public/favicon-32x32.png
  12. Двоичные данные
      public/favicon.ico
  13. 21
    0
      public/manifest.json
  14. 128
    0
      public/sw.js
  15. 1
    0
      public/sw.js.map
  16. 2701
    0
      public/workbox-6b19f60b.js
  17. 1
    0
      public/workbox-6b19f60b.js.map
  18. 884
    20
      yarn.lock

+ 1
- 1
components/editor.tsx Просмотреть файл

@@ -27,7 +27,7 @@ export default function Editor() {
27 27
       <StylePanel />
28 28
       <Canvas />
29 29
       <ToolsPanel />
30
-      <StatusBar />
30
+      {/* <StatusBar /> */}
31 31
     </Layout>
32 32
   )
33 33
 }

+ 1
- 1
components/tools-panel/tools-panel.tsx Просмотреть файл

@@ -177,7 +177,7 @@ export default function ToolsPanel() {
177 177
 
178 178
 const OuterContainer = styled('div', {
179 179
   position: 'fixed',
180
-  bottom: 40,
180
+  bottom: 32,
181 181
   left: 0,
182 182
   right: 0,
183 183
   padding: '0 8px 12px 8px',

+ 7
- 0
next.config.js Просмотреть файл

@@ -0,0 +1,7 @@
1
+const withPWA = require('next-pwa')
2
+
3
+module.exports = withPWA({
4
+  pwa: {
5
+    dest: 'public',
6
+  },
7
+})

+ 1
- 0
package.json Просмотреть файл

@@ -22,6 +22,7 @@
22 22
     "framer-motion": "^4.1.16",
23 23
     "ismobilejs": "^1.1.1",
24 24
     "next": "10.2.0",
25
+    "next-pwa": "^5.2.21",
25 26
     "perfect-freehand": "^0.4.8",
26 27
     "prettier": "^2.3.0",
27 28
     "react": "17.0.2",

+ 11
- 1
pages/_app.tsx Просмотреть файл

@@ -4,7 +4,17 @@ import 'styles/globals.css'
4 4
 
5 5
 function MyApp({ Component, pageProps }: AppProps) {
6 6
   globalStyles()
7
-  return <Component {...pageProps} />
7
+  return (
8
+    <>
9
+      <head>
10
+        <meta
11
+          name="viewport"
12
+          content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no, user-scalable=no, viewport-fit=cover"
13
+        />
14
+      </head>
15
+      <Component {...pageProps} />
16
+    </>
17
+  )
8 18
 }
9 19
 
10 20
 export default MyApp

+ 33
- 1
pages/_document.tsx Просмотреть файл

@@ -27,7 +27,39 @@ class MyDocument extends NextDocument {
27 27
   render() {
28 28
     return (
29 29
       <Html lang="en">
30
-        <Head />
30
+        <Head>
31
+          <meta name="application-name" content="tldraw" />
32
+          <meta name="apple-mobile-web-app-capable" content="yes" />
33
+          <meta name="apple-mobile-web-app-status-bar-style" content="black" />
34
+          <meta name="apple-mobile-web-app-title" content="tldraw" />
35
+          <meta name="description" content="A tiny little drawing app." />
36
+          <meta name="format-detection" content="telephone=no" />
37
+          <meta name="mobile-web-app-capable" content="yes" />
38
+          <meta
39
+            name="msapplication-config"
40
+            content="/static/icons/browserconfig.xml"
41
+          />
42
+          <meta name="msapplication-TileColor" content="#3174d7" />
43
+          <meta name="msapplication-tap-highlight" content="no" />
44
+          <meta name="theme-color" content="#ffffff" />
45
+
46
+          <meta name="twitter:card" content="summary" />
47
+          <meta name="twitter:url" content="https://tldraw.com" />
48
+          <meta name="twitter:title" content="tldraw" />
49
+          <meta
50
+            name="twitter:description"
51
+            content="A tiny little drawing app."
52
+          />
53
+          <meta name="twitter:creator" content="@steveruizok" />
54
+          <meta property="og:type" content="website" />
55
+          <meta property="og:title" content="tldraw" />
56
+          <meta
57
+            property="og:description"
58
+            content="A tiny little drawing app."
59
+          />
60
+          <meta property="og:site_name" content="tldraw" />
61
+          <meta property="og:url" content="https://tldraw.com" />
62
+        </Head>
31 63
         <body className={dark}>
32 64
           <Main />
33 65
           <NextScript />

Двоичные данные
public/android-chrome-192x192.png Просмотреть файл


Двоичные данные
public/android-chrome-512x512.png Просмотреть файл


Двоичные данные
public/apple-touch-icon.png Просмотреть файл


Двоичные данные
public/favicon-16x16.png Просмотреть файл


Двоичные данные
public/favicon-32x32.png Просмотреть файл


Двоичные данные
public/favicon.ico Просмотреть файл


+ 21
- 0
public/manifest.json Просмотреть файл

@@ -0,0 +1,21 @@
1
+{
2
+  "name": "tldraw",
3
+  "short_name": "tldraw",
4
+  "icons": [
5
+    {
6
+      "src": "/android-chrome-192x192.png",
7
+      "sizes": "192x192",
8
+      "type": "image/png"
9
+    },
10
+    {
11
+      "src": "/android-chrome-512x512.png",
12
+      "sizes": "512x512",
13
+      "type": "image/png"
14
+    }
15
+  ],
16
+  "theme_color": "#FFFFFF",
17
+  "background_color": "#FFFFFF",
18
+  "start_url": "/",
19
+  "display": "minimal-ui",
20
+  "orientation": "portrait"
21
+}

+ 128
- 0
public/sw.js Просмотреть файл

@@ -0,0 +1,128 @@
1
+/**
2
+ * Copyright 2018 Google Inc. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *     http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ * limitations under the License.
12
+ */
13
+
14
+// If the loader is already loaded, just stop.
15
+if (!self.define) {
16
+  const singleRequire = name => {
17
+    if (name !== 'require') {
18
+      name = name + '.js';
19
+    }
20
+    let promise = Promise.resolve();
21
+    if (!registry[name]) {
22
+      
23
+        promise = new Promise(async resolve => {
24
+          if ("document" in self) {
25
+            const script = document.createElement("script");
26
+            script.src = name;
27
+            document.head.appendChild(script);
28
+            script.onload = resolve;
29
+          } else {
30
+            importScripts(name);
31
+            resolve();
32
+          }
33
+        });
34
+      
35
+    }
36
+    return promise.then(() => {
37
+      if (!registry[name]) {
38
+        throw new Error(`Module ${name} didn’t register its module`);
39
+      }
40
+      return registry[name];
41
+    });
42
+  };
43
+
44
+  const require = (names, resolve) => {
45
+    Promise.all(names.map(singleRequire))
46
+      .then(modules => resolve(modules.length === 1 ? modules[0] : modules));
47
+  };
48
+  
49
+  const registry = {
50
+    require: Promise.resolve(require)
51
+  };
52
+
53
+  self.define = (moduleName, depsNames, factory) => {
54
+    if (registry[moduleName]) {
55
+      // Module is already loading or loaded.
56
+      return;
57
+    }
58
+    registry[moduleName] = Promise.resolve().then(() => {
59
+      let exports = {};
60
+      const module = {
61
+        uri: location.origin + moduleName.slice(1)
62
+      };
63
+      return Promise.all(
64
+        depsNames.map(depName => {
65
+          switch(depName) {
66
+            case "exports":
67
+              return exports;
68
+            case "module":
69
+              return module;
70
+            default:
71
+              return singleRequire(depName);
72
+          }
73
+        })
74
+      ).then(deps => {
75
+        const facValue = factory(...deps);
76
+        if(!exports.default) {
77
+          exports.default = facValue;
78
+        }
79
+        return exports;
80
+      });
81
+    });
82
+  };
83
+}
84
+define("./sw.js",['./workbox-6b19f60b'], function (workbox) { 'use strict';
85
+
86
+  /**
87
+  * Welcome to your Workbox-powered service worker!
88
+  *
89
+  * You'll need to register this file in your web app.
90
+  * See https://goo.gl/nhQhGp
91
+  *
92
+  * The rest of the code is auto-generated. Please don't update this file
93
+  * directly; instead, make changes to your Workbox build configuration
94
+  * and re-run your build process.
95
+  * See https://goo.gl/2aRDsh
96
+  */
97
+
98
+  importScripts();
99
+  self.skipWaiting();
100
+  workbox.clientsClaim();
101
+  workbox.registerRoute("/", new workbox.NetworkFirst({
102
+    "cacheName": "start-url",
103
+    plugins: [{
104
+      cacheWillUpdate: async ({
105
+        request,
106
+        response,
107
+        event,
108
+        state
109
+      }) => {
110
+        if (response && response.type === 'opaqueredirect') {
111
+          return new Response(response.body, {
112
+            status: 200,
113
+            statusText: 'OK',
114
+            headers: response.headers
115
+          });
116
+        }
117
+
118
+        return response;
119
+      }
120
+    }]
121
+  }), 'GET');
122
+  workbox.registerRoute(/.*/i, new workbox.NetworkOnly({
123
+    "cacheName": "dev",
124
+    plugins: []
125
+  }), 'GET');
126
+
127
+});
128
+//# sourceMappingURL=sw.js.map

+ 1
- 0
public/sw.js.map Просмотреть файл

@@ -0,0 +1 @@
1
+{"version":3,"file":"sw.js","sources":["../../../../../private/var/folders/3w/cj9n4h8j7xl3b82k45v7xw2r0000gn/T/af88887397cd2af68f658e66ccc7f5cc/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/stephenruiz/Developer/GitHub/code-slate/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/stephenruiz/Developer/GitHub/code-slate/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/Users/stephenruiz/Developer/GitHub/code-slate/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/stephenruiz/Developer/GitHub/code-slate/node_modules/workbox-core/clientsClaim.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n  \n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({request, response, event, state}) => { if (response && response.type === 'opaqueredirect') { return new Response(response.body, {status: 200, statusText: 'OK', headers: response.headers}); } return response; } }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [] }), 'GET');\n\n\n\n\n"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","plugins","cacheWillUpdate","request","response","event","state","type","Response","body","status","statusText","headers","workbox_strategies_NetworkOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGoJ;EACpJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGAA,aAAa;EAUbC,IAAI,CAACC,WAAL;AAEAC,sBAAyB;AAIzBC,uBAA6B,CAAC,GAAD,EAAM,IAAIC,oBAAJ,CAAoC;EAAE,eAAY,WAAd;EAA2BC,EAAAA,OAAO,EAAE,CAAC;EAAEC,IAAAA,eAAe,EAAE,OAAO;EAACC,MAAAA,OAAD;EAAUC,MAAAA,QAAV;EAAoBC,MAAAA,KAApB;EAA2BC,MAAAA;EAA3B,KAAP,KAA6C;EAAE,UAAIF,QAAQ,IAAIA,QAAQ,CAACG,IAAT,KAAkB,gBAAlC,EAAoD;EAAE,eAAO,IAAIC,QAAJ,CAAaJ,QAAQ,CAACK,IAAtB,EAA4B;EAACC,UAAAA,MAAM,EAAE,GAAT;EAAcC,UAAAA,UAAU,EAAE,IAA1B;EAAgCC,UAAAA,OAAO,EAAER,QAAQ,CAACQ;EAAlD,SAA5B,CAAP;EAAiG;;EAAC,aAAOR,QAAP;EAAkB;EAA5O,GAAD;EAApC,CAApC,CAAN,EAAmU,KAAnU,CAA7B;AACAL,uBAA6B,CAAC,KAAD,EAAQ,IAAIc,mBAAJ,CAAmC;EAAE,eAAY,KAAd;EAAqBZ,EAAAA,OAAO,EAAE;EAA9B,CAAnC,CAAR,EAAgF,KAAhF,CAA7B;;"}

+ 2701
- 0
public/workbox-6b19f60b.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 1
- 0
public/workbox-6b19f60b.js.map
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 884
- 20
yarn.lock
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


Загрузка…
Отмена
Сохранить