knowidea-ui 0.12.2 → 0.14.0
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.
- package/dist/AppShell.d.ts +4 -2
- package/dist/AppShell.js +3 -3
- package/dist/CodeEditor.d.ts +3 -1
- package/dist/CodeEditor.js +3 -1
- package/package.json +7 -7
package/dist/AppShell.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface AppShellProps {
|
|
|
18
18
|
label?: string;
|
|
19
19
|
/** 中身の上に置く物。AppBar など */
|
|
20
20
|
header?: ReactNode;
|
|
21
|
+
/** 中身の下に置く物。後から出る知らせなど。出ると中身の段を下から縮め、中身に重ねない。中身の上の端は動かない */
|
|
22
|
+
footer?: ReactNode;
|
|
21
23
|
/** 左の切り替えの下に置く物(PC の幅だけ) */
|
|
22
24
|
sideFooter?: ReactNode;
|
|
23
25
|
/** 枠の高さ。既定 100dvh。中身が長い時は <main> の中だけが送られる。見本の中に置く時に絞る */
|
|
@@ -28,8 +30,8 @@ export interface AppShellProps {
|
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* 画面の枠。スマホと iPad(1024px 未満)は下に、PC(1024px 以上)は左に画面の切り替えを出す。
|
|
31
|
-
* 中身は <main> に入り、送られるのは <main> だけ。上の header
|
|
33
|
+
* 中身は <main> に入り、送られるのは <main> だけ。上の header、下の footer と切り替えは別の段に置き、中身に重ねない。
|
|
32
34
|
* <main> は Tab で止まり、押せる物の無い長い中身も矢印のキーで送れる。
|
|
33
35
|
* 切り替えは両方を描き、幅で片方だけを見せる(見えない方は読み上げにも出ない)。
|
|
34
36
|
*/
|
|
35
|
-
export declare function AppShell({ items, current, bottomItems, bottomCurrent, brand, label, header, sideFooter, minHeight, className, style, children }: AppShellProps): import("react").JSX.Element;
|
|
37
|
+
export declare function AppShell({ items, current, bottomItems, bottomCurrent, brand, label, header, footer, sideFooter, minHeight, className, style, children }: AppShellProps): import("react").JSX.Element;
|
package/dist/AppShell.js
CHANGED
|
@@ -4,11 +4,11 @@ import { Drawer } from "./Drawer.js";
|
|
|
4
4
|
import { cx } from "./utils.js";
|
|
5
5
|
/**
|
|
6
6
|
* 画面の枠。スマホと iPad(1024px 未満)は下に、PC(1024px 以上)は左に画面の切り替えを出す。
|
|
7
|
-
* 中身は <main> に入り、送られるのは <main> だけ。上の header
|
|
7
|
+
* 中身は <main> に入り、送られるのは <main> だけ。上の header、下の footer と切り替えは別の段に置き、中身に重ねない。
|
|
8
8
|
* <main> は Tab で止まり、押せる物の無い長い中身も矢印のキーで送れる。
|
|
9
9
|
* 切り替えは両方を描き、幅で片方だけを見せる(見えない方は読み上げにも出ない)。
|
|
10
10
|
*/
|
|
11
|
-
export function AppShell({ items, current, bottomItems, bottomCurrent, brand, label = "画面の切り替え", header, sideFooter, minHeight, className, style, children }) {
|
|
11
|
+
export function AppShell({ items, current, bottomItems, bottomCurrent, brand, label = "画面の切り替え", header, footer, sideFooter, minHeight, className, style, children }) {
|
|
12
12
|
const s = { ...(minHeight ? { "--ki-shell-height": minHeight } : null), ...style };
|
|
13
|
-
return (_jsxs("div", { className: cx("ki-shell", className), style: s, children: [_jsx(Drawer, { className: "ki-shell__side", variant: "permanent", items: items, current: current, brand: brand, label: label, footer: sideFooter }), _jsxs("div", { className: "ki-shell__body", children: [header, _jsx("main", { className: "ki-shell__main", tabIndex: 0, children: children })] }), _jsx(BottomNavigation, { className: "ki-shell__bottom", items: bottomItems ?? items, current: bottomCurrent ?? current, label: label })] }));
|
|
13
|
+
return (_jsxs("div", { className: cx("ki-shell", className), style: s, children: [_jsx(Drawer, { className: "ki-shell__side", variant: "permanent", items: items, current: current, brand: brand, label: label, footer: sideFooter }), _jsxs("div", { className: "ki-shell__body", children: [header, _jsx("main", { className: "ki-shell__main", tabIndex: 0, children: children }), footer === undefined || footer === null || footer === false ? null : _jsx("div", { className: "ki-shell__footer", children: footer })] }), _jsx(BottomNavigation, { className: "ki-shell__bottom", items: bottomItems ?? items, current: bottomCurrent ?? current, label: label })] }));
|
|
14
14
|
}
|
package/dist/CodeEditor.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export interface CodeEditorProps {
|
|
|
61
61
|
height?: string;
|
|
62
62
|
/** CodeMirror の拡張を足す */
|
|
63
63
|
extensions?: Extension[];
|
|
64
|
+
/** CSP の nonce。CodeMirror は見た目を <style> で差し込むので、style-src を nonce で許す画面で渡す。作った時の値だけを使う */
|
|
65
|
+
cspNonce?: string;
|
|
64
66
|
className?: string;
|
|
65
67
|
style?: CSSProperties;
|
|
66
68
|
}
|
|
@@ -70,4 +72,4 @@ export interface CodeEditorProps {
|
|
|
70
72
|
* 外から value を替えると(別のファイルを開いた時など)、onChange は呼ばず、元に戻す履歴を空にする。
|
|
71
73
|
* knowidea-ui/editor から読み込む(CodeMirror を、使う画面でだけ読み込むため)。
|
|
72
74
|
*/
|
|
73
|
-
export declare function CodeEditor({ value, onChange, label, language, readOnly, wrap, diagnostics, complete, hover, onDefinition, onSave, height, extensions, className, style }: CodeEditorProps): import("react").JSX.Element;
|
|
75
|
+
export declare function CodeEditor({ value, onChange, label, language, readOnly, wrap, diagnostics, complete, hover, onDefinition, onSave, height, extensions, cspNonce, className, style }: CodeEditorProps): import("react").JSX.Element;
|
package/dist/CodeEditor.js
CHANGED
|
@@ -61,7 +61,7 @@ const infoField = StateField.define({
|
|
|
61
61
|
* 外から value を替えると(別のファイルを開いた時など)、onChange は呼ばず、元に戻す履歴を空にする。
|
|
62
62
|
* knowidea-ui/editor から読み込む(CodeMirror を、使う画面でだけ読み込むため)。
|
|
63
63
|
*/
|
|
64
|
-
export function CodeEditor({ value, onChange, label, language = "text", readOnly = false, wrap, diagnostics, complete, hover, onDefinition, onSave, height, extensions, className, style }) {
|
|
64
|
+
export function CodeEditor({ value, onChange, label, language = "text", readOnly = false, wrap, diagnostics, complete, hover, onDefinition, onSave, height, extensions, cspNonce, className, style }) {
|
|
65
65
|
const host = useRef(null);
|
|
66
66
|
const view = useRef(null);
|
|
67
67
|
// ready は、エディタを作った回数と、外から中身を入れ替えた回数。替わるたびに、下の effect が今の設定を送り直す
|
|
@@ -142,6 +142,8 @@ export function CodeEditor({ value, onChange, label, language = "text", readOnly
|
|
|
142
142
|
EditorView.updateListener.of((u) => { if (u.docChanged)
|
|
143
143
|
cb.current.onChange?.(u.state.doc.toString()); }),
|
|
144
144
|
p.label.of([]), p.language.of([]), p.readOnly.of([]), p.wrap.of([]), p.extra.of([]),
|
|
145
|
+
// 見た目の <style> は作った時に差し込むので、nonce は作る時から持たせる
|
|
146
|
+
cspNonce ? EditorView.cspNonce.of(cspNonce) : [],
|
|
145
147
|
];
|
|
146
148
|
const v = new EditorView({ parent: host.current, state: EditorState.create({ doc: value, extensions: base.current }) });
|
|
147
149
|
view.current = v;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knowidea-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "KNOW IDEA UI の React の部品(Base UI が土台)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^19.0.0",
|
|
47
47
|
"react-dom": "^19.0.0",
|
|
48
|
-
"knowidea-
|
|
49
|
-
"knowidea-
|
|
50
|
-
"knowidea-
|
|
48
|
+
"knowidea-tokens": "^0.14.0",
|
|
49
|
+
"knowidea-css": "^0.14.0",
|
|
50
|
+
"knowidea-icons": "^0.14.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "19.3.0",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"react": "19.3.0",
|
|
56
56
|
"react-dom": "19.3.0",
|
|
57
57
|
"typescript": "5.9.3",
|
|
58
|
-
"knowidea-
|
|
59
|
-
"knowidea-
|
|
60
|
-
"knowidea-tokens": "0.
|
|
58
|
+
"knowidea-css": "0.14.0",
|
|
59
|
+
"knowidea-icons": "0.14.0",
|
|
60
|
+
"knowidea-tokens": "0.14.0"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|
|
63
63
|
"dist",
|