egatari 0.6.8 → 0.6.9-rc.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.
Files changed (78) hide show
  1. package/README.ja.md +2 -2
  2. package/README.md +2 -2
  3. package/components.lock.json +84 -3
  4. package/components2.lock.json +202 -1
  5. package/kit/check-messages.mjs +5 -0
  6. package/kit/check.mjs +9 -4
  7. package/kit/core/check-parity.mjs +62 -0
  8. package/kit/core/check-source.mjs +56 -0
  9. package/kit/core/colab-core.mjs +1 -1
  10. package/kit/core/color-vocab.mjs +8 -2
  11. package/kit/core/layout-scan.mjs +7 -4
  12. package/kit/core/llm-pack-assemble.mjs +1 -1
  13. package/kit/core/llm-pack-data.mjs +185 -9
  14. package/kit/core/llm-pack.mjs +1 -1
  15. package/kit/core/narration-lint.mjs +12 -0
  16. package/kit/core/new-deck.mjs +3 -0
  17. package/kit/core/part-labels.mjs +6 -0
  18. package/kit/core/template-text.mjs +5 -3
  19. package/kit/deck.js +88 -13
  20. package/kit/instruction-version.json +1 -1
  21. package/kit/player.json +1 -1
  22. package/kit/player.lock.json +2 -2
  23. package/kit/presenter.js +33 -9
  24. package/kit/tools.js +4 -0
  25. package/package.json +1 -1
  26. package/themes/asagi/theme.json +1 -1
  27. package/themes/asagi/tokens.css +12 -0
  28. package/themes/business/theme.json +1 -1
  29. package/themes/business/tokens.css +12 -0
  30. package/themes/default/README.ja.md +24 -1
  31. package/themes/default/README.md +24 -1
  32. package/themes/default/theme.json +1 -1
  33. package/themes/default/tokens.css +12 -0
  34. package/themes/kogecha/theme.json +1 -1
  35. package/themes/kogecha/tokens.css +12 -0
  36. package/themes/kokugo/theme.json +1 -1
  37. package/themes/kokugo/tokens.css +12 -0
  38. package/themes/murasaki/theme.json +1 -1
  39. package/themes/murasaki/tokens.css +12 -0
  40. package/themes/sumi/theme.json +1 -1
  41. package/themes/sumi/tokens.css +12 -0
  42. package/themes/tokiwa/theme.json +1 -1
  43. package/themes/tokiwa/tokens.css +12 -0
  44. package/themes.lock.json +80 -24
  45. package/vendor/components/CATALOG.md +7 -1
  46. package/vendor/components/sha256/1298d779fe60ccfc09747fbdba47e2111175bd7fd2385a5b68c8f2644cd267be/README.en.md +23 -0
  47. package/vendor/components/sha256/1298d779fe60ccfc09747fbdba47e2111175bd7fd2385a5b68c8f2644cd267be/index.js +120 -0
  48. package/vendor/components/sha256/7aea8341beffcd4ad95c12b7e7e3be3f0f52eb7932d424be9e74e2fbd7339e45/README.en.md +23 -0
  49. package/vendor/components/sha256/7aea8341beffcd4ad95c12b7e7e3be3f0f52eb7932d424be9e74e2fbd7339e45/index.js +289 -0
  50. package/vendor/components/sha256/90ed438b40ed8d765348834b2bed2baad9b0053c2168c218335b6d95b9c80283/README.en.md +44 -0
  51. package/vendor/components/sha256/90ed438b40ed8d765348834b2bed2baad9b0053c2168c218335b6d95b9c80283/index.js +203 -0
  52. package/vendor/components/sha256/a69ab76ff7d0746d093b4e606d7b113be921cbb156edc16c2ad40aafab280d42/README.en.md +22 -0
  53. package/vendor/components/sha256/a69ab76ff7d0746d093b4e606d7b113be921cbb156edc16c2ad40aafab280d42/index.js +145 -0
  54. package/vendor/components/sha256/d75c461bb7b2b1c9a2b6d15bee1e11bcec88ef94931174d6b222cd309f6a0287/README.en.md +24 -0
  55. package/vendor/components/sha256/d75c461bb7b2b1c9a2b6d15bee1e11bcec88ef94931174d6b222cd309f6a0287/index.js +103 -0
  56. package/vendor/components/sha256/decb7c026527ea269a401efedcb5d4d56d186074b286d2f94772068bef56b256/README.en.md +31 -0
  57. package/vendor/components/sha256/decb7c026527ea269a401efedcb5d4d56d186074b286d2f94772068bef56b256/index.js +267 -0
  58. package/vendor/components/sha256/f13af97d7ebf9893d5783eff27e4e1ce092ccd01783b332ad01aa0d201356548/README.en.md +38 -0
  59. package/vendor/components/sha256/f13af97d7ebf9893d5783eff27e4e1ce092ccd01783b332ad01aa0d201356548/index.js +266 -0
  60. package/vendor/components-2/manifest-2.6.0.json +2104 -0
  61. package/vendor/egatari-spec/SOURCE.json +2 -2
  62. package/vendor/egatari-spec/schema/egatari-audio.schema.json +21 -0
  63. package/vendor/themes/asagi/1.1.0/theme.json +14 -0
  64. package/vendor/themes/asagi/1.1.0/tokens.css +18 -0
  65. package/vendor/themes/business/1.1.0/theme.json +5 -0
  66. package/vendor/themes/business/1.1.0/tokens.css +29 -0
  67. package/vendor/themes/default/1.3.0/theme.json +4 -0
  68. package/vendor/themes/default/1.3.0/tokens.css +74 -0
  69. package/vendor/themes/kogecha/1.1.0/theme.json +10 -0
  70. package/vendor/themes/kogecha/1.1.0/tokens.css +17 -0
  71. package/vendor/themes/kokugo/1.1.0/theme.json +5 -0
  72. package/vendor/themes/kokugo/1.1.0/tokens.css +13 -0
  73. package/vendor/themes/murasaki/1.1.0/theme.json +10 -0
  74. package/vendor/themes/murasaki/1.1.0/tokens.css +13 -0
  75. package/vendor/themes/sumi/1.1.0/theme.json +10 -0
  76. package/vendor/themes/sumi/1.1.0/tokens.css +37 -0
  77. package/vendor/themes/tokiwa/1.1.0/theme.json +10 -0
  78. package/vendor/themes/tokiwa/1.1.0/tokens.css +15 -0
@@ -1,5 +1,5 @@
1
1
  // チャットの AI への指示(AI instruction pack)を組み立てる。Node にもブラウザにも依存しない(純粋な ESM)
2
- // 指示は「共通の本体」(規格 R-…・大きさ・出力の形・標準の部品)と、束ごとの専門の部品の指示(stats・math・maps・kokugo・english・music・business・tools …。
2
+ // 指示は「共通の本体」(規格 R-…・大きさ・出力の形・標準の部品)と、束ごとの専門の部品の指示(stats・data・math・maps・kokugo・english・music・business・tools …。
3
3
  // パーツライブラリ 2.0 の manifest の set)からなる。特殊(extra)の部品は入れない(handoff/parts-tiers-2026-10-27.md §1、backlog #125)。
4
4
  // 材料(kit/core/llm-pack-data.mjs)は tools/make-llm-guide.mjs が tools/llm-guide/・docs/contract・部品の README から作る(手で直さない)。
5
5
  // 同じ関数を、編集アプリの「AI への指示をコピー」(app/llm.js)・コマンド(kit/llm-pack.mjs)・docs の書き出し(tools/make-llm-guide.mjs)・
