From 5e27433e5b3e6ac6ce3fff3cc538f88d0311eca3 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 14:19:39 -0400
Subject: [PATCH 01/30] add `noDefault` prop to `Dropdown`
---
.../src/lib/atoms/inputs/dropdown/Dropdown.svelte | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
index c0a2be10bb..5328bb4a88 100644
--- a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
+++ b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
@@ -51,6 +51,15 @@
/** @type {string} */
export let defaultValue = undefined;
+ /** @type {boolean} */
+ export let noDefault = false;
+ noDefault = noDefault === true || noDefault === 'true';
+
+ if (noDefault) {
+ // `Symbol()` so it isn't == to anything else
+ defaultValue = Symbol();
+ }
+
const ctx = {
hasBeenSet: defaultValue !== undefined,
handleSelect,
@@ -150,7 +159,7 @@
function useNewQuery(query) {
items = query;
- if (hasQuery && defaultValue) {
+ if (hasQuery && defaultValue !== undefined) {
ctx.hasBeenSet = true;
if (browser) {
(async () => {
From d43c7fab6bbbda8f1817a088f719e8c3b39c6968 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 14:19:57 -0400
Subject: [PATCH 02/30] add `noDefault` to `Dropdown` docs, missing
`hideDuringPrint`
---
sites/docs/docs/components/dropdown.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sites/docs/docs/components/dropdown.md b/sites/docs/docs/components/dropdown.md
index 3139625f4b..2d3eb7948b 100644
--- a/sites/docs/docs/components/dropdown.md
+++ b/sites/docs/docs/components/dropdown.md
@@ -162,6 +162,13 @@ where column_name like '${inputs.name_of_dropdown.value}'
No |
- |
First value in dropdown |
+
+
+ noDefault |
+ Stops any default from being selected. Overrides any set `defaultValue`. |
+ No |
+ true | false |
+ false |
multiple |
@@ -198,6 +205,13 @@ where column_name like '${inputs.name_of_dropdown.value}'
SQL where clause |
- |
+
+ hideDuringPrint |
+ Hide the component when the report is printed |
+ No |
+ true | false |
+ true |
+
## DropdownOption
From 044917abd9ae35c3557e425d31917de46db168c7 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 14:20:12 -0400
Subject: [PATCH 03/30] add `noDefault` to `test-env` dropdown
---
sites/test-env/pages/dropdown.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sites/test-env/pages/dropdown.md b/sites/test-env/pages/dropdown.md
index a9fad5afcb..a483153e9b 100644
--- a/sites/test-env/pages/dropdown.md
+++ b/sites/test-env/pages/dropdown.md
@@ -71,7 +71,7 @@ Orders of {inputs.multiple_selected_order_ids.label}
## Small Demo
-
+
```selected_items
From 9bac016ccfb9c07ffaa75107c4f51952c748e484 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 15:51:07 -0400
Subject: [PATCH 04/30] changeset
---
.changeset/lazy-hornets-call.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 .changeset/lazy-hornets-call.md
diff --git a/.changeset/lazy-hornets-call.md b/.changeset/lazy-hornets-call.md
new file mode 100644
index 0000000000..84e3920489
--- /dev/null
+++ b/.changeset/lazy-hornets-call.md
@@ -0,0 +1,5 @@
+---
+'@evidence-dev/core-components': minor
+---
+
+add `noDefault` prop to `Dropdown`, support for multi-defaultValue
From ef225dcb9e8e1b15b7b2e6c7ca4c1943a86051ef Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 15:51:16 -0400
Subject: [PATCH 05/30] add multi-defaultValue
---
.../lib/atoms/inputs/dropdown/Dropdown.svelte | 22 ++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
index 5328bb4a88..e304b87486 100644
--- a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
+++ b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
@@ -48,20 +48,26 @@
export let hideDuringPrint = true;
- /** @type {string} */
- export let defaultValue = undefined;
+ /** @type {string | string[]} */
+ export let defaultValue = [];
+ const _defaultValue = Array.isArray(defaultValue) ? defaultValue : [defaultValue];
/** @type {boolean} */
export let noDefault = false;
noDefault = noDefault === true || noDefault === 'true';
if (noDefault) {
- // `Symbol()` so it isn't == to anything else
- defaultValue = Symbol();
+ _defaultValue.length = 0;
}
+ const defaultStatus = noDefault
+ ? 'no_default'
+ : _defaultValue.length > 0
+ ? 'manual_default'
+ : 'auto_default';
+
const ctx = {
- hasBeenSet: defaultValue !== undefined,
+ hasBeenSet: defaultStatus !== 'auto_default',
handleSelect,
multiple
};
@@ -159,16 +165,16 @@
function useNewQuery(query) {
items = query;
- if (hasQuery && defaultValue !== undefined) {
+ if (hasQuery && defaultStatus !== 'auto_default') {
ctx.hasBeenSet = true;
if (browser) {
(async () => {
await query.fetch();
- $selectedValues = query.filter((x) => x.value == defaultValue);
+ $selectedValues = query.filter((x) => _defaultValue.find((d) => x.value == d));
selectedValuesToInput();
})();
} else {
- $selectedValues = query.filter((x) => x.value == defaultValue);
+ $selectedValues = query.filter((x) => _defaultValue.find((d) => x.value == d));
selectedValuesToInput();
}
} else {
From d38a55571f41acb3aa4b8d74ee2c44cf57329287 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 15:51:53 -0400
Subject: [PATCH 06/30] add to docs
---
sites/docs/docs/components/dropdown.md | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/sites/docs/docs/components/dropdown.md b/sites/docs/docs/components/dropdown.md
index 2d3eb7948b..4f8313ba40 100644
--- a/sites/docs/docs/components/dropdown.md
+++ b/sites/docs/docs/components/dropdown.md
@@ -123,6 +123,23 @@ where column_name like '${inputs.name_of_dropdown.value}'
```
````
+### Multiple defaultValues
+
+````markdown
+
+
+```sql filtered_query
+select *
+from source_name.table
+where column_name like '${inputs.name_of_dropdown.value}'
+```
+````
+
## Dropdown
### Options
@@ -150,15 +167,15 @@ where column_name like '${inputs.name_of_dropdown.value}'
- |
- value |
+ value |
Column name from the query containing values to pick from |
No |
column name |
- |
-
+
defaultValue |
- Value to use when the dropdown is first loaded. Must be one of the options in the dropdown. |
+ Value(s) to use when the dropdown is first loaded. Must be options in the values of the dropdown. Note: for multiple values, the array must be formatted as `defaultValue={[]}`, not `defaultValue=[]` |
No |
- |
First value in dropdown |
From cd93a628d8f1e545588241aaf089cc62e4170ec6 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 17:53:48 -0400
Subject: [PATCH 07/30] switch to boolean
---
.../src/lib/atoms/inputs/dropdown/Dropdown.svelte | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
index e304b87486..1b84fb06db 100644
--- a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
+++ b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
@@ -60,14 +60,10 @@
_defaultValue.length = 0;
}
- const defaultStatus = noDefault
- ? 'no_default'
- : _defaultValue.length > 0
- ? 'manual_default'
- : 'auto_default';
+ const hasDefault = noDefault || _defaultValue.length >= 0;
const ctx = {
- hasBeenSet: defaultStatus !== 'auto_default',
+ hasBeenSet: hasDefault,
handleSelect,
multiple
};
@@ -165,7 +161,7 @@
function useNewQuery(query) {
items = query;
- if (hasQuery && defaultStatus !== 'auto_default') {
+ if (hasQuery && hasDefault) {
ctx.hasBeenSet = true;
if (browser) {
(async () => {
From ed8d3c18a62fe21b3a47cfa30e1d76f82b8487eb Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 17:54:38 -0400
Subject: [PATCH 08/30] wrong comparison
---
.../src/lib/atoms/inputs/dropdown/Dropdown.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
index 1b84fb06db..f365fc10bd 100644
--- a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
+++ b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
@@ -60,7 +60,7 @@
_defaultValue.length = 0;
}
- const hasDefault = noDefault || _defaultValue.length >= 0;
+ const hasDefault = noDefault || _defaultValue.length > 0;
const ctx = {
hasBeenSet: hasDefault,
From 7235d59f479806cfd8032196b8414c5d18f51622 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 27 Mar 2024 18:07:11 -0400
Subject: [PATCH 09/30] add multi defaultValue example to dropdown.md
---
sites/test-env/pages/dropdown.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sites/test-env/pages/dropdown.md b/sites/test-env/pages/dropdown.md
index a483153e9b..cf4fb1ff63 100644
--- a/sites/test-env/pages/dropdown.md
+++ b/sites/test-env/pages/dropdown.md
@@ -47,7 +47,7 @@ select * from orders
select * from orders where id in ${inputs.multiple_selected_order_ids.value}
```
-
+
Orders of {inputs.multiple_selected_order_ids.label}
From 9d005bc264f16a6dc7d36fcb2d36461991f53e01 Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 27 Mar 2024 18:58:07 -0400
Subject: [PATCH 10/30] add anchor links to headers in preprocess
---
packages/lib/preprocess/index.cjs | 2 ++
packages/lib/preprocess/package.json | 1 +
.../tableofcontents/ContentsList.svelte | 19 +++++++----------
pnpm-lock.yaml | 21 +++++++++++++++++++
4 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/packages/lib/preprocess/index.cjs b/packages/lib/preprocess/index.cjs
index f41d866554..fa17c649c1 100644
--- a/packages/lib/preprocess/index.cjs
+++ b/packages/lib/preprocess/index.cjs
@@ -6,6 +6,7 @@ const addClasses = require('./src/add-classes.cjs');
// This is includes future proofing to add support for Prism highlighting
const processFrontmatter = require('./src/frontmatter/process-frontmatter.cjs');
const injectPartials = require('./src/partials/inject-partials.cjs');
+const remarkSlug = require('remark-slug');
module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
return [
@@ -23,6 +24,7 @@ module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
highlight: {
highlighter
},
+ remarkPlugins: [remarkSlug],
rehypePlugins: [
[
addClasses,
diff --git a/packages/lib/preprocess/package.json b/packages/lib/preprocess/package.json
index 627774198d..8bfa8ef92e 100644
--- a/packages/lib/preprocess/package.json
+++ b/packages/lib/preprocess/package.json
@@ -23,6 +23,7 @@
"mdsvex": "0.11.0",
"prismjs": "^1.29.0",
"remark-parse": "8.0.2",
+ "remark-slug": "6.1.0",
"svelte": "4.2.12",
"svelte-preprocess": "5.1.3",
"unified": "^9.1.0",
diff --git a/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte b/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
index 4dc68a7676..868e455165 100644
--- a/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
+++ b/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
@@ -5,11 +5,7 @@
let observer;
function updateLinks() {
- headers = Array.from(document.querySelectorAll('h1.markdown, h2.markdown'));
- headers.forEach((header, i) => {
- // Headers may contain values that change in response to user input, so we create our anchors as just the position on the page.
- header.id = encodeURIComponent(i + 1);
- });
+ headers = Array.from(document.querySelectorAll('h1.markdown, h2.markdown, h3.markdown'));
}
function observeDocumentChanges() {
@@ -38,11 +34,10 @@
On this page
- {#each headers as header, i}
+ {#each headers as header}
@@ -54,10 +49,6 @@
@apply block text-gray-600 text-xs transition-all duration-200 py-1;
}
- /* a.h1.first {
- @apply mt-0;
- } */
-
a:hover {
@apply underline;
}
@@ -66,6 +57,10 @@
@apply pl-0 text-gray-500;
}
+ a.h3 {
+ @apply pl-4 text-gray-500;
+ }
+
a.h1 {
@apply mt-3 font-semibold block bg-white shadow shadow-white;
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0a0409abc4..1fa0227216 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -697,6 +697,9 @@ importers:
remark-parse:
specifier: 8.0.2
version: 8.0.2
+ remark-slug:
+ specifier: 6.1.0
+ version: 6.1.0
svelte:
specifier: 4.2.12
version: 4.2.12
@@ -18017,6 +18020,10 @@ packages:
unist-util-visit: 2.0.3
dev: false
+ /mdast-util-to-string@1.1.0:
+ resolution: {integrity: sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==}
+ dev: false
+
/mdast-util-to-string@2.0.0:
resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==}
dev: false
@@ -19332,6 +19339,9 @@ packages:
resolution: {integrity: sha512-W+gxAq7aQ9dJIg/XLKGcRT0cvnStFAQHPaI0pvD0U2l6IVLueUAm3nwN7lkY62zZNmlvNx6jNtE4wlbS+CyqSg==}
engines: {node: '>= 12.0.0'}
hasBin: true
+ peerDependenciesMeta:
+ '@parcel/core':
+ optional: true
dependencies:
'@parcel/config-default': 2.12.0(@parcel/core@2.12.0)(postcss@8.4.38)(typescript@5.4.2)
'@parcel/core': 2.12.0
@@ -21133,6 +21143,14 @@ packages:
xtend: 4.0.2
dev: false
+ /remark-slug@6.1.0:
+ resolution: {integrity: sha512-oGCxDF9deA8phWvxFuyr3oSJsdyUAxMFbA0mZ7Y1Sas+emILtO+e5WutF9564gDsEN4IXaQXm5pFo6MLH+YmwQ==}
+ dependencies:
+ github-slugger: 1.5.0
+ mdast-util-to-string: 1.1.0
+ unist-util-visit: 2.0.3
+ dev: false
+
/remark-squeeze-paragraphs@4.0.0:
resolution: {integrity: sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw==}
dependencies:
@@ -21965,6 +21983,9 @@ packages:
/sqlite3@5.1.6:
resolution: {integrity: sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==}
requiresBuild: true
+ peerDependenciesMeta:
+ node-gyp:
+ optional: true
dependencies:
'@mapbox/node-pre-gyp': 1.0.11
node-addon-api: 4.3.0
From ac9a832bbfe76955c572fa2686e4c59c3c569a24 Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 27 Mar 2024 21:53:56 -0400
Subject: [PATCH 11/30] autolinks
---
packages/lib/preprocess/index.cjs | 7 ++++++-
packages/lib/preprocess/package.json | 1 +
pnpm-lock.yaml | 20 +++++++++++++++++++
.../src/pages/links-to-page-headers/+page.md | 4 ++++
4 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 sites/example-project/src/pages/links-to-page-headers/+page.md
diff --git a/packages/lib/preprocess/index.cjs b/packages/lib/preprocess/index.cjs
index fa17c649c1..24992a468c 100644
--- a/packages/lib/preprocess/index.cjs
+++ b/packages/lib/preprocess/index.cjs
@@ -7,6 +7,7 @@ const addClasses = require('./src/add-classes.cjs');
const processFrontmatter = require('./src/frontmatter/process-frontmatter.cjs');
const injectPartials = require('./src/partials/inject-partials.cjs');
const remarkSlug = require('remark-slug');
+const rehypeAutolinkHeadings = require('rehype-autolink-headings');
module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
return [
@@ -31,7 +32,11 @@ module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
{
'*': 'markdown'
}
- ]
+ ],
+ [rehypeAutolinkHeadings, {
+ behavior: 'wrap',
+ properties: {}
+ }],
]
}),
diff --git a/packages/lib/preprocess/package.json b/packages/lib/preprocess/package.json
index 8bfa8ef92e..72718f6678 100644
--- a/packages/lib/preprocess/package.json
+++ b/packages/lib/preprocess/package.json
@@ -24,6 +24,7 @@
"prismjs": "^1.29.0",
"remark-parse": "8.0.2",
"remark-slug": "6.1.0",
+ "rehype-autolink-headings": "5.1.0",
"svelte": "4.2.12",
"svelte-preprocess": "5.1.3",
"unified": "^9.1.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1fa0227216..8d76edb980 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -694,6 +694,9 @@ importers:
prismjs:
specifier: ^1.29.0
version: 1.29.0
+ rehype-autolink-headings:
+ specifier: 5.1.0
+ version: 5.1.0
remark-parse:
specifier: 8.0.2
version: 8.0.2
@@ -15467,10 +15470,18 @@ packages:
web-namespaces: 1.1.4
dev: false
+ /hast-util-has-property@1.0.4:
+ resolution: {integrity: sha512-ghHup2voGfgFoHMGnaLHOjbYFACKrRh9KFttdCzMCbFoBMJXiNi2+XTrPP8+q6cDJM/RSqlCfVWrjp1H201rZg==}
+ dev: false
+
/hast-util-has-property@2.0.1:
resolution: {integrity: sha512-X2+RwZIMTMKpXUzlotatPzWj8bspCymtXH3cfG3iQKV+wPF53Vgaqxi/eLqGck0wKq1kS9nvoB1wchbCPEL8sg==}
dev: false
+ /hast-util-heading-rank@1.0.1:
+ resolution: {integrity: sha512-P6Hq7RCky9syMevlrN90QWpqWDXCxwIVOfQR2rK6P4GpY4bqjKEuCzoWSRORZ7vz+VgRpLnXimh+mkwvVFjbyQ==}
+ dev: false
+
/hast-util-heading-rank@3.0.0:
resolution: {integrity: sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA==}
dependencies:
@@ -21027,6 +21038,15 @@ packages:
dependencies:
jsesc: 0.5.0
+ /rehype-autolink-headings@5.1.0:
+ resolution: {integrity: sha512-ujU4/ALnWLJQubobQaMdC0h9nkzi7HlW9SOuCxZOkkJqhc/TrQ1cigIjMFQ2Tfc/es0KiFopKvwCUGw7Gw+mFw==}
+ dependencies:
+ extend: 3.0.2
+ hast-util-has-property: 1.0.4
+ hast-util-heading-rank: 1.0.1
+ unist-util-visit: 2.0.3
+ dev: false
+
/rehype-external-links@3.0.0:
resolution: {integrity: sha512-yp+e5N9V3C6bwBeAC4n796kc86M4gJCdlVhiMTxIrJG5UHDMh+PJANf9heqORJbt1nrCbDwIlAZKjANIaVBbvw==}
dependencies:
diff --git a/sites/example-project/src/pages/links-to-page-headers/+page.md b/sites/example-project/src/pages/links-to-page-headers/+page.md
new file mode 100644
index 0000000000..b1f57b2d23
--- /dev/null
+++ b/sites/example-project/src/pages/links-to-page-headers/+page.md
@@ -0,0 +1,4 @@
+
+Doesn't currently work
+
+[Deep in the text](/text-and-metrics/text#more-nostra-non-parsque-talia-discussit)
\ No newline at end of file
From 3b0a5720f8bf4c82e25f81d1417c9f9e7793a63f Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 27 Mar 2024 22:00:05 -0400
Subject: [PATCH 12/30] rehype not remark
---
packages/lib/preprocess/index.cjs | 11 ++++------
packages/lib/preprocess/package.json | 2 +-
pnpm-lock.yaml | 32 +++++++++++++++-------------
3 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/packages/lib/preprocess/index.cjs b/packages/lib/preprocess/index.cjs
index 24992a468c..a865a29ee9 100644
--- a/packages/lib/preprocess/index.cjs
+++ b/packages/lib/preprocess/index.cjs
@@ -6,7 +6,7 @@ const addClasses = require('./src/add-classes.cjs');
// This is includes future proofing to add support for Prism highlighting
const processFrontmatter = require('./src/frontmatter/process-frontmatter.cjs');
const injectPartials = require('./src/partials/inject-partials.cjs');
-const remarkSlug = require('remark-slug');
+const rehypeSlug = require('rehype-slug');
const rehypeAutolinkHeadings = require('rehype-autolink-headings');
module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
@@ -25,14 +25,11 @@ module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
highlight: {
highlighter
},
- remarkPlugins: [remarkSlug],
rehypePlugins: [
- [
- addClasses,
- {
+ [addClasses, {
'*': 'markdown'
- }
- ],
+ }],
+ [rehypeSlug],
[rehypeAutolinkHeadings, {
behavior: 'wrap',
properties: {}
diff --git a/packages/lib/preprocess/package.json b/packages/lib/preprocess/package.json
index 72718f6678..03b0e6a384 100644
--- a/packages/lib/preprocess/package.json
+++ b/packages/lib/preprocess/package.json
@@ -23,7 +23,7 @@
"mdsvex": "0.11.0",
"prismjs": "^1.29.0",
"remark-parse": "8.0.2",
- "remark-slug": "6.1.0",
+ "rehype-slug": "4.0.1",
"rehype-autolink-headings": "5.1.0",
"svelte": "4.2.12",
"svelte-preprocess": "5.1.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8d76edb980..65e57e270b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -697,12 +697,12 @@ importers:
rehype-autolink-headings:
specifier: 5.1.0
version: 5.1.0
+ rehype-slug:
+ specifier: 4.0.1
+ version: 4.0.1
remark-parse:
specifier: 8.0.2
version: 8.0.2
- remark-slug:
- specifier: 6.1.0
- version: 6.1.0
svelte:
specifier: 4.2.12
version: 4.2.12
@@ -15547,6 +15547,10 @@ packages:
zwitch: 1.0.5
dev: false
+ /hast-util-to-string@1.0.4:
+ resolution: {integrity: sha512-eK0MxRX47AV2eZ+Lyr18DCpQgodvaS3fAQO2+b9Two9F5HEoRPhiUMNzoXArMJfZi2yieFzUBMRl3HNJ3Jus3w==}
+ dev: false
+
/hast-util-to-string@2.0.0:
resolution: {integrity: sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A==}
dependencies:
@@ -18031,10 +18035,6 @@ packages:
unist-util-visit: 2.0.3
dev: false
- /mdast-util-to-string@1.1.0:
- resolution: {integrity: sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==}
- dev: false
-
/mdast-util-to-string@2.0.0:
resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==}
dev: false
@@ -21076,6 +21076,16 @@ packages:
parse5: 6.0.1
dev: false
+ /rehype-slug@4.0.1:
+ resolution: {integrity: sha512-KIlJALf9WfHFF21icwTd2yI2IP+RQRweaxH9ChVGQwRYy36+hiomG4ZSe0yQRyCt+D/vE39LbAcOI/h4O4GPhA==}
+ dependencies:
+ github-slugger: 1.5.0
+ hast-util-has-property: 1.0.4
+ hast-util-heading-rank: 1.0.1
+ hast-util-to-string: 1.0.4
+ unist-util-visit: 2.0.3
+ dev: false
+
/rehype-slug@6.0.0:
resolution: {integrity: sha512-lWyvf/jwu+oS5+hL5eClVd3hNdmwM1kAC0BUvEGD19pajQMIzcNUd/k9GsfQ+FfECvX+JE+e9/btsKH0EjJT6A==}
dependencies:
@@ -21163,14 +21173,6 @@ packages:
xtend: 4.0.2
dev: false
- /remark-slug@6.1.0:
- resolution: {integrity: sha512-oGCxDF9deA8phWvxFuyr3oSJsdyUAxMFbA0mZ7Y1Sas+emILtO+e5WutF9564gDsEN4IXaQXm5pFo6MLH+YmwQ==}
- dependencies:
- github-slugger: 1.5.0
- mdast-util-to-string: 1.1.0
- unist-util-visit: 2.0.3
- dev: false
-
/remark-squeeze-paragraphs@4.0.0:
resolution: {integrity: sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw==}
dependencies:
From e1e9a0687ec8d37a5de3b76f7fd3c1eb12cfdf16 Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 27 Mar 2024 22:17:36 -0400
Subject: [PATCH 13/30] changeset
---
.changeset/sharp-years-film.md | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 .changeset/sharp-years-film.md
diff --git a/.changeset/sharp-years-film.md b/.changeset/sharp-years-film.md
new file mode 100644
index 0000000000..57b16743a0
--- /dev/null
+++ b/.changeset/sharp-years-film.md
@@ -0,0 +1,6 @@
+---
+'@evidence-dev/preprocess': patch
+'@evidence-dev/core-components': patch
+---
+
+Add automatic links to headers
From e3cfb89a9a6bcc72ceb51a447405294a6c547863 Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 27 Mar 2024 22:28:44 -0400
Subject: [PATCH 14/30] format
---
packages/lib/preprocess/index.cjs | 18 ++++++++++++------
.../layout/tableofcontents/ContentsList.svelte | 5 +----
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/packages/lib/preprocess/index.cjs b/packages/lib/preprocess/index.cjs
index a865a29ee9..62270c41ce 100644
--- a/packages/lib/preprocess/index.cjs
+++ b/packages/lib/preprocess/index.cjs
@@ -26,14 +26,20 @@ module.exports = function evidencePreprocess(componentDevelopmentMode = false) {
highlighter
},
rehypePlugins: [
- [addClasses, {
+ [
+ addClasses,
+ {
'*': 'markdown'
- }],
+ }
+ ],
[rehypeSlug],
- [rehypeAutolinkHeadings, {
- behavior: 'wrap',
- properties: {}
- }],
+ [
+ rehypeAutolinkHeadings,
+ {
+ behavior: 'wrap',
+ properties: {}
+ }
+ ]
]
}),
diff --git a/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte b/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
index 868e455165..eede04f22a 100644
--- a/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
+++ b/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
@@ -35,10 +35,7 @@
On this page
{#each headers as header}
-
{/each}
From 673e1553d86f919ca802bb654f49a4bdde2435bc Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Thu, 28 Mar 2024 01:40:15 -0400
Subject: [PATCH 15/30] add `disableSelectAll`, docs
---
.../lib/atoms/inputs/dropdown/Dropdown.svelte | 27 ++++++++++---------
sites/docs/docs/components/dropdown.md | 9 ++++++-
2 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
index 1aa911788f..a53508042c 100644
--- a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
+++ b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/Dropdown.svelte
@@ -48,14 +48,13 @@
export let hideDuringPrint = true;
+ export let disableSelectAll = false;
+
/** @type {string | string[]} */
export let defaultValue = [];
const _defaultValue = Array.isArray(defaultValue) ? defaultValue : [defaultValue];
- /** @type {boolean} */
export let noDefault = false;
- noDefault = noDefault === true || noDefault === 'true';
-
if (noDefault) {
_defaultValue.length = 0;
}
@@ -267,16 +266,18 @@
{/if}
{#if multiple}
-
- {
- $selectedValues = $items.map((x) => ({ label: x.label, value: x.value }));
- selectedValuesToInput();
- }}
- >
- Select all
-
+ {#if !disableSelectAll}
+
+ {
+ $selectedValues = $items.map((x) => ({ label: x.label, value: x.value }));
+ selectedValuesToInput();
+ }}
+ >
+ Select all
+
+ {/if}
No
true | false |
false |
+
+
+ disableSelectAll |
+ Removes the `Select all` button. Recommended for large datasets. |
+ No |
+ true | false |
+ false |
multiple |
Enables multi-select which returns a list |
No |
- boolean |
+ true | false |
false |
From 079c67a3e00a1ba8a42b80ee06fa4fadcf910e92 Mon Sep 17 00:00:00 2001
From: Tobias Hoffmann
Date: Fri, 29 Mar 2024 16:18:12 +0100
Subject: [PATCH 16/30] fix echarts options update
---
packages/lib/component-utilities/src/echarts.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/lib/component-utilities/src/echarts.js b/packages/lib/component-utilities/src/echarts.js
index 9318df32b1..7f1309745f 100644
--- a/packages/lib/component-utilities/src/echarts.js
+++ b/packages/lib/component-utilities/src/echarts.js
@@ -163,7 +163,8 @@ export default (node, option) => {
}
};
- const updateChart = (option) => {
+ const updateChart = (newOption) => {
+ option = newOption;
chart.setOption(
{
...option.config,
From 32c3a1e5e77474ce27df0480672955919c92920b Mon Sep 17 00:00:00 2001
From: Tobias Hoffmann
Date: Fri, 29 Mar 2024 16:22:43 +0100
Subject: [PATCH 17/30] source sql ending in a line comment need final newline
---
packages/lib/db-commons/index.cjs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/lib/db-commons/index.cjs b/packages/lib/db-commons/index.cjs
index b84f0e31a0..c7b55ce8e3 100644
--- a/packages/lib/db-commons/index.cjs
+++ b/packages/lib/db-commons/index.cjs
@@ -186,7 +186,8 @@ const cleanQuery = (query) => {
let cleanedString = query.trim();
if (cleanedString.endsWith(';'))
cleanedString = cleanedString.substring(0, cleanedString.length - 1);
- return cleanedString;
+ // query might end with a line comment, which has to be ended
+ return cleanedString + '\n';
};
/**
From a3048ed9d88c59d075d70f783cb9b03b819ee2b6 Mon Sep 17 00:00:00 2001
From: Tobias Hoffmann
Date: Fri, 29 Mar 2024 17:11:19 +0100
Subject: [PATCH 18/30] postgres: extract json columns as string instead of
[Object object]
---
packages/datasources/postgres/index.cjs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/datasources/postgres/index.cjs b/packages/datasources/postgres/index.cjs
index cd05b2e17e..95a41b09ba 100644
--- a/packages/datasources/postgres/index.cjs
+++ b/packages/datasources/postgres/index.cjs
@@ -125,7 +125,7 @@ const runQuery = async (queryString, database, batchSize = 100000, closeBeforeRe
// to avoid loss of accuracy in very large numbers. This is something to keep an eye on,
// but for now, we are replacing the default parsing functions with the applicable
// JavaScript parsing function for each data type:
- var types = require('pg').types;
+ var types = pg.types;
// Override bigint:
types.setTypeParser(20, function (val) {
@@ -142,6 +142,10 @@ const runQuery = async (queryString, database, batchSize = 100000, closeBeforeRe
return parseFloat(val.replace(/[^0-9.]/g, ''));
});
+ // Override json / jsonb:
+ types.setTypeParser(types.builtins.JSON, String);
+ types.setTypeParser(types.builtins.JSONB, String);
+
var pool = new Pool(credentials);
// Set schema if specified. Can't be done using the connection string / credentials. See issue: https://github.com/brianc/node-postgres/issues/1123#issuecomment-501510375 & solution: https://node-postgres.com/apis/pool#events
From 47fdbdef380ad9888f98d37b45a9c349a5467839 Mon Sep 17 00:00:00 2001
From: Tobias Hoffmann
Date: Fri, 29 Mar 2024 17:16:21 +0100
Subject: [PATCH 19/30] universal-sql: allow duckdb json columns (as string)
(for duckdb versions w/ json support, i.e. >= 1.28.1-dev...)
---
packages/lib/universal-sql/src/calculateScore.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/lib/universal-sql/src/calculateScore.js b/packages/lib/universal-sql/src/calculateScore.js
index c26bf747b5..6466a68df2 100644
--- a/packages/lib/universal-sql/src/calculateScore.js
+++ b/packages/lib/universal-sql/src/calculateScore.js
@@ -108,6 +108,7 @@ export function duckdbTypeToEvidenceType(column_type) {
case 'TIME':
case 'TIME WITH TIME ZONE': // return 'bigint';
case 'BLOB':
+ case 'JSON':
case 'BIT': // return 'Uint8Array';
return 'string';
default:
From d98b79942e9fb673b917ace8fc8948de3f8f5721 Mon Sep 17 00:00:00 2001
From: Tobias Hoffmann
Date: Fri, 29 Mar 2024 17:31:07 +0100
Subject: [PATCH 20/30] standardizeResult should also be applied to first batch
---
packages/datasources/postgres/index.cjs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/datasources/postgres/index.cjs b/packages/datasources/postgres/index.cjs
index cd05b2e17e..870759008e 100644
--- a/packages/datasources/postgres/index.cjs
+++ b/packages/datasources/postgres/index.cjs
@@ -168,7 +168,7 @@ const runQuery = async (queryString, database, batchSize = 100000, closeBeforeRe
return {
rows: async function* () {
try {
- yield firstBatch;
+ yield standardizeResult(firstBatch);
let results;
while ((results = await cursor.read(batchSize)) && results.length > 0)
yield standardizeResult(results);
From 246085683d4bacece96b067b0eeb20ab5335bb34 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Mon, 1 Apr 2024 15:25:39 -0400
Subject: [PATCH 21/30] add example `disableSelectAll` usage
---
sites/test-env/pages/dropdown.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sites/test-env/pages/dropdown.md b/sites/test-env/pages/dropdown.md
index cf4fb1ff63..f89d1d3d06 100644
--- a/sites/test-env/pages/dropdown.md
+++ b/sites/test-env/pages/dropdown.md
@@ -47,7 +47,7 @@ select * from orders
select * from orders where id in ${inputs.multiple_selected_order_ids.value}
```
-
+
Orders of {inputs.multiple_selected_order_ids.label}
From 20c3fd6db3fd870d6d57dfefe597bd7c2201c0d8 Mon Sep 17 00:00:00 2001
From: Archie Sarre Wood <58074498+archiewood@users.noreply.github.com>
Date: Fri, 5 Apr 2024 14:34:34 -0400
Subject: [PATCH 22/30] Update
packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
Co-authored-by: csjh <61282104+csjh@users.noreply.github.com>
---
.../lib/organisms/layout/tableofcontents/ContentsList.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte b/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
index eede04f22a..2bb5bb92b1 100644
--- a/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
+++ b/packages/ui/core-components/src/lib/organisms/layout/tableofcontents/ContentsList.svelte
@@ -35,7 +35,7 @@
On this page
{#each headers as header}
-
{/each}
From 050de6f2546f980906c5f5cb3da8af20daf7e1bf Mon Sep 17 00:00:00 2001
From: Archie Sarre Wood <58074498+archiewood@users.noreply.github.com>
Date: Fri, 5 Apr 2024 14:35:33 -0400
Subject: [PATCH 23/30] Delete
sites/example-project/src/pages/links-to-page-headers/+page.md
---
.../example-project/src/pages/links-to-page-headers/+page.md | 4 ----
1 file changed, 4 deletions(-)
delete mode 100644 sites/example-project/src/pages/links-to-page-headers/+page.md
diff --git a/sites/example-project/src/pages/links-to-page-headers/+page.md b/sites/example-project/src/pages/links-to-page-headers/+page.md
deleted file mode 100644
index b1f57b2d23..0000000000
--- a/sites/example-project/src/pages/links-to-page-headers/+page.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Doesn't currently work
-
-[Deep in the text](/text-and-metrics/text#more-nostra-non-parsque-talia-discussit)
\ No newline at end of file
From 1da26c4e6082190dbdacfa23696498198032a376 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Tue, 9 Apr 2024 17:51:19 -0400
Subject: [PATCH 24/30] changeset
---
.changeset/funny-falcons-act.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 .changeset/funny-falcons-act.md
diff --git a/.changeset/funny-falcons-act.md b/.changeset/funny-falcons-act.md
new file mode 100644
index 0000000000..aebeea4f48
--- /dev/null
+++ b/.changeset/funny-falcons-act.md
@@ -0,0 +1,5 @@
+---
+'@evidence-dev/db-commons': patch
+---
+
+add more leniency for comments in queries
From 5e0bbf31b0909e836c433f9ab57d0499bd7137c8 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 10 Apr 2024 13:50:37 -0400
Subject: [PATCH 25/30] changeset
---
.changeset/pretty-jobs-wait.md | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 .changeset/pretty-jobs-wait.md
diff --git a/.changeset/pretty-jobs-wait.md b/.changeset/pretty-jobs-wait.md
new file mode 100644
index 0000000000..3abb6ccd52
--- /dev/null
+++ b/.changeset/pretty-jobs-wait.md
@@ -0,0 +1,6 @@
+---
+'@evidence-dev/postgres': patch
+'@evidence-dev/universal-sql': patch
+---
+
+stop blocking advanced usage of json with usql
From 629f93a07a3b461935da61c7ed758a51696efe6f Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 10 Apr 2024 16:00:10 -0400
Subject: [PATCH 26/30] changeset
---
.changeset/silver-tools-serve.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 .changeset/silver-tools-serve.md
diff --git a/.changeset/silver-tools-serve.md b/.changeset/silver-tools-serve.md
new file mode 100644
index 0000000000..9d71b9564f
--- /dev/null
+++ b/.changeset/silver-tools-serve.md
@@ -0,0 +1,5 @@
+---
+'@evidence-dev/component-utilities': patch
+---
+
+properly update `option` for other functions to use
From e2176af7d30196c477710d1fb891642b24e39a63 Mon Sep 17 00:00:00 2001
From: csjh <61282104+csjh@users.noreply.github.com>
Date: Wed, 10 Apr 2024 16:02:24 -0400
Subject: [PATCH 27/30] changeset
---
.changeset/hungry-chefs-wave.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 .changeset/hungry-chefs-wave.md
diff --git a/.changeset/hungry-chefs-wave.md b/.changeset/hungry-chefs-wave.md
new file mode 100644
index 0000000000..46f7723962
--- /dev/null
+++ b/.changeset/hungry-chefs-wave.md
@@ -0,0 +1,5 @@
+---
+'@evidence-dev/postgres': patch
+---
+
+apply `standardizeResult` to first batch of postgres results
From 09824e5c73d35621c2911b9152eeaae1b6ac6213 Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 10 Apr 2024 21:56:13 -0400
Subject: [PATCH 28/30] allow raw HTML to be rendered in tables with html
contentType
---
.../core-components/src/lib/unsorted/viz/table/TableRow.svelte | 2 ++
1 file changed, 2 insertions(+)
diff --git a/packages/ui/core-components/src/lib/unsorted/viz/table/TableRow.svelte b/packages/ui/core-components/src/lib/unsorted/viz/table/TableRow.svelte
index f2723f2b53..4b5056543d 100644
--- a/packages/ui/core-components/src/lib/unsorted/viz/table/TableRow.svelte
+++ b/packages/ui/core-components/src/lib/unsorted/viz/table/TableRow.svelte
@@ -161,6 +161,8 @@
neutralMax={column.neutralMax}
chip={column.chip}
/>
+ {:else if column.contentType === 'html' && row[column.id] !== undefined}
+ {@html row[column.id]}
{:else}
{formatValue(
row[column.id],
From 505f121b665789337924e2217515c8239a3260ea Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 10 Apr 2024 22:11:34 -0400
Subject: [PATCH 29/30] changeset
---
.changeset/smart-dryers-hunt.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 .changeset/smart-dryers-hunt.md
diff --git a/.changeset/smart-dryers-hunt.md b/.changeset/smart-dryers-hunt.md
new file mode 100644
index 0000000000..b2d91a84be
--- /dev/null
+++ b/.changeset/smart-dryers-hunt.md
@@ -0,0 +1,5 @@
+---
+'@evidence-dev/core-components': patch
+---
+
+Adds support for HTML contentType in DataTables
From 5098c3eec9c9557e3a9ae104f7d072cadf9d2a60 Mon Sep 17 00:00:00 2001
From: Archie Wood <58074498+archiewood@users.noreply.github.com>
Date: Wed, 10 Apr 2024 23:14:01 -0400
Subject: [PATCH 30/30] maintain correct sizing for bold, italic,
strikethrough, code spans
---
.changeset/smooth-boats-tell.md | 5 +++++
sites/example-project/src/app.css | 14 +++++++++++++-
.../src/pages/text-and-metrics/markdown/+page.md | 12 ++++++++++--
3 files changed, 28 insertions(+), 3 deletions(-)
create mode 100644 .changeset/smooth-boats-tell.md
diff --git a/.changeset/smooth-boats-tell.md b/.changeset/smooth-boats-tell.md
new file mode 100644
index 0000000000..30d6435e67
--- /dev/null
+++ b/.changeset/smooth-boats-tell.md
@@ -0,0 +1,5 @@
+---
+'@evidence-dev/core-components': patch
+---
+
+Fixes bold, italic, strikethrough and code span sizing issues in markdown
diff --git a/sites/example-project/src/app.css b/sites/example-project/src/app.css
index 88e19df552..c541f829a1 100644
--- a/sites/example-project/src/app.css
+++ b/sites/example-project/src/app.css
@@ -172,7 +172,7 @@
}
code.markdown {
- @apply font-mono text-gray-800 text-sm bg-gray-50 border rounded px-1 select-all py-0.5;
+ @apply font-mono text-gray-800 text-[0.875em] bg-gray-50 border rounded px-1 select-all py-0.5;
}
form code {
@@ -186,6 +186,18 @@
blockquote.markdown * {
@apply text-gray-500;
}
+ /* Ensure size and color are maintained for bold, italic, strikethrough */
+ strong.markdown {
+ @apply text-[1em] text-inherit;
+ }
+
+ em.markdown {
+ @apply text-[1em] text-inherit;
+ }
+
+ del.markdown {
+ @apply text-[1em] text-inherit;
+ }
table.markdown {
@apply min-w-full border-collapse text-center mx-auto my-5;
diff --git a/sites/example-project/src/pages/text-and-metrics/markdown/+page.md b/sites/example-project/src/pages/text-and-metrics/markdown/+page.md
index 27d8bfb65f..010ccf8c47 100644
--- a/sites/example-project/src/pages/text-and-metrics/markdown/+page.md
+++ b/sites/example-project/src/pages/text-and-metrics/markdown/+page.md
@@ -15,6 +15,14 @@ title: Markdown
###### Heading Level 6
+# ~~Heading Level 1 with Strikethrough~~
+
+# Heading Level 1 with _Italics_
+
+# Heading Level 1 with **Bold**
+
+# Heading Level 1 with `code`
+
# Link Headers
# [Link h1](/)
@@ -67,7 +75,7 @@ _Italic_
~~Strikethrough~~
Textsuperscript
Textsubscript
-Underline
+# This is Underline and **Bold**
## Highlighting
@@ -140,7 +148,7 @@ Link to [Google](https://google.com)
| Column One | Column Two | Column Three |
| :--------: | :--------: | :----------: |
-| A | B | C |
+| A `with code` | B | C |
| 1 | 2 | 3 |
| D | E | F |
| 4 | 5 | 6 |