kingkont 0.20.36 → 0.20.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.20.36",
3
+ "version": "0.20.38",
4
4
  "description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
5
5
  "main": "main.js",
6
6
  "bin": {
package/renderer/board.js CHANGED
@@ -3379,6 +3379,23 @@ async function selectBoard(board) {
3379
3379
  // openRepliquesFor(board.name).catch(e => console.warn('replicas open failed', e));
3380
3380
  // }
3381
3381
  localStorage.setItem(`lastBoard:${state.filmHandle.name}`, JSON.stringify({ kind: board.kind, name: board.name }));
3382
+ // Web: обновить hash чтобы юзер мог расшарить ссылку на конкретную сцену.
3383
+ // Юзер: «когда я открываю сцену — меняй хеш». Формат:
3384
+ // #template=PROJECT&board=ИмяСцены (view-only / template)
3385
+ // #project=PROJECT&board=ИмяСцены (edit mode)
3386
+ // #project=PROJECT&kind=character&board=Анна (персонаж/локация)
3387
+ // history.replaceState — чтобы не засирать history-стек на каждом switch.
3388
+ if (window.__KINGKONT_WEB__ && state.cloudProjectId) {
3389
+ const isTpl = /^#template=/.test(location.hash || '');
3390
+ const prefix = isTpl ? 'template' : 'project';
3391
+ const params = [`${prefix}=${state.cloudProjectId}`];
3392
+ if (board.kind && board.kind !== 'episode') params.push(`kind=${board.kind}`);
3393
+ params.push(`board=${encodeURIComponent(board.name)}`);
3394
+ const newHash = '#' + params.join('&');
3395
+ if (location.hash !== newHash) {
3396
+ history.replaceState(null, '', location.pathname + location.search + newHash);
3397
+ }
3398
+ }
3382
3399
  await refreshSidebar();
3383
3400
  await renderCanvas();
3384
3401
  // Сбрасываем кэш URL клипов и декодированных AudioBuffer от прошлой доски
package/renderer/media.js CHANGED
@@ -1108,8 +1108,13 @@ document.addEventListener('paste', async e => {
1108
1108
  }
1109
1109
  if (all.length) {
1110
1110
  e.preventDefault();
1111
- const cx = canvasWrap.scrollLeft / state.zoom + 200;
1112
- const cy = canvasWrap.scrollTop / state.zoom + 100;
1111
+ // Конвертация frame-coord canvas-content-coord: вычитаем padX/padY.
1112
+ // Юзер: «когда я вставляю картинку она не добавляется в видимой зоне,
1113
+ // а добавляется куда-то в центр». Раньше `scrollLeft / zoom + 200`
1114
+ // улетало на ≈(padX/zoom+200, padY/zoom+100), т.е. в самый центр canvas'а.
1115
+ const _pad = (typeof _getFramePadding === 'function') ? _getFramePadding() : { padX: 0, padY: 0 };
1116
+ const cx = (canvasWrap.scrollLeft - _pad.padX) / state.zoom + 80;
1117
+ const cy = (canvasWrap.scrollTop - _pad.padY) / state.zoom + 80;
1113
1118
  let i = 0;
1114
1119
  for (const f of all) {
1115
1120
  const type = getFileType(f);