@operato/markdown 0.2.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +29 -0
- package/.storybook/main.js +3 -0
- package/.storybook/server.mjs +8 -0
- package/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/assets/scripts/markdown-webworker.js +30 -0
- package/demo/index.html +34 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/markdown-style.d.ts +1 -0
- package/dist/src/markdown-style.js +122 -0
- package/dist/src/markdown-style.js.map +1 -0
- package/dist/src/markdown.d.ts +1 -0
- package/dist/src/markdown.js +18 -0
- package/dist/src/markdown.js.map +1 -0
- package/dist/src/ox-layout.d.ts +45 -0
- package/dist/src/ox-layout.js +148 -0
- package/dist/src/ox-layout.js.map +1 -0
- package/dist/src/ox-markdown.d.ts +12 -0
- package/dist/src/ox-markdown.js +124 -0
- package/dist/src/ox-markdown.js.map +1 -0
- package/dist/src/ox-toolbar-style.d.ts +4 -0
- package/dist/src/ox-toolbar-style.js +226 -0
- package/dist/src/ox-toolbar-style.js.map +1 -0
- package/dist/src/ox-toolbar.d.ts +4 -0
- package/dist/src/ox-toolbar.js +122 -0
- package/dist/src/ox-toolbar.js.map +1 -0
- package/dist/stories/index.stories.d.ts +33 -0
- package/dist/stories/index.stories.js +33 -0
- package/dist/stories/index.stories.js.map +1 -0
- package/dist/test/ox-layout.test.d.ts +1 -0
- package/dist/test/ox-layout.test.js +24 -0
- package/dist/test/ox-layout.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +72 -0
- package/src/index.ts +1 -0
- package/src/markdown-style.ts +122 -0
- package/src/markdown.ts +20 -0
- package/src/ox-markdown.ts +119 -0
- package/tsconfig.json +22 -0
- package/web-dev-server.config.mjs +27 -0
- package/web-test-runner.config.mjs +41 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@lit/reactive-element/decorators/base.d.ts","../../../node_modules/@lit/reactive-element/decorators/custom-element.d.ts","../../../node_modules/@lit/reactive-element/decorators/property.d.ts","../../../node_modules/@lit/reactive-element/decorators/state.d.ts","../../../node_modules/@lit/reactive-element/decorators/event-options.d.ts","../../../node_modules/@lit/reactive-element/decorators/query.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-all.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-async.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.d.ts","../../../node_modules/lit/decorators.d.ts","../src/markdown-style.ts","../../styles/dist/src/headroom-styles.d.ts","../../styles/dist/src/scrollbar-styles.d.ts","../../styles/dist/src/spinner-styles.d.ts","../../styles/dist/src/index.d.ts","../src/markdown.ts","../../../node_modules/lit-html/directives/unsafe-html.d.ts","../src/ox-markdown.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"6adbf5efd0e374ff5f427a4f26a5a413e9734eee5067a0e86da69aea41910b52","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","0c8a56610b08f55e29ffb466cd27626ad6dbe822312a398026e82270c63088e3","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","7b33ee85f2e96a51c0e3bcee47b247a24515aff37a7d8b5dfe4e18b735d37440","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"70f04c91d3186b1b10157157887fab664968fc9b88377785a5ee42750c202c6d","06e20da1bc94df355f22ac7a9533c2488816ec4cb9134d9b160a263629a07072","c311ef8d8b159d0c268b415f78c1949498dc2d14455a9891c5b8ef84625b1e41","f07a77a7fb1d49aa2b61cb68bf712a083487acd7130d20223a83de03af0c257d","97c58f6db61d45712d91d2260994817ae2b568bbb37cc280013079b6b5d2232d","ac388c7c7a262213a3700451bc921e382a93fb27c0252c34ccf03540b4ce044b","9bdb35d0b28dcd5d8f0879bd29f0cf07b7eb48aa63be4dd44057e32fcfeb1c83","fb0107c83e2e0e75b77dacd0c3c6c3ab6844e98dce2a8f858c6f0a57c12136a6","84610cf09dee3cefc910555318f1ad7b45f1cba36905a86849324ca4fead2385","a25d1e52291791819032826af5c52987e16ffdb96e8bb69f7f1790f5ab080be6","d660961abada6b5030461f3322ef3a2e1d9fec74167574f8b590a7796cf90a72","707b4eae3d469b2f347d2083037151922f94c370a9456ebd5ac0a4fb7441c7e7","ef509d57201aa4e2e3e2b3d1fafd066a8ce68cd2caea737d539c3544f5a99a67","84c66a77a1302611ea5001dc88d10de1b5d87c6b2f30a48585495217421ce1ac","7b2b714e726a7735e797983ed548ce9e12ef5c159b2dadc3fffd6f28aa2324a3","cf93fb9208a01c80f0fad245c4360356e5de6c2384b7641acf0b9cc2f5c42448","336398b0efaf964124e636a9b29c4edd5870aee79ac64bf87be58a9d66b7c048","571bc65ec37ba124e762bb822e14a2b8502dc684e356be8feaccbd6b9cadd023","0766fae8dbc740ce8a4731666a1537594d7763f71f46bbfef67ed9d7a34cb0cc","992458683d6de67eb6bf7a8d3ca235e9f9e07b24e6b6694ac9313d0ab00eee4e","133f37c4f3d0dc144efda59a3880df4fdf506f0ae98d859062c8c3e430d5b91c","a3a813989f3414191f54b84f2bdd91c651141533724714b2885d8db7bc94c0a7","453b0b8928616f194438b99f3fb75236011aa2216bc16025879082af81fdee34","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","5533392c50c51b1a5c32b89f13145db929c574ef1c5949cf67a074a05ea107d9","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"902cd98bf46e95caf4118a0733fb801e9e90eec3edaed6abdad77124afec9ca2","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a7971f9fb2a32ec7788ec6cda9d7a33c02023dfe9a62db2030ad1359649d8050","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1cdb8f094b969dcc183745dc88404e2d8fcf2a858c6e7cc2441011476573238e",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5},"fileIdsList":[[112],[43,112],[50,112],[43,50,112],[41,42,112],[69,112],[72,112],[73,78,112],[74,84,85,92,101,111,112],[74,75,84,92,112],[76,112],[77,78,85,93,112],[78,101,108,112],[79,81,84,92,112],[80,112],[81,82,112],[83,84,112],[84,112],[84,85,86,101,111,112],[84,85,86,101,112],[87,92,101,111,112],[84,85,87,88,92,101,108,111,112],[87,89,101,108,111,112],[69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118],[84,90,112],[91,111,112],[81,84,92,101,112],[93,112],[94,112],[72,95,112],[96,110,112,116],[97,112],[98,112],[84,99,112],[99,100,112,114],[84,101,102,103,112],[101,103,112],[101,102,112],[104,112],[105,112],[84,106,107,112],[106,107,112],[78,92,108,112],[109,112],[92,110,112],[73,87,98,111,112],[78,112],[101,112,113],[112,114],[112,115],[73,78,84,86,95,101,111,112,114,116],[101,112,117],[44,112],[43,47,112],[47,112],[46,47,112],[45,46,112],[51,52,53,54,55,56,57,58,112],[43,47,48,112],[40,67,112],[40,49,112],[40,112],[40,46,49,59,60,64,65,66,112],[49,112],[61,62,63,112]],"referencedMap":[[41,1],[50,2],[51,3],[54,4],[52,4],[56,4],[58,4],[57,4],[55,4],[53,3],[42,1],[43,5],[120,1],[69,6],[70,6],[72,7],[73,8],[74,9],[75,10],[76,11],[77,12],[78,13],[79,14],[80,15],[81,16],[82,16],[83,17],[84,18],[85,19],[86,20],[71,1],[118,1],[87,21],[88,22],[89,23],[119,24],[90,25],[91,26],[92,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,34],[100,35],[101,36],[103,37],[102,38],[104,39],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[45,53],[44,1],[48,54],[46,55],[66,56],[47,57],[59,58],[49,59],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[68,60],[60,61],[65,62],[67,63],[61,64],[64,65],[62,64],[63,64]],"exportedModulesMap":[[41,1],[50,2],[51,3],[54,4],[52,4],[56,4],[58,4],[57,4],[55,4],[53,3],[42,1],[43,5],[120,1],[69,6],[70,6],[72,7],[73,8],[74,9],[75,10],[76,11],[77,12],[78,13],[79,14],[80,15],[81,16],[82,16],[83,17],[84,18],[85,19],[86,20],[71,1],[118,1],[87,21],[88,22],[89,23],[119,24],[90,25],[91,26],[92,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,34],[100,35],[101,36],[103,37],[102,38],[104,39],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[45,53],[44,1],[48,54],[46,55],[66,56],[47,57],[59,58],[49,59],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[68,60],[60,61],[65,62],[67,63],[61,64],[64,65],[62,64],[63,64]],"semanticDiagnosticsPerFile":[41,50,51,54,52,56,58,57,55,53,42,43,120,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,71,118,87,88,89,119,90,91,92,93,94,95,96,97,98,99,100,101,103,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,45,44,48,46,66,47,59,49,40,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,68,60,65,67,61,64,62,63]},"version":"4.5.2"}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@operato/markdown",
|
|
3
|
+
"description": "Webcomponent markdown following open-wc recommendations",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "heartyoh",
|
|
6
|
+
"version": "0.2.49",
|
|
7
|
+
"main": "dist/src/index.js",
|
|
8
|
+
"module": "dist/src/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"@operato:registry": "https://registry.npmjs.org"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/hatiolab/operato.git",
|
|
19
|
+
"directory": "webcomponents/markdown"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"analyze": "cem analyze --litelement",
|
|
23
|
+
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
24
|
+
"build": "tsc && npm run analyze -- --exclude dist",
|
|
25
|
+
"prepublish": "tsc && npm run analyze -- --exclude dist",
|
|
26
|
+
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
27
|
+
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
28
|
+
"test": "tsc && wtr --coverage",
|
|
29
|
+
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
|
|
30
|
+
"storybook": "tsc && npm run analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
|
|
31
|
+
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@operato/styles": "^0.2.49",
|
|
35
|
+
"lit": "^2.0.2",
|
|
36
|
+
"marked": "^4.0.7"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
40
|
+
"@hatiolab/prettier-config": "^1.0.0",
|
|
41
|
+
"@open-wc/eslint-config": "^4.3.0",
|
|
42
|
+
"@open-wc/testing": "next",
|
|
43
|
+
"@types/marked": "^4.0.1",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
45
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
46
|
+
"@web/dev-server": "^0.1.25",
|
|
47
|
+
"@web/dev-server-storybook": "next",
|
|
48
|
+
"@web/test-runner": "next",
|
|
49
|
+
"concurrently": "^5.3.0",
|
|
50
|
+
"eslint": "^7.32.0",
|
|
51
|
+
"eslint-config-prettier": "^8.3.0",
|
|
52
|
+
"husky": "^4.3.8",
|
|
53
|
+
"lint-staged": "^10.5.4",
|
|
54
|
+
"prettier": "^2.4.1",
|
|
55
|
+
"tslib": "^2.3.1",
|
|
56
|
+
"typescript": "^4.5.2"
|
|
57
|
+
},
|
|
58
|
+
"customElements": "custom-elements.json",
|
|
59
|
+
"prettier": "@hatiolab/prettier-config",
|
|
60
|
+
"husky": {
|
|
61
|
+
"hooks": {
|
|
62
|
+
"pre-commit": "lint-staged"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"lint-staged": {
|
|
66
|
+
"*.ts": [
|
|
67
|
+
"eslint --fix",
|
|
68
|
+
"prettier --write"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"gitHead": "9a384d8b1eb814d71dd1146d3eb8e0754b763d97"
|
|
72
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ox-markdown'
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { css } from 'lit'
|
|
2
|
+
|
|
3
|
+
export const MarkdownStyle = css`
|
|
4
|
+
h1 {
|
|
5
|
+
background-color: var(--help-panel-title-background-color);
|
|
6
|
+
margin: var(--help-panel-title-margin);
|
|
7
|
+
padding: var(--help-panel-title-padding);
|
|
8
|
+
font-size: var(--help-panel-h1-title-font-size);
|
|
9
|
+
text-transform: capitalize;
|
|
10
|
+
color: var(--help-panel-h1-title-color);
|
|
11
|
+
}
|
|
12
|
+
h2 {
|
|
13
|
+
margin: var(--help-panel-title-margin);
|
|
14
|
+
padding: var(--help-panel-title-padding);
|
|
15
|
+
font-size: var(--help-panel-h2-title-font-size);
|
|
16
|
+
color: var(--help-panel-h2-title-color);
|
|
17
|
+
text-transform: capitalize;
|
|
18
|
+
}
|
|
19
|
+
h3 {
|
|
20
|
+
margin: var(--help-panel-title-margin);
|
|
21
|
+
padding: var(--help-panel-title-padding);
|
|
22
|
+
font-size: var(--help-panel-h3-title-font-size);
|
|
23
|
+
color: var(--help-panel-h3-title-color);
|
|
24
|
+
}
|
|
25
|
+
mwc-icon {
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
img {
|
|
30
|
+
display: block;
|
|
31
|
+
margin: var(--margin-narrow) var(--margin-default);
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
}
|
|
34
|
+
img[src*='#icon25'] {
|
|
35
|
+
width: 25px;
|
|
36
|
+
height: 25px;
|
|
37
|
+
}
|
|
38
|
+
img[src*='#icon50'] {
|
|
39
|
+
width: 50px;
|
|
40
|
+
height: 50px;
|
|
41
|
+
}
|
|
42
|
+
img[src*='#icon100'] {
|
|
43
|
+
width: 100px;
|
|
44
|
+
height: 100px;
|
|
45
|
+
}
|
|
46
|
+
img[src*='#icon25inlined'],
|
|
47
|
+
img[src*='#icon50inlined'],
|
|
48
|
+
img[src*='#icon100inlined'] {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
margin: var(--margin-narrow);
|
|
51
|
+
}
|
|
52
|
+
p {
|
|
53
|
+
margin: var(--help-panel-paragraph-margin);
|
|
54
|
+
font-size: var(--help-panel-font-size);
|
|
55
|
+
}
|
|
56
|
+
[focusBox] {
|
|
57
|
+
display: block;
|
|
58
|
+
padding: var(--help-panel-focusBox-padding);
|
|
59
|
+
border: var(--help-panel-focusBox-border);
|
|
60
|
+
border-radius: var(--help-panel-focusBox-border-radius);
|
|
61
|
+
background-color: var(--help-panel-focusBox-background-color);
|
|
62
|
+
color: var(--help-panel-focusBox-color);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[subtitle] {
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
}
|
|
68
|
+
[subtitle]::before {
|
|
69
|
+
content: '';
|
|
70
|
+
width: 7px;
|
|
71
|
+
height: 7px;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
border: 3px solid var(--theme-white-color);
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
margin-right: var(--margin-narrow);
|
|
76
|
+
}
|
|
77
|
+
p + ol,
|
|
78
|
+
p + ul {
|
|
79
|
+
font-size: var(--help-panel-content-font-size);
|
|
80
|
+
}
|
|
81
|
+
ol,
|
|
82
|
+
ul {
|
|
83
|
+
padding: 0 0 0 30px;
|
|
84
|
+
}
|
|
85
|
+
ol li,
|
|
86
|
+
ul li {
|
|
87
|
+
margin: 0 0 2px 0;
|
|
88
|
+
}
|
|
89
|
+
a {
|
|
90
|
+
margin-bottom: 0 !important;
|
|
91
|
+
color: var(--help-panel-a-color);
|
|
92
|
+
font-size: var(--fontsize-default);
|
|
93
|
+
text-decoration: underline;
|
|
94
|
+
}
|
|
95
|
+
a mwc-icon {
|
|
96
|
+
font-size: var(--help-panel-a-icon-size);
|
|
97
|
+
margin: 0;
|
|
98
|
+
}
|
|
99
|
+
a:hover {
|
|
100
|
+
background-color: var(--opacity-light-dark-color);
|
|
101
|
+
font-weight: bold;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
table {
|
|
105
|
+
border-collapse: collapse;
|
|
106
|
+
border: var(--border-dark-color);
|
|
107
|
+
font-size: 0.9em;
|
|
108
|
+
}
|
|
109
|
+
th {
|
|
110
|
+
border-top: 3px solid var(--primary-color);
|
|
111
|
+
background-color: var(--main-section-background-color);
|
|
112
|
+
color: var(--secondary-color);
|
|
113
|
+
}
|
|
114
|
+
th,
|
|
115
|
+
td {
|
|
116
|
+
border-bottom: var(--border-dark-color);
|
|
117
|
+
padding: var(--padding-narrow);
|
|
118
|
+
}
|
|
119
|
+
tr:nth-child(even) {
|
|
120
|
+
background-color: #f6f6f6;
|
|
121
|
+
}
|
|
122
|
+
`
|
package/src/markdown.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const worker = new Worker('/node_modules/@operato/markdown/assets/scripts/markdown-webworker.js')
|
|
2
|
+
const TIMEOUT_LIMIT = 20000
|
|
3
|
+
|
|
4
|
+
export async function md(markdown: string, options: StructuredSerializeOptions): Promise<any> {
|
|
5
|
+
return new Promise((resolve, reject) => {
|
|
6
|
+
var timeout = setTimeout(() => {
|
|
7
|
+
reject('Marked took too long!')
|
|
8
|
+
}, TIMEOUT_LIMIT)
|
|
9
|
+
|
|
10
|
+
worker.onmessage = e => {
|
|
11
|
+
clearTimeout(timeout)
|
|
12
|
+
resolve(e.data)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
worker.postMessage({
|
|
16
|
+
content: markdown,
|
|
17
|
+
options
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult, css, html } from 'lit'
|
|
2
|
+
import { customElement, property, state } from 'lit/decorators'
|
|
3
|
+
|
|
4
|
+
import { DirectiveResult } from 'lit-html/directive'
|
|
5
|
+
import { MarkdownStyle } from './markdown-style'
|
|
6
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
7
|
+
import { md } from './markdown'
|
|
8
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html'
|
|
9
|
+
|
|
10
|
+
@customElement('ox-markdown')
|
|
11
|
+
export class OxMarkdown extends LitElement {
|
|
12
|
+
static styles = [
|
|
13
|
+
ScrollbarStyles,
|
|
14
|
+
MarkdownStyle,
|
|
15
|
+
css`
|
|
16
|
+
#toc {
|
|
17
|
+
position: absolute;
|
|
18
|
+
max-width: 250px;
|
|
19
|
+
background-color: var(--theme-white-color);
|
|
20
|
+
padding: var(--padding-default);
|
|
21
|
+
right: var(--margin-wide);
|
|
22
|
+
font: bold var(--fontsize-large) var(--theme-font);
|
|
23
|
+
color: var(--secondary-text-color);
|
|
24
|
+
}
|
|
25
|
+
#toc ul {
|
|
26
|
+
list-style: circle;
|
|
27
|
+
margin: var(--margin-default) 0 0 var(--margin-wide);
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
#toc a {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
margin-left: -var(--margin-narrow);
|
|
33
|
+
padding: var(--padding-narrow) 0;
|
|
34
|
+
font: normal var(--fontsize-default) var(--theme-font);
|
|
35
|
+
color: var(--secondary-color);
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
#toc a:hover {
|
|
40
|
+
background-color: var(--theme-white-color);
|
|
41
|
+
text-decoration: underline;
|
|
42
|
+
color: var(--primary-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media screen and (max-width: 480px) {
|
|
46
|
+
#toc {
|
|
47
|
+
background-color: var(--main-section-background-color);
|
|
48
|
+
border-left: 4px solid var(--primary-color);
|
|
49
|
+
border-bottom: 1px dotted rgba(0, 0, 0, 0.2);
|
|
50
|
+
position: relative;
|
|
51
|
+
width: 100%;
|
|
52
|
+
max-width: initial;
|
|
53
|
+
padding: var(--padding-default) var(--padding-default) var(--padding-default) var(--padding-wide);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
@property({ type: String }) src?: string
|
|
60
|
+
@property({ type: Boolean }) toc: boolean = false
|
|
61
|
+
|
|
62
|
+
@state() _html?: TemplateResult | DirectiveResult | null
|
|
63
|
+
@state() _headings: any[] = []
|
|
64
|
+
|
|
65
|
+
render() {
|
|
66
|
+
return html`
|
|
67
|
+
${this.toc ? this.renderToc() : html``}
|
|
68
|
+
${this._html}
|
|
69
|
+
`
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
renderToc() {
|
|
73
|
+
var toc = this._headings || []
|
|
74
|
+
|
|
75
|
+
return toc && toc.length > 0
|
|
76
|
+
? html`
|
|
77
|
+
<div id="toc">
|
|
78
|
+
Table Of Contents
|
|
79
|
+
<ul>
|
|
80
|
+
${toc.map(
|
|
81
|
+
heading => html` <li><a @click=${() => heading?.scrollIntoView()}>${heading.textContent}</a></li> `
|
|
82
|
+
)}
|
|
83
|
+
</ul>
|
|
84
|
+
</div>
|
|
85
|
+
`
|
|
86
|
+
: html``
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async updated(changed: PropertyValues<this>) {
|
|
90
|
+
if (changed.has('src')) {
|
|
91
|
+
if (this.src) {
|
|
92
|
+
const response = await fetch(this.src)
|
|
93
|
+
const content = await response.text()
|
|
94
|
+
|
|
95
|
+
if (!response.ok) {
|
|
96
|
+
this._html = html`
|
|
97
|
+
<h1>Error : ${response.status}</h1>
|
|
98
|
+
<div>${content}</div>
|
|
99
|
+
`
|
|
100
|
+
} else {
|
|
101
|
+
if (response.headers.get('Content-Type')?.indexOf('text/markdown') !== -1) {
|
|
102
|
+
this._html = unsafeHTML(
|
|
103
|
+
(await md(content, {
|
|
104
|
+
baseUrl: this.src
|
|
105
|
+
} as StructuredSerializeOptions)) || ''
|
|
106
|
+
)
|
|
107
|
+
} else {
|
|
108
|
+
this._html = unsafeHTML(content || '')
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if(changed.has('_html')) {
|
|
115
|
+
this._headings = Array.from(this.renderRoot.querySelectorAll('h2'))
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2018",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2017", "dom"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"rootDir": "./",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"incremental": true,
|
|
19
|
+
"types": ["node", "mocha"]
|
|
20
|
+
},
|
|
21
|
+
"include": ["**/*.ts"]
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
+
|
|
3
|
+
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
+
const hmr = process.argv.includes('--hmr');
|
|
5
|
+
|
|
6
|
+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
+
open: '/demo/',
|
|
8
|
+
/** Use regular watch mode if HMR is not enabled. */
|
|
9
|
+
watch: !hmr,
|
|
10
|
+
/** Resolve bare module imports */
|
|
11
|
+
nodeResolve: {
|
|
12
|
+
exportConditions: ['browser', 'development'],
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
+
// esbuildTarget: 'auto'
|
|
17
|
+
|
|
18
|
+
/** Set appIndex to enable SPA routing */
|
|
19
|
+
// appIndex: 'demo/index.html',
|
|
20
|
+
|
|
21
|
+
plugins: [
|
|
22
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
// See documentation for all available options
|
|
27
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
+
|
|
3
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
+
|
|
5
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
+
/** Test files to run */
|
|
7
|
+
files: 'dist/test/**/*.test.js',
|
|
8
|
+
|
|
9
|
+
/** Resolve bare module imports */
|
|
10
|
+
nodeResolve: {
|
|
11
|
+
exportConditions: ['browser', 'development'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/** Filter out lit dev mode logs */
|
|
15
|
+
filterBrowserLogs(log) {
|
|
16
|
+
for (const arg of log.args) {
|
|
17
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
+
// esbuildTarget: 'auto',
|
|
26
|
+
|
|
27
|
+
/** Amount of browsers to run concurrently */
|
|
28
|
+
// concurrentBrowsers: 2,
|
|
29
|
+
|
|
30
|
+
/** Amount of test files per browser to test concurrently */
|
|
31
|
+
// concurrency: 1,
|
|
32
|
+
|
|
33
|
+
/** Browsers to run tests on */
|
|
34
|
+
// browsers: [
|
|
35
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
+
// ],
|
|
39
|
+
|
|
40
|
+
// See documentation for all available options
|
|
41
|
+
});
|