@zikojs/notebook 0.15.0 → 0.15.1

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.
@@ -1,91 +1,91 @@
1
- /* --- MARKDOWN --- */
2
-
3
- .ziko-notebook .markdown-rendered-cell {
4
- flex: 1 1 0;
5
- min-width: 0;
6
- padding: 8px 12px;
7
- cursor: pointer;
8
- min-height: 38px;
9
- border: 1px dashed transparent;
10
- border-radius: 4px;
11
- transition: background 0.15s ease, border-color 0.15s ease;
12
- }
13
-
14
- .ziko-notebook .markdown-rendered-cell:hover {
15
- background: #f8fafc;
16
- border-color: #cbd5e1;
17
- }
18
-
19
- .ziko-notebook .cell.active .markdown-rendered-cell {
20
- border-color: #94a3b8;
21
- }
22
-
23
- .ziko-notebook .markdown-body {
24
- line-height: 1.6;
25
- }
26
-
27
- .ziko-notebook .markdown-body h1,
28
- .ziko-notebook .markdown-body h2,
29
- .ziko-notebook .markdown-body h3 {
30
- margin-top: 8px;
31
- margin-bottom: 8px;
32
- font-weight: 600;
33
- }
34
-
35
- .ziko-notebook .markdown-body h1 {
36
- font-size: 1.5em;
37
- border-bottom: 1px solid var(--border-color);
38
- padding-bottom: 4px;
39
- }
40
-
41
- .ziko-notebook .markdown-body h2 {
42
- font-size: 1.25em;
43
- }
44
-
45
- .ziko-notebook .markdown-body h3 {
46
- font-size: 1.1em;
47
- }
48
-
49
- .ziko-notebook .markdown-body p {
50
- margin-bottom: 8px;
51
- }
52
-
53
- .ziko-notebook .markdown-body p:last-child {
54
- margin-bottom: 0;
55
- }
56
-
57
- .ziko-notebook .markdown-body ul,
58
- .ziko-notebook .markdown-body ol {
59
- padding-left: 20px;
60
- margin-bottom: 8px;
61
- }
62
-
63
- .ziko-notebook .markdown-body code {
64
- background: #f1f5f9;
65
- padding: 2px 4px;
66
- border-radius: 4px;
67
- font-family: ui-monospace, SFMono-Regular, monospace;
68
- font-size: 0.9em;
69
- }
70
-
71
- .ziko-notebook .markdown-body pre {
72
- background: #1e293b;
73
- color: #f8fafc;
74
- padding: 10px;
75
- border-radius: 6px;
76
- overflow-x: auto;
77
- margin: 8px 0;
78
- }
79
-
80
- .ziko-notebook .markdown-body pre code {
81
- background: transparent;
82
- color: inherit;
83
- padding: 0;
84
- }
85
-
86
- .ziko-notebook .markdown-body blockquote {
87
- border-left: 4px solid var(--primary);
88
- padding-left: 10px;
89
- color: #64748b;
90
- margin: 8px 0;
91
- }
1
+ /* --- MARKDOWN --- */
2
+
3
+ .ziko-notebook .markdown-rendered-cell {
4
+ flex: 1 1 0;
5
+ min-width: 0;
6
+ padding: 8px 12px;
7
+ cursor: pointer;
8
+ min-height: 38px;
9
+ border: 1px dashed transparent;
10
+ border-radius: 4px;
11
+ transition: background 0.15s ease, border-color 0.15s ease;
12
+ }
13
+
14
+ .ziko-notebook .markdown-rendered-cell:hover {
15
+ background: #f8fafc;
16
+ border-color: #cbd5e1;
17
+ }
18
+
19
+ .ziko-notebook .cell.active .markdown-rendered-cell {
20
+ border-color: #94a3b8;
21
+ }
22
+
23
+ .ziko-notebook .markdown-body {
24
+ line-height: 1.6;
25
+ }
26
+
27
+ .ziko-notebook .markdown-body h1,
28
+ .ziko-notebook .markdown-body h2,
29
+ .ziko-notebook .markdown-body h3 {
30
+ margin-top: 8px;
31
+ margin-bottom: 8px;
32
+ font-weight: 600;
33
+ }
34
+
35
+ .ziko-notebook .markdown-body h1 {
36
+ font-size: 1.5em;
37
+ border-bottom: 1px solid var(--border-color);
38
+ padding-bottom: 4px;
39
+ }
40
+
41
+ .ziko-notebook .markdown-body h2 {
42
+ font-size: 1.25em;
43
+ }
44
+
45
+ .ziko-notebook .markdown-body h3 {
46
+ font-size: 1.1em;
47
+ }
48
+
49
+ .ziko-notebook .markdown-body p {
50
+ margin-bottom: 8px;
51
+ }
52
+
53
+ .ziko-notebook .markdown-body p:last-child {
54
+ margin-bottom: 0;
55
+ }
56
+
57
+ .ziko-notebook .markdown-body ul,
58
+ .ziko-notebook .markdown-body ol {
59
+ padding-left: 20px;
60
+ margin-bottom: 8px;
61
+ }
62
+
63
+ .ziko-notebook .markdown-body code {
64
+ background: #f1f5f9;
65
+ padding: 2px 4px;
66
+ border-radius: 4px;
67
+ font-family: ui-monospace, SFMono-Regular, monospace;
68
+ font-size: 0.9em;
69
+ }
70
+
71
+ .ziko-notebook .markdown-body pre {
72
+ background: #1e293b;
73
+ color: #f8fafc;
74
+ padding: 10px;
75
+ border-radius: 6px;
76
+ overflow-x: auto;
77
+ margin: 8px 0;
78
+ }
79
+
80
+ .ziko-notebook .markdown-body pre code {
81
+ background: transparent;
82
+ color: inherit;
83
+ padding: 0;
84
+ }
85
+
86
+ .ziko-notebook .markdown-body blockquote {
87
+ border-left: 4px solid var(--primary);
88
+ padding-left: 10px;
89
+ color: #64748b;
90
+ margin: 8px 0;
91
+ }
@@ -1,135 +1,135 @@
1
- import { remark } from "remark";
2
- import remarkRehype from "remark-rehype";
3
- import rehypeStringify from "rehype-stringify";
4
-
5
- import { tags } from "ziko/dom";
6
-
7
- const { div } = tags;
8
-
9
- export function MarkdownView({
10
- cellData,
11
- actions,
12
- remarkPlugins = [],
13
- rehypePlugins = [],
14
- }) {
15
- const content = div();
16
-
17
- remark()
18
- .use(remarkPlugins)
19
- .use(remarkRehype, { allowDangerousHtml: true })
20
- .use(rehypePlugins)
21
- .use(rehypeStringify)
22
- .process(cellData.code || "*Empty Markdown Cell*")
23
- .then((file) => {
24
- content.element.innerHTML = String(file);
25
- })
26
- .catch((err) => {
27
- content.element.innerHTML =
28
- `<div class="error-output">Markdown rendering error: ${err.message}</div>`;
29
- });
30
-
31
- const wrap = div(
32
- { class: "markdown-rendered-cell markdown-body" },
33
- content
34
- );
35
-
36
- wrap.element.addEventListener("dblclick", () =>
37
- actions.editMarkdown()
38
- );
39
-
40
- return wrap.element;
41
- }
42
-
43
-
44
-
45
- // import { remark } from "remark";
46
- // import remarkRehype from "remark-rehype";
47
- // import rehypeStringify from "rehype-stringify";
48
-
49
- // import { tags } from "ziko/dom";
50
-
51
- // const { div } = tags;
52
-
53
- // /**
54
- // * Activate elements inserted through innerHTML.
55
- // *
56
- // * Scripts created by innerHTML are inert, so recreate them
57
- // * as real DOM nodes. This also handles external scripts.
58
- // */
59
- // async function activateHTML(container) {
60
- // const scripts = [
61
- // ...container.querySelectorAll("script"),
62
- // ];
63
-
64
- // for (const oldScript of scripts) {
65
- // const script = document.createElement("script");
66
-
67
- // for (const attribute of oldScript.attributes) {
68
- // script.setAttribute(
69
- // attribute.name,
70
- // attribute.value
71
- // );
72
- // }
73
-
74
- // script.textContent = oldScript.textContent;
75
-
76
- // oldScript.replaceWith(script);
77
-
78
- // if (script.src) {
79
- // await new Promise((resolve, reject) => {
80
- // script.addEventListener(
81
- // "load",
82
- // resolve,
83
- // { once: true }
84
- // );
85
-
86
- // script.addEventListener(
87
- // "error",
88
- // reject,
89
- // { once: true }
90
- // );
91
- // });
92
- // }
93
- // }
94
- // }
95
-
96
- // export function MarkdownView({
97
- // cellData,
98
- // actions,
99
- // remarkPlugins = [],
100
- // rehypePlugins = [],
101
- // }) {
102
- // const content = div();
103
-
104
- // remark()
105
- // .use(remarkPlugins)
106
- // .use(remarkRehype, {
107
- // allowDangerousHtml: true,
108
- // })
109
- // .use(rehypePlugins)
110
- // .use(rehypeStringify)
111
- // .process(cellData.code || "*Empty Markdown Cell*")
112
- // .then(async (file) => {
113
- // content.element.innerHTML = String(file);
114
-
115
- // await activateHTML(content.element);
116
- // })
117
- // .catch((err) => {
118
- // content.element.innerHTML = `
119
- // <div class="error-output">
120
- // Markdown rendering error: ${err.message}
121
- // </div>
122
- // `;
123
- // });
124
-
125
- // const wrap = div(
126
- // {
127
- // class: "markdown-rendered-cell markdown-body",
128
- // },
129
- // content
130
- // );
131
-
132
- // wrap.onClick(() => actions.editMarkdown());
133
-
134
- // return wrap.element;
1
+ import { remark } from "remark";
2
+ import remarkRehype from "remark-rehype";
3
+ import rehypeStringify from "rehype-stringify";
4
+
5
+ import { tags } from "ziko/dom";
6
+
7
+ const { div } = tags;
8
+
9
+ export function MarkdownView({
10
+ cellData,
11
+ actions,
12
+ remarkPlugins = [],
13
+ rehypePlugins = [],
14
+ }) {
15
+ const content = div();
16
+
17
+ remark()
18
+ .use(remarkPlugins)
19
+ .use(remarkRehype, { allowDangerousHtml: true })
20
+ .use(rehypePlugins)
21
+ .use(rehypeStringify)
22
+ .process(cellData.code || "*Empty Markdown Cell*")
23
+ .then((file) => {
24
+ content.element.innerHTML = String(file);
25
+ })
26
+ .catch((err) => {
27
+ content.element.innerHTML =
28
+ `<div class="error-output">Markdown rendering error: ${err.message}</div>`;
29
+ });
30
+
31
+ const wrap = div(
32
+ { class: "markdown-rendered-cell markdown-body" },
33
+ content
34
+ );
35
+
36
+ wrap.element.addEventListener("dblclick", () =>
37
+ actions.editMarkdown()
38
+ );
39
+
40
+ return wrap.element;
41
+ }
42
+
43
+
44
+
45
+ // import { remark } from "remark";
46
+ // import remarkRehype from "remark-rehype";
47
+ // import rehypeStringify from "rehype-stringify";
48
+
49
+ // import { tags } from "ziko/dom";
50
+
51
+ // const { div } = tags;
52
+
53
+ // /**
54
+ // * Activate elements inserted through innerHTML.
55
+ // *
56
+ // * Scripts created by innerHTML are inert, so recreate them
57
+ // * as real DOM nodes. This also handles external scripts.
58
+ // */
59
+ // async function activateHTML(container) {
60
+ // const scripts = [
61
+ // ...container.querySelectorAll("script"),
62
+ // ];
63
+
64
+ // for (const oldScript of scripts) {
65
+ // const script = document.createElement("script");
66
+
67
+ // for (const attribute of oldScript.attributes) {
68
+ // script.setAttribute(
69
+ // attribute.name,
70
+ // attribute.value
71
+ // );
72
+ // }
73
+
74
+ // script.textContent = oldScript.textContent;
75
+
76
+ // oldScript.replaceWith(script);
77
+
78
+ // if (script.src) {
79
+ // await new Promise((resolve, reject) => {
80
+ // script.addEventListener(
81
+ // "load",
82
+ // resolve,
83
+ // { once: true }
84
+ // );
85
+
86
+ // script.addEventListener(
87
+ // "error",
88
+ // reject,
89
+ // { once: true }
90
+ // );
91
+ // });
92
+ // }
93
+ // }
94
+ // }
95
+
96
+ // export function MarkdownView({
97
+ // cellData,
98
+ // actions,
99
+ // remarkPlugins = [],
100
+ // rehypePlugins = [],
101
+ // }) {
102
+ // const content = div();
103
+
104
+ // remark()
105
+ // .use(remarkPlugins)
106
+ // .use(remarkRehype, {
107
+ // allowDangerousHtml: true,
108
+ // })
109
+ // .use(rehypePlugins)
110
+ // .use(rehypeStringify)
111
+ // .process(cellData.code || "*Empty Markdown Cell*")
112
+ // .then(async (file) => {
113
+ // content.element.innerHTML = String(file);
114
+
115
+ // await activateHTML(content.element);
116
+ // })
117
+ // .catch((err) => {
118
+ // content.element.innerHTML = `
119
+ // <div class="error-output">
120
+ // Markdown rendering error: ${err.message}
121
+ // </div>
122
+ // `;
123
+ // });
124
+
125
+ // const wrap = div(
126
+ // {
127
+ // class: "markdown-rendered-cell markdown-body",
128
+ // },
129
+ // content
130
+ // );
131
+
132
+ // wrap.onClick(() => actions.editMarkdown());
133
+
134
+ // return wrap.element;
135
135
  // }
@@ -1,31 +1,31 @@
1
- import _Check from '@zikojs/lucide/Check'
2
- import _Copy from '@zikojs/lucide/Copy'
3
- import _Lock from '@zikojs/lucide/Lock'
4
- import _Unlock from '@zikojs/lucide/Unlock'
5
- import _Code2 from '@zikojs/lucide/Code2'
6
- import _FileText from '@zikojs/lucide/FileText'
7
- import _Pencil from '@zikojs/lucide/Pencil'
8
- import _Play from '@zikojs/lucide/Play'
9
- import _Refresh from '@zikojs/lucide/RefreshCcw'
10
- import _Plus from '@zikojs/lucide/Plus'
11
- import _Trash2 from '@zikojs/lucide/Trash2'
12
- import _PlayForward from '@zikojs/lucide/StepForward'
13
- import _Eraser from '@zikojs/lucide/Eraser'
14
- import _Download from '@zikojs/lucide/Download'
15
- import _Loader2 from '@zikojs/lucide/Loader2'
16
-
17
- export const Check = () => _Check({ class: 'icon', stroke : 'currentColor' }).element
18
- export const Copy = () => _Copy({ class: 'icon', stroke : 'currentColor' }).element
19
- export const Lock = () => _Lock({ class: 'icon', stroke : 'currentColor' }).element
20
- export const Unlock = () => _Unlock({ class: 'icon', stroke : 'currentColor' }).element
21
- export const Code2 = () => _Code2({ class: 'icon', stroke : 'currentColor' }).element
22
- export const FileText = () => _FileText({ class: 'icon', stroke : 'currentColor' }).element
23
- export const Pencil = () => _Pencil({ class: 'icon', stroke : 'currentColor' }).element
24
- export const Play = () => _Play({ class: 'icon', stroke : 'currentColor' }).element
25
- export const Refresh = () => _Refresh({ class: 'icon', stroke : 'currentColor' }).element
26
- export const Plus = () => _Plus({ class: 'icon', stroke : 'currentColor' }).element
27
- export const Trash2 = () => _Trash2({ class: 'icon', stroke : 'currentColor' }).element
28
- export const PlayForward = () => _PlayForward({ class: 'icon', stroke : 'currentColor' }).element
29
- export const Eraser = () => _Eraser({ class: 'icon', stroke : 'currentColor' }).element
30
- export const Download = () => _Download({ class: 'icon', stroke : 'currentColor' }).element
31
- export const Loader2 = () => _Loader2({ class: 'icon', stroke : 'currentColor' }).element
1
+ import _Check from '@zikojs/lucide/Check'
2
+ import _Copy from '@zikojs/lucide/Copy'
3
+ import _Lock from '@zikojs/lucide/Lock'
4
+ import _Unlock from '@zikojs/lucide/Unlock'
5
+ import _Code2 from '@zikojs/lucide/Code2'
6
+ import _FileText from '@zikojs/lucide/FileText'
7
+ import _Pencil from '@zikojs/lucide/Pencil'
8
+ import _Play from '@zikojs/lucide/Play'
9
+ import _Refresh from '@zikojs/lucide/RefreshCcw'
10
+ import _Plus from '@zikojs/lucide/Plus'
11
+ import _Trash2 from '@zikojs/lucide/Trash2'
12
+ import _PlayForward from '@zikojs/lucide/StepForward'
13
+ import _Eraser from '@zikojs/lucide/Eraser'
14
+ import _Download from '@zikojs/lucide/Download'
15
+ import _Loader2 from '@zikojs/lucide/Loader2'
16
+
17
+ export const Check = () => _Check({ class: 'icon', stroke : 'currentColor' }).element
18
+ export const Copy = () => _Copy({ class: 'icon', stroke : 'currentColor' }).element
19
+ export const Lock = () => _Lock({ class: 'icon', stroke : 'currentColor' }).element
20
+ export const Unlock = () => _Unlock({ class: 'icon', stroke : 'currentColor' }).element
21
+ export const Code2 = () => _Code2({ class: 'icon', stroke : 'currentColor' }).element
22
+ export const FileText = () => _FileText({ class: 'icon', stroke : 'currentColor' }).element
23
+ export const Pencil = () => _Pencil({ class: 'icon', stroke : 'currentColor' }).element
24
+ export const Play = () => _Play({ class: 'icon', stroke : 'currentColor' }).element
25
+ export const Refresh = () => _Refresh({ class: 'icon', stroke : 'currentColor' }).element
26
+ export const Plus = () => _Plus({ class: 'icon', stroke : 'currentColor' }).element
27
+ export const Trash2 = () => _Trash2({ class: 'icon', stroke : 'currentColor' }).element
28
+ export const PlayForward = () => _PlayForward({ class: 'icon', stroke : 'currentColor' }).element
29
+ export const Eraser = () => _Eraser({ class: 'icon', stroke : 'currentColor' }).element
30
+ export const Download = () => _Download({ class: 'icon', stroke : 'currentColor' }).element
31
+ export const Loader2 = () => _Loader2({ class: 'icon', stroke : 'currentColor' }).element
@@ -1,23 +1,23 @@
1
- @import url('./ErrorOutput/index.css');
2
- @import url('./Button/index.css');
3
- @import url('./Header/index.css');
4
- @import url('./MarkdownView//index.css');
5
-
6
- .ziko-notebook .runtime-select {
7
- font-family: inherit;
8
- font-size: 11px;
9
- padding: 2px 4px;
10
- border: 1px solid var(--border-color);
11
- border-radius: 4px;
12
- background: #ffffff;
13
- color: #1e293b;
14
- cursor: pointer;
15
- height: 28px;
16
- min-width: 50px;
17
- translate: 0 -2px;
18
- }
19
-
20
- .ziko-notebook .runtime-select:focus {
21
- outline: none;
22
- border-color: var(--primary);
1
+ @import url('./ErrorOutput/index.css');
2
+ @import url('./Button/index.css');
3
+ @import url('./Header/index.css');
4
+ @import url('./MarkdownView//index.css');
5
+
6
+ .ziko-notebook .runtime-select {
7
+ font-family: inherit;
8
+ font-size: 11px;
9
+ padding: 2px 4px;
10
+ border: 1px solid var(--border-color);
11
+ border-radius: 4px;
12
+ background: #ffffff;
13
+ color: #1e293b;
14
+ cursor: pointer;
15
+ height: 28px;
16
+ min-width: 50px;
17
+ translate: 0 -2px;
18
+ }
19
+
20
+ .ziko-notebook .runtime-select:focus {
21
+ outline: none;
22
+ border-color: var(--primary);
23
23
  }
@@ -1,4 +1,4 @@
1
- export * from './MarkdownView/index.js'
2
- export * from './CellItem/index.js'
3
- export * from './Header/index.js'
1
+ export * from './MarkdownView/index.js'
2
+ export * from './CellItem/index.js'
3
+ export * from './Header/index.js'
4
4
  export * from './ErrorOutput/index.js'