@@ -33,6 +33,12 @@ function bare(display) {
33
33
  .replace(/\*+(?![A-Za-zͰ-Ͽ0-9(])/g, ''); // 後置の星(Q*、x*_i)。a*b の * は掛け算として残す
34
34
  return x;
35
35
  }
36
+ // 式の検査(narrFormula)に使う発言の文字:読みの指定 {x|よみ} は読みのほうで見る。1 つの記号の読み({E_i|イーアイ}・{θ|シータ}・{N₀|エヌゼロ})
37
+ // は R-reading が認める書き方、式に 1 つの読み({1-η|…}・{E_i + E_j|…})は readingExpr が受け持つので、どちらも narrFormula では数えない。
38
+ // {mark:…|…}・{cue}・注は除く
39
+ export function formulaText(raw) {
40
+ return stripNotes(String(raw)).replace(/\{cue\}/g, '').replace(READING, (m, d, r) => (/^mark:/.test(d.trim()) ? '' : r.trim()));
41
+ }
36
42
  export function readingProblems(raw) {
37
43
  const out = [];
38
44
  for (const m of stripNotes(raw).matchAll(READING)) {
@@ -124,11 +130,16 @@ function denseOps(s, ops, n) {
124
130
  }
125
131
  return false;
126
132
  }
133
+ // コードの識別子(cross_val_score・random_state・train_test_split)は語で、式ではない:英字で始まり _ でつないだ 2 つ以上の部分のうち、
134
+ // どれかが 3 字以上の英字の並び。x_1・x_t・a_ij・\alpha_t(バックスラッシュは別に数える)のような下付きは式のまま
135
+ const IDENT_RE = /(?<![A-Za-z0-9_\\])[A-Za-z][A-Za-z0-9]*(?:_[A-Za-z0-9]+)+(?![A-Za-z0-9_])/g;
136
+ const dropIdents = (s) => s.replace(IDENT_RE, (w) => (w.split('_').some((p) => /^[A-Za-z]{3,}/.test(p)) ? ' ' : w));
127
137
  // 日本語の発言:バックスラッシュ・^・_、15 字に = + − × * が 4 つ以上、記号らしい英字が密(英字の名前・語は数えない)
128
138
  // 名前・語とみなす英字の並び:3 字以上(sin・log などの関数の名前を除く)か、2 字以上の大文字(AI・HTML)。
129
139
  // 残る英字(x・ax・dx・f など)が 4 つ以上で、名前・語を除いた後の字(空白を除く)の半分を超えれば式。
130
140
  // 前の規則(英字をすべて数える)より警告が増えることはない
131
141
  function formulaLikeJa(s) {
142
+ s = dropIdents(s);
132
143
  if (/\\|\^|_/.test(s)) return true;
133
144
  if (denseOps(s, '=+−×*', 4)) return true;
134
145
  const rest = s.replace(/[A-Za-z]+/g, (w) => (w.length >= 3 && !MATH_WORDS.has(w.toLowerCase())) || /^[A-Z]{2,}$/.test(w) ? '' : w);
@@ -138,6 +149,7 @@ function formulaLikeJa(s) {
138
149
  }
139
150
  // 英語の発言:ラテン文字が多いのは当たり前なので、バックスラッシュ・^・_ と、15 字に演算子 3 つ以上だけを見る
140
151
  function formulaLikeEn(s) {
152
+ s = dropIdents(s);
141
153
  if (/\\|\^|_/.test(s)) return true;
142
154
  return denseOps(s, '=+−×*<>≤≥/', 3);
143
155
  }
@@ -94,6 +94,7 @@ export const CATEGORIES = [
94
94
  // 束そのものは manifest の set から読む(ここにない束は、名前のまま出す)
95
95
  export const SET_LABELS = [
96
96
  { set: 'stats', label: { ja: '統計の図', en: 'Statistics charts' }, inside: { ja: 'ヒストグラム・箱ひげ図・ヒートマップ', en: 'Histograms, box plots, heatmaps' } },
97
+ { set: 'data', label: { ja: '情報・データサイエンス', en: 'Data science and code' }, inside: { ja: '標本抽出・信頼区間・交差検証・コードの解説', en: 'Sampling, confidence intervals, cross-validation, code walkthroughs' } },
97
98
  { set: 'math', label: { ja: '算数・数学', en: 'Arithmetic and mathematics' }, inside: { ja: '筆算・数直線・テープ図・関数', en: 'Column arithmetic, number lines, tape diagrams, functions' } },
98
99
  { set: 'maps', label: { ja: '地図', en: 'Maps' }, inside: { ja: '日本地図・世界地図', en: 'Maps of Japan and the world' } },
99
100
  { set: 'kokugo', label: { ja: '国語', en: 'Japanese language arts' }, inside: { ja: '漢文・古文・現代文・縦書き', en: 'Kanbun, kobun, modern texts, vertical writing' } },
@@ -120,6 +121,7 @@ const SUBJECT_FIRST = ['class'];
120
121
  export const WORDS = Object.freeze({
121
122
  ja: {
122
123
  stats: ['分布', '統計', 'データ', 'ヒストグラム', '箱ひげ', '相関', 'ベイズ', '推定', '検定'],
124
+ data: ['データサイエンス', '情報I', '情報Ⅰ', 'プログラミング', '交差検証', '信頼区間', '標本抽出', '確率変数', '期待値'],
123
125
  math: ['筆算', 'わり算', '割り算', 'かけ算', '掛け算', '分数', '割合', '数直線', 'テープ図', '関数'],
124
126
  maps: ['地図', '都道府県', '地方', '世界', { w: '国', not: ['国語'] }, '人口', '地域'],
125
127
  kokugo: ['国語', '漢文', '漢詩', '古文', '現代文', '評論', '小説', '書き順', 'ひらがな'],
@@ -130,6 +132,7 @@ export const WORDS = Object.freeze({
130
132
  },
131
133
  en: {
132
134
  stats: ['distribution', 'distributions', 'statistics', 'statistical', 'data', 'histogram', 'histograms', 'box plot', 'box plots', 'correlation', 'Bayes', 'Bayesian', 'estimation', 'hypothesis test', 'hypothesis testing'],
135
+ data: ['data science', 'programming', 'cross-validation', 'confidence interval', 'confidence intervals', 'sampling', 'random variable', 'random variables', 'expected value'],
133
136
  math: ['long division', 'column addition', 'multiplication', 'division', 'fraction', 'fractions', 'ratio', 'ratios', 'percentage', 'percentages', 'number line', 'tape diagram', 'function', 'functions'],
134
137
  maps: ['map', 'maps', 'prefecture', 'prefectures', 'region', 'regions', 'world', 'country', 'countries', 'population'],
135
138
  kokugo: ['kanbun', 'kobun', 'kanshi', 'classical Japanese', 'classical Chinese', 'stroke order', 'hiragana', 'katakana', 'kanji'],
@@ -58,6 +58,12 @@ const LOCAL = {
58
58
  'm-score': { ja: '楽譜', en: 'Score', icon: 'keyboard', desc: { ja: '五線譜を 1 音ずつ出して鳴らす', en: 'Staff notation, one note at a time, with sound' } },
59
59
  'm-particles': { icon: 'cycle', desc: { ja: '粒子の動きで、状態や変化の仕組みを見せる', en: 'Particles in motion, showing how a state or a change works' } },
60
60
  'm-orbit': { ja: '月の満ち欠け', en: 'Moon phases', icon: 'cycle', desc: { ja: '月の位置と見える形を並べて動かす', en: 'The Moon’s position and its visible shape, moving together' } },
61
+ 'm-mapping': { icon: 'dist', desc: { ja: '実験の結果を数値に対応させ、確率分布を作る', en: 'Maps outcomes to numbers and builds a probability distribution' } },
62
+ 'm-sampling': { icon: 'collect', desc: { ja: '母集団から標本を取り、標本分布を積み上げる', en: 'Draws samples from a population and builds up the sampling distribution' } },
63
+ 'm-ci': { icon: 'boxplot', desc: { ja: '区間を重ね、母平均を含む割合で信頼水準を示す', en: 'Repeated intervals; the share that contains the mean shows the confidence level' } },
64
+ 'm-folds': { icon: 'matrix', desc: { ja: '検証用の区画を順に替え、誤差と平均を示す', en: 'Rotates the validation fold and shows each error and the mean' } },
65
+ 'm-balance': { icon: 'numberline', desc: { ja: '確率の重りを置き、期待値でつり合う様子を示す', en: 'Probabilities as weights that balance at the expected value' } },
66
+ 'm-code': { icon: 'syntax', desc: { ja: '短いコードを行ごとに説明し、出力を見せる', en: 'Explains short code line by line, then shows the output' } },
61
67
  };
62
68
  // 名前は manifest の display を先に。display だけあって表にない部品も名前を出す(絵は汎用)
63
69
  export const PART_LABELS = Object.freeze(Object.fromEntries([...Object.keys(LOCAL), ...Object.keys(MANIFEST_NAMES).filter((t) => !LOCAL[t])]
@@ -23,7 +23,7 @@ export const TEMPLATE_TEXT = Object.freeze({
23
23
  'two-cols': { h: '2 つを比べる見出し', a: '左の列の見出し', b: '右の列の見出し', la: '左の列の項目', lb: '右の列の項目', concl: '⇒ 比べて分かること', n: '左と右を比べて話すことを書く', nc: '結論の行で話すことを書く' },
24
24
  figure: { h: '図の題', fig: '図をここに', cap: '図 1:図の説明', concl: '→ 図から読み取れること', n: '図を指しながら話すことを書く', nc: '結論の行で話すことを書く' },
25
25
  section: { h: '新しい章の題', lead: 'この章で話すこと', n: 'この章で話すことを書く' },
26
- quote: { h: '引用の題', q: '「引用する文をここに書きます」', cite: '— 出典', n: '引用を読み上げ、何を言っているかを書く' },
26
+ quote: { h: '引用の題', q: '「引用する文をここに書く」', cite: '— 出典', n: '引用を読み上げ、何を言っているかを書く' },
27
27
  },
28
28
  en: {
29
29
  'title-body': { h: 'New slide heading', li: ['First point', 'Second point'], concl: '⇒ The point of this slide', n: 'Write what you say on this slide', ni: ['Write what you say with the first point', 'Write what you say with the second point'], nc: 'Write what you say with the conclusion line' },
@@ -35,8 +35,10 @@ export const TEMPLATE_TEXT = Object.freeze({
35
35
  });
36
36
  const NARR_KEYS = new Set(['n', 'ni', 'nc']);
37
37
  const norm = (s) => String(s ?? '').replace(/\s+/g, ' ').trim();
38
- export const TEMPLATE_DEFAULTS = Object.freeze([...new Set(Object.values(TEMPLATE_TEXT).flatMap((L) => Object.values(L).flatMap((t) =>
39
- Object.entries(t).filter(([k]) => !NARR_KEYS.has(k)).flatMap(([, v]) => [].concat(v)).map(norm))))]);
38
+ // 前の版の雛形の字(今は書かないが、残っていれば雛形のままとして知らせる)。引用の雛形は v0.6.8 まで です・ます で、品質チェックの desuMasu に当たった
39
+ const EARLIER_DEFAULTS = ['「引用する文をここに書きます」'];
40
+ export const TEMPLATE_DEFAULTS = Object.freeze([...new Set([...Object.values(TEMPLATE_TEXT).flatMap((L) => Object.values(L).flatMap((t) =>
41
+ Object.entries(t).filter(([k]) => !NARR_KEYS.has(k)).flatMap(([, v]) => [].concat(v)).map(norm))), ...EARLIER_DEFAULTS.map(norm)])]);
40
42
  const DEFAULTS = new Set(TEMPLATE_DEFAULTS);
41
43
 
42
44
  export function placeholderSteps(narration) {
package/kit/deck.js CHANGED
@@ -1571,7 +1571,7 @@ var soundContext = null, soundHandles = [], soundForced = false, soundResuming =
1571
1571
  // the whole step when it starts (up to SOUND_AHEAD seconds ahead, rolling for longer steps), and in autoplay the next
1572
1572
  // step as well, so a stalled main thread (no frames for a while) never makes a note late.
1573
1573
  // Each handle remembers its run and step time so that a step change, extension or pause can cancel what has not sounded.
1574
- var SOUND_AHEAD = 30, soundClock = null, soundNext = null, autoGo = null;
1574
+ var SOUND_AHEAD = 30, soundClock = null, soundNext = null, autoGo = null, seekAt = null; // seekAt:埋め込みの seek の {i, k, t}(play が使う)
1575
1575
  var soundMute = DECK.SoundPreferences ? DECK.SoundPreferences.createMuteSetting() : null;
1576
1576
  DECK.hasComponentSounds = function(){
1577
1577
  return !!slides && slides.some(function(s){ return s._comps.some(function(c){ return !!(c.constructor && c.constructor.sounds) || typeof c.events === "function"; }); });
@@ -1717,8 +1717,10 @@ function play(i, k, animate, from, sounds){
1717
1717
  stopLoop();
1718
1718
  announce(i, k);
1719
1719
  if (CAP.on && CAP_LIVE) capRestart(i, k);
1720
- POS.setT(!animate || REDUCE ? null : 0);
1721
- if (!animate || (REDUCE && !(animDur(i, k) > 0) && !sounds)){ seek(i, k, Infinity); POS.publish(); return; }
1720
+ // 埋め込みの seek(Player P8)で段階の中の時刻 t を頼まれたら、その t で描き、位置の知らせも t にする(seekAt)
1721
+ var at = seekAt && seekAt.i === i && seekAt.k === k ? seekAt.t : null;
1722
+ POS.setT(at !== null ? at : !animate || REDUCE ? null : 0);
1723
+ if (!animate || (REDUCE && !(animDur(i, k) > 0) && !sounds)){ seek(i, k, at !== null ? at : Infinity); POS.publish(); return; }
1722
1724
  if (i !== POS.i){ slides[POS.i]._tok++; slides[POS.i]._legacyAt = undefined; }
1723
1725
  legacy(slides[i], k, REDUCE); // 動きを減らす設定で時計の部品のために回すときも、ほかは最後の状態
1724
1726
  var d = REDUCE ? animDur(i, k) : Math.max(animDur(i, k), previewOn() ? 0 : marksEnd(i, k), k === 0 && from >= 0 && morphSrc(i) === from ? T.morph : 0);
@@ -1836,10 +1838,11 @@ function ensureAudio(){
1836
1838
  audioEl.addEventListener("timeupdate", function(){ if (CAP.on && auto) drawCaption(POS.i, POS.k, Infinity); turnTick(); });
1837
1839
  }
1838
1840
  }
1839
- function playAudio(g, at){
1841
+ // at:声の所(一時停止から続けるとき。src はそのまま)。load:src を入れ直して at から(埋め込みの seek で段階の途中から再生するとき)
1842
+ function playAudio(g, at, load){
1840
1843
  ensureAudio();
1841
1844
  if (auto) auto.playing = g.key;
1842
- if (at === undefined){ audioEl.src = g.audio; audioEl.currentTime = g.audioOffset || 0; }
1845
+ if (at === undefined || load){ audioEl.src = g.audio; audioEl.currentTime = at === undefined ? g.audioOffset || 0 : at; }
1843
1846
  audioEl.preservesPitch = true; audioEl.mozPreservesPitch = true; audioEl.webkitPreservesPitch = true;
1844
1847
  audioEl.playbackRate = RATE;
1845
1848
  var pr = audioEl.play();
@@ -1851,7 +1854,8 @@ function runSeg(rec){
1851
1854
  clearTimeout(auto.atimer);
1852
1855
  if (audioEl && !rec) audioEl.pause();
1853
1856
  var g = auto.tl[auto.idx];
1854
- if (!g){ if (videoViewer()) videoEnded = true; stopAuto(); return; }
1857
+ // タイムラインの最後の段階を流し終えた。埋め込み(Player P8)では state(止まった)の後に {egatari:"ended"}
1858
+ if (!g){ if (videoViewer()) videoEnded = true; stopAuto(); if (EMBED) post({egatari: "ended"}); return; }
1855
1859
  // Step ends are on one absolute clock: autoplay's start plus the planned lengths (and extensions) of the steps before.
1856
1860
  // A timer that fires late shortens the next step instead of delaying everything after it. After a long stall
1857
1861
  // (a background tab throttles timers), start again from now rather than rushing through steps, unless this
@@ -1873,7 +1877,7 @@ function runSeg(rec){
1873
1877
  turnTick();
1874
1878
  if (g.audio){
1875
1879
  ensureAudio();
1876
- if (rec && rec.audio !== null) playAudio(g, rec.audio);
1880
+ if (rec && rec.audio !== null) playAudio(g, rec.audio, !!rec.load);
1877
1881
  else auto.atimer = setTimeout(function(){ if (auto) playAudio(g); }, Math.max(0, auto.segStart + Math.max(0, g.lead - auto.e0) / RATE * 1000 - performance.now()));
1878
1882
  }
1879
1883
  scheduleAutoEnd();
@@ -1889,6 +1893,8 @@ function scheduleAutoEnd(){
1889
1893
  // Long extensions may exceed a browser timer's maximum delay.
1890
1894
  if (remaining > 2147483){ scheduleAutoEnd(); return; }
1891
1895
  auto.segStart += Math.max(0, g.dur + DECK.stepExtension(g.i, g.k) - auto.e0) / RATE * 1000;
1896
+ // 埋め込み(Player P8):再生でこの段階を終わりまで流した(飛ばした段階・手で送った段階には送らない)
1897
+ if (EMBED) post({egatari: "stepEnded", slideKey: g.slideKey, stepKey: stepKey(slides[g.i], g.k)});
1892
1898
  auto.idx++; runSeg();
1893
1899
  }, Math.min(remaining * 1000, 2147483000));
1894
1900
  }
@@ -2000,10 +2006,34 @@ window.addEventListener("message", function(e){
2000
2006
  // 同じスライドの中の送りは跳ばない(ctx.entered。本体の位置についていくだけ)
2001
2007
  } else if (m.type === "deck-input-state" && DECK.view === "follow" && e.source === window.parent){
2002
2008
  mirrorInput(m.viewer);
2003
- } else if (EMBED && e.source === window.parent && m.egatari === "links" && typeof m.follow === "boolean"){
2009
+ } else if (EMBED && e.source === window.parent && m.egatari === "links"){
2004
2010
  // 親がリンクで動くのを止める・許す(format spec §9.1A。止めている間は linkRefused を送る)
2011
+ if (typeof m.follow !== "boolean"){ post({egatari: "error", id: m.id, code: "links", message: "follow must be true or false"}); return; }
2005
2012
  LINKS.follow = m.follow;
2006
2013
  post({egatari: "links", id: m.id, follow: LINKS.follow});
2014
+ } else if (EMBED && e.source === window.parent && m.egatari === "seek"){
2015
+ // 位置へ(Player P8):{egatari:"seek", id?, slide, step, t}。当てたら position の後に {egatari:"seeked", id?, slideKey, stepKey, t}
2016
+ var sp = resolveSeek(m);
2017
+ if (sp.error){ post({egatari: "error", id: m.id, code: "seek", message: sp.error}); return; }
2018
+ var st = seekTo(sp.i, sp.k, sp.t);
2019
+ post({egatari: "seeked", id: m.id, slideKey: slides[sp.i]._key, stepKey: stepKey(slides[sp.i], sp.k), t: st});
2020
+ } else if (EMBED && e.source === window.parent && m.egatari === "preview"){
2021
+ // 先のステップを薄く見せる(Player P1・P8):{egatari:"preview", id?, on}。l と同じ入り切り。同じ形で答える
2022
+ if (typeof m.on !== "boolean"){ post({egatari: "error", id: m.id, code: "preview", message: "on must be true or false"}); return; }
2023
+ if (DECK.mode === "video"){ post({egatari: "error", id: m.id, code: "preview", message: "no preview in video mode"}); return; }
2024
+ if (previewOn() !== m.on) DECK.togglePreview();
2025
+ post({egatari: "preview", id: m.id, on: previewOn()});
2026
+ } else if (EMBED && e.source === window.parent && m.egatari === "controls"){
2027
+ // プレーヤー自身の操作(帯・取っ手・出し方の 1 行・窓の再生と表示のボタン)を隠す・出す(Player P8。?controls=0 と同じもの)。同じ形で答える
2028
+ if (typeof m.visible !== "boolean"){ post({egatari: "error", id: m.id, code: "controls", message: "visible must be true or false"}); return; }
2029
+ setControls(m.visible);
2030
+ post({egatari: "controls", id: m.id, visible: m.visible});
2031
+ } else if (EMBED && e.source === window.parent && m.egatari === "snapshot"){
2032
+ // 位置の画像(Player P8 では OPTIONAL):このプレーヤーは作らない
2033
+ post({egatari: "error", id: m.id, code: "unsupported", message: "snapshot is not supported by this player"});
2034
+ } else if (EMBED && e.source === window.parent && typeof m.egatari === "string" && EMBED_CMDS.indexOf(m.egatari) < 0){
2035
+ // 知らない命令(Player P8 の turn は知らせで、命令ではない)
2036
+ post({egatari: "error", id: m.id, code: "unsupported", message: "unknown command: " + m.egatari.slice(0, 40)});
2007
2037
  } else if (EMBED && e.source === window.parent && (m.egatari === "play" || m.egatari === "pause")){
2008
2038
  // 再生・一時停止(Player P8)。声を始められなければ playBlocked(playAudio)
2009
2039
  if (m.egatari === "play"){ if (!auto && !EDIT) startAuto(); } else if (auto) stopAuto(true);
@@ -2018,6 +2048,45 @@ window.addEventListener("message", function(e){
2018
2048
  }
2019
2049
  });
2020
2050
 
2051
+ // 埋め込みの命令(Player P8)。layout は kit/panes.js が受ける。ほかの名前には error(unsupported)で答える
2052
+ var EMBED_CMDS = ["seek", "play", "pause", "rate", "mode", "layout", "preview", "controls", "snapshot", "links"];
2053
+ // seek の slide(スライドの鍵か 0 からの番号)・step(段階の鍵。数字でもよい。なければ 0)・t(秒。null・なしは ∞)を {i, k, t} に。読めなければ {error}
2054
+ function resolveSeek(m){
2055
+ var i = typeof m.slide === "string" ? slideIndexOf(m.slide) : typeof m.slide === "number" && Math.floor(m.slide) === m.slide && m.slide >= 0 && m.slide < slides.length ? m.slide : -2;
2056
+ if (i === -2) return {error: "slide must be a slideKey or an index from 0 to " + (slides.length - 1)};
2057
+ if (i < 0) return {error: "unknown slide"};
2058
+ var sk = m.step == null ? "0" : typeof m.step === "string" ? m.step : typeof m.step === "number" && Math.floor(m.step) === m.step ? String(m.step) : null;
2059
+ if (sk === null) return {error: "step must be a stepKey"};
2060
+ var k = stepIndexOf(slides[i], sk);
2061
+ if (typeof k === "string") return {error: k};
2062
+ if (!(m.t == null || (typeof m.t === "number" && isFinite(m.t) && m.t >= 0))) return {error: "t must be seconds (0 or more) or null"};
2063
+ return {i: i, k: k, t: m.t == null ? null : m.t};
2064
+ }
2065
+ // (i, k, t) へ(t null は最終状態)。再生の状態は保つ:再生中なら t から(t null なら段階の初めから。帯の跳ぶと同じ)続ける。当てた t を返す
2066
+ function seekTo(i, k, t){
2067
+ var was = !!auto;
2068
+ if (was) stopAuto();
2069
+ POS.setCause("seek");
2070
+ try {
2071
+ if (!was || t === null){ seekAt = t === null ? null : {i: i, k: k, t: t}; go(i, k, false); }
2072
+ else {
2073
+ // 段階の動きを t から実時間で流す(自動再生と同じ autoGo の入口。e0 = t)
2074
+ var g = DECK.timeline().find(function(x){ return x.i === i && x.k === k; });
2075
+ seekAt = {i: i, k: k, t: t};
2076
+ autoGo = {i: i, k: k, start: performance.now(), e0: t, dur: g ? g.dur : 0, next: null};
2077
+ try { go(i, k, true); } finally { autoGo = null; }
2078
+ // 一時停止から続けるのと同じ道で再生を始める:段階の中の時刻 t、声は lead を過ぎていればその所から
2079
+ if (g) paused = {key: g.key, e: t, audio: g.audio && t >= g.lead ? (g.audioOffset || 0) + t - g.lead : null, load: true};
2080
+ }
2081
+ } finally { seekAt = null; POS.setCause(null); }
2082
+ if (was) startAuto(true);
2083
+ syncBack();
2084
+ return was && t === null ? 0 : t;
2085
+ }
2086
+ function setControls(on){
2087
+ document.documentElement.classList.toggle("deck-nocontrols", !on);
2088
+ document.dispatchEvent(new CustomEvent("deck:controls", {detail: {visible: on}}));
2089
+ }
2021
2090
  // ---------------------------------------------------------------- スライドへのリンク(format spec §9.1A。docs/contract.md §9)
2022
2091
  // <a href="#<スライドの id>"> はそのスライドの段階 0、<a href="#<id>:<段階の鍵>"> はその段階(段階の鍵は 0・1・… か concl)。
2023
2092
  // 段階の鍵は最後の : で切る(旧来の鍵は : を含みうる)。数字だけの #N(1 から)はこれまでどおりスライドの番号。
@@ -2048,14 +2117,20 @@ function resolveFragment(f){
2048
2117
  if (i < 0) return {error: "unknown slide", slide: f.lastIndexOf(":") > 0 ? f.slice(0, f.lastIndexOf(":")) : f};
2049
2118
  var s = slides[i], out = {i: i, k: 0, key: s._key, id: s.id || null};
2050
2119
  if (sk === null) return out;
2051
- if (sk === "concl"){ if (s._cstep < 0) return {error: "no concl step", slide: s._key, step: sk, i: i}; out.k = s._cstep; return out; }
2052
- if (!/^(0|[1-9][0-9]{0,2})$/.test(sk)) return {error: "not a step key", slide: s._key, step: sk, i: i};
2053
- var k = +sk;
2054
- // 結論の段階の鍵は concl(数字では指さない)
2055
- if (k > s._max || k === s._cstep) return {error: "step out of range", slide: s._key, step: sk, i: i, max: s._cstep >= 0 ? s._cstep - 1 : s._max};
2120
+ var k = stepIndexOf(s, sk);
2121
+ if (typeof k === "string") return k === "step out of range" ? {error: k, slide: s._key, step: sk, i: i, max: s._cstep >= 0 ? s._cstep - 1 : s._max} : {error: k, slide: s._key, step: sk, i: i};
2056
2122
  out.k = k;
2057
2123
  return out;
2058
2124
  }
2125
+ // 段階の鍵(0・1・… か concl)を段階の番号に。読めなければわけの文字列
2126
+ function stepIndexOf(s, sk){
2127
+ if (sk === "concl") return s._cstep < 0 ? "no concl step" : s._cstep;
2128
+ if (!/^(0|[1-9][0-9]{0,2})$/.test(sk)) return "not a step key";
2129
+ var k = +sk;
2130
+ // 結論の段階の鍵は concl(数字では指さない)
2131
+ if (k > s._max || k === s._cstep) return "step out of range";
2132
+ return k;
2133
+ }
2059
2134
  DECK.resolveFragment = resolveFragment;
2060
2135
  // 位置の書き方(id があれば <id>[:<段階の鍵>]。id のない旧来のスライドは段階 0 なら <番号>、ほかは <鍵>:<段階の鍵>)
2061
2136
  function fragmentOf(i, k){
@@ -1,3 +1,3 @@
1
1
  {
2
- "instruction": "03b74c31"
2
+ "instruction": "b2ad9e7c"
3
3
  }
package/kit/player.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "egatari-player",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "title": "Egatari Player"
5
5
  }
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.4.1",
3
- "sha256": "d20e0e8b05c3be7ae2406f6f129222d5ee5f5b2cddb0ae02492d283081abbce7"
2
+ "version": "1.5.0",
3
+ "sha256": "dba0dabece1eca914ff8614b95b324ba81530f78a45ca6fc945bcf21a641569d"
4
4
  }
package/kit/presenter.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // 発表者ビュー(presenter.js)。本体で p を押すと、同じ HTML を ?presenter=1 で開く
2
- // 左:今の画面、右上:次の段階、右下:口述原稿(カンペ)、上:位置・経過時間・時刻
2
+ // 左:今の画面(先のステップを薄く見せる。発表者だけの見え方で、本体の画面は変えない)、右上:次のスライド(すべてのステップを出した最後の姿。
3
+ // 最後のスライドでは「終わり」)、右下:口述原稿(カンペ)、上:位置・経過時間・時刻
3
4
  // 本体とは postMessage でやり取りする(file:// でも動く)
4
5
  // ボタンは Tab で選べ(枠は :focus-visible のときだけ)、名前(aria-label)と、道具は入/切(aria-pressed)を持つ
5
6
  (function(){
@@ -7,11 +8,11 @@
7
8
  var DECK = window.DECK;
8
9
  // 画面の言葉(<html lang> が ja 以外なら英語。deck.js の DECK.ja)
9
10
  var L = DECK.ja === false
10
- ? {cur: "Current slide", nextFrame: "Next step preview", auto: "Autoplay", stop: "Stop", autoKey: "Autoplay (a)", reset: "Reset timer", next: "Next", notes: "Script", slide: "Slide ", step: "Step ", none: "(no script)", nextStep: "Next step",
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",
11
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)",
12
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
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"]]}
14
- : {cur: "今の画面", nextFrame: "次のステップの画面", auto: "自動再生", stop: "停止", autoKey: "自動再生(a)", reset: "経過時間を戻す", next: "次", notes: "台本", slide: "スライド ", step: "ステップ ", none: "(台本なし)", nextStep: "次のステップ",
15
+ : {cur: "今の画面", nextFrame: "次のスライド", end: "終わり", auto: "自動再生", stop: "停止", autoKey: "自動再生(a)", reset: "経過時間を戻す", next: "次のスライド", notes: "台本", slide: "スライド ", step: "ステップ ", none: "(台本なし)", nextStep: "次のステップ",
15
16
  laser: "レーザーポインター(x)", pen: "ペン(d)", color: "ペンの色", vpen: "消えるペン(v)", clear: "書き込みを消す", over: "本体でスライド一覧(o)", lect: "先のステップを薄く見せる(l)",
16
17
  feedback: "フィードバックを送る", back: "戻る", close: "発表者ビューを閉じる(p)", tap: "ここを押すと操作できます", black: "黒い画面中", blackT: "本体の画面は真っ黒です(b か、本体の画面のクリックで戻る)",
17
18
  legend: [["→/Space", "次"], ["←", "前"], ["a", "自動再生"], ["b", "黒い画面"], ["x", "レーザーポインター"], ["d", "ペン"], ["v", "消えるペン"], ["o", "一覧"], ["Esc", "解除・閉じる"], ["p", "閉じる"]]};
@@ -57,7 +58,7 @@ DECK.presenterView = function(){
57
58
  ' <span id="pv-timer" role="timer">00:00</span><span id="pv-clock"></span>' +
58
59
  ' <button type="button" id="pv-close">' + L.close + '</button></header>' +
59
60
  ' <main><div id="pv-cur"><iframe id="f-cur" title="' + L.cur + '"></iframe></div>' +
60
- ' <aside><div id="pv-next"><div class="lab">' + L.next + '</div><iframe id="f-next" title="' + L.nextFrame + '" tabindex="-1"></iframe></div>' +
61
+ ' <aside><div id="pv-next"><div class="lab">' + L.next + '</div><iframe id="f-next" title="' + L.nextFrame + '" tabindex="-1"></iframe><div id="pv-end" hidden>' + L.end + '</div></div>' +
61
62
  ' <div id="pv-notes"><div class="lab">' + L.notes + '</div><div id="pv-text"></div></div></aside></main>' +
62
63
  ' <footer id="pv-keys">' + legend + '</footer>' +
63
64
  '</div>';
@@ -74,6 +75,9 @@ DECK.presenterView = function(){
74
75
  "#pv aside{flex:1;display:flex;flex-direction:column;gap:12px;min-width:0}" +
75
76
  // 「次」の画面は見るだけ:押しても中にフォーカスを入れない(中のデッキはキーを受けないので、キーが止まってしまう)。押すと発表者ビューに残る
76
77
  "#pv-next iframe{width:100%;aspect-ratio:16/9;border:0;background:#000;opacity:.85;pointer-events:none}" +
78
+ "#pv-next iframe[hidden],#pv-end[hidden]{display:none}" +
79
+ // 最後のスライドの「次のスライド」:画面と同じ大きさの、ただの「終わり」
80
+ "#pv-end{width:100%;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;background:#000;color:#bbb;font-size:28px;letter-spacing:.08em}" +
77
81
  "#pv .lab{font-size:13px;color:#999;margin-bottom:4px}" +
78
82
  "#pv-notes{flex:1;overflow:auto;background:#262626;border-radius:8px;padding:10px 14px}" +
79
83
  "#pv-text .ai{font-size:12px;color:#aaa;margin:0 0 6px}" +
@@ -102,7 +106,11 @@ DECK.presenterView = function(){
102
106
  "#pv-keys kbd{display:inline-block;padding:0 5px;border:1px solid #444;border-radius:4px;background:#222;color:#ddd;font:600 11.5px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}";
103
107
  document.head.appendChild(st);
104
108
  var fc = document.getElementById("f-cur"), fn = document.getElementById("f-next");
105
- fc.src = base + q + sep + "view=follow"; fn.src = base + q + sep + "view=next";
109
+ // 「今の画面」はいつも先のステップを薄く見せる(preview=1。本体の l・プレビューと同じ描き方で、濃さはテーマの --preview-opacity)。
110
+ // 発表者だけの見え方なので、本体の画面のモードは変えない。q に preview があれば除く
111
+ var fq = q.replace(/([?&])preview=[^&]*&?/, "$1").replace(/[?&]$/, "");
112
+ fc.src = base + fq + (fq ? "&" : "?") + "view=follow&preview=1"; fn.src = base + q + sep + "view=next";
113
+ var fe = document.getElementById("pv-end");
106
114
  var pos = null, started = Date.now();
107
115
  // 暗転(本体の b):札を出し、今の画面を薄くする(発表者には中身を見せたまま)
108
116
  function setBlack(on){
@@ -138,8 +146,11 @@ DECK.presenterView = function(){
138
146
  bb.hidden = !pos.back;
139
147
  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); }
140
148
  fc.contentWindow && fc.contentWindow.postMessage({type: "deck-goto", i: pos.i, k: pos.k, animate: true, viewer: pos.viewer}, "*");
141
- var ni = pos.k < pos.max ? pos.i : pos.i + 1, nk = pos.k < pos.max ? pos.k + 1 : 0;
142
- fn.contentWindow && fn.contentWindow.postMessage({type: "deck-goto", i: ni, k: nk, animate: false}, "*");
149
+ // 次のスライド:段階が残っていても次のスライドを、すべてのステップを出した姿で(k は大きく送り、デッキが最後の段階に収める)。
150
+ // 最後のスライドでは「終わり」
151
+ var last = pos.i >= pos.n - 1;
152
+ fn.hidden = last; fe.hidden = !last;
153
+ if (!last && fn.contentWindow) fn.contentWindow.postMessage({type: "deck-goto", i: pos.i + 1, k: 1e9, animate: false}, "*");
143
154
  var cur = notes(pos.key), nxt = pos.nextKey ? notes(pos.nextKey) : [];
144
155
  // 合成した声・作り方の記録がない音声の段階:口述原稿の上に 1 行(format spec §7.3。キーの一覧と同じ文)
145
156
  var vn = DECK.voiceNote ? DECK.voiceNote(pos.key) : "";
@@ -207,8 +218,21 @@ DECK.presenterView = function(){
207
218
  // 道具のボタン:キーと同じ(tools.js の DECK.ptools.key)。フォーカスを奪わないので、押した後も矢印で送れる
208
219
  [].forEach.call(document.querySelectorAll("#pv button"), function(b){ b.addEventListener("mousedown", function(e){ e.preventDefault(); }); });
209
220
  [].forEach.call(document.querySelectorAll("#pv .pv-tools button"), function(b){
210
- b.onclick = function(e){ if (b.hasAttribute("data-c")) PT.color(+b.getAttribute("data-c")); else PT.key(b.getAttribute("data-k")); if (e.detail !== 0) b.blur(); };
221
+ b.onclick = function(e){ if (b.hasAttribute("data-c")) PT.color(+b.getAttribute("data-c")); else if (b.getAttribute("data-k") === "l") lectAudience(); else PT.key(b.getAttribute("data-k")); if (e.detail !== 0) b.blur(); };
211
222
  });
223
+ // 先のステップを薄く見せる(l・そのボタン):切り替えるのは本体の画面だけ。「今の画面」はいつも薄く見せるので、
224
+ // tools.js が「今の画面」にも送る l の命令は送らせない(窓の捕捉の段で受けて、本体にだけ送る)。キーは増やさず、l の意味も変えない
225
+ var audPrev = DECK.mode === "lecture";
226
+ function lectAudience(){
227
+ try { if (opener && !opener.closed) opener.postMessage({type: "deck-tool", cmd: "key", key: "l"}, "*"); } catch (e) {}
228
+ audPrev = !audPrev; syncTools();
229
+ }
230
+ window.addEventListener("keydown", function(e){
231
+ if (e.key !== "l" || e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey) return;
232
+ var t = e.target;
233
+ if (t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))) return;
234
+ e.preventDefault(); e.stopImmediatePropagation(); unTap(); lectAudience();
235
+ }, true);
212
236
  function syncTools(){
213
237
  var m = PT && PT.mode();
214
238
  var c = PT && PT.color ? PT.color() : 0, sw = document.querySelector("#pv .pv-sw");
@@ -216,7 +240,7 @@ DECK.presenterView = function(){
216
240
  [].forEach.call(document.querySelectorAll("#pv .pv-sw button"), function(b){ b.setAttribute("aria-pressed", +b.getAttribute("data-c") === c ? "true" : "false"); });
217
241
  [].forEach.call(document.querySelectorAll("#pv .pv-dot"), function(d){ d.style.background = PT.hex ? PT.hex[PT.colors[c]] : "var(--" + PT.colors[c] + ")"; });
218
242
  [].forEach.call(document.querySelectorAll("#pv .pv-tools [data-b]"), function(b){
219
- var n = b.getAttribute("data-b"), on = n === "lect" ? DECK.mode === "lecture" : n === m; // 先のステップを薄く見せる:字幕と同じ入/切
243
+ var n = b.getAttribute("data-b"), on = n === "lect" ? audPrev : n === m; // 先のステップを薄く見せる(本体の画面):字幕と同じ入/切
220
244
  b.classList.toggle("on", on);
221
245
  if (b.hasAttribute("aria-pressed")) b.setAttribute("aria-pressed", on ? "true" : "false");
222
246
  });
package/kit/tools.js CHANGED
@@ -158,6 +158,8 @@ css(
158
158
  " color:#fff;background:rgba(20,20,20,.45);opacity:0;cursor:pointer;transition:opacity .25s}" +
159
159
  "#dt-handle.show{opacity:.3}#dt-handle.show:hover,#dt-handle.show:focus-visible{opacity:.85}" +
160
160
  "#dt-handle:focus-visible{outline:2px solid #fff;outline-offset:1px;box-shadow:0 0 0 4px rgba(0,0,0,.55)}" +
161
+ // 埋め込みで親が操作を隠したとき({egatari:"controls", visible:false}、Player P8):帯・取っ手・出し方の 1 行を出さない(Tab でも入らない)
162
+ "html.deck-nocontrols #dt-cb,html.deck-nocontrols #dt-handle,html.deck-nocontrols #dt-hint{display:none}" +
161
163
  "#dt-cb button{all:unset;position:relative;box-sizing:border-box;width:32px;height:32px;border-radius:8px;cursor:pointer;color:rgba(255,255,255,.86);" +
162
164
  " display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;transition:background .12s,color .12s}" +
163
165
  "#dt-cb button:hover{background:rgba(255,255,255,.14);color:#fff}" +
@@ -286,6 +288,8 @@ function build(){
286
288
  // 埋め込みで親が操作を隠したとき(?embed=1&controls=0、Player P8)は帯を作らない(取っ手も出し方の行もない)
287
289
  var noControls = Q.get("embed") === "1" && /^(0|false|no|off)$/i.test(Q.get("controls") || "");
288
290
  if (!FOLLOW){ if (!noControls) buildBar(); loadAttachments(); }
291
+ // 埋め込みの {egatari:"controls", visible}(kit/deck.js):隠すのは html.deck-nocontrols(下の CSS)。?controls=0 で作らなかった帯は、出すときに作る
292
+ document.addEventListener("deck:controls", function(e){ if (e.detail && e.detail.visible && !cb && !FOLLOW) buildBar(); });
289
293
  }
290
294
 
291
295
  // ---------------------------------------------------------------- 添付(format spec §3.8):ダウンロードだけ
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egatari",
3
- "version": "0.6.8",
3
+ "version": "0.6.9-rc.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://studio.egatari.org/",
6
6
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "asagi",
3
3
  "extends": "default",
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "fonts": {
6
6
  "body": "Zen Maru Gothic",
7
7
  "heading": "Zen Maru Gothic"
@@ -6,6 +6,18 @@
6
6
  --cover-bg: #eaf3f5;
7
7
  --font-sans: "Zen Maru Gothic", "BIZ UDPGothic", sans-serif;
8
8
  --lit: #FFCE3A; /* 光と照らされる側。明るい黄(淡い地 1.4:1。1.1.0) */
9
+ /* 物の色(format spec §8.4):内容そのものである色。小学校・広報向けに少し明るく。名前か頭文字を添え、白・黒と地に近い色には輪郭線。1.2.0 */
10
+ --obj-white: #FFFFFF;
11
+ --obj-black: #262626;
12
+ --obj-red: #E8383D;
13
+ --obj-green: #36A852;
14
+ --obj-yellow: #FFDC1E;
15
+ --obj-blue: #2B7BE0;
16
+ --obj-brown: #915F33;
17
+ --obj-purple: #9650B8;
18
+ --obj-pink: #F58CBC;
19
+ --obj-orange: #F59A23;
20
+ --obj-gray: #949494;
9
21
  }
10
22
  /* look heading: soft */
11
23
  .slide:not(.cover):not(.sec):not(.layout-tate) > h2{border-bottom:0;background:var(--base-wash);border-radius:16px;padding:8px 22px}
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "business",
3
3
  "extends": "default",
4
- "version": "1.1.0"
4
+ "version": "1.2.0"
5
5
  }
@@ -19,6 +19,18 @@
19
19
  --series-3: var(--accent2);
20
20
  --series-4: var(--muted);
21
21
  --lit: #F2C300; /* 光と照らされる側。黄(橙の --emph と分かれるよう赤みを抑えた。白地 1.7:1。1.1.0) */
22
+ /* 物の色(format spec §8.4):内容そのものである色。default と同じ値(どのテーマでも赤い玉は同じ赤)。名前か頭文字を添え、白・黒と地に近い色には輪郭線。1.2.0 */
23
+ --obj-white: #FFFFFF;
24
+ --obj-black: #222222;
25
+ --obj-red: #E0242B;
26
+ --obj-green: #2E9E44;
27
+ --obj-yellow: #F5D90A;
28
+ --obj-blue: #1E6FD9;
29
+ --obj-brown: #8B5A2B;
30
+ --obj-purple: #8E44AD;
31
+ --obj-pink: #F27BB0;
32
+ --obj-orange: #F28C1A;
33
+ --obj-gray: #8C8C8C;
22
34
  }
23
35
  @supports (color: color-mix(in oklch, red 10%, white)){
24
36
  :root{
@@ -1,4 +1,4 @@
1
- <!-- i18n: pair=README.md sha256=506765754fe23769 -->
1
+ <!-- i18n: pair=README.md sha256=76e9a45733d2970d -->
2
2
  # テーマ `default`
3
3
 
4
4
  [English](README.md)
@@ -40,3 +40,26 @@
40
40
 
41
41
  - **`--lit` `#F5B800`。** 日の光や灯りの色として思い浮かぶ、少し山吹寄りの暖かい黄。白地では淡い(1.79:1)ので、形は輪郭線が見せる。WCAG 1.4.11 の 3:1 は塗りではなく輪郭線が満たす。模擬した 4 つの色覚の型のどれでも、`--emph` との差が `--emph` と `--term` と同じ線を越える(`node tools/test-themes.mjs`)ので、太陽と結論を取り違えない。
42
42
  - 同梱のテーマはそれぞれ自分の `--lit` を持つ(配色に合う暖かい黄。`sumi` と `business` は橙の `--emph` から離した)。`default` を継ぐテーマで宣言しないものは `#F5B800` を受け継ぐ。
43
+
44
+ ## 物の色:`--obj-*`(1.4.0)
45
+
46
+ `--obj-white` … `--obj-gray` は 11 の基本色名で、色そのものが内容である色に使う:袋の中の赤い玉、青のリトマス紙、青信号(format spec §8.4)。塗りの色で、物の上か横に色の名前か頭文字(「赤」、"R")を添え、色だけで伝えない(たとえば赤と緑は多くの人に似て見える)。白・黒と地に近い色には `--fg` か `--muted` の輪郭線も付ける。図の系列は `--series-*`、意味は上の役割を使う。
47
+
48
+ | 変数 | 値 | OKLCH L / C / h | 白地 |
49
+ |---|---|---|---|
50
+ | `--obj-white` | `#FFFFFF` | 1.000 / 0.000 / – | 1.00:1 |
51
+ | `--obj-black` | `#222222` | 0.252 / 0.000 / – | 15.91:1 |
52
+ | `--obj-red` | `#E0242B` | 0.584 / 0.219 / 26.1 | 4.71:1 |
53
+ | `--obj-green` | `#2E9E44` | 0.617 / 0.163 / 146.5 | 3.45:1 |
54
+ | `--obj-yellow` | `#F5D90A` | 0.882 / 0.182 / 99.8 | 1.42:1 |
55
+ | `--obj-blue` | `#1E6FD9` | 0.555 / 0.179 / 257.4 | 4.85:1 |
56
+ | `--obj-brown` | `#8B5A2B` | 0.512 / 0.090 / 62.2 | 5.84:1 |
57
+ | `--obj-purple` | `#8E44AD` | 0.526 / 0.170 / 314.7 | 5.87:1 |
58
+ | `--obj-pink` | `#F27BB0` | 0.733 / 0.156 / 353.6 | 2.55:1 |
59
+ | `--obj-orange` | `#F28C1A` | 0.734 / 0.165 / 60.4 | 2.46:1 |
60
+ | `--obj-gray` | `#8C8C8C` | 0.640 / 0.000 / – | 3.36:1 |
61
+
62
+ - **名前どおりに見える。** 色相は OKLCH でそれぞれの窓に入る(red 15–45°、orange 50–80°、yellow 85–115°、green 125–165°、blue 235–275°、purple 285–335°、pink 340–15°。窓はその名前の CSS の色の色相を含み、互いに重ならない)。brown は orange と同じ色相で、暗く鮮やかさが低いことで分かれる(明るさ 0.35–0.60、鮮やかさ 0.04–0.12)。white・black・gray は鮮やかさ 0.02 以下(`node tools/test-themes.mjs`)。
63
+ - **隣どうしが分かれる。** 隣り合う色の名前(red–orange、orange–yellow、yellow–green、green–blue、blue–purple、purple–pink、pink–red、brown–orange、brown–red、gray–white、gray–black)は 3 色型で ΔE00 20 以上離す。`--emph` と `--term` と同じ線で、並べなくても 1 つずつ見て投影で名前を言い分けられる差。ここで最も近い組は brown–red(23.7)。名前か頭文字をいつも添えるので、色覚の模擬は求めない。
64
+ - **黄は `--lit` と別。** `--obj-yellow` はレモン寄りの黄(h 99.8)で、山吹寄りの `--lit`(h 84.4)から離した(ΔE00 11.1)。役割が違う:`--lit` は光と光が照らすもの、`--obj-yellow` は黄色い物で、どのみち名前を添える。2 つのあいだに線は決めない。
65
+ - 地とのコントラストは求めない(名前と輪郭線を添える塗り)。白地では 1.4〜15.9:1。`sumi`・`kokugo`・`tokiwa`・`murasaki`・`business` は同じ値なので、どのテーマでも赤い玉は同じ赤。`kogecha` は落ち着いた配色に合わせて鮮やかさを少し抑え、`asagi` は小学校向けに少し明るい。同梱のテーマはどれも 11 色を自分の `tokens.css` で宣言する。`default` を継ぐテーマで宣言しないものはこの値を受け継ぐ。
@@ -1,4 +1,4 @@
1
- <!-- i18n: pair=README.ja.md sha256=3d692c529201acca -->
1
+ <!-- i18n: pair=README.ja.md sha256=98eb821a9024cb6c -->
2
2
  # Theme `default`
3
3
 
4
4
  [日本語](README.ja.md)
@@ -40,3 +40,26 @@ From the plain-theme proposal by @totasuko-lab (1.1.0 took its colours). The con
40
40
 
41
41
  - **`--lit` `#F5B800`.** A warm, slightly amber yellow, the colour people expect for sunlight and lamps. On white it is pale (1.79:1), so the outline carries the shape; the 3:1 of WCAG 1.4.11 is met by the outline, not the fill. Under all four simulated colour-vision types it stays apart from `--emph` by the same limits as `--emph` against `--term` (`node tools/test-themes.mjs`), so the sun and a conclusion are not confused.
42
42
  - Each bundled theme sets its own `--lit` (a warm yellow fitting its palette; `sumi` and `business` lean away from their orange `--emph`). Themes that extend `default` without setting it inherit `#F5B800`.
43
+
44
+ ## Object colours: `--obj-*` (1.4.0)
45
+
46
+ `--obj-white` … `--obj-gray` are the eleven basic colour terms, for colours that are themselves the content: a red ball in a bag, blue litmus paper, a green traffic light (format spec §8.4). They are fills shown with the name or initial of the colour (「赤」, "R") on or beside the object, never colour alone, because red and green, for example, look alike to many viewers; white, black and any colour near the background also get an outline in `--fg` or `--muted`. Chart categories use `--series-*`, and meanings use the roles above.
47
+
48
+ | Token | Value | OKLCH L / C / h | On white |
49
+ |---|---|---|---|
50
+ | `--obj-white` | `#FFFFFF` | 1.000 / 0.000 / – | 1.00:1 |
51
+ | `--obj-black` | `#222222` | 0.252 / 0.000 / – | 15.91:1 |
52
+ | `--obj-red` | `#E0242B` | 0.584 / 0.219 / 26.1 | 4.71:1 |
53
+ | `--obj-green` | `#2E9E44` | 0.617 / 0.163 / 146.5 | 3.45:1 |
54
+ | `--obj-yellow` | `#F5D90A` | 0.882 / 0.182 / 99.8 | 1.42:1 |
55
+ | `--obj-blue` | `#1E6FD9` | 0.555 / 0.179 / 257.4 | 4.85:1 |
56
+ | `--obj-brown` | `#8B5A2B` | 0.512 / 0.090 / 62.2 | 5.84:1 |
57
+ | `--obj-purple` | `#8E44AD` | 0.526 / 0.170 / 314.7 | 5.87:1 |
58
+ | `--obj-pink` | `#F27BB0` | 0.733 / 0.156 / 353.6 | 2.55:1 |
59
+ | `--obj-orange` | `#F28C1A` | 0.734 / 0.165 / 60.4 | 2.46:1 |
60
+ | `--obj-gray` | `#8C8C8C` | 0.640 / 0.000 / – | 3.36:1 |
61
+
62
+ - **Recognisably the name.** Each hue lies in its family's window in OKLCH (red 15–45°, orange 50–80°, yellow 85–115°, green 125–165°, blue 235–275°, purple 285–335°, pink 340–15°; the windows hold the hue of the CSS colour of that name and do not overlap). Brown shares orange's hue and is told apart by being darker and less saturated (lightness 0.35–0.60, chroma 0.04–0.12). White, black and gray have chroma ≤ 0.02 (`node tools/test-themes.mjs`).
63
+ - **Neighbours stay apart.** Adjacent names (red–orange, orange–yellow, yellow–green, green–blue, blue–purple, purple–pink, pink–red, brown–orange, brown–red, gray–white, gray–black) are at least ΔE00 20 apart for normal vision, the same limit as `--emph` against `--term`: a difference that can be named one swatch at a time on a projector, not only side by side. The closest pair here is brown–red (23.7). Colour-vision simulation is not required, because the name or initial always comes with the colour.
64
+ - **Yellow is not `--lit`.** `--obj-yellow` is a lemon yellow (h 99.8), leaning away from the amber `--lit` (h 84.4; ΔE00 11.1). They are different roles: `--lit` is light and what it lights, `--obj-yellow` a yellow object, which carries its name anyway; no limit is set between them.
65
+ - Contrast with the background is not required (these are fills with labels and outlines); on white it is 1.4–15.9:1. `sumi`, `kokugo`, `tokiwa`, `murasaki` and `business` use the same values, so a red ball is the same red in every theme; `kogecha` lowers the chroma a little to fit its subdued palette, and `asagi` is a little brighter for primary schools. Every bundled theme declares all eleven in its own `tokens.css`; a theme that extends `default` without them inherits these.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "default",
3
- "version": "1.3.0"
3
+ "version": "1.4.0"
4
4
  }
@@ -28,6 +28,18 @@
28
28
  --emph-tint: #fbe7e3;
29
29
  --concl-bg: #F5F5F5; /* 結論の行の地。無彩のごく淡い灰(--emph の字 5.3:1・--fg 14.6:1。色覚の型と白黒でも見え方が同じ。1.2.0) */
30
30
  --lit: #F5B800; /* 光と、光が照らすもの(太陽・灯り・月の明るい側)。山吹寄りの黄(白地 1.8:1。字の色ではない:輪郭線と一緒に描く。色覚の模擬でも --emph と分かれる。1.3.0) */
31
+ /* 物の色(format spec §8.4):内容そのものである色(袋の玉・リトマス紙・信号)。11 の基本色名。色だけで伝えない:名前か頭文字を添え、白・黒と地に近い色には輪郭線(--fg か --muted)。1.4.0 */
32
+ --obj-white: #FFFFFF;
33
+ --obj-black: #222222;
34
+ --obj-red: #E0242B;
35
+ --obj-green: #2E9E44;
36
+ --obj-yellow: #F5D90A;
37
+ --obj-blue: #1E6FD9;
38
+ --obj-brown: #8B5A2B;
39
+ --obj-purple: #8E44AD;
40
+ --obj-pink: #F27BB0;
41
+ --obj-orange: #F28C1A;
42
+ --obj-gray: #8C8C8C;
31
43
 
32
44
  /* 先のステップを薄く見せるときの濃さ(format spec §8.4 の --preview-opacity。プレーヤーも部品もこれを読む) */
33
45
  --preview-opacity: .45;