Consolidate Lit repositories: figma-to-lit, figma_lit_example, lit-3d-piano, lit-calculator, lit-code-editor, lit-draggable-dom, lit-file-based-routing, lit-force-graph, lit-html-editor, lit-html-table, lit-modules, lit-native, lit-node-editor, lit-sheet-music, lit-starter-ts, lit-vscode-extension, lit-wmr, vite-lit-capacitor, vite-lit-element-starter, vite-rxdb-lit
This commit is contained in:
Submodule lit-html-editor deleted from 221d1716ed
+24
@@ -0,0 +1,24 @@
|
||||
name: Demo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./dist
|
||||
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
types
|
||||
*.local
|
||||
test.html
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"contenteditable"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
Apache License, Version 2.0
|
||||
SPDX short identifier: Apache-2.0
|
||||
Further resources on the Apache License, Version 2.0
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
1. Definitions.
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
2. Grant of Copyright License.
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
3. Grant of Patent License.
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
4. Redistribution.
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
5. Submission of Contributions.
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
6. Trademarks.
|
||||
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
7. Disclaimer of Warranty.
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
8. Limitation of Liability.
|
||||
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
9. Accepting Warranty or Additional Liability.
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
END OF TERMS AND CONDITIONS
|
||||
APPENDIX: How to apply the Apache License to your work
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Material+Icons&display=block"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<title>Lit HTML Editor</title>
|
||||
<script type="module" src="/src/rich-text-editor.ts"></script>
|
||||
<style>
|
||||
body {
|
||||
position: fixed;
|
||||
bottom: env(safe-area-inset-bottom);
|
||||
top: env(safe-area-inset-top);
|
||||
left: env(safe-area-inset-left);
|
||||
right: env(safe-area-inset-right);
|
||||
height: -webkit-fill-available;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
@media (hover: none) {
|
||||
body {
|
||||
bottom: calc(
|
||||
env(keyboard-inset-height) + env(safe-area-inset-bottom)
|
||||
);
|
||||
}
|
||||
}
|
||||
rich-text {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<rich-text>
|
||||
<template>
|
||||
<h1>Headline 1</h1>
|
||||
<p>This is a paragraph.</p>
|
||||
<p>
|
||||
<span style="background-color: rgb(255, 0, 0)"
|
||||
><font color="#ffffff">Styled Text</font></span
|
||||
>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
||||
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
|
||||
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
||||
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
||||
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
||||
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
||||
culpa qui officia deserunt mollit anim id est laborum.
|
||||
</p>
|
||||
</template>
|
||||
</rich-text>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+653
@@ -0,0 +1,653 @@
|
||||
{
|
||||
"name": "lit-html-editor",
|
||||
"version": "0.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "lit-html-editor",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-icon": "^0.25.3",
|
||||
"@material/mwc-icon-button": "^0.21.0",
|
||||
"lit": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.1.3",
|
||||
"vite": "^2.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@lit/reactive-element": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.0.0.tgz",
|
||||
"integrity": "sha512-Kpgenb8UNFsKCsFhggiVvUkCbcFQSd6N8hffYEEGjz27/4rw3cTSsmP9t3q1EHOAsdum60Wo64HvuZDFpEwexA=="
|
||||
},
|
||||
"node_modules/@material/animation": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/animation/-/animation-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-SMkEHENcSy8jYYPg+ZmMGvI5YobU5FlYw0MPsg/RUxBdelt9OMQYELgJW3y7RrppF/tpJoZuYnZwyeUJc4OhLQ==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/base": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/base/-/base-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-aMPQ4eM95ZQDY53WzcSEbNhZAqRmYzgumpYEdz5PjOKO66lHparMUXlbQ2LqKhMrKuNg/LWY3Ncl8nL0h0LWfA==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/dom": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/dom/-/dom-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-uoX4Z0EbrigvHp/M2MzG0S0DNMivTY0U6E0WCiDVo8YrY67NJLSyVJnTpNhtthrCWJInKMcOUJwj73H6/GxX1A==",
|
||||
"dependencies": {
|
||||
"@material/feature-targeting": "12.0.0-canary.197f64fa2.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/feature-targeting": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/feature-targeting/-/feature-targeting-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-KZoxPbl0iCsESx11bAZ0qeAQJ7eqI6+nBX0T9AaJ5GFELP168uhkINDJX0TvQf5fgTNkEpeQrncJRaFuqHQTMg==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-base": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-base/-/mwc-base-0.21.0.tgz",
|
||||
"integrity": "sha512-yaXnsgMBtz8NEHLhoA6LNPip/8CWKDOdC6HZAPTBQH+ZnyQ8JvqATGSP0YrkiGg34jNVE8gNrbkI85GzNVKmCA==",
|
||||
"dependencies": {
|
||||
"@material/base": "=12.0.0-canary.197f64fa2.0",
|
||||
"@material/dom": "=12.0.0-canary.197f64fa2.0",
|
||||
"lit-element": "~2.4.0",
|
||||
"tslib": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-base/node_modules/lit-element": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz",
|
||||
"integrity": "sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==",
|
||||
"dependencies": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-icon": {
|
||||
"version": "0.25.3",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-icon/-/mwc-icon-0.25.3.tgz",
|
||||
"integrity": "sha512-36076AWZIRSr8qYOLjuDDkxej/HA0XAosrj7TS1ZeLlUBnLUtbDtvc1S7KSa0hqez7ouzOqGaWK24yoNnTa2OA==",
|
||||
"dependencies": {
|
||||
"lit": "^2.0.0",
|
||||
"tslib": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-icon-button": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-icon-button/-/mwc-icon-button-0.21.0.tgz",
|
||||
"integrity": "sha512-puJb956mvzlalDPhkHqb3AgVLO8nZUdHqDpzgX4WgIuQXOXhU1IYKbJpMv3CJG/xpbtETuzftvK5OZ5vO4sfRw==",
|
||||
"dependencies": {
|
||||
"@material/mwc-ripple": "^0.21.0",
|
||||
"lit-element": "~2.4.0",
|
||||
"tslib": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-icon-button/node_modules/lit-element": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz",
|
||||
"integrity": "sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==",
|
||||
"dependencies": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-ripple": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-ripple/-/mwc-ripple-0.21.0.tgz",
|
||||
"integrity": "sha512-4UnUmtEBGJ9qH+bqUz7ydwt3G0sjtqUDujz2d5EFn5Iv6ddo1btcbRCWMm80oKSE4tevfTUMW0+3hlaAqrx8fg==",
|
||||
"dependencies": {
|
||||
"@material/dom": "=12.0.0-canary.197f64fa2.0",
|
||||
"@material/mwc-base": "^0.21.0",
|
||||
"@material/ripple": "=12.0.0-canary.197f64fa2.0",
|
||||
"lit-element": "~2.4.0",
|
||||
"lit-html": "^1.1.2",
|
||||
"tslib": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/mwc-ripple/node_modules/lit-element": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz",
|
||||
"integrity": "sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==",
|
||||
"dependencies": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/ripple": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-KnwaJ4tb83uATp8dPePSeairxfLKpOhFjAwIqNUAuM2oxMGHQU4F6TU1lNuoH9J4gy+yK3uwmtCqMbQYe265MA==",
|
||||
"dependencies": {
|
||||
"@material/animation": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/base": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/dom": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/feature-targeting": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/theme": "12.0.0-canary.197f64fa2.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@material/theme": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/theme/-/theme-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-7juM8i8nU1LfQjmknAi8OdUwg+Db2XYL9LBQNyQ0pib/WguuydLCwqZWckGGClBsyenn7MLCwIn//GtB5YO1eg==",
|
||||
"dependencies": {
|
||||
"@material/feature-targeting": "12.0.0-canary.197f64fa2.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/trusted-types": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz",
|
||||
"integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg=="
|
||||
},
|
||||
"node_modules/colorette": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
|
||||
"integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.11.23",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz",
|
||||
"integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
|
||||
"integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/lit": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit/-/lit-2.0.0.tgz",
|
||||
"integrity": "sha512-pqi5O/wVzQ9Bn4ERRoYQlt1EAUWyY5Wv888vzpoArbtChc+zfUv1XohRqSdtQZYCogl0eHKd+MQwymg2XJfECg==",
|
||||
"dependencies": {
|
||||
"@lit/reactive-element": "^1.0.0",
|
||||
"lit-element": "^3.0.0",
|
||||
"lit-html": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lit-element": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.0.0.tgz",
|
||||
"integrity": "sha512-oPqRhhBBhs+AlI62QLwtWQNU/bNK/h2L1jI3IDroqZubo6XVAkyNy2dW3CRfjij8mrNlY7wULOfyyKKOnfEePA==",
|
||||
"dependencies": {
|
||||
"@lit/reactive-element": "^1.0.0",
|
||||
"lit-html": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lit-element/node_modules/lit-html": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.0.0.tgz",
|
||||
"integrity": "sha512-tJsCapCmc0vtLj6harqd6HfCxnlt/RSkgowtz4SC9dFE3nSL38Tb33I5HMDiyJsRjQZRTgpVsahrnDrR9wg27w==",
|
||||
"dependencies": {
|
||||
"@types/trusted-types": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/lit-html": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-1.4.1.tgz",
|
||||
"integrity": "sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA=="
|
||||
},
|
||||
"node_modules/lit/node_modules/lit-html": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.0.0.tgz",
|
||||
"integrity": "sha512-tJsCapCmc0vtLj6harqd6HfCxnlt/RSkgowtz4SC9dFE3nSL38Tb33I5HMDiyJsRjQZRTgpVsahrnDrR9wg27w==",
|
||||
"dependencies": {
|
||||
"@types/trusted-types": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.1.23",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz",
|
||||
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz",
|
||||
"integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"colorette": "^1.2.2",
|
||||
"nanoid": "^3.1.23",
|
||||
"source-map-js": "^0.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "2.50.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.50.0.tgz",
|
||||
"integrity": "sha512-wO+F2MqWPGUCZx0549oqY8dsQqHVjuSxoyBWWnxKoQE+1UGcDKjtL7wHq/8jnnLJEeoGDQLf3ztrpgRwlbGJ0A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz",
|
||||
"integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
|
||||
"integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w=="
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
|
||||
"integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "2.3.4",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-2.3.4.tgz",
|
||||
"integrity": "sha512-7orxrF65+Q5n/sMCnO91S8OS0gkPJ7g+y3bLlc7CPCXVswK8to1T8YycCk9SZh+AcIc0TuN6YajWTBFS5atMNA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.11.23",
|
||||
"postcss": "^8.2.10",
|
||||
"resolve": "^1.19.0",
|
||||
"rollup": "^2.38.5"
|
||||
},
|
||||
"bin": {
|
||||
"vite": "bin/vite.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@lit/reactive-element": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.0.0.tgz",
|
||||
"integrity": "sha512-Kpgenb8UNFsKCsFhggiVvUkCbcFQSd6N8hffYEEGjz27/4rw3cTSsmP9t3q1EHOAsdum60Wo64HvuZDFpEwexA=="
|
||||
},
|
||||
"@material/animation": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/animation/-/animation-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-SMkEHENcSy8jYYPg+ZmMGvI5YobU5FlYw0MPsg/RUxBdelt9OMQYELgJW3y7RrppF/tpJoZuYnZwyeUJc4OhLQ==",
|
||||
"requires": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"@material/base": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/base/-/base-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-aMPQ4eM95ZQDY53WzcSEbNhZAqRmYzgumpYEdz5PjOKO66lHparMUXlbQ2LqKhMrKuNg/LWY3Ncl8nL0h0LWfA==",
|
||||
"requires": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"@material/dom": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/dom/-/dom-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-uoX4Z0EbrigvHp/M2MzG0S0DNMivTY0U6E0WCiDVo8YrY67NJLSyVJnTpNhtthrCWJInKMcOUJwj73H6/GxX1A==",
|
||||
"requires": {
|
||||
"@material/feature-targeting": "12.0.0-canary.197f64fa2.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"@material/feature-targeting": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/feature-targeting/-/feature-targeting-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-KZoxPbl0iCsESx11bAZ0qeAQJ7eqI6+nBX0T9AaJ5GFELP168uhkINDJX0TvQf5fgTNkEpeQrncJRaFuqHQTMg==",
|
||||
"requires": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"@material/mwc-base": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-base/-/mwc-base-0.21.0.tgz",
|
||||
"integrity": "sha512-yaXnsgMBtz8NEHLhoA6LNPip/8CWKDOdC6HZAPTBQH+ZnyQ8JvqATGSP0YrkiGg34jNVE8gNrbkI85GzNVKmCA==",
|
||||
"requires": {
|
||||
"@material/base": "=12.0.0-canary.197f64fa2.0",
|
||||
"@material/dom": "=12.0.0-canary.197f64fa2.0",
|
||||
"lit-element": "~2.4.0",
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit-element": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz",
|
||||
"integrity": "sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==",
|
||||
"requires": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@material/mwc-icon": {
|
||||
"version": "0.25.3",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-icon/-/mwc-icon-0.25.3.tgz",
|
||||
"integrity": "sha512-36076AWZIRSr8qYOLjuDDkxej/HA0XAosrj7TS1ZeLlUBnLUtbDtvc1S7KSa0hqez7ouzOqGaWK24yoNnTa2OA==",
|
||||
"requires": {
|
||||
"lit": "^2.0.0",
|
||||
"tslib": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"@material/mwc-icon-button": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-icon-button/-/mwc-icon-button-0.21.0.tgz",
|
||||
"integrity": "sha512-puJb956mvzlalDPhkHqb3AgVLO8nZUdHqDpzgX4WgIuQXOXhU1IYKbJpMv3CJG/xpbtETuzftvK5OZ5vO4sfRw==",
|
||||
"requires": {
|
||||
"@material/mwc-ripple": "^0.21.0",
|
||||
"lit-element": "~2.4.0",
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit-element": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz",
|
||||
"integrity": "sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==",
|
||||
"requires": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@material/mwc-ripple": {
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/mwc-ripple/-/mwc-ripple-0.21.0.tgz",
|
||||
"integrity": "sha512-4UnUmtEBGJ9qH+bqUz7ydwt3G0sjtqUDujz2d5EFn5Iv6ddo1btcbRCWMm80oKSE4tevfTUMW0+3hlaAqrx8fg==",
|
||||
"requires": {
|
||||
"@material/dom": "=12.0.0-canary.197f64fa2.0",
|
||||
"@material/mwc-base": "^0.21.0",
|
||||
"@material/ripple": "=12.0.0-canary.197f64fa2.0",
|
||||
"lit-element": "~2.4.0",
|
||||
"lit-html": "^1.1.2",
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit-element": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz",
|
||||
"integrity": "sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==",
|
||||
"requires": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@material/ripple": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-KnwaJ4tb83uATp8dPePSeairxfLKpOhFjAwIqNUAuM2oxMGHQU4F6TU1lNuoH9J4gy+yK3uwmtCqMbQYe265MA==",
|
||||
"requires": {
|
||||
"@material/animation": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/base": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/dom": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/feature-targeting": "12.0.0-canary.197f64fa2.0",
|
||||
"@material/theme": "12.0.0-canary.197f64fa2.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"@material/theme": {
|
||||
"version": "12.0.0-canary.197f64fa2.0",
|
||||
"resolved": "https://registry.npmjs.org/@material/theme/-/theme-12.0.0-canary.197f64fa2.0.tgz",
|
||||
"integrity": "sha512-7juM8i8nU1LfQjmknAi8OdUwg+Db2XYL9LBQNyQ0pib/WguuydLCwqZWckGGClBsyenn7MLCwIn//GtB5YO1eg==",
|
||||
"requires": {
|
||||
"@material/feature-targeting": "12.0.0-canary.197f64fa2.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"@types/trusted-types": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz",
|
||||
"integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg=="
|
||||
},
|
||||
"colorette": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
|
||||
"integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
|
||||
"dev": true
|
||||
},
|
||||
"esbuild": {
|
||||
"version": "0.11.23",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz",
|
||||
"integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==",
|
||||
"dev": true
|
||||
},
|
||||
"fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"dev": true
|
||||
},
|
||||
"has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"function-bind": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"is-core-module": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
|
||||
"integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"lit": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit/-/lit-2.0.0.tgz",
|
||||
"integrity": "sha512-pqi5O/wVzQ9Bn4ERRoYQlt1EAUWyY5Wv888vzpoArbtChc+zfUv1XohRqSdtQZYCogl0eHKd+MQwymg2XJfECg==",
|
||||
"requires": {
|
||||
"@lit/reactive-element": "^1.0.0",
|
||||
"lit-element": "^3.0.0",
|
||||
"lit-html": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit-html": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.0.0.tgz",
|
||||
"integrity": "sha512-tJsCapCmc0vtLj6harqd6HfCxnlt/RSkgowtz4SC9dFE3nSL38Tb33I5HMDiyJsRjQZRTgpVsahrnDrR9wg27w==",
|
||||
"requires": {
|
||||
"@types/trusted-types": "^2.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"lit-element": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.0.0.tgz",
|
||||
"integrity": "sha512-oPqRhhBBhs+AlI62QLwtWQNU/bNK/h2L1jI3IDroqZubo6XVAkyNy2dW3CRfjij8mrNlY7wULOfyyKKOnfEePA==",
|
||||
"requires": {
|
||||
"@lit/reactive-element": "^1.0.0",
|
||||
"lit-html": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit-html": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.0.0.tgz",
|
||||
"integrity": "sha512-tJsCapCmc0vtLj6harqd6HfCxnlt/RSkgowtz4SC9dFE3nSL38Tb33I5HMDiyJsRjQZRTgpVsahrnDrR9wg27w==",
|
||||
"requires": {
|
||||
"@types/trusted-types": "^2.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"lit-html": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-1.4.1.tgz",
|
||||
"integrity": "sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA=="
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.1.23",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz",
|
||||
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==",
|
||||
"dev": true
|
||||
},
|
||||
"path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"postcss": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz",
|
||||
"integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colorette": "^1.2.2",
|
||||
"nanoid": "^3.1.23",
|
||||
"source-map-js": "^0.6.2"
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"rollup": {
|
||||
"version": "2.50.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.50.0.tgz",
|
||||
"integrity": "sha512-wO+F2MqWPGUCZx0549oqY8dsQqHVjuSxoyBWWnxKoQE+1UGcDKjtL7wHq/8jnnLJEeoGDQLf3ztrpgRwlbGJ0A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fsevents": "~2.3.1"
|
||||
}
|
||||
},
|
||||
"source-map-js": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz",
|
||||
"integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==",
|
||||
"dev": true
|
||||
},
|
||||
"tslib": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
|
||||
"integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
|
||||
"integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
|
||||
"dev": true
|
||||
},
|
||||
"vite": {
|
||||
"version": "2.3.4",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-2.3.4.tgz",
|
||||
"integrity": "sha512-7orxrF65+Q5n/sMCnO91S8OS0gkPJ7g+y3bLlc7CPCXVswK8to1T8YycCk9SZh+AcIc0TuN6YajWTBFS5atMNA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esbuild": "^0.11.23",
|
||||
"fsevents": "~2.3.1",
|
||||
"postcss": "^8.2.10",
|
||||
"resolve": "^1.19.0",
|
||||
"rollup": "^2.38.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "lit-html-editor",
|
||||
"version": "0.0.0",
|
||||
"types": "types/my-element.d.ts",
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
"build": "tsc && vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@material/mwc-icon": "^0.25.3",
|
||||
"@material/mwc-icon-button": "^0.21.0",
|
||||
"lit": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.1.3",
|
||||
"vite": "^2.3.4"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -0,0 +1,96 @@
|
||||
import { html, css, LitElement } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
import "@material/mwc-icon-button";
|
||||
import "@material/mwc-icon";
|
||||
|
||||
@customElement("rich-action")
|
||||
export class RichAction extends LitElement {
|
||||
static styles = css`
|
||||
* {
|
||||
--mdc-icon-size: var(--icon-size);
|
||||
--mdc-icon-button-size: var(--icon-size);
|
||||
}
|
||||
section {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
section * {
|
||||
margin: 2px;
|
||||
}
|
||||
mwc-icon-button[active] {
|
||||
color: var(--rich-action-active-color);
|
||||
}
|
||||
mwc-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
`;
|
||||
|
||||
@property({ type: String }) command = "";
|
||||
@property({ type: String }) value?: string;
|
||||
@property({ type: String }) icon = "info";
|
||||
@property({ type: Boolean }) active = false;
|
||||
@property({ type: Array, hasChanged: () => true }) values: Option[] = [];
|
||||
|
||||
render() {
|
||||
const { icon, command, value, active, values } = this;
|
||||
const hasItems = values.length > 0;
|
||||
return html`<section>
|
||||
${hasItems
|
||||
? html` <mwc-icon>${icon}</mwc-icon>
|
||||
<select
|
||||
@change=${(e: Event) => {
|
||||
const event = e as CustomEvent;
|
||||
const select = event.target as HTMLSelectElement;
|
||||
const selectedValue = select.value;
|
||||
if (selectedValue === "--") {
|
||||
editorCommand("removeFormat", undefined);
|
||||
} else {
|
||||
editorCommand(command, selectedValue);
|
||||
}
|
||||
}}
|
||||
>
|
||||
${values.map(
|
||||
(v) =>
|
||||
html`<option value=${v.value} ?selected=${v.value === value}>
|
||||
${v.name}
|
||||
</option>`
|
||||
)}
|
||||
</select>`
|
||||
: html`<mwc-icon-button
|
||||
?active="${active}"
|
||||
icon=${icon}
|
||||
@click=${() => {
|
||||
if (command) {
|
||||
editorCommand(command, value);
|
||||
} else {
|
||||
this.dispatchEvent(
|
||||
new Event("action", {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
}}
|
||||
></mwc-icon-button>`}
|
||||
<div><slot></slot></div>
|
||||
</section>`;
|
||||
}
|
||||
}
|
||||
|
||||
interface Option {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export function editorCommand(command: string, value?: string) {
|
||||
document.execCommand(command, true, value);
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"rich-action": RichAction;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
import { html, css, LitElement } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
import { live } from "../utils/live";
|
||||
|
||||
import "./rich-toolbar";
|
||||
import "./rich-viewer";
|
||||
|
||||
@customElement("rich-text")
|
||||
export class RichText extends LitElement {
|
||||
static styles = css`
|
||||
:host {
|
||||
--rich-color: black;
|
||||
--rich-background: white;
|
||||
--rich-action-active-color: red;
|
||||
--icon-size: 24px;
|
||||
--rich-padding: 8px;
|
||||
}
|
||||
main {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-rows: 1fr auto;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-areas:
|
||||
"viewer"
|
||||
"toolbar";
|
||||
}
|
||||
|
||||
rich-toolbar {
|
||||
grid-area: toolbar;
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
background-color: var(--rich-background);
|
||||
color: var(--rich-color);
|
||||
border-top: 1px solid var(--rich-color);
|
||||
}
|
||||
|
||||
rich-viewer {
|
||||
grid-area: viewer;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
background-color: var(--rich-background);
|
||||
color: var(--rich-color);
|
||||
}
|
||||
|
||||
/* @media (hover: hover) and (pointer: fine) {
|
||||
main {
|
||||
grid-template-rows: auto 1fr;
|
||||
grid-template-areas:
|
||||
"toolbar"
|
||||
"viewer";
|
||||
}
|
||||
rich-toolbar {
|
||||
border-top: none;
|
||||
border-bottom: 1px solid var(--rich-color);
|
||||
}
|
||||
} */
|
||||
main {
|
||||
grid-template-rows: auto 1fr;
|
||||
grid-template-areas:
|
||||
"toolbar"
|
||||
"viewer";
|
||||
}
|
||||
rich-toolbar {
|
||||
border-top: none;
|
||||
border-bottom: 1px solid var(--rich-color);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:host {
|
||||
--rich-background: black;
|
||||
--rich-color: white;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@live selection: Selection | null = null;
|
||||
@property({ type: Boolean }) readonly = false;
|
||||
@property({ type: Object, hasChanged: () => true }) node: Element =
|
||||
document.createElement("div");
|
||||
|
||||
render() {
|
||||
const { selection, readonly, node } = this;
|
||||
return html`<main>
|
||||
<rich-toolbar
|
||||
.selection=${selection}
|
||||
.node=${node}
|
||||
@set-content=${(e: Event) => {
|
||||
const event = e as CustomEvent<string>;
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(event.detail, "text/html");
|
||||
const root = doc.querySelector("body");
|
||||
this.node.innerHTML = root?.innerHTML ?? "";
|
||||
this.requestUpdate();
|
||||
}}
|
||||
></rich-toolbar>
|
||||
<rich-viewer
|
||||
?readonly=${readonly}
|
||||
@selection=${(e: Event) => {
|
||||
const event = e as CustomEvent;
|
||||
this.selection = event.detail;
|
||||
}}
|
||||
.node=${node}
|
||||
>
|
||||
</rich-viewer>
|
||||
</main>`;
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
const children = this.children;
|
||||
if (children.length > 0) {
|
||||
// Check if <template> is the first child
|
||||
const template = children[0];
|
||||
if (template.tagName === "TEMPLATE") {
|
||||
const content = template.innerHTML.trim();
|
||||
if (content.length > 0) {
|
||||
this.node.innerHTML = content;
|
||||
this.requestUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"rich-text": RichText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
import { html, css, LitElement } from "lit";
|
||||
import { customElement, property, query, state } from "lit/decorators.js";
|
||||
import { checkFonts } from "../utils/check-fonts";
|
||||
import { live } from "../utils/live";
|
||||
|
||||
import "./rich-action";
|
||||
import { editorCommand } from "./rich-action";
|
||||
|
||||
@customElement("rich-toolbar")
|
||||
export class RichToolbar extends LitElement {
|
||||
static styles = css`
|
||||
header {
|
||||
width: 100%;
|
||||
color: var(--rich-color);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
input[type="color"] {
|
||||
-webkit-appearance: none;
|
||||
border: none;
|
||||
width: var(--icon-size);
|
||||
height: var(--icon-size);
|
||||
}
|
||||
input[type="color"]::-webkit-color-swatch-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
input[type="color"]::-webkit-color-swatch {
|
||||
border: none;
|
||||
}
|
||||
`;
|
||||
|
||||
@live selection: Selection | null = null;
|
||||
@query("#fg-color") fgColorInput!: HTMLInputElement;
|
||||
@query("#bd-color") bdColorInput!: HTMLInputElement;
|
||||
@state() fileHandle?: any;
|
||||
@property({ type: Object, hasChanged: () => true }) node!: Element;
|
||||
|
||||
render() {
|
||||
const tags = this.getTags();
|
||||
return html`<header>
|
||||
<rich-action icon="format_clear" command="removeFormat"></rich-action>
|
||||
<rich-action
|
||||
icon="format_bold"
|
||||
command="bold"
|
||||
?active=${tags.includes("b")}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_italic"
|
||||
command="italic"
|
||||
?active=${tags.includes("i")}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_underlined"
|
||||
command="underline"
|
||||
?active=${tags.includes("u")}
|
||||
></rich-action>
|
||||
<rich-action icon="format_align_left" command="justifyleft"></rich-action>
|
||||
<rich-action
|
||||
icon="format_align_center"
|
||||
command="justifycenter"
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_align_right"
|
||||
command="justifyright"
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_list_numbered"
|
||||
command="insertorderedlist"
|
||||
?active=${tags.includes("ol")}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_list_bulleted"
|
||||
command="insertunorderedlist"
|
||||
?active=${tags.includes("ul")}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_quote"
|
||||
command="formatblock"
|
||||
value="blockquote"
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_indent_decrease"
|
||||
command="outdent"
|
||||
></rich-action>
|
||||
<rich-action icon="format_indent_increase" command="indent"></rich-action>
|
||||
<rich-action
|
||||
icon="add_link"
|
||||
?active=${tags.includes("a")}
|
||||
@action=${() => {
|
||||
const newLink = prompt("Write the URL here", "https://");
|
||||
// Check if valid url
|
||||
if (newLink && newLink.match(/^(http|https):\/\/[^ "]+$/)) {
|
||||
editorCommand("createlink", newLink);
|
||||
}
|
||||
}}
|
||||
>
|
||||
</rich-action>
|
||||
<rich-action
|
||||
icon="link_off"
|
||||
?active=${tags.includes("a")}
|
||||
command="unlink"
|
||||
>
|
||||
</rich-action>
|
||||
<rich-action
|
||||
icon="format_color_text"
|
||||
@action=${() => this.fgColorInput.click()}
|
||||
>
|
||||
<input
|
||||
type="color"
|
||||
id="fg-color"
|
||||
@input=${(e: Event) => {
|
||||
const input = e.target as HTMLInputElement;
|
||||
editorCommand("forecolor", input.value);
|
||||
}}
|
||||
/>
|
||||
</rich-action>
|
||||
<rich-action
|
||||
icon="border_color"
|
||||
@action=${() => this.bdColorInput.click()}
|
||||
>
|
||||
<input
|
||||
type="color"
|
||||
id="bd-color"
|
||||
@input=${(e: Event) => {
|
||||
const input = e.target as HTMLInputElement;
|
||||
editorCommand("backcolor", input.value);
|
||||
}}
|
||||
/>
|
||||
</rich-action>
|
||||
<rich-action
|
||||
icon="title"
|
||||
command="formatblock"
|
||||
.values=${[
|
||||
{ name: "Normal Text", value: "--" },
|
||||
{ name: "Heading 1", value: "h1" },
|
||||
{ name: "Heading 2", value: "h2" },
|
||||
{ name: "Heading 3", value: "h3" },
|
||||
{ name: "Heading 4", value: "h4" },
|
||||
{ name: "Heading 5", value: "h5" },
|
||||
{ name: "Heading 6", value: "h6" },
|
||||
{ name: "Paragraph", value: "p" },
|
||||
{ name: "Pre-Formatted", value: "pre" },
|
||||
]}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="text_format"
|
||||
command="fontname"
|
||||
.values=${[
|
||||
{ name: "Font Name", value: "--" },
|
||||
...Array.from(checkFonts()).map((font) => ({
|
||||
name: font,
|
||||
value: font,
|
||||
})),
|
||||
]}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="format_size"
|
||||
command="fontsize"
|
||||
.values=${[
|
||||
{ name: "Font Size", value: "--" },
|
||||
{ name: "Very Small", value: "1" },
|
||||
{ name: "Small", value: "2" },
|
||||
{ name: "Normal", value: "3" },
|
||||
{ name: "Medium Large", value: "4" },
|
||||
{ name: "Large", value: "5" },
|
||||
{ name: "Very Large", value: "6" },
|
||||
{ name: "Maximum", value: "7" },
|
||||
]}
|
||||
></rich-action>
|
||||
<rich-action icon="undo" command="undo"></rich-action>
|
||||
<rich-action icon="redo" command="redo"></rich-action>
|
||||
<rich-action icon="content_cut" command="cut"></rich-action>
|
||||
<rich-action icon="content_copy" command="copy"></rich-action>
|
||||
<rich-action icon="content_paste" command="paste"></rich-action>
|
||||
<rich-action
|
||||
icon="file_upload"
|
||||
@action=${async () => {
|
||||
if ("showOpenFilePicker" in window) {
|
||||
// File system api
|
||||
// @ts-ignore
|
||||
const [fileHandle] = await window.showOpenFilePicker();
|
||||
this.fileHandle = fileHandle;
|
||||
if (fileHandle) {
|
||||
const file = await fileHandle.getFile();
|
||||
const contents = await file.text();
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("set-content", {
|
||||
detail: contents,
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Fallback to input
|
||||
const input = document.createElement("input");
|
||||
input.type = "file";
|
||||
input.click();
|
||||
input.onchange = async () => {
|
||||
const file = input.files![0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const data = reader.result as string;
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("set-content", {
|
||||
detail: data,
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
})
|
||||
);
|
||||
};
|
||||
reader.readAsText(file);
|
||||
}
|
||||
};
|
||||
}
|
||||
}}
|
||||
></rich-action>
|
||||
<rich-action
|
||||
icon="file_download"
|
||||
@action=${async () => {
|
||||
const contents = this.node.innerHTML;
|
||||
if (this.fileHandle) {
|
||||
const writable = await this.fileHandle.createWritable();
|
||||
await writable.write(
|
||||
[
|
||||
`<!DOCTYPE html>`,
|
||||
`<html lang="en">`,
|
||||
` <head> </head>`,
|
||||
` <body>${contents}</body>`,
|
||||
`</html>`,
|
||||
].join("\n")
|
||||
);
|
||||
await writable.close();
|
||||
} else {
|
||||
// Download file
|
||||
const url = window.URL.createObjectURL(
|
||||
new Blob([contents], { type: "text/html" })
|
||||
);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = "index.html";
|
||||
link.click();
|
||||
}
|
||||
}}
|
||||
></rich-action>
|
||||
</header>`;
|
||||
}
|
||||
|
||||
getTags() {
|
||||
const { selection } = this;
|
||||
let tags: string[] = [];
|
||||
if (selection) {
|
||||
if (selection.type === "Range") {
|
||||
// @ts-ignore
|
||||
let parentNode = selection?.baseNode;
|
||||
if (parentNode) {
|
||||
const checkNode = () => {
|
||||
const tag = parentNode?.tagName?.toLowerCase()?.trim();
|
||||
if (tag) tags.push(tag);
|
||||
};
|
||||
while (parentNode != null) {
|
||||
checkNode();
|
||||
parentNode = parentNode?.parentNode;
|
||||
}
|
||||
}
|
||||
// Remove root tag
|
||||
tags.pop();
|
||||
} else {
|
||||
const content = this.selection?.toString() || "";
|
||||
tags = (content.match(/<[^>]+>/g) || [])
|
||||
.filter((tag) => !tag.startsWith("</"))
|
||||
.map((tag) => tag.replace(/<|>/g, ""));
|
||||
}
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"rich-toolbar": RichToolbar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import { html, css, LitElement } from "lit";
|
||||
import { customElement, property, query } from "lit/decorators.js";
|
||||
|
||||
@customElement("rich-viewer")
|
||||
export class RichViewer extends LitElement {
|
||||
static styles = css`
|
||||
article {
|
||||
padding: var(--rich-padding);
|
||||
width: calc(100% - var(--rich-padding) * 2);
|
||||
height: calc(100% - var(--rich-padding) * 2);
|
||||
}
|
||||
|
||||
article[contenteditable="true"] {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
`;
|
||||
|
||||
@query("#content") content!: HTMLDivElement;
|
||||
@property({ type: Boolean }) readonly = false;
|
||||
@property({ type: Object, hasChanged: () => true }) node!: Element;
|
||||
|
||||
render() {
|
||||
const { readonly, node } = this;
|
||||
return html`<article
|
||||
id="content"
|
||||
contenteditable=${readonly ? "false" : "true"}
|
||||
@input=${() => this.updateSelection()}
|
||||
>
|
||||
${node}
|
||||
</article>`;
|
||||
}
|
||||
|
||||
updateSelection() {
|
||||
// @ts-ignore
|
||||
const shadowSelection = this.shadowRoot?.getSelection
|
||||
? // @ts-ignore
|
||||
this.shadowRoot!.getSelection()
|
||||
: null;
|
||||
const selection =
|
||||
shadowSelection || document.getSelection() || window.getSelection();
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("selection", {
|
||||
detail: selection,
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
document.execCommand("defaultParagraphSeparator", false, "br");
|
||||
document.addEventListener("selectionchange", () => {
|
||||
this.updateSelection();
|
||||
});
|
||||
window.addEventListener("selectionchange", () => {
|
||||
this.updateSelection();
|
||||
});
|
||||
document.addEventListener("keydown", () => {
|
||||
this.updateSelection();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"rich-viewer": RichViewer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<svg width="410" height="404" viewBox="0 0 410 404" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M399.641 59.5246L215.643 388.545C211.844 395.338 202.084 395.378 198.228 388.618L10.5817 59.5563C6.38087 52.1896 12.6802 43.2665 21.0281 44.7586L205.223 77.6824C206.398 77.8924 207.601 77.8904 208.776 77.6763L389.119 44.8058C397.439 43.2894 403.768 52.1434 399.641 59.5246Z" fill="url(#paint0_linear)"/>
|
||||
<path d="M292.965 1.5744L156.801 28.2552C154.563 28.6937 152.906 30.5903 152.771 32.8664L144.395 174.33C144.198 177.662 147.258 180.248 150.51 179.498L188.42 170.749C191.967 169.931 195.172 173.055 194.443 176.622L183.18 231.775C182.422 235.487 185.907 238.661 189.532 237.56L212.947 230.446C216.577 229.344 220.065 232.527 219.297 236.242L201.398 322.875C200.278 328.294 207.486 331.249 210.492 326.603L212.5 323.5L323.454 102.072C325.312 98.3645 322.108 94.137 318.036 94.9228L279.014 102.454C275.347 103.161 272.227 99.746 273.262 96.1583L298.731 7.86689C299.767 4.27314 296.636 0.855181 292.965 1.5744Z" fill="url(#paint1_linear)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="6.00017" y1="32.9999" x2="235" y2="344" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41D1FF"/>
|
||||
<stop offset="1" stop-color="#BD34FE"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear" x1="194.651" y1="8.81818" x2="236.076" y2="292.989" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFEA83"/>
|
||||
<stop offset="0.0833333" stop-color="#FFDD35"/>
|
||||
<stop offset="1" stop-color="#FFA800"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,4 @@
|
||||
export * from './components/rich-text';
|
||||
export * from './components/rich-action';
|
||||
export * from './components/rich-toolbar';
|
||||
export * from './components/rich-viewer';
|
||||
@@ -0,0 +1,138 @@
|
||||
export function checkFonts(): string[] {
|
||||
const fontCheck = new Set(
|
||||
[
|
||||
// Windows 10
|
||||
"Arial",
|
||||
"Arial Black",
|
||||
"Bahnschrift",
|
||||
"Calibri",
|
||||
"Cambria",
|
||||
"Cambria Math",
|
||||
"Candara",
|
||||
"Comic Sans MS",
|
||||
"Consolas",
|
||||
"Constantia",
|
||||
"Corbel",
|
||||
"Courier New",
|
||||
"Ebrima",
|
||||
"Franklin Gothic Medium",
|
||||
"Gabriola",
|
||||
"Gadugi",
|
||||
"Georgia",
|
||||
"HoloLens MDL2 Assets",
|
||||
"Impact",
|
||||
"Ink Free",
|
||||
"Javanese Text",
|
||||
"Leelawadee UI",
|
||||
"Lucida Console",
|
||||
"Lucida Sans Unicode",
|
||||
"Malgun Gothic",
|
||||
"Marlett",
|
||||
"Microsoft Himalaya",
|
||||
"Microsoft JhengHei",
|
||||
"Microsoft New Tai Lue",
|
||||
"Microsoft PhagsPa",
|
||||
"Microsoft Sans Serif",
|
||||
"Microsoft Tai Le",
|
||||
"Microsoft YaHei",
|
||||
"Microsoft Yi Baiti",
|
||||
"MingLiU-ExtB",
|
||||
"Mongolian Baiti",
|
||||
"MS Gothic",
|
||||
"MV Boli",
|
||||
"Myanmar Text",
|
||||
"Nirmala UI",
|
||||
"Palatino Linotype",
|
||||
"Segoe MDL2 Assets",
|
||||
"Segoe Print",
|
||||
"Segoe Script",
|
||||
"Segoe UI",
|
||||
"Segoe UI Historic",
|
||||
"Segoe UI Emoji",
|
||||
"Segoe UI Symbol",
|
||||
"SimSun",
|
||||
"Sitka",
|
||||
"Sylfaen",
|
||||
"Symbol",
|
||||
"Tahoma",
|
||||
"Times New Roman",
|
||||
"Trebuchet MS",
|
||||
"Verdana",
|
||||
"Webdings",
|
||||
"Wingdings",
|
||||
"Yu Gothic",
|
||||
// macOS
|
||||
"American Typewriter",
|
||||
"Andale Mono",
|
||||
"Arial",
|
||||
"Arial Black",
|
||||
"Arial Narrow",
|
||||
"Arial Rounded MT Bold",
|
||||
"Arial Unicode MS",
|
||||
"Avenir",
|
||||
"Avenir Next",
|
||||
"Avenir Next Condensed",
|
||||
"Baskerville",
|
||||
"Big Caslon",
|
||||
"Bodoni 72",
|
||||
"Bodoni 72 Oldstyle",
|
||||
"Bodoni 72 Smallcaps",
|
||||
"Bradley Hand",
|
||||
"Brush Script MT",
|
||||
"Chalkboard",
|
||||
"Chalkboard SE",
|
||||
"Chalkduster",
|
||||
"Charter",
|
||||
"Cochin",
|
||||
"Comic Sans MS",
|
||||
"Copperplate",
|
||||
"Courier",
|
||||
"Courier New",
|
||||
"Didot",
|
||||
"DIN Alternate",
|
||||
"DIN Condensed",
|
||||
"Futura",
|
||||
"Geneva",
|
||||
"Georgia",
|
||||
"Gill Sans",
|
||||
"Helvetica",
|
||||
"Helvetica Neue",
|
||||
"Herculanum",
|
||||
"Hoefler Text",
|
||||
"Impact",
|
||||
"Lucida Grande",
|
||||
"Luminari",
|
||||
"Marker Felt",
|
||||
"Menlo",
|
||||
"Microsoft Sans Serif",
|
||||
"Monaco",
|
||||
"Noteworthy",
|
||||
"Optima",
|
||||
"Palatino",
|
||||
"Papyrus",
|
||||
"Phosphate",
|
||||
"Rockwell",
|
||||
"Savoye LET",
|
||||
"SignPainter",
|
||||
"Skia",
|
||||
"Snell Roundhand",
|
||||
"Tahoma",
|
||||
"Times",
|
||||
"Times New Roman",
|
||||
"Trattatello",
|
||||
"Trebuchet MS",
|
||||
"Verdana",
|
||||
"Zapfino",
|
||||
].sort()
|
||||
);
|
||||
const fontAvailable = new Set<string>();
|
||||
// @ts-ignore
|
||||
for (const font of fontCheck.values()) {
|
||||
// @ts-ignore
|
||||
if (document.fonts.check(`12px "${font}"`)) {
|
||||
fontAvailable.add(font);
|
||||
}
|
||||
}
|
||||
// @ts-ignore
|
||||
return fontAvailable.values();
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { property } from "lit/decorators.js";
|
||||
|
||||
export const live = property({ type: Object, hasChanged: () => true });
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"lib": [
|
||||
"es2017",
|
||||
"dom",
|
||||
"dom.iterable"
|
||||
],
|
||||
"declaration": true,
|
||||
"outDir": "./types",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
|
||||
export default defineConfig({
|
||||
base: '/lit-html-editor/',
|
||||
build: {
|
||||
lib: {
|
||||
entry: "src/rich-text-editor.ts",
|
||||
formats: ["es"],
|
||||
},
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve(__dirname, "index.html"),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user