From fbb7e5b22d26d2d7ad45d408213f5be880d058f8 Mon Sep 17 00:00:00 2001 From: "David R. Myers" Date: Fri, 20 Sep 2024 15:00:18 -0400 Subject: [PATCH 1/3] Update CI actions --- .github/actions/install-dependencies/action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 1943fba..8fe86e5 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -3,13 +3,12 @@ description: Install with cached dependencies runs: using: composite steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 18 - - uses: pnpm/action-setup@v2.4.0 + - uses: pnpm/action-setup@v4 with: run_install: false - version: 8 - shell: bash run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v3 From a9d0e7d5427ee8683815b3f28d158ed054b3ed1d Mon Sep 17 00:00:00 2001 From: "David R. Myers" Date: Tue, 2 Jul 2024 20:29:07 -0400 Subject: [PATCH 2/3] Store the demo doc as a URL query param --- examples/demo.ts | 14 +++++++++++++- index.html | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/demo.ts b/examples/demo.ts index 389bd59..f0686e4 100644 --- a/examples/demo.ts +++ b/examples/demo.ts @@ -12,8 +12,11 @@ declare global { } } +const url = new URL(window.location.href) +const doc = url.searchParams.get('doc') ?? example + window.ink = ink(document.getElementById('app')!, { - doc: example, + doc, files: { clipboard: true, dragAndDrop: true, @@ -29,6 +32,13 @@ window.ink = ink(document.getElementById('app')!, { }, injectMarkup: true, }, + hooks: { + afterUpdate: (text) => { + url.searchParams.set('doc', text) + + window.history.replaceState(null, '', url) + }, + }, interface: { images: true, lists: true, @@ -55,3 +65,5 @@ const toggleTheme = (theme: Values.Appearance) => { window.auto = toggleTheme.bind(undefined, 'auto') window.dark = toggleTheme.bind(undefined, 'dark') window.light = toggleTheme.bind(undefined, 'light') + +toggleTheme('light') diff --git a/index.html b/index.html index efbd71f..ce9299a 100644 --- a/index.html +++ b/index.html @@ -19,10 +19,18 @@ margin: 0; } + + @media (prefers-color-scheme: dark) { + .auto { + background-color: #222; + color: white; + } + }
- + + From 7d224849161d8e20d82d733000dce4836559314b Mon Sep 17 00:00:00 2001 From: "David R. Myers" Date: Sun, 7 Jul 2024 16:50:07 -0400 Subject: [PATCH 3/3] Break URLs and links on long lines --- src/editor/extensions/theme.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor/extensions/theme.ts b/src/editor/extensions/theme.ts index 0de661f..e73b0eb 100644 --- a/src/editor/extensions/theme.ts +++ b/src/editor/extensions/theme.ts @@ -137,10 +137,12 @@ export const theme = (): Extension => { { tag: tags.link, color: 'var(--ink-internal-syntax-link-color)', + wordBreak: 'break-all', }, { tag: tags.url, color: 'var(--ink-internal-syntax-url-color)', + wordBreak: 'break-all', }, // string group {