egatari 0.6.17 → 0.6.18
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/CHANGELOG.md +36 -1
- package/README.ja.md +14 -13
- package/README.md +2 -1
- package/components.lock.json +119 -45
- package/components2.lock.json +639 -1
- package/kit/check-messages.mjs +5 -0
- package/kit/check.mjs +6 -0
- package/kit/core/bookmark.mjs +28 -0
- package/kit/core/build-core.mjs +4 -2
- package/kit/core/check-parity.mjs +4 -0
- package/kit/core/check-rules.mjs +3 -2
- package/kit/core/check-source.mjs +6 -0
- package/kit/core/llm-pack-assemble.mjs +37 -66
- package/kit/core/llm-pack-data.mjs +839 -45
- package/kit/core/llm-pack.mjs +6 -4
- package/kit/core/llm-request.mjs +2 -2
- package/kit/core/new-deck-pack.mjs +38 -44
- package/kit/core/new-deck.mjs +82 -74
- package/kit/core/part-labels.mjs +2 -0
- package/kit/core/purposes.mjs +9 -3
- package/kit/core/sample-info.mjs +17 -3
- package/kit/core/slide-ops.mjs +22 -0
- package/kit/core/tate-mix.mjs +25 -0
- package/kit/core/theme-derive.mjs +56 -17
- package/kit/core/theme-shapes.mjs +15 -1
- package/kit/deck.js +53 -2
- package/kit/instruction-version.json +1 -1
- package/kit/llm-pack.mjs +5 -7
- package/kit/player.json +1 -1
- package/kit/player.lock.json +2 -2
- package/kit/presenter.js +36 -4
- package/kit/tools.js +54 -2
- package/package.json +1 -1
- package/vendor/components/CATALOG.md +24 -22
- package/vendor/components/sha256/038f9d32c89c8212ab25d6e3180023b6fe024a53053ab2ef1443ecab92e3ce43/index.js +205 -0
- package/vendor/components/sha256/07479cb6e5194a01b2a8a9029f3646060f0dbb673f2737d2132738af2eb379e5/README.en.md +44 -0
- package/vendor/components/sha256/07479cb6e5194a01b2a8a9029f3646060f0dbb673f2737d2132738af2eb379e5/index.js +306 -0
- package/vendor/components/sha256/077678d8b14a8065c4f74a9fe1669728c68a0f763bfdca18b304f5c3d863632a/README.en.md +54 -0
- package/vendor/components/sha256/077678d8b14a8065c4f74a9fe1669728c68a0f763bfdca18b304f5c3d863632a/index.js +470 -0
- package/vendor/components/sha256/0840322bf51eeb3c8188ce21ad70af17c13974ac0151065a39c430a3813ee07f/README.en.md +23 -0
- package/vendor/components/sha256/0840322bf51eeb3c8188ce21ad70af17c13974ac0151065a39c430a3813ee07f/index.js +289 -0
- package/vendor/components/sha256/0c25d49d23529879054737aa181951519fe585c4728fd505e0e3c8869953eac7/index.js +934 -0
- package/vendor/components/sha256/0dd302b82925f35743a893d5c271898ada3659aa0de2d3249ef45936aad10ae0/LICENSE-strokesvg.txt +115 -0
- package/vendor/components/sha256/0dd302b82925f35743a893d5c271898ada3659aa0de2d3249ef45936aad10ae0/OFL.txt +93 -0
- package/vendor/components/sha256/0dd302b82925f35743a893d5c271898ada3659aa0de2d3249ef45936aad10ae0/index.js +755 -0
- package/vendor/components/sha256/0dd302b82925f35743a893d5c271898ada3659aa0de2d3249ef45936aad10ae0/strokes-CHANGES.md +20 -0
- package/vendor/components/sha256/0e9e92df8d70eb6d9fcf10916c361769c7cd37baacece8d7eb96bbbc7fbcf942/README.en.md +25 -0
- package/vendor/components/sha256/0e9e92df8d70eb6d9fcf10916c361769c7cd37baacece8d7eb96bbbc7fbcf942/index.js +317 -0
- package/vendor/components/sha256/12ef6a11055407f5cddc40154a49cf2737b0786429fe0fcc94ee1d8245597b40/index.js +244 -0
- package/vendor/components/sha256/13c9ce43396b2f5693ce430a924dae4ddcd1e8a4ad0c9b9e724ff52acb874d0c/index.js +354 -0
- package/vendor/components/sha256/1a0f21def0efbbdef64461cafa40f3883bc7f7122adf79d01f09ca4a245e5dcb/index.js +465 -0
- package/vendor/components/sha256/208175d05b37d326855fad792b10137f785e5d05d91a2cde119d0dbd69d2ed98/index.js +100 -0
- package/vendor/components/sha256/218d88998b70f0732c18d91ccc238b2d63f6b0aaa483883b83685a25468f214a/README.en.md +34 -0
- package/vendor/components/sha256/218d88998b70f0732c18d91ccc238b2d63f6b0aaa483883b83685a25468f214a/index.js +246 -0
- package/vendor/components/sha256/2579bcb46b6525902763cd15a2e08fc5ebd9a2695cdaba63438e5b47907a47e0/README.en.md +24 -0
- package/vendor/components/sha256/2579bcb46b6525902763cd15a2e08fc5ebd9a2695cdaba63438e5b47907a47e0/index.js +554 -0
- package/vendor/components/sha256/2787e410e533e4ad48b0a3c2b652579cf5797f9c51fcf32f5478212a7acef95f/README.en.md +28 -0
- package/vendor/components/sha256/2787e410e533e4ad48b0a3c2b652579cf5797f9c51fcf32f5478212a7acef95f/index.js +214 -0
- package/vendor/components/sha256/2a011338d0fc3c77e102eaa57cde2b6e3726bc279f133174b0b8c9a654263cbc/index.js +824 -0
- package/vendor/components/sha256/2fce5ab0c31dca0aa1586a2c69237870a9cce46c0bc6ab7392c27968d016bd15/index.js +75 -0
- package/vendor/components/sha256/3417efe4722f569690563d9abcea8b144db2f8fa97b83cf0118fb3a34cd4cb2b/README.en.md +23 -0
- package/vendor/components/sha256/3417efe4722f569690563d9abcea8b144db2f8fa97b83cf0118fb3a34cd4cb2b/index.js +150 -0
- package/vendor/components/sha256/3a7962fa87c670447eed54aca08604ef03cd26bf2c334b4667190060e6a17965/README.en.md +18 -0
- package/vendor/components/sha256/3a7962fa87c670447eed54aca08604ef03cd26bf2c334b4667190060e6a17965/index.js +279 -0
- package/vendor/components/sha256/42450c6b36404d66641568f6d6f55e42a4a036d4d9cdf308f709464913b32fe9/README.en.md +42 -0
- package/vendor/components/sha256/42450c6b36404d66641568f6d6f55e42a4a036d4d9cdf308f709464913b32fe9/index.js +272 -0
- package/vendor/components/sha256/45cea6c1abfb3467e3e3dbe7fec58647716999a0c39cf7163531ae389f898d29/README.en.md +30 -0
- package/vendor/components/sha256/45cea6c1abfb3467e3e3dbe7fec58647716999a0c39cf7163531ae389f898d29/index.js +305 -0
- package/vendor/components/sha256/4c8cae404d551a1bb021e8345af5aa45d4f412f13497aa84b142f11a29a365dc/index.js +124 -0
- package/vendor/components/sha256/5521b5b40a43c48c5ae5a50ce87afb3d47bb23b133b16841086d8322364cdd5e/README.en.md +23 -0
- package/vendor/components/sha256/5521b5b40a43c48c5ae5a50ce87afb3d47bb23b133b16841086d8322364cdd5e/index.js +120 -0
- package/vendor/components/sha256/5fe30fd7a84b937a1325d8af2b8e437211efae82ab46d5a433bc4ef07bcaef11/README.en.md +18 -0
- package/vendor/components/sha256/5fe30fd7a84b937a1325d8af2b8e437211efae82ab46d5a433bc4ef07bcaef11/index.js +243 -0
- package/vendor/components/sha256/631f4c4b90c9a41c0f26c9600d5cf2d6447251d04a20f08f48a85aeb4cb0f6fb/index.js +107 -0
- package/vendor/components/sha256/6749f44ed6476a05d4e3026373c188a0e1a19b77a5836579813f62a1477ac35e/README.en.md +31 -0
- package/vendor/components/sha256/6749f44ed6476a05d4e3026373c188a0e1a19b77a5836579813f62a1477ac35e/index.js +271 -0
- package/vendor/components/sha256/701f1deef79fe05eeb18e1119e5a5c4d60a9dfe265e93a4dff79223bc598dbf0/index.js +521 -0
- package/vendor/components/sha256/711cf58fa946c9c0abc953b2f695d02bf5a5a7f73851b09f834e894baf88be38/index.js +122 -0
- package/vendor/components/sha256/728576c57a5ccb39531ad4cb8074fce95480f01603a77dbf57dca0e52199f7c4/index.js +37 -0
- package/vendor/components/sha256/73edc74a2dc4a63b717106c1c1572967b6d306270574e9635d032de16c8ada72/README.en.md +18 -0
- package/vendor/components/sha256/73edc74a2dc4a63b717106c1c1572967b6d306270574e9635d032de16c8ada72/index.js +382 -0
- package/vendor/components/sha256/76bdb63c3e5e14fbb4816bc9f235490817bb5d7be990a826f5077aa08226702c/index.js +162 -0
- package/vendor/components/sha256/7a5adf73fc053b9f2ca56643b5683b42589edb0f63c845ecb7ae7e6b87eccc30/README.en.md +51 -0
- package/vendor/components/sha256/7a5adf73fc053b9f2ca56643b5683b42589edb0f63c845ecb7ae7e6b87eccc30/index.js +230 -0
- package/vendor/components/sha256/7ab483e7fb05f646b062340d70f2749d070b4f64fed7acc0b8a7754d9ef9fded/README.en.md +26 -0
- package/vendor/components/sha256/7ab483e7fb05f646b062340d70f2749d070b4f64fed7acc0b8a7754d9ef9fded/index.js +322 -0
- package/vendor/components/sha256/7af6e5e6dffb618b39f27d883c691ca128f3af06040ee505e75c79c678bfdcfe/README.en.md +18 -0
- package/vendor/components/sha256/7af6e5e6dffb618b39f27d883c691ca128f3af06040ee505e75c79c678bfdcfe/index.js +103 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/chords.json +89 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/extras.json +192 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/fixtures/ties.json +360 -0
- package/vendor/components/sha256/7dea2c3728b85122b04515aa06ab198657529e7cd101b9ab34d4ecb2905ce94e/index.js +508 -0
- package/vendor/components/sha256/832556ea9c82c292a3ba9e1b332f2405c5c2f969ff8157c91ed80226ec8ac62e/README.en.md +22 -0
- package/vendor/components/sha256/832556ea9c82c292a3ba9e1b332f2405c5c2f969ff8157c91ed80226ec8ac62e/index.js +145 -0
- package/vendor/components/sha256/8a4b6dce84d7a69aaafeb75c1c572fe7904fd49e3169c1c85851ccaeae2a7b11/index.js +41 -0
- package/vendor/components/sha256/8bb511cb90902bc7721e59ca08685b26adbf33539e36a4a45172485d6d3d455b/index.js +250 -0
- package/vendor/components/sha256/8db9c936c36b79b9e3b2be37639487b15502a6937f411ed714621a8091437e9b/README.en.md +21 -0
- package/vendor/components/sha256/8db9c936c36b79b9e3b2be37639487b15502a6937f411ed714621a8091437e9b/index.js +108 -0
- package/vendor/components/sha256/8e5e90c90cb6b06a790b0420e43d79d7da663f1cc19ff06d381ec849b4a8fc57/index.js +312 -0
- package/vendor/components/sha256/a1c2b2fa06e4229815ab82a9202c266ec887a67632a175854c7d136a92389ca3/index.js +69 -0
- package/vendor/components/sha256/a7c4282db79d46557bdbaf84ca519606dc46f3c23455db4a26f663453f85813c/README.en.md +38 -0
- package/vendor/components/sha256/a7c4282db79d46557bdbaf84ca519606dc46f3c23455db4a26f663453f85813c/index.js +414 -0
- package/vendor/components/sha256/aac2f8a23cb1b606e9635061cb288f006588c80a7258540cae846ae677f55ff5/index.js +238 -0
- package/vendor/components/sha256/ace7e82e866b577ad42bbc4b64e11bae18982e3236aadceb6c2e6c20f41234cf/README.en.md +45 -0
- package/vendor/components/sha256/ace7e82e866b577ad42bbc4b64e11bae18982e3236aadceb6c2e6c20f41234cf/index.js +211 -0
- package/vendor/components/sha256/aeb0b9b5991a5c1df7191c397780a699f2c7310123ca210a58486c0a23e44006/index.js +342 -0
- package/vendor/components/sha256/af3355efd6739a56c6cb53990100f41703361c475c123b9b2762421c68509036/index.js +315 -0
- package/vendor/components/sha256/b10183a66b58b827a1410cf8b0117af567647684464d5777529dc66f0cea343a/LICENSE-tabler.txt +21 -0
- package/vendor/components/sha256/b10183a66b58b827a1410cf8b0117af567647684464d5777529dc66f0cea343a/index.js +4868 -0
- package/vendor/components/sha256/b10183a66b58b827a1410cf8b0117af567647684464d5777529dc66f0cea343a/names.txt +4808 -0
- package/vendor/components/sha256/b348ea64cc19632df96a91dfd7c435e4a62095aede72b504d03537be70d6d930/index.js +606 -0
- package/vendor/components/sha256/b53bfa03d1e9feb3cb492f440bf9d100c96eb4fe6b76c42b512a56e9158829cd/index.js +351 -0
- package/vendor/components/sha256/b9443e1cdac4850b1ead9f8449a3061678bbb77fbc53eb9b23d01e1cf50750c3/index.js +619 -0
- package/vendor/components/sha256/bc1e2a02c959ac203819d03c0d25b3776a6a9a4290aae860b26cbbe3d29e876d/index.js +268 -0
- package/vendor/components/sha256/beeb180c0e2250bb04490b092c0a235cae47fca2ed1de2d9ef078a5c14b1a963/index.js +429 -0
- package/vendor/components/sha256/c5fd7713e55e96d75824a21146c0251896d7d9dd028b4d169191433135a97981/index.js +200 -0
- package/vendor/components/sha256/c61987e9994940fc668ed8a010e575ee52027b54ed9c5dd1cc9fdf67649092b3/index.js +404 -0
- package/vendor/components/sha256/ccc8bfe174b6903ec254dfef4f5d1c614271ea39963649add7fcb8d83c081eba/index.js +278 -0
- package/vendor/components/sha256/da267bc65fde0a9279127d5a82f6c253ad74984da6fb11391f00604ad9ffe80d/index.js +93 -0
- package/vendor/components/sha256/dea36cd7010991a572ef394ee32b5e17564aeff09d3ec4ed3820d7e43c9a58be/index.js +484 -0
- package/vendor/components/sha256/df3fdb2aed487d4f6e60a8abab1fe0d1e9fa2a4193fd162edf3c384ea8db5a1b/index.js +180 -0
- package/vendor/components/sha256/e27d517f39eb554c7a9ecea7b59fcf1d347c4deeb3fe2250797aa233bfb7e2b0/index.js +747 -0
- package/vendor/components/sha256/e31f6b058503f7980597c89b3e964c512ee08de7cba3fa99904d499abbb5d0e8/README.en.md +20 -0
- package/vendor/components/sha256/e31f6b058503f7980597c89b3e964c512ee08de7cba3fa99904d499abbb5d0e8/index.js +310 -0
- package/vendor/components/sha256/f4100076a37dbde6046d85969d651feffc925bd984ffe9f333ea9bd2b6816918/README.en.md +30 -0
- package/vendor/components/sha256/f4100076a37dbde6046d85969d651feffc925bd984ffe9f333ea9bd2b6816918/index.js +192 -0
- package/vendor/components/sha256/fa6442fa3c5082cf161c29308fe0ecbd85fa33e8e4bad08c12e7961b46b1365b/README.en.md +24 -0
- package/vendor/components/sha256/fa6442fa3c5082cf161c29308fe0ecbd85fa33e8e4bad08c12e7961b46b1365b/index.js +214 -0
- package/vendor/components-2/manifest-2.16.0.json +2919 -0
- package/vendor/components-2/manifest-2.17.0.json +2852 -0
- package/vendor/components-2/manifest-2.18.0.json +3182 -0
- package/vendor/egatari-spec/SOURCE.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// テーマを作る画面(backlog #58 stage 2)の計算:
|
|
2
2
|
// 基調色 1 つからほかの色を導き、裏で色を確かめ、通らないときは通るいちばん近い色を探し、テーマのファイル(tokens.css・theme.json)を書く。
|
|
3
3
|
// 外の名前を使わない(ブラウザでも Node でも動く。app/theme-workshop.js と tools/test-theme-derive.mjs が使う)。色の計算は kit/core/color-check.mjs
|
|
4
4
|
//
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// 白飛び(明るい部屋の投影。周りの光 15%):用語の色と地のコントラスト 3:1 以上(fail)
|
|
21
21
|
// 印刷:書き出す tokens.css が章の扉と表紙に print-color-adjust:exact を書くので、背景のグラフィックを印刷しない設定でも地が消えない(検査は要らない)
|
|
22
22
|
import { contrast, de76, de2000, simulate, hex2rgb, rgb2hex, relLum } from './color-check.mjs';
|
|
23
|
+
import { BACKGROUNDS, FONT_KINDS, fontKindOf, cleanLook, COVER_BAND_TEXT, lookCss, lookIn, withoutLooks } from './theme-shapes.mjs';
|
|
23
24
|
import { FONT_LIST } from './build-core.mjs';
|
|
24
25
|
|
|
25
26
|
// ---------------------------------------------------------------- OKLab / OKLCH(Björn Ottosson 2020)
|
|
@@ -85,7 +86,7 @@ export function deriveTheme(base, overrides = {}) {
|
|
|
85
86
|
// ---------------------------------------------------------------- 確かめる
|
|
86
87
|
export const NEED = Object.freeze({ text: 4.5, washout: 3, de76: 35, de2000: 20, grey: 8, greyFail: 4, redHue: 25 });
|
|
87
88
|
// input:{base, overrides}。返すのは通らなかったものだけ
|
|
88
|
-
export function checkTheme(t, { coverBg = null, overrides = {} } = {}) {
|
|
89
|
+
export function checkTheme(t, { coverBg = null, overrides = {}, look = {} } = {}) {
|
|
89
90
|
const out = [];
|
|
90
91
|
const who = (k) => (overrides && overrides[k] ? k : 'base'); // 直すときに替える入力
|
|
91
92
|
const text = (id, fg, bg, token) => { const v = contrast(fg, bg); if (v < NEED.text) out.push({ id, level: 'fail', token, value: v, need: NEED.text }); };
|
|
@@ -93,8 +94,11 @@ export function checkTheme(t, { coverBg = null, overrides = {} } = {}) {
|
|
|
93
94
|
text('title-contrast', t.title, t.bg, who('title'));
|
|
94
95
|
text('accent2-contrast', t.accent2, t.bg, who('accent2'));
|
|
95
96
|
text('sec-contrast', t['sec-fg'], t['sec-bg'], 'base');
|
|
97
|
+
if (look.heading === 'band') text('heading-band', t['sec-fg'], t.base, 'base');
|
|
98
|
+
const bandText = COVER_BAND_TEXT[look.cover];
|
|
99
|
+
if (bandText) text('cover-band', t[bandText], t.base, 'base');
|
|
96
100
|
if (overrides && overrides.emph) { text('emph-contrast', t.emph, t.bg, 'emph'); text('concl-contrast', t.emph, t['concl-bg'], 'emph'); }
|
|
97
|
-
if (coverBg) text('cover-title', t.title, coverBg, 'cover');
|
|
101
|
+
if (coverBg) text('cover-title', look.cover === 'left-bar' ? t.fg : t.title, coverBg, 'cover');
|
|
98
102
|
// 色覚:結論の色と用語の色
|
|
99
103
|
const ct = overrides && overrides.term ? 'term' : overrides && overrides.emph ? 'emph' : 'base';
|
|
100
104
|
let worst = null;
|
|
@@ -115,7 +119,7 @@ export function checkTheme(t, { coverBg = null, overrides = {} } = {}) {
|
|
|
115
119
|
if (w < NEED.washout) out.push({ id: 'washout', level: 'fail', token: who('term'), value: w, need: NEED.washout });
|
|
116
120
|
return out;
|
|
117
121
|
}
|
|
118
|
-
export const checkInput = (input, opts = {}) => checkTheme(
|
|
122
|
+
export const checkInput = (input, opts = {}) => checkTheme(builderTokens(input), { ...opts, look: input.look || {}, overrides: input.overrides || {} });
|
|
119
123
|
|
|
120
124
|
// ---------------------------------------------------------------- 直す色を探す
|
|
121
125
|
// token の fail がなくなる色のうち、元の色にいちばん近いもの(CIEDE2000)。OKLCH の明るさを動かし、色相も ±90° まで回して探す
|
|
@@ -170,24 +174,31 @@ export const fontStack = (family) => {
|
|
|
170
174
|
const f = FONT_CHOICES.find((x) => x.family === family) || FONT_CHOICES[0];
|
|
171
175
|
return `"${f.family}", ${SERIF.test(f.family) ? (f.group === 'ja' ? '"Hiragino Mincho ProN", "Yu Mincho", serif' : 'Georgia, serif') : FALLBACK[f.group] || 'sans-serif'}`;
|
|
172
176
|
};
|
|
173
|
-
const TOKEN_ORDER = ['base', 'title', 'complement', 'accent2', 'base-tint', 'base-wash', 'comp-tint', 'term', 'emph', 'ramp-1', 'ramp-2', 'ramp-3', 'ramp-4', 'ramp-5'];
|
|
177
|
+
const TOKEN_ORDER = ['base', 'rule', 'title', 'complement', 'accent2', 'base-tint', 'base-wash', 'comp-tint', 'term', 'emph', 'ramp-1', 'ramp-2', 'ramp-3', 'ramp-4', 'ramp-5'];
|
|
174
178
|
// input:{base, overrides, font}。coverImage:'data:image/…;base64,…'(そのまま tokens.css に入る。テーマの hash と 1 ファイルに入る。#171(b))
|
|
175
|
-
export function themeFiles(input, { name, title = '', coverImage = '', results = null } = {}) {
|
|
176
|
-
const t =
|
|
177
|
-
const
|
|
179
|
+
export function themeFiles(input, { name, title = '', coverImage = '', coverBg = null, results = null } = {}) {
|
|
180
|
+
const t = builderTokens(input);
|
|
181
|
+
const source = input.source;
|
|
182
|
+
const family = FONT_CHOICES.some((f) => f.family === input.font) ? input.font : FONT_KINDS[input.fontKind] || FONT_CHOICES[0].family;
|
|
183
|
+
const look = cleanLook(input.look);
|
|
184
|
+
const res = results || checkInput(input, { coverBg });
|
|
178
185
|
const head = [`/* ${title || name}: made with the theme builder in Egatari Studio (New…, step 3, Custom).`,
|
|
179
186
|
` Main colour ${t.base}. The other colours are worked out from it${Object.keys(input.overrides || {}).length ? '; changed by hand: ' + Object.keys(input.overrides).join(', ') : ''}.`,
|
|
180
187
|
` Checks: ${res.length ? res.map((x) => `${x.level} ${x.id}`).join(', ') : 'all passed'}. */`];
|
|
181
|
-
const
|
|
182
|
-
lines
|
|
188
|
+
const recolour = !source || normHex(input.base) !== source.base;
|
|
189
|
+
const lines = (recolour ? [...TOKEN_ORDER, 'fg', 'muted', 'concl-bg', 'sec-bg', 'sec-fg'] : EDITABLE.filter((k) => isHex(input.overrides?.[k]))).map((k) => ` --${k}: ${t[k]};`);
|
|
190
|
+
if (!source || family !== source.font) lines.push(` --font-sans: ${fontStack(family)};`);
|
|
191
|
+
if (!source || input.background !== source.background) lines.push(` --bg: ${BACKGROUNDS[input.background] || BACKGROUNDS.white};`, ' --cover-bg: var(--bg);');
|
|
183
192
|
if (coverImage) lines.push(` --cover-bg: url("${coverImage}") center / cover no-repeat var(--bg);`);
|
|
184
|
-
const css = [...head, ':root{', ...lines, '}',
|
|
193
|
+
const css = [...head, source ? withoutLooks(source.css) : '', ':root{', ...lines, '}', lookCss(look),
|
|
194
|
+
source && family !== source.font ? `.slide h2,.slide.cover h1,.slide.sec h1,.slide.sec h2{font-family:var(--font-sans)}` : '',
|
|
185
195
|
'/* print the section divider and cover backgrounds even when the browser does not print background graphics */',
|
|
186
196
|
'@media print{.slide.sec,.slide.cover{-webkit-print-color-adjust:exact;print-color-adjust:exact}}', ''].join('\n');
|
|
187
|
-
const f = FONT_CHOICES.find((x) => x.family ===
|
|
197
|
+
const f = FONT_CHOICES.find((x) => x.family === family);
|
|
188
198
|
const json = { name, ...(title ? { title } : {}), extends: 'default', version: '1.0.0',
|
|
189
|
-
...(f && !f.default ? { fonts: { body: f.family } } : {}),
|
|
190
|
-
|
|
199
|
+
...((source && family === source.font) ? { fonts: source.fonts || {} } : f && !f.default ? { fonts: { body: f.family } } : {}),
|
|
200
|
+
look, background: input.background || 'white', fontKind: input.fontKind || fontKindOf(family),
|
|
201
|
+
builder: { ...(coverImage && isHex(coverBg) ? { coverBg: normHex(coverBg) } : {}), base: t.base, font: family, start: input.start || 'default', ...(source ? { source: { ...source, css: withoutLooks(source.css) } } : {}), ...(Object.keys(input.overrides || {}).length ? { overrides: input.overrides } : {}) } };
|
|
191
202
|
return { 'tokens.css': css, 'theme.json': JSON.stringify(json, null, 2) + '\n' };
|
|
192
203
|
}
|
|
193
204
|
export function readBuilder(themeJson) {
|
|
@@ -197,13 +208,41 @@ export function readBuilder(themeJson) {
|
|
|
197
208
|
if (!b || !isHex(b.base)) return null;
|
|
198
209
|
const overrides = {};
|
|
199
210
|
for (const [k, v] of Object.entries(b.overrides || {})) if (EDITABLE.includes(k) && isHex(v)) overrides[k] = normHex(v);
|
|
200
|
-
return { base: normHex(b.base), font: FONT_CHOICES.some((f) => f.family === b.font) ? b.font : '', overrides
|
|
211
|
+
return { ...(isHex(b.coverBg) ? { coverBg: normHex(b.coverBg) } : {}), base: normHex(b.base), font: FONT_CHOICES.some((f) => f.family === b.font) ? b.font : '', overrides,
|
|
212
|
+
look: cleanLook(j.look), background: Object.hasOwn(BACKGROUNDS, j.background) ? j.background : 'white',
|
|
213
|
+
fontKind: Object.hasOwn(FONT_KINDS, j.fontKind) ? j.fontKind : fontKindOf(b.font || ''), start: b.start || 'default',
|
|
214
|
+
...(b.source && typeof b.source.css === 'string' && isHex(b.source.base) ? { source: { ...b.source, base: normHex(b.source.base) } } : {}) };
|
|
201
215
|
}
|
|
202
216
|
// 同梱のテーマの tokens.css から始める値(最後の --base と --font-sans の最初の名前)
|
|
203
|
-
export function startFrom(tokensCss) {
|
|
217
|
+
export function startFrom(tokensCss, config = {}) {
|
|
218
|
+
try { if (typeof config === 'string') config = JSON.parse(config); } catch { config = {}; }
|
|
204
219
|
const c = String(tokensCss || '').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
205
220
|
const b = [...c.matchAll(/--base\s*:\s*(#[0-9a-fA-F]{6})\b/g)].pop();
|
|
206
221
|
const f = [...c.matchAll(/--font-sans\s*:\s*([^;}]+)/g)].pop();
|
|
207
222
|
const fam = f ? f[1].split(',')[0].trim().replace(/^["']|["']$/g, '') : '';
|
|
208
|
-
|
|
223
|
+
const font = config?.fonts?.body || (FONT_CHOICES.some((x) => x.family === fam) ? fam : /var\(--font-mincho\)/.test(c) ? 'BIZ UDPMincho' : '');
|
|
224
|
+
const bg = [...c.matchAll(/--bg\s*:\s*(#[0-9a-fA-F]{6})\b/g)].pop();
|
|
225
|
+
return { base: b ? normHex(b[1]) : null, font, fontKind: fontKindOf(font),
|
|
226
|
+
background: bg && normHex(bg[1]) !== '#FFFFFF' ? 'off-white' : 'white',
|
|
227
|
+
look: cleanLook(config?.look || Object.fromEntries(Object.entries(lookIn(tokensCss)).map(([k, v]) => [k, v.id]))) };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Keep the starting theme's CSS intact; regenerate its palette only after changing the base.
|
|
231
|
+
export function builderTokens(input) {
|
|
232
|
+
const t = deriveTheme(input.base, input.overrides);
|
|
233
|
+
const source = input.source;
|
|
234
|
+
if (source && normHex(input.base) === source.base) {
|
|
235
|
+
const css = source.css.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
236
|
+
for (const m of css.matchAll(/--([\w-]+)\s*:\s*(#[0-9a-fA-F]{6})\b/g)) t[m[1]] = normHex(m[2]);
|
|
237
|
+
for (const m of css.matchAll(/--([\w-]+)\s*:\s*var\(--([\w-]+)\)/g)) if (t[m[2]]) t[m[1]] = t[m[2]];
|
|
238
|
+
for (const [k, v] of Object.entries(input.overrides || {})) if (EDITABLE.includes(k) && isHex(v)) t[k] = normHex(v);
|
|
239
|
+
}
|
|
240
|
+
if (source && input.background === source.background) {
|
|
241
|
+
const bg = [...source.css.matchAll(/--bg\s*:\s*(#[0-9a-fA-F]{6})\b/g)].pop();
|
|
242
|
+
if (bg) t.bg = normHex(bg[1]);
|
|
243
|
+
} else {
|
|
244
|
+
const bg = BACKGROUNDS[input.background] || BACKGROUNDS.white;
|
|
245
|
+
t.bg = bg === 'var(--base-wash)' ? t['base-wash'] : bg;
|
|
246
|
+
}
|
|
247
|
+
return t;
|
|
209
248
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// テーマの形(見出し・表紙・結論の行)の決まった CSS
|
|
1
|
+
// テーマの形(見出し・表紙・結論の行)の決まった CSS の断片(backlog #58 stage 2)。
|
|
2
2
|
// 同梱のテーマはこの断片をそのまま tokens.css に写し、どれを選んだかを theme.json の look に書く({"heading": "band", "cover": "left-bar", "concl": "left-rule"})。
|
|
3
3
|
// テーマを作る画面は同じ断片を並べるだけで、選んだ形のテーマを書き出せる。tools/test-themes.mjs が、tokens.css の中の断片がここと同じかを確かめる。
|
|
4
4
|
// 断片はテーマのファイルに写す(組み立てはここを読まない)ので、ここを変えても出したテーマの見た目と hash は変わらない(変えたら写したテーマの版を上げる)。
|
|
@@ -15,6 +15,7 @@ const H = '.slide:not(.cover):not(.sec):not(.layout-tate) > h2';
|
|
|
15
15
|
|
|
16
16
|
export const SHAPES = Object.freeze({
|
|
17
17
|
heading: Object.freeze({
|
|
18
|
+
default: '',
|
|
18
19
|
// 下線(既定。kit/layouts.css のまま)
|
|
19
20
|
underline: '',
|
|
20
21
|
// 太い下線と、題の前の四角(常盤)
|
|
@@ -29,6 +30,7 @@ export const SHAPES = Object.freeze({
|
|
|
29
30
|
band: `${H}{left:0;right:0;top:0;padding:26px 48px 18px;background:var(--base);color:var(--sec-fg,#fff);border-bottom:4px solid var(--rule)}\n.slide:not(.cover):not(.sec):not(.layout-tate) > .kicker{--kicker-color:var(--sec-fg,#fff);z-index:1}\n.slide:not(.cover):not(.sec):not(.layout-tate) > .kicker + h2{padding-top:48px;padding-bottom:4px}`,
|
|
30
31
|
}),
|
|
31
32
|
cover: Object.freeze({
|
|
33
|
+
default: '',
|
|
32
34
|
// 中央・上に細い帯(既定。kit/layouts.css のまま)
|
|
33
35
|
'top-band': '',
|
|
34
36
|
// 中央・上に太い帯(常盤)
|
|
@@ -50,6 +52,7 @@ export const SHAPES = Object.freeze({
|
|
|
50
52
|
circle: '.slide.cover::before{left:auto;right:-80px;top:-80px;width:300px;height:300px;border-radius:50%;background:var(--base-tint)}',
|
|
51
53
|
}),
|
|
52
54
|
concl: Object.freeze({
|
|
55
|
+
default: '',
|
|
53
56
|
// 左の縦線(既定。themes/default/tokens.css 1.2.0)
|
|
54
57
|
'left-rule': '',
|
|
55
58
|
// 角丸の枠(浅葱)
|
|
@@ -78,3 +81,14 @@ export function lookIn(tokensCss) {
|
|
|
78
81
|
for (const m of String(tokensCss).replace(/\r\n?/g, '\n').matchAll(/\/\* look (\w+): ([\w-]+) \*\/\n([\s\S]*?)\n\/\* \/look \*\//g)) out[m[1]] = { id: m[2], css: m[3] };
|
|
79
82
|
return out;
|
|
80
83
|
}
|
|
84
|
+
|
|
85
|
+
// Background choices are tokens; the starting theme retains its exact paper colour until changed.
|
|
86
|
+
export const BACKGROUNDS = Object.freeze({ white: '#FFFFFF', 'off-white': '#FFFDF8', 'base-wash': 'var(--base-wash)' });
|
|
87
|
+
export const FONT_KINDS = Object.freeze({ gothic: 'BIZ UDPGothic', mincho: 'BIZ UDPMincho', 'maru-gothic': 'Zen Maru Gothic' });
|
|
88
|
+
export const fontKindOf = (font) => /Maru/.test(font) ? 'maru-gothic' : /Mincho|Serif|Fraunces/.test(font) ? 'mincho' : 'gothic';
|
|
89
|
+
export const cleanLook = (look) => Object.fromEntries(Object.keys(DEFAULT_LOOK).map((key) => [key, Object.hasOwn(SHAPES[key], look?.[key]) ? look[key] : 'default']));
|
|
90
|
+
export const withoutLooks = (css) => String(css || '').replace(/\r\n?/g, '\n').replace(/\/\* look \w+: [\w-]+ \*\/\n[\s\S]*?\n\/\* \/look \*\//g, '');
|
|
91
|
+
|
|
92
|
+
// These bands sit outside all cover text boxes (venue, title and author).
|
|
93
|
+
// Keep this list explicit: a future band behind text must declare the foreground token here.
|
|
94
|
+
export const COVER_BAND_TEXT = Object.freeze({ default: null, 'top-band': null, 'top-band-wide': null, 'bottom-band': null, 'left-bar': null, frame: null, circle: null });
|
package/kit/deck.js
CHANGED
|
@@ -1970,7 +1970,8 @@ function broadcast(p){
|
|
|
1970
1970
|
var ni = step < slides[cur]._max ? cur : cur + 1, nk = step < slides[cur]._max ? step + 1 : 0;
|
|
1971
1971
|
var msg = {type: "deck-pos", i: cur, k: step, max: slides[cur]._max, n: slides.length, key: DECK.stepKey(cur, step),
|
|
1972
1972
|
nextKey: ni < slides.length ? DECK.stepKey(ni, nk) : null, auto: p.playing, cause: p.cause || "control",
|
|
1973
|
-
back: p.top ? titleOf(slides[p.top.i]) : null, black: isBlack(), viewer: inputState()
|
|
1973
|
+
back: p.top ? titleOf(slides[p.top.i]) : null, black: isBlack(), viewer: inputState(),
|
|
1974
|
+
bookmarks: DECK.bookmarks(), bm: !!(p.top && p.top.bm)};
|
|
1974
1975
|
if (presenter && !presenter.closed) presenter.postMessage(msg, "*");
|
|
1975
1976
|
// 編集のプレビュー(server/hints.js が DECK_DEV を立てた枠)では、中継する親の窓にも送る。ほかの親(埋め込み・知らない枠)には送らない(埋め込みは下の position だけ)
|
|
1976
1977
|
if (editorParent() && presenter !== window.parent) window.parent.postMessage(msg, "*");
|
|
@@ -2004,6 +2005,7 @@ window.addEventListener("message", function(e){
|
|
|
2004
2005
|
else if (m.cmd === "goto"){ POS.setCause("seek"); go(m.i, m.k, !!m.animate); POS.setCause(null); }
|
|
2005
2006
|
else if (m.cmd === "link" && typeof m.frag === "string") DECK.follow(m.frag); // 発表者ビューの中の画面で押したリンク
|
|
2006
2007
|
else if (m.cmd === "back") back();
|
|
2008
|
+
else if (m.cmd === "bookmark"){ if (m.next) bookmarkNext(); else if (typeof m.n === "number") bookmarkGo(m.n); } // 発表者ビューのしおりのボタンと q
|
|
2007
2009
|
else if (m.cmd === "blackout"){ if (!EDIT) setBlack(!isBlack()); else e.source.postMessage({type: "deck-black", on: false}, "*"); } // 発表者ビューの b(編集中は入らない)
|
|
2008
2010
|
else if (m.cmd === "auto"){ if (!EDIT) DECK.autoplay(); else POS.publish(); } // 編集中は始めない(発表者ビューのボタンは今の状態に戻す)
|
|
2009
2011
|
// 編集の画面から送られたキー:編集のプレビュー(server/hints.js が DECK_DEV を立てる)で、親の窓から届いたものだけ。ほかの送り手(自分・子の枠・別の窓)は無視する
|
|
@@ -2207,7 +2209,7 @@ function followLink(pos, opts){
|
|
|
2207
2209
|
if (DECK.view){ post({type: "deck-link", frag: fragmentOf(pos.i, pos.k)}); return false; } // 発表者ビューの中の画面:本体に任せる
|
|
2208
2210
|
var target = {slideKey: slides[pos.i]._key, stepKey: stepKey(slides[pos.i], pos.k)};
|
|
2209
2211
|
if (!LINKS.follow){ post(Object.assign({egatari: "linkRefused"}, target)); return false; }
|
|
2210
|
-
var depth = POS.push({i: POS.i, k: POS.k, el: opts.keyboard ? opts.el : null});
|
|
2212
|
+
var depth = POS.push({i: POS.i, k: POS.k, el: opts.keyboard ? opts.el : null, bm: !!opts.bm});
|
|
2211
2213
|
if (TOP) try { history.pushState({egatariLink: depth, to: {i: pos.i, k: pos.k}}, "", "#" + fragmentOf(pos.i, pos.k)); } catch (e) {}
|
|
2212
2214
|
moveTo(pos.i, pos.k, "link");
|
|
2213
2215
|
return true;
|
|
@@ -2248,6 +2250,45 @@ window.addEventListener("popstate", function(e){
|
|
|
2248
2250
|
moveTo(at.i, at.k, "link");
|
|
2249
2251
|
}
|
|
2250
2252
|
});
|
|
2253
|
+
// ---------------------------------------------------------------- しおり(format spec §8.0 Bookmarks、Player P4.3)
|
|
2254
|
+
// data-bookmark="名前" の付いたスライド(section.slide)へ、操作の帯・発表者ビューのボタンと q で飛ぶ。飛ぶ先はそのスライドの最終状態
|
|
2255
|
+
// (#<id>:concl のリンクと同じ。結論の行のないスライドは最後のステップ)。飛ぶのはリンクと同じ流れ(followLink)で、「戻る」の跡に bm の印を付ける。
|
|
2256
|
+
// 跡のいちばん上が bm の間は「しおりで来ている」:続けて飛んでも(ボタン・q)跡を積まず、「元の位置に戻る」(back)はしおりを使い始める前の位置へ。
|
|
2257
|
+
// q は今の位置より後の次のしおりへ。最後のしおりより後で押すと、しおりで来ていれば元の位置へ戻り、そうでなければ最初のしおりへ。
|
|
2258
|
+
// 動画(?mode=video)・発表者ビューの中の画面では使わない(ボタンも作らない。印刷では帯ごと隠れる)
|
|
2259
|
+
var BM = null;
|
|
2260
|
+
function bookmarkList(){
|
|
2261
|
+
if (BM) return BM;
|
|
2262
|
+
BM = [];
|
|
2263
|
+
slides.forEach(function(s, i){ var n = (s.getAttribute("data-bookmark") || "").replace(/\s+/g, " ").trim(); if (n) BM.push({i: i, name: n}); });
|
|
2264
|
+
return BM;
|
|
2265
|
+
}
|
|
2266
|
+
function bmAllowed(){ return started && DECK.mode !== "video" && !DECK.view && !videoViewer(); }
|
|
2267
|
+
function bmPos(b){ var s = slides[b.i]; return {i: b.i, k: s._cstep >= 0 ? s._cstep : s._max}; }
|
|
2268
|
+
function bmOn(){ var t = POS.top(); return !!(t && t.bm); }
|
|
2269
|
+
function bookmarkGo(n){
|
|
2270
|
+
var b = bmAllowed() ? bookmarkList()[n] : null;
|
|
2271
|
+
if (!b) return false;
|
|
2272
|
+
var p = bmPos(b);
|
|
2273
|
+
if (!bmOn()) return followLink(p, {bm: true});
|
|
2274
|
+
// しおりで来ている:跡は積まない(戻る先は元の位置のまま)。上の窓の履歴は今の項目の行き先だけを書き換える
|
|
2275
|
+
if (TOP && history.state && history.state.egatariLink === POS.depth) try { history.replaceState({egatariLink: POS.depth, to: {i: p.i, k: p.k}}, "", "#" + fragmentOf(p.i, p.k)); } catch (e) {}
|
|
2276
|
+
moveTo(p.i, p.k, "link");
|
|
2277
|
+
return true;
|
|
2278
|
+
}
|
|
2279
|
+
function bookmarkNext(){
|
|
2280
|
+
var L = bmAllowed() ? bookmarkList() : [];
|
|
2281
|
+
if (!L.length) return false;
|
|
2282
|
+
for (var n = 0; n < L.length; n++){ var p = bmPos(L[n]); if (p.i > POS.i || (p.i === POS.i && p.k > POS.k)) return bookmarkGo(n); }
|
|
2283
|
+
if (bmOn()) return back(); // 最後のしおりの後:元の位置へ
|
|
2284
|
+
return bookmarkGo(0);
|
|
2285
|
+
}
|
|
2286
|
+
DECK.bookmarks = function(){ return bmAllowed() ? bookmarkList().map(function(b){ return {i: b.i, name: b.name}; }) : []; };
|
|
2287
|
+
DECK.bookmark = function(n){ return bookmarkGo(n); };
|
|
2288
|
+
DECK.nextBookmark = function(){ return bookmarkNext(); };
|
|
2289
|
+
DECK.bookmarkActive = function(){ return bmAllowed() && bmOn(); };
|
|
2290
|
+
DECK.bookmarkBack = function(){ return bmAllowed() && bmOn() ? back() : false; };
|
|
2291
|
+
|
|
2251
2292
|
// ---------------------------------------------------------------- 授業の外へ出るリンク(format spec §11。決まりは kit/core/link-policy.mjs の LinkPolicy)
|
|
2252
2293
|
// 外へ出るときは、行き先の host と全体を見せて確かめる(https: の普通のリンクは、同じ閲覧のあいだ同じ host に一度同意すれば再び聞かない)。
|
|
2253
2294
|
// 見える字が別の host を名指す・https: でない・ダウンロード・userinfo・punycode の host は、毎回確かめる。http(s)・mailto・tel 以外は開かない。
|
|
@@ -2374,6 +2415,15 @@ function syncBack(){
|
|
|
2374
2415
|
document.body.appendChild(b);
|
|
2375
2416
|
}
|
|
2376
2417
|
var to = titleOf(slides[t.i]);
|
|
2418
|
+
if (t.bm){ // しおりで来ている:元の位置に戻る(Player P4.3)
|
|
2419
|
+
LINKS.btn.querySelector(".lab").textContent = L10N("元の位置に戻る", "Back to where you were");
|
|
2420
|
+
LINKS.btn.querySelector(".to").textContent = "";
|
|
2421
|
+
LINKS.btn.title = L10N("元の位置に戻る(Backspace)", "Back to where you were (Backspace)");
|
|
2422
|
+
LINKS.btn.setAttribute("aria-label", L10N("元の位置に戻る", "Back to where you were"));
|
|
2423
|
+
LINKS.btn.setAttribute("aria-keyshortcuts", "Backspace Alt+ArrowLeft");
|
|
2424
|
+
LINKS.btn.hidden = false;
|
|
2425
|
+
return;
|
|
2426
|
+
}
|
|
2377
2427
|
LINKS.btn.querySelector(".lab").textContent = L10N("戻る", "Back");
|
|
2378
2428
|
LINKS.btn.querySelector(".to").textContent = to;
|
|
2379
2429
|
LINKS.btn.title = L10N("戻る:", "Back to ") + to + L10N("(Backspace / Alt+←)", " (Backspace / Alt+←)");
|
|
@@ -2674,6 +2724,7 @@ document.addEventListener("keydown", function(e){
|
|
|
2674
2724
|
if (EDIT && (k === "a" || k === "b" || k === "f")) return;
|
|
2675
2725
|
if (k === "f") DECK.toggleFullscreen();
|
|
2676
2726
|
else if (k === "p") openPresenter();
|
|
2727
|
+
else if (k === "q"){ if (bookmarkNext()) e.preventDefault(); } // 次のしおりへ(Player P4.3)
|
|
2677
2728
|
else if (k === "a") DECK.autoplay();
|
|
2678
2729
|
else if (k === "l") DECK.togglePreview();
|
|
2679
2730
|
else if (k === ">" || k === "<") stepRate(k === ">" ? 1 : -1);
|
package/kit/llm-pack.mjs
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
// node kit/llm-pack.mjs --no-fit [--sets …] 無料のプランで目安に収めない(下の fit をしない。比べる・調べる用)
|
|
5
5
|
// node kit/llm-pack.mjs --from-sample <名前> [--request <文|ファイル>] [--plan …] [--lang …]
|
|
6
6
|
// 「このサンプルを参考に作る」で ② を書いて ④ で写す指示と同じバイト(backlog #130。kit/core/new-deck-pack.mjs の fromSamplePack):
|
|
7
|
-
// examples/<名前>/sample.json
|
|
8
|
-
//
|
|
9
|
-
//
|
|
7
|
+
// examples/<名前>/sample.json の場面・テーマ・ラベル(伝えたいこと・題材・読み手)と構成。--request の 1 行目は ② のタイトル、
|
|
8
|
+
// 残りは内容(なければ空)。指示はパーツの順位で組む(サンプルのパーツが一番上。handoff #43 ④):上から説明を載せ、
|
|
9
|
+
// 上限を越える手前で止め、残りは言いたいことの表に名前だけ(軽量も詳細も同じ。kit/core/new-deck-pack.mjs の newDeckPack)
|
|
10
10
|
// node kit/llm-pack.mjs --list [--lang ja] 束・その部品・大きさ(無料のプランは収めた大きさと収める前の大きさ。最後に有料のプラン)
|
|
11
11
|
// node kit/llm-pack.mjs --help | -h 使い方
|
|
12
12
|
// 無料のプランは、編集アプリの新規作成と同じに目安(PACK_CAP_KB.free と、貼り付けの長さ FREE_PASTE_UNITS の近いほう。fitSize)に収める(kit/core/llm-pack.mjs の fitPack。backlog #125):
|
|
@@ -110,10 +110,8 @@ if (argv.includes('--from-sample')) {
|
|
|
110
110
|
if (argv.includes('--no-fit') || arg('--sets') !== undefined || argv.includes('--list')) throw new Error('--from-sample cannot be used with --sets, --list or --no-fit');
|
|
111
111
|
const lang = langArg || 'en', plan = planArg || 'free';
|
|
112
112
|
const r = samplePack(String(arg('--from-sample') || ''), lang, plan);
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
if (r.dropped.length) console.error(`note: ${plan} plan: still over the limit, so these specialized parts the sample does not use were left out, largest first: ${r.dropped.join(', ')} (the sample's own parts stay)`);
|
|
116
|
-
if (r.ownShortened.length) console.error(`note: light instructions: still over the limit with nothing else to leave out, so these parts of the sample get only their catalogue line too: ${r.ownShortened.join(', ')}`);
|
|
113
|
+
// 順位で組む(kit/core/new-deck-pack.mjs の newDeckPack):説明つきのパーツと名前だけのパーツの数を stderr に
|
|
114
|
+
console.error(`note: ${plan} plan: ${r.described.length} parts described (${r.described.join(', ') || 'none'}), ${r.named.length} by name only`);
|
|
117
115
|
if (r.over) console.error(`warning: ${plan} plan: ${kbOf(r.bytes)} KB is still over the limit`);
|
|
118
116
|
process.stdout.write(r.text);
|
|
119
117
|
} catch (e) { console.error(e.message); process.exit(2); }
|
package/kit/player.json
CHANGED
package/kit/player.lock.json
CHANGED
package/kit/presenter.js
CHANGED
|
@@ -10,11 +10,11 @@ var DECK = window.DECK;
|
|
|
10
10
|
var L = DECK.ja === false
|
|
11
11
|
? {cur: "Current slide", nextFrame: "Next slide", end: "End", auto: "Autoplay", stop: "Stop", autoKey: "Autoplay (a)", reset: "Reset timer", next: "Next slide", notes: "Script", slide: "Slide ", step: "Step ", none: "(no script)", nextStep: "Next step",
|
|
12
12
|
laser: "Laser pointer (x)", pen: "Pen (d)", color: "Pen color", vpen: "Fading pen (v)", clear: "Clear ink", over: "Overview on the main window (o)", lect: "Show later steps faintly (l)",
|
|
13
|
-
feedback: "Send feedback", back: "Back", close: "Close presenter view (p)", tap: "Click here to control", black: "Black screen", blackT: "The audience screen is black (b, or click it, to return)",
|
|
13
|
+
feedback: "Send feedback", back: "Back", bmGroup: "Bookmarks", bm: "Bookmark: ", bmBack: "Back to where you were", close: "Close presenter view (p)", tap: "Click here to control", black: "Black screen", blackT: "The audience screen is black (b, or click it, to return)",
|
|
14
14
|
legend: [["→/Space", "next"], ["←", "prev"], ["a", "autoplay"], ["b", "black screen"], ["x", "laser pointer"], ["d", "pen"], ["v", "fading pen"], ["o", "overview"], ["Esc", "exit tool / close"], ["p", "close"]]}
|
|
15
15
|
: {cur: "今の画面", nextFrame: "次のスライド", end: "終わり", auto: "自動再生", stop: "停止", autoKey: "自動再生(a)", reset: "経過時間を戻す", next: "次のスライド", notes: "台本", slide: "スライド ", step: "ステップ ", none: "(台本なし)", nextStep: "次のステップ",
|
|
16
16
|
laser: "レーザーポインター(x)", pen: "ペン(d)", color: "ペンの色", vpen: "消えるペン(v)", clear: "書き込みを消去", over: "本体でスライド一覧(o)", lect: "先のステップを薄く見せる(l)",
|
|
17
|
-
feedback: "フィードバックを送信", back: "戻る", close: "発表者ビューを閉じる(p)", tap: "ここを押すと操作できます", black: "黒い画面中", blackT: "本体の画面は真っ黒です(b か、本体の画面のクリックで戻る)",
|
|
17
|
+
feedback: "フィードバックを送信", back: "戻る", bmGroup: "しおり", bm: "しおり:", bmBack: "元の位置に戻る", close: "発表者ビューを閉じる(p)", tap: "ここを押すと操作できます", black: "黒い画面中", blackT: "本体の画面は真っ黒です(b か、本体の画面のクリックで戻る)",
|
|
18
18
|
legend: [["→/Space", "次"], ["←", "前"], ["a", "自動再生"], ["b", "黒い画面"], ["x", "レーザーポインター"], ["d", "ペン"], ["v", "消えるペン"], ["o", "一覧"], ["Esc", "解除・閉じる"], ["p", "閉じる"]]};
|
|
19
19
|
// 道具のボタン:[絵の名前, キー(DECK.ptools.key に渡す), 表示するキー]
|
|
20
20
|
var TOOLS = [["laser", "x", "x"], ["pen", "d", "d"], ["vpen", "v", "v"], ["clear", "clear", "⌫"], ["over", "o", "o"], ["lect", "l", "l"]];
|
|
@@ -53,6 +53,7 @@ DECK.presenterView = function(){
|
|
|
53
53
|
'<div id="pv">' +
|
|
54
54
|
' <header><span id="pv-pos"></span><span id="pv-step"></span><span id="pv-black" role="status" title="' + L.blackT + '" hidden>■ ' + L.black + '</span><span class="sp"></span>' +
|
|
55
55
|
' <button type="button" id="pv-back" aria-label="' + L.back + '" hidden>← ' + L.back + '</button>' +
|
|
56
|
+
' <span id="pv-bm" role="group" aria-label="' + L.bmGroup + '" hidden></span>' +
|
|
56
57
|
' <button type="button" id="pv-auto" title="' + L.autoKey + '" aria-pressed="false">▶ ' + L.auto + '</button>' + tools +
|
|
57
58
|
'<button type="button" id="pv-reset" title="' + L.reset + '" aria-label="' + L.reset + '">⟲</button>' +
|
|
58
59
|
' <span id="pv-timer" role="timer">00:00</span><span id="pv-clock"></span>' +
|
|
@@ -84,6 +85,8 @@ DECK.presenterView = function(){
|
|
|
84
85
|
"#pv-text p{margin:0 0 10px;font-size:22px;line-height:1.6}#pv-text .role{color:#9cf;font-size:14px;margin-right:6px}" +
|
|
85
86
|
"#pv-text .note{color:#f2cf86;font-size:.85em;font-style:italic;white-space:pre-wrap}@media print{#pv-text .note{display:none!important}}" +
|
|
86
87
|
"#pv-text .next{color:#888}#pv-text .next p{font-size:18px}" +
|
|
88
|
+
"#pv-bm{display:flex;gap:4px;min-width:0;flex-wrap:wrap}#pv-bm[hidden],#pv-bm button[hidden]{display:none}" +
|
|
89
|
+
"#pv-bm button{max-width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#pv-bm button[aria-current=true]{border-color:#ddd}" +
|
|
87
90
|
"#pv header button{height:34px}#pv-back{max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#pv-back[hidden]{display:none}" +
|
|
88
91
|
"#pv .pv-tools{display:flex;gap:4px}" +
|
|
89
92
|
"#pv .pv-tools button{display:flex;align-items:center;gap:5px;padding:0 9px;user-select:none}" +
|
|
@@ -141,9 +144,10 @@ DECK.presenterView = function(){
|
|
|
141
144
|
ab.setAttribute("aria-pressed", pos.auto ? "true" : "false");
|
|
142
145
|
syncTools();
|
|
143
146
|
document.getElementById("pv-step").textContent = L.step + pos.k + " / " + pos.max;
|
|
144
|
-
|
|
147
|
+
syncBookmarks();
|
|
148
|
+
// リンクで来たとき:本体と同じ「戻る」(しおりで来ているときは、しおりの「元の位置に戻る」を出す)
|
|
145
149
|
var bb = document.getElementById("pv-back");
|
|
146
|
-
bb.hidden = !pos.back;
|
|
150
|
+
bb.hidden = !pos.back || !!pos.bm;
|
|
147
151
|
if (pos.back){ var c = DECK.ja === false ? ": " : ":"; bb.textContent = "← " + L.back + c + pos.back; bb.title = L.back + c + pos.back + (DECK.ja === false ? " (Backspace / Alt+←)" : "(Backspace / Alt+←)"); bb.setAttribute("aria-label", L.back + c + pos.back); }
|
|
148
152
|
fc.contentWindow && fc.contentWindow.postMessage({type: "deck-goto", i: pos.i, k: pos.k, animate: true, viewer: pos.viewer}, "*");
|
|
149
153
|
// 次のスライド:段階が残っていても次のスライドを、すべてのステップを出した姿で(k は大きく送り、デッキが最後の段階に収める)。
|
|
@@ -158,6 +162,33 @@ DECK.presenterView = function(){
|
|
|
158
162
|
document.getElementById("pv-text").innerHTML = ai + (html(cur) || '<p style="color:#777">' + L.none + '</p>') +
|
|
159
163
|
(nxt.length ? '<div class="next"><div class="lab">' + L.nextStep + '</div>' + html(nxt) + "</div>" : "");
|
|
160
164
|
}
|
|
165
|
+
// しおり(format spec §8.0、Player P4.3):本体の帯と同じボタン。名前のボタンは本体の位置の知らせ(bookmarks)から作り、
|
|
166
|
+
// しおりで来ている間(bm)だけ「元の位置に戻る」
|
|
167
|
+
var bmSig = null, bmButtons = [];
|
|
168
|
+
function syncBookmarks(){
|
|
169
|
+
var g = document.getElementById("pv-bm"), BL = pos.bookmarks || [], sig = JSON.stringify(BL);
|
|
170
|
+
if (sig !== bmSig){
|
|
171
|
+
bmSig = sig; g.textContent = ""; bmButtons = [];
|
|
172
|
+
BL.forEach(function(x, n){
|
|
173
|
+
var b = document.createElement("button"); b.type = "button"; b.setAttribute("data-bm", n);
|
|
174
|
+
b.textContent = x.name; b.title = L.bm + x.name; b.setAttribute("aria-label", L.bm + x.name);
|
|
175
|
+
b.addEventListener("mousedown", function(e){ e.preventDefault(); });
|
|
176
|
+
b.onclick = function(e){ send("bookmark", {n: n}); if (e.detail !== 0) b.blur(); };
|
|
177
|
+
g.appendChild(b); bmButtons.push(b);
|
|
178
|
+
});
|
|
179
|
+
var r = document.createElement("button"); r.type = "button"; r.id = "pv-bmback"; r.hidden = true;
|
|
180
|
+
r.textContent = "↩ " + L.bmBack; r.title = L.bmBack + (DECK.ja === false ? " (Backspace)" : "(Backspace)"); r.setAttribute("aria-label", L.bmBack);
|
|
181
|
+
r.addEventListener("mousedown", function(e){ e.preventDefault(); });
|
|
182
|
+
r.onclick = function(e){ send("back"); if (e.detail !== 0) r.blur(); };
|
|
183
|
+
g.appendChild(r);
|
|
184
|
+
}
|
|
185
|
+
g.hidden = !BL.length;
|
|
186
|
+
var rb = document.getElementById("pv-bmback"); if (rb) rb.hidden = !pos.bm;
|
|
187
|
+
bmButtons.forEach(function(b){
|
|
188
|
+
var x = BL[+b.getAttribute("data-bm")];
|
|
189
|
+
if (pos.bm && x && x.i === pos.i) b.setAttribute("aria-current", "true"); else b.removeAttribute("aria-current");
|
|
190
|
+
});
|
|
191
|
+
}
|
|
161
192
|
window.addEventListener("message", function(e){
|
|
162
193
|
var m = e.data || {};
|
|
163
194
|
if (m.type === "deck-pos" && e.source === opener){ pos = m; update(); if (typeof m.black === "boolean") setBlack(m.black); }
|
|
@@ -212,6 +243,7 @@ DECK.presenterView = function(){
|
|
|
212
243
|
else if (k === "ArrowLeft" || k === "PageUp" || k === "ArrowUp"){ e.preventDefault(); send("prev"); }
|
|
213
244
|
else if (e.metaKey || e.ctrlKey) return;
|
|
214
245
|
else if (k === "a") send("auto");
|
|
246
|
+
else if (k === "q"){ e.preventDefault(); send("bookmark", {next: true}); } // 次のしおりへ(Player P4.3)
|
|
215
247
|
else if (k === "b"){ e.preventDefault(); send("blackout"); }
|
|
216
248
|
});
|
|
217
249
|
// マウスで押したらフォーカスを残さない(キーボードで押したとき、detail = 0、は残す)
|
package/kit/tools.js
CHANGED
|
@@ -108,6 +108,8 @@ if (Q.get("presenter")){
|
|
|
108
108
|
else if (m.type === "deck-tool-key" && !m.mod && (m.alt || !key(m.key, m.shift))){
|
|
109
109
|
// Esc(道具を使っていなければ。使っていれば上の key が切る)と p:発表者ビューを閉じる(presenter.js。全画面なら全画面をやめるだけ)
|
|
110
110
|
if (!m.alt && (m.key === "Escape" || m.key === "p")){ if (DECK.presenterClose) DECK.presenterClose(); return; }
|
|
111
|
+
// 「今の画面」にフォーカスがあるときの q:次のしおりへ(Player P4.3)
|
|
112
|
+
if (!m.alt && !m.shift && m.key === "q"){ if (window.opener) window.opener.postMessage({type: "deck-cmd", cmd: "bookmark", next: true}, "*"); return; }
|
|
111
113
|
// 「今の画面」にフォーカスがあるときの送り操作。Backspace・Alt+← はリンクの前の位置へ戻る
|
|
112
114
|
var bk = (m.key === "Backspace" && !m.alt && !m.shift) || (m.key === "ArrowLeft" && m.alt);
|
|
113
115
|
var nx = !m.alt && /^(ArrowRight|ArrowDown|PageDown| )$/.test(m.key), pv = !m.alt && /^(ArrowLeft|ArrowUp|PageUp)$/.test(m.key);
|
|
@@ -143,6 +145,8 @@ css(
|
|
|
143
145
|
".dt-cell:hover .dt-thumb{outline-color:rgba(255,255,255,.35)}.dt-cell.sel .dt-thumb{outline-color:#fff}" +
|
|
144
146
|
".dt-cap{display:flex;gap:8px;margin-top:8px;white-space:nowrap;overflow:hidden}.dt-cap span{overflow:hidden;text-overflow:ellipsis}" +
|
|
145
147
|
".dt-cap b{font-variant-numeric:tabular-nums;color:#999;font-weight:600}" +
|
|
148
|
+
// 一覧のしおりの名前(Player P4.3):題の後ろに小さく薄く
|
|
149
|
+
".dt-cap .dt-bmk{flex:none;max-width:45%;color:#999;font-size:12px;align-self:center}.dt-cell.sel .dt-cap .dt-bmk{color:#ccc}" +
|
|
146
150
|
".dt-cell.cur .dt-cap b{color:#fff;background:var(--emph,#d33);border-radius:4px;padding:0 6px}.dt-cell.sel .dt-cap{color:#fff}" +
|
|
147
151
|
// 操作の帯(モード表示と同じ、暗い半透明の丸い帯)
|
|
148
152
|
"#dt-cb{position:fixed;left:50%;bottom:10px;z-index:35;display:flex;align-items:center;gap:1px;padding:3px 7px;border-radius:999px;" +
|
|
@@ -170,6 +174,10 @@ css(
|
|
|
170
174
|
"#dt-cb svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}" +
|
|
171
175
|
"#dt-cb kbd{font:600 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;opacity:.55;letter-spacing:.02em}#dt-cb button.on kbd{opacity:.7}" +
|
|
172
176
|
"#dt-cb .sep{width:1px;height:18px;background:rgba(255,255,255,.18);margin:0 5px}" +
|
|
177
|
+
// しおり(Player P4.3):名前の字のボタンをまとめ、しおりで来ている間だけ「元の位置に戻る」
|
|
178
|
+
"#dt-cb .dt-bm{display:flex;align-items:center;gap:2px}" +
|
|
179
|
+
"#dt-cb .dt-bm button{width:auto;max-width:16em;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;line-height:32px;font:600 12px/32px -apple-system,BlinkMacSystemFont,'Hiragino Sans',sans-serif}" +
|
|
180
|
+
"#dt-cb .dt-bm button[hidden]{display:none}#dt-cb .dt-bm button[aria-current=true]{box-shadow:inset 0 -2px 0 rgba(255,255,255,.7)}" +
|
|
173
181
|
// 再生速度:字で今の速さを見せる
|
|
174
182
|
"#dt-cb button[data-b=rate]{width:auto;min-width:40px;padding:0 4px;font:600 12px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-variant-numeric:tabular-nums}" +
|
|
175
183
|
// 編集モードの間は、発表の道具(再生・再生速度・レーザー・ペン・消えるペン・色・消す・一覧・全画面)のボタンを隠す
|
|
@@ -658,6 +666,13 @@ function openOverview(){
|
|
|
658
666
|
cell.innerHTML = '<span class="dt-thumb" style="display:block" aria-hidden="true"></span><span class="dt-cap" style="display:flex" aria-hidden="true"><b>' + (i + 1) + "</b><span></span></span>";
|
|
659
667
|
cell.querySelector(".dt-thumb").appendChild(c);
|
|
660
668
|
cell.querySelector(".dt-cap span").textContent = titleOf(s);
|
|
669
|
+
// しおりの名前(Player P4.3):題の後ろに小さく
|
|
670
|
+
var bmk = (s.getAttribute("data-bookmark") || "").replace(/\s+/g, " ").trim();
|
|
671
|
+
if (bmk){
|
|
672
|
+
var bt = document.createElement("span"); bt.className = "dt-bmk"; bt.textContent = BM_T.one(bmk);
|
|
673
|
+
cell.querySelector(".dt-cap").appendChild(bt);
|
|
674
|
+
cell.setAttribute("aria-label", cell.getAttribute("aria-label") + (JA ? "(" : " (") + BM_T.one(bmk) + (JA ? ")" : ")"));
|
|
675
|
+
}
|
|
661
676
|
cell.addEventListener("click", function(){ pick(i); });
|
|
662
677
|
grid.appendChild(cell); cells.push(cell);
|
|
663
678
|
}); });
|
|
@@ -788,7 +803,7 @@ function rateNext(){ var R = DECK.RATES || [1], j = R.indexOf(DECK.rate()); DECK
|
|
|
788
803
|
function playStep(d){ if (DECK.playStep) DECK.playStep(d); else press(d < 0 ? "ArrowLeft" : "ArrowRight"); }
|
|
789
804
|
var BTNS = [["prev", "←", function(){ playStep(-1); }], ["auto", "a", "a"], ["next", "→", function(){ playStep(1); }], ["rate", "", rateNext], null,
|
|
790
805
|
["laser", "x", "x"], ["pen", "d", "d"], ["vpen", "v", "v"], ["clear", "⌫", function(){ clear(false); }], null,
|
|
791
|
-
["over", "o", "o"], ["view", "r", function(b){ DECK.panes.menu(b); }], ["lect", "l", "l"], ["cap", "s", "s"], ["read", "", function(){ raStart(); }], ["mute", "", function(){ DECK.muteSounds(!DECK.muteSounds()); }], ["pres", "p", "p"], ["full", "f", "f"], null, ["help", "?", "?"]];
|
|
806
|
+
["over", "o", "o"], ["view", "r", function(b){ DECK.panes.menu(b); }], ["lect", "l", "l"], ["cap", "s", "s"], ["read", "", function(){ raStart(); }], ["mute", "", function(){ DECK.muteSounds(!DECK.muteSounds()); }], ["pres", "p", "p"], ["full", "f", "f"], null, ["bm"], null, ["help", "?", "?"]];
|
|
792
807
|
TIP.auto = PLAY.play; TIP.rate = PLAY.rate;
|
|
793
808
|
// 押すと入/切が変わるボタン(aria-pressed を付ける)
|
|
794
809
|
var TOGGLES = ["auto", "laser", "pen", "vpen", "lect", "cap", "read", "mute", "full", "help"];
|
|
@@ -809,7 +824,10 @@ function buildBar(){
|
|
|
809
824
|
cb = document.createElement("div"); cb.id = "dt-cb"; cb.className = "deck-tools";
|
|
810
825
|
cb.setAttribute("role", "toolbar");
|
|
811
826
|
cb.setAttribute("aria-label", JA ? "スライドの操作" : "Slide controls");
|
|
827
|
+
var skipSep = false;
|
|
812
828
|
BTNS.forEach(function(b){
|
|
829
|
+
if (!b && skipSep){ skipSep = false; return; }
|
|
830
|
+
if (b && b[0] === "bm"){ if (!bmGroup()) skipSep = true; return; }
|
|
813
831
|
if (!b){ var s = document.createElement("i"); s.className = "sep" + (cb.querySelector('[data-b="clear"]') && !cb.querySelector(".dt-tsep") ? " dt-tsep" : ""); s.setAttribute("aria-hidden", "true"); cb.appendChild(s); return; }
|
|
814
832
|
if (b[0] === "read" && !RA) return; // 読み上げ:端末で読めないとき・読めるステップがないときは出さない
|
|
815
833
|
if (b[0] === "mute" && !(DECK.hasComponentSounds && DECK.hasComponentSounds())) return;
|
|
@@ -895,6 +913,29 @@ function buildBar(){
|
|
|
895
913
|
placeBar(); syncBar(); // 帯の高さ(狭い画面では 2 行)を測って置く
|
|
896
914
|
if (!hintSeen()) showHint();
|
|
897
915
|
}
|
|
916
|
+
// しおり(format spec §8.0、Player P4.3):しおりの名前のボタン(押すとそのスライドの最終状態へ)と、しおりで来ている間だけの「元の位置に戻る」。
|
|
917
|
+
// しおりがなければ作らない(false)。動画ではこの道具ごと作らない。印刷では帯ごと隠れる
|
|
918
|
+
var BM_T = JA ? {group: "しおり", one: function(n){ return "しおり:" + n; }, back: "元の位置に戻る"}
|
|
919
|
+
: {group: "Bookmarks", one: function(n){ return "Bookmark: " + n; }, back: "Back to where you were"};
|
|
920
|
+
function bmGroup(){
|
|
921
|
+
var L = DECK.bookmarks ? DECK.bookmarks() : [];
|
|
922
|
+
if (!L.length) return false;
|
|
923
|
+
var g = document.createElement("span"); g.className = "dt-bm"; g.setAttribute("role", "group"); g.setAttribute("aria-label", BM_T.group);
|
|
924
|
+
L.forEach(function(x, n){
|
|
925
|
+
var e = document.createElement("button"); e.type = "button";
|
|
926
|
+
e.setAttribute("data-bm", n); e.textContent = x.name;
|
|
927
|
+
e.title = BM_T.one(x.name); e.setAttribute("aria-label", BM_T.one(x.name));
|
|
928
|
+
e._act = function(){ DECK.bookmark(n); };
|
|
929
|
+
g.appendChild(e);
|
|
930
|
+
});
|
|
931
|
+
var r = document.createElement("button"); r.type = "button";
|
|
932
|
+
r.setAttribute("data-b", "bmback"); r.textContent = "↩ " + BM_T.back; r.hidden = true;
|
|
933
|
+
r.title = BM_T.back + kk("Backspace"); r.setAttribute("aria-label", BM_T.back); r.setAttribute("aria-keyshortcuts", "Backspace");
|
|
934
|
+
r._act = function(){ DECK.bookmarkBack(); };
|
|
935
|
+
g.appendChild(r);
|
|
936
|
+
cb.appendChild(g);
|
|
937
|
+
return true;
|
|
938
|
+
}
|
|
898
939
|
// 舞台の下に 44px 以上の余白があれば余白の真ん中に、なければ下端に重ねる
|
|
899
940
|
// 舞台を置く箱(kit/deck.js の fit と同じ。窓の並べ方で左の欄だけになる:kit/panes.js の DECK.stageBox)
|
|
900
941
|
function sbox(){ var b = DECK.stageBox && DECK.stageBox(); return b || {x: 0, y: 0, w: innerWidth, h: innerHeight}; }
|
|
@@ -1022,6 +1063,16 @@ function syncBar(){
|
|
|
1022
1063
|
rb.title = PLAY.rate + (JA ? ":" : ": ") + rv + "×" + kk("< >");
|
|
1023
1064
|
rb.setAttribute("aria-label", PLAY.rate + (JA ? ":" : ": ") + rv + "×");
|
|
1024
1065
|
}
|
|
1066
|
+
// しおり:しおりで来ている間だけ「元の位置に戻る」。今いるしおりのボタンに印
|
|
1067
|
+
var bg = cb.querySelector(".dt-bm");
|
|
1068
|
+
if (bg){
|
|
1069
|
+
var act = DECK.bookmarkActive && DECK.bookmarkActive(), st = DECK.state(), L = DECK.bookmarks();
|
|
1070
|
+
bg.querySelector('[data-b="bmback"]').hidden = !act;
|
|
1071
|
+
[].forEach.call(bg.querySelectorAll("[data-bm]"), function(x){
|
|
1072
|
+
var b = L[+x.getAttribute("data-bm")], here = !!(act && b && b.i === st.slide - 1);
|
|
1073
|
+
if (here) x.setAttribute("aria-current", "true"); else x.removeAttribute("aria-current");
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1025
1076
|
// ボタンの数が変わって(ペンの色・編集モード)帯の行の数が変わったら、置き直す
|
|
1026
1077
|
if (cb.offsetHeight !== cb._h){ cb._h = cb.offsetHeight; placeBar(); }
|
|
1027
1078
|
}
|
|
@@ -1037,7 +1088,8 @@ function helpHtml(){
|
|
|
1037
1088
|
row(K("→", "Space"), j ? "次のステップ" : "Next step"), row(K("←"), j ? "前のステップ" : "Previous step"),
|
|
1038
1089
|
row(K("Shift") + "+" + K("←", "→"), j ? "スライド単位" : "By slide"), row(K("Home", "End"), j ? "最初 / 最後" : "First / last"),
|
|
1039
1090
|
row(K("12") + " " + K("Enter"), j ? "そのページへ" : "Go to slide"), row(K("o"), j ? "スライド一覧" : "Slide overview"),
|
|
1040
|
-
row(K("Backspace") + " / " + K("Alt") + "+" + K("←"), j ? "リンクの前に戻る" : "Back (after a link)")]
|
|
1091
|
+
row(K("Backspace") + " / " + K("Alt") + "+" + K("←"), j ? "リンクの前に戻る" : "Back (after a link)")]
|
|
1092
|
+
.concat(DECK.bookmarks && DECK.bookmarks().length ? [row(K("q"), j ? "次のしおりへ(最後の次は元の位置へ)" : "Next bookmark (after the last one, back to where you were)")] : [])),
|
|
1041
1093
|
sec(j ? "表示" : "View", [row(K("a"), PLAY.play + " / " + PLAY.pause), row(K("<") + " " + K(">"), PLAY.rate + (j ? "(遅く / 速く)" : " (slower / faster)"))].concat(DECK.panes && !isDev() && (!DECK.panes.offered || DECK.panes.offered().length > 1) ? [row(K("r"), DECK.panes.order())] : []).concat([row(K("l"), j ? "先のステップを薄く見せる(l)" : "Show later steps faintly (l)"), row(K("s"), j ? "字幕" : "Captions"),
|
|
1042
1094
|
row(K("Shift") + "+" + K("s"), j ? "字幕の大きさ(S / M / L)" : "Caption size (S / M / L)"),
|
|
1043
1095
|
row(K("b"), j ? "黒い画面" : "Black screen")].concat(canFull() ? [row(K("f"), j ? "全画面" : "Fullscreen")] : []).concat([row(K("p"), j ? "発表者ビュー" : "Presenter view")]).concat([
|