@open-slide/core 1.11.0 → 1.11.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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Locale, Plural } from "./types-D_q_ylIe.js";
2
2
  import { OpenSlideConfig } from "./config-14qk4fP8.js";
3
3
  import { CSSProperties, ComponentType, HTMLAttributes, PropsWithChildren } from "react";
4
- import * as react_jsx_runtime1 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import * as react_jsx_runtime3 from "react/jsx-runtime";
6
6
  import * as react_jsx_runtime4 from "react/jsx-runtime";
7
7
 
@@ -20,7 +20,7 @@ declare function ImagePlaceholder({
20
20
  style,
21
21
  className,
22
22
  ...rest
23
- }: ImagePlaceholderProps): react_jsx_runtime1.JSX.Element;
23
+ }: ImagePlaceholderProps): react_jsx_runtime0.JSX.Element;
24
24
 
25
25
  //#endregion
26
26
  //#region src/app/lib/design.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-slide/core",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "Runtime and CLI for open-slide — write slides in slides/, we handle the rest.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -510,6 +510,7 @@ function RenameCard({
510
510
  if (!saving) commit();
511
511
  }}
512
512
  onKeyDown={(e) => {
513
+ if (e.nativeEvent.isComposing) return;
513
514
  if (e.key === 'Enter') {
514
515
  e.preventDefault();
515
516
  commit();
@@ -97,6 +97,9 @@ export function NotesDrawer({ slideId, index, total, initial }: Props) {
97
97
  }}
98
98
  onKeyDown={(e) => {
99
99
  if (e.key === 'Escape') {
100
+ // Escape during IME composition dismisses the candidate
101
+ // list; it must not blur the textarea.
102
+ if (e.nativeEvent.isComposing) return;
100
103
  e.preventDefault();
101
104
  textareaRef.current?.blur();
102
105
  } else if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
@@ -50,14 +50,17 @@ export function useTouchSwipe<T extends HTMLElement>({
50
50
  else onPrev();
51
51
  };
52
52
 
53
+ const onCancel = () => {
54
+ start.current = null;
55
+ };
56
+
53
57
  el.addEventListener('touchstart', onStart, { passive: true });
54
58
  el.addEventListener('touchend', onEnd);
55
- el.addEventListener('touchcancel', () => {
56
- start.current = null;
57
- });
59
+ el.addEventListener('touchcancel', onCancel);
58
60
  return () => {
59
61
  el.removeEventListener('touchstart', onStart);
60
62
  el.removeEventListener('touchend', onEnd);
63
+ el.removeEventListener('touchcancel', onCancel);
61
64
  };
62
65
  }, [ref, enabled, onPrev, onNext]);
63
66
  }
@@ -197,6 +197,7 @@ export function FolderItem({
197
197
  onChange={(e) => setDraftName(e.target.value)}
198
198
  onBlur={commitRename}
199
199
  onKeyDown={(e) => {
200
+ if (e.nativeEvent.isComposing) return;
200
201
  if (e.key === 'Enter') commitRename();
201
202
  if (e.key === 'Escape') {
202
203
  setDraftName(row.folder.name);
@@ -255,6 +255,7 @@ export function Sidebar({
255
255
  value={newName}
256
256
  onChange={(e) => setNewName(e.target.value)}
257
257
  onKeyDown={(e) => {
258
+ if (e.nativeEvent.isComposing) return;
258
259
  if (e.key === 'Enter') commitCreate();
259
260
  if (e.key === 'Escape') exitCreate();
260
261
  }}
@@ -251,7 +251,7 @@ function slideRelsXml(idx: number): string {
251
251
  }
252
252
 
253
253
  function themeXml(): string {
254
- return `${XML_DECL}<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>`;
254
+ return `${XML_DECL}<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>`;
255
255
  }
256
256
 
257
257
  function sleep(ms: number): Promise<void> {
@@ -616,6 +616,7 @@ function RenameDialog({
616
616
  value={value}
617
617
  onChange={(e) => setValue(e.target.value)}
618
618
  onKeyDown={(e) => {
619
+ if (e.nativeEvent.isComposing) return;
619
620
  if (e.key === 'Enter') {
620
621
  e.preventDefault();
621
622
  submit();
@@ -1006,6 +1006,7 @@ function InlineTitleEditor({
1006
1006
  if (!saving) commit();
1007
1007
  }}
1008
1008
  onKeyDown={(e) => {
1009
+ if (e.nativeEvent.isComposing) return;
1009
1010
  if (e.key === 'Enter') {
1010
1011
  e.preventDefault();
1011
1012
  commit();