Skip to content

Commit

Permalink
Make everything works on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegWock committed Jul 6, 2024
1 parent fc329ab commit 2d68b34
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"author": "OlegWock",
"authorUrl": "https://sinja.io",
"fundingUrl": "https://sinja.io/support",
"isDesktopOnly": true
"isDesktopOnly": false
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions src/bundler.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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() {
Expand Down
16 changes: 1 addition & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2d68b34

Please sign in to comment.