From 2d68b34929b0eddf4c37e8dea2279c4a6f3f3d0b Mon Sep 17 00:00:00 2001 From: OlegWock Date: Sat, 6 Jul 2024 16:25:32 +0200 Subject: [PATCH] Make everything works on mobile --- README.md | 2 +- TODO.md | 1 - manifest.json | 2 +- package.json | 1 - src/bundler.ts | 4 +--- yarn.lock | 16 +--------------- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 0bbc067..3ad8b64 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,12 @@ This is a plugin for Obsidian (https://obsidian.md) which enables you to use rea * Full-fledged JSX for more complex usecases. * Inline JS execution (in progress). * Supports both reading and live preview modes. +* Works on mobile. * Components are loaded from JS files, so you can use your favorite editor. * Emera supports TypeScript, ES modules (local only), and direct import of CSS files. ## Roadmap -* Support for mobile * Accessing frontmatter in components and inline js * Share variables between code blocks on same page. So you could do something like: ````markdown diff --git a/TODO.md b/TODO.md index 4f7d697..86718ab 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,3 @@ -* Check that it works on mobile * Expose frontmatter to inline JS and components * JS code blocks with `export` should make variable available in page's scope diff --git a/manifest.json b/manifest.json index f0a4f02..ccbdd04 100644 --- a/manifest.json +++ b/manifest.json @@ -7,5 +7,5 @@ "author": "OlegWock", "authorUrl": "https://sinja.io", "fundingUrl": "https://sinja.io/support", - "isDesktopOnly": true + "isDesktopOnly": false } diff --git a/package.json b/package.json index 7cdbe5b..7e511fe 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "@codemirror/lang-markdown": "^0.20.0", "@codemirror/language-data": "^0.20.0", "@rollup/browser": "^3.29.0", - "@rollup/pluginutils": "^5.1.0", "@types/babel__standalone": "^7.1.7", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/src/bundler.ts b/src/bundler.ts index 7647d73..50ffd07 100644 --- a/src/bundler.ts +++ b/src/bundler.ts @@ -1,5 +1,4 @@ import { rollup, type Plugin as RollupPlugin } from '@rollup/browser'; -import { createFilter } from "@rollup/pluginutils"; import { normalizePath, TFile } from 'obsidian'; import * as Babel from '@babel/standalone'; import { ComponentType } from 'react'; @@ -194,8 +193,7 @@ const rollupBabelPlugin = (plugin: EmeraPlugin): RollupPlugin => ({ const rollupCssPlugin = (plugin: EmeraPlugin): RollupPlugin => ({ name: 'emera-styles', transform(code, id) { - const filter = createFilter(["**/*.css"], [], { resolve: false }); - if (!filter(id)) return; + if (!id.endsWith('.css')) return; const injectionCode = ` (function() { diff --git a/yarn.lock b/yarn.lock index f3212c4..8ac0e7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -484,15 +484,6 @@ resolved "https://registry.yarnpkg.com/@rollup/browser/-/browser-3.29.4.tgz#5c534f8ab3a617e7d12d99dc10d16755b07e4b17" integrity sha512-qkWkilNBn+90/9Xn2stuwFpXYhG/mZVPlDkTIPdQSEtJES0NS4o4atceEqeGeHOjQREY2jaIv7ld3IajA/Bmfw== -"@rollup/pluginutils@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0" - integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== - dependencies: - "@types/estree" "^1.0.0" - estree-walker "^2.0.2" - picomatch "^2.3.1" - "@types/babel__core@^7.1.0": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -540,7 +531,7 @@ dependencies: "@types/tern" "*" -"@types/estree@*", "@types/estree@^1.0.0": +"@types/estree@*": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== @@ -778,11 +769,6 @@ estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - eventemitter3@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4"