fika-editor 3.5.4 → 3.5.5

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.
@@ -0,0 +1,27 @@
1
+ export type FormulaKey = 'quadraticFormula' | 'differenceOfSquares' | 'perfectSquare' | 'trigPythagorean' | 'arithmeticSum' | 'geometricSum' | 'integrationByParts' | 'newtonSecondLaw' | 'kineticEnergy' | 'ohmLaw' | 'idealGas' | 'massEnergy' | 'gauss' | 'fourier' | 'taylor' | 'definiteIntegral' | 'trigIdentity1' | 'trigIdentity2' | 'binomialExpansion' | 'euler' | 'bernoulli' | 'totalDifferential' | 'nonHomogeneous' | 'cauchyMeanValue' | 'lagrangeMeanValue' | 'derivative' | 'trigIntegral' | 'quadricSurface' | 'secondOrderDifferential' | 'directionalDerivative';
2
+ export type SymbolCategoryKey = 'operators' | 'group' | 'verbatim' | 'greek';
3
+ /** Locale-free formula structure. Resolve labels via getFormulaList() or i18n. */
4
+ export declare const FORMULA_LIST: {
5
+ key: FormulaKey;
6
+ latex: string;
7
+ }[];
8
+ /** Locale-free symbol categories. Resolve labels via getSymbolList() or i18n. */
9
+ export declare const SYMBOL_LIST: {
10
+ type: SymbolCategoryKey;
11
+ children: {
12
+ latex: string;
13
+ }[];
14
+ }[];
15
+ /** Formula list with labels in the active locale. */
16
+ export declare function getFormulaList(): {
17
+ label: import("typesafe-i18n").LocalizedString;
18
+ latex: string;
19
+ }[];
20
+ /** Symbol categories with labels in the active locale. */
21
+ export declare function getSymbolList(): {
22
+ type: SymbolCategoryKey;
23
+ label: import("typesafe-i18n").LocalizedString;
24
+ children: {
25
+ latex: string;
26
+ }[];
27
+ }[];
@@ -1,6 +1,7 @@
1
+ import type { AddSlideOptions } from '../store/slides';
1
2
  import type { PPTElement, Slide } from '../types/slides';
2
3
  export default _default;
3
4
  declare function _default(): {
4
5
  addElementsFromData: (elements: PPTElement[]) => void;
5
- addSlidesFromData: (slides: Slide[]) => void;
6
+ addSlidesFromData: (slides: Slide[], options?: AddSlideOptions) => void;
6
7
  };
@@ -2713,7 +2713,59 @@ export type NamespaceConfigsTranslation = {
2713
2713
  trapezoidReverse: string;
2714
2714
  };
2715
2715
  latex: {
2716
+ /**
2717
+ * I​n​s​e​r​t​ ​a​ ​f​o​r​m​u​l​a​ ​p​r​e​s​e​t
2718
+ */
2719
+ presetLabel: string;
2716
2720
  formulas: {
2721
+ /**
2722
+ * Q​u​a​d​r​a​t​i​c​ ​f​o​r​m​u​l​a​ ​(​a​ ​≠​ ​0​)
2723
+ */
2724
+ quadraticFormula: string;
2725
+ /**
2726
+ * D​i​f​f​e​r​e​n​c​e​ ​o​f​ ​s​q​u​a​r​e​s
2727
+ */
2728
+ differenceOfSquares: string;
2729
+ /**
2730
+ * S​q​u​a​r​e​ ​o​f​ ​a​ ​s​u​m
2731
+ */
2732
+ perfectSquare: string;
2733
+ /**
2734
+ * P​y​t​h​a​g​o​r​e​a​n​ ​t​r​i​g​o​n​o​m​e​t​r​i​c​ ​i​d​e​n​t​i​t​y
2735
+ */
2736
+ trigPythagorean: string;
2737
+ /**
2738
+ * A​r​i​t​h​m​e​t​i​c​ ​s​e​r​i​e​s​ ​s​u​m
2739
+ */
2740
+ arithmeticSum: string;
2741
+ /**
2742
+ * G​e​o​m​e​t​r​i​c​ ​s​e​r​i​e​s​ ​s​u​m​ ​(​q​ ​≠​ ​1​)
2743
+ */
2744
+ geometricSum: string;
2745
+ /**
2746
+ * I​n​t​e​g​r​a​t​i​o​n​ ​b​y​ ​p​a​r​t​s
2747
+ */
2748
+ integrationByParts: string;
2749
+ /**
2750
+ * N​e​w​t​o​n​’​s​ ​s​e​c​o​n​d​ ​l​a​w
2751
+ */
2752
+ newtonSecondLaw: string;
2753
+ /**
2754
+ * K​i​n​e​t​i​c​ ​e​n​e​r​g​y
2755
+ */
2756
+ kineticEnergy: string;
2757
+ /**
2758
+ * O​h​m​’​s​ ​l​a​w
2759
+ */
2760
+ ohmLaw: string;
2761
+ /**
2762
+ * I​d​e​a​l​ ​g​a​s​ ​l​a​w
2763
+ */
2764
+ idealGas: string;
2765
+ /**
2766
+ * M​a​s​s​–​e​n​e​r​g​y​ ​e​q​u​i​v​a​l​e​n​c​e
2767
+ */
2768
+ massEnergy: string;
2717
2769
  /**
2718
2770
  * G​a​u​s​s​ ​t​h​e​o​r​e​m
2719
2771
  */
@@ -8739,7 +8791,59 @@ export type TranslationFunctions = {
8739
8791
  trapezoidReverse: () => LocalizedString;
8740
8792
  };
8741
8793
  latex: {
8794
+ /**
8795
+ * Insert a formula preset
8796
+ */
8797
+ presetLabel: () => LocalizedString;
8742
8798
  formulas: {
8799
+ /**
8800
+ * Quadratic formula (a ≠ 0)
8801
+ */
8802
+ quadraticFormula: () => LocalizedString;
8803
+ /**
8804
+ * Difference of squares
8805
+ */
8806
+ differenceOfSquares: () => LocalizedString;
8807
+ /**
8808
+ * Square of a sum
8809
+ */
8810
+ perfectSquare: () => LocalizedString;
8811
+ /**
8812
+ * Pythagorean trigonometric identity
8813
+ */
8814
+ trigPythagorean: () => LocalizedString;
8815
+ /**
8816
+ * Arithmetic series sum
8817
+ */
8818
+ arithmeticSum: () => LocalizedString;
8819
+ /**
8820
+ * Geometric series sum (q ≠ 1)
8821
+ */
8822
+ geometricSum: () => LocalizedString;
8823
+ /**
8824
+ * Integration by parts
8825
+ */
8826
+ integrationByParts: () => LocalizedString;
8827
+ /**
8828
+ * Newton’s second law
8829
+ */
8830
+ newtonSecondLaw: () => LocalizedString;
8831
+ /**
8832
+ * Kinetic energy
8833
+ */
8834
+ kineticEnergy: () => LocalizedString;
8835
+ /**
8836
+ * Ohm’s law
8837
+ */
8838
+ ohmLaw: () => LocalizedString;
8839
+ /**
8840
+ * Ideal gas law
8841
+ */
8842
+ idealGas: () => LocalizedString;
8843
+ /**
8844
+ * Mass–energy equivalence
8845
+ */
8846
+ massEnergy: () => LocalizedString;
8743
8847
  /**
8744
8848
  * Gauss theorem
8745
8849
  */
@@ -3,6 +3,17 @@
3
3
  * Enables future source-preserving writeback (Mona-style) without
4
4
  * regenerating untouched OOXML parts.
5
5
  */
6
+ export interface SourcePackageDocument {
7
+ slides: readonly {
8
+ sourcePackageId?: string;
9
+ }[];
10
+ title: string;
11
+ theme: unknown;
12
+ viewportSize: number;
13
+ viewportRatio: number;
14
+ }
15
+ /** Certify only a fully applied import; retaining bytes alone is not sufficient. */
16
+ export declare function certifySourcePackageDocument(packageId: string, document: SourcePackageDocument): void;
6
17
  export declare function retainSourcePackage(packageId: string, bytes: ArrayBuffer): void;
7
18
  export declare function getSourcePackage(packageId: string): ArrayBuffer | undefined;
8
19
  export declare function hasSourcePackage(packageId: string): boolean;
@@ -16,4 +27,4 @@ export declare function getActiveSourcePackageId(): string | null;
16
27
  */
17
28
  export declare function tryGetCleanRetainedPackage(slides: Array<{
18
29
  sourcePackageId?: string;
19
- }>): ArrayBuffer | null;
30
+ }>, context?: Omit<SourcePackageDocument, 'slides'>): ArrayBuffer | null;
@@ -0,0 +1,11 @@
1
+ /** PowerPoint cell alpha exposes the slide; themed tables paint over paper in the editor. */
2
+ export declare function tableCellExportFill(fill: {
3
+ color: string;
4
+ alpha: number;
5
+ }, themed: boolean): {
6
+ color: string;
7
+ transparency?: undefined;
8
+ } | {
9
+ color: string;
10
+ transparency: number;
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fika-editor",
3
- "version": "3.5.4",
3
+ "version": "3.5.5",
4
4
  "description": "Fika presentation editor embed bundle with a typed agentic bridge.",
5
5
  "type": "module",
6
6
  "main": "dist/embed/fika-embed.js",
@@ -1 +0,0 @@
1
- export const __rspack_esm_id=6144;export const __rspack_esm_ids=[6144];export const __webpack_modules__={12115(e,t,l){l.d(t,{default:()=>m});var a=l(71178),i=l(2476),r=l(51649),s=l(70223),o=l(55104),n=l(58433),d=l(1449),c=l(98649);let u=(0,i.Q)({"latex-editor":"latex-editor-mnJArm",header:"header-XfWVan",title:"title-Ke9F2A",lede:"lede-hhKW7u","field-label":"field-label-GSgsEb",field:"field-tfm2EM",ready:"ready-AIjjie","field-skel":"field-skel-WHJApR","field-host":"field-host-VRmK45","field-hint":"field-hint-pJaAzp","kb-toggle":"kb-toggle-H7zJIx",active:"active-Uhi2eH","kb-icon":"kb-icon-Wc0ACj","tips-block":"tips-block-KmDH8o","tips-label":"tips-label-lVDrnK",tips:"tips-yjZQrc",tip:"tip-hpJ4LC",footer:"footer-EA_6l0",btn:"btn-yTLGMT",primary:"primary-RVhXDX"});function m(e){let{value:t="",onUpdate:l,onClose:i}=e,{LL:m}=(0,c.PO)(),h=!!t,p=h?m.components.latexEditor.editTitle():m.components.latexEditor.title(),f=(0,r.useRef)(null),b=(0,r.useRef)(null),x=(0,r.useRef)(null),y=(0,r.useRef)(""),[v,k]=(0,r.useState)(!1),[j,g]=(0,r.useState)(!t),[E,w]=(0,r.useState)(!!t),[_,C]=(0,r.useState)(!1),[N,M]=(0,r.useState)({left:"44px"}),A=()=>{let e=x.current;return e?((e.getValue?e.getValue("latex-without-placeholders"):e.value)||"").trim():""},L=(0,r.useCallback)(()=>{let e=x.current,t=f.current;if(!e||!t)return;let l=t.getBoundingClientRect(),a=e.shadowRoot,i=a?.querySelector(".ML__content"),r=a?.querySelector(".ML__caret, .ML__text-caret, .ML__latex-caret"),s=44;if(r){let e=parseFloat(getComputedStyle(r,"::after").borderRightWidth)||2,t=r.getBoundingClientRect();s=(t.height>0?t.left:i?.getBoundingClientRect().left??l.left+28)-l.left+e+14}else i&&(s=i.getBoundingClientRect().left-l.left+12);M({left:`${Math.max(36,Math.round(s))}px`})},[]),R=(0,r.useCallback)(()=>{C(!!window.mathVirtualKeyboard?.visible)},[]),V=(0,r.useCallback)(()=>{let e=!A();g(e),w(!e||!!y.current)},[]),K=(0,r.useCallback)(()=>{try{window.mathVirtualKeyboard?.hide({animate:!1})}catch{}document.body.style.removeProperty("padding-bottom"),C(!1)},[]),P=(0,r.useCallback)(()=>{K();let e=window.mathVirtualKeyboard;e&&e.removeEventListener("virtual-keyboard-toggle",R);let t=x.current;t&&(t.removeEventListener("input",V),t.removeEventListener("focus",L),t.parentElement&&t.parentElement.removeChild(t)),x.current=null},[K,R,V,L]);(0,r.useEffect)(()=>{let e=!1;return(async()=>{if(await (0,o.IM)(),(0,o.aX)(),await Promise.resolve(),e)return;let l=b.current;if(!l)return;P();let a=document.createElement("math-field");a.setAttribute("default-mode","math"),a.mathVirtualKeyboardPolicy="manual",t&&(a.value=t),a.addEventListener("input",V),a.addEventListener("focus",L),l.appendChild(a),x.current=a;let i=y.current;i&&(a.insert(i,{focus:!0,selectionMode:"placeholder"}),y.current=""),k(!0),V(),window.mathVirtualKeyboard?.addEventListener("virtual-keyboard-toggle",R),requestAnimationFrame(()=>{a.focus(),requestAnimationFrame(()=>L())})})(),()=>{e=!0,P()}},[P,V,L,R]),(0,r.useEffect)(()=>{j&&Promise.resolve().then(()=>L())},[j,L]);let S=e=>{let t=x.current;if(!t){y.current=e,g(!1),w(!0);return}t.focus(),t.insert(e,{focus:!0,selectionMode:"placeholder"}),y.current="",V()},q=async()=>{let e=A()||y.current;if(!e)return s.A.error(m.components.latexEditor.formulaEmpty());let t=160,a=64;try{let l=await Promise.race([(0,o.JX)(e),new Promise(e=>{setTimeout(()=>e({width:t,height:a}),280)})]);t=l.width,a=l.height}catch{}l?.({latex:e,path:"",w:t,h:a})};return(0,a.jsxs)("div",{className:u("latex-editor"),children:[(0,a.jsxs)("div",{className:u("header"),children:[(0,a.jsx)("div",{className:u("title"),children:p}),(0,a.jsx)("p",{className:u("lede"),children:m.components.latexEditor.description()})]}),(0,a.jsx)("label",{className:u("field-label"),children:m.components.latexEditor.fieldLabel()}),(0,a.jsxs)("div",{className:u("field",{ready:v}),ref:f,onClick:()=>void x.current?.focus(),children:[v?null:(0,a.jsx)(n.A,{className:u("field-skel")}),(0,a.jsx)("div",{className:u("field-host"),ref:b}),v&&j?(0,a.jsx)("div",{className:u("field-hint"),style:N,children:m.components.latexEditor.hint()}):null,v?(0,a.jsx)("button",{type:"button",className:u("kb-toggle",{active:_}),title:m.components.latexEditor.keyboardTooltip(),"aria-label":m.components.latexEditor.keyboardTooltip(),"aria-pressed":_,onClick:e=>{let t;e.stopPropagation(),x.current?.focus(),(0,o.aX)(),(t=window.mathVirtualKeyboard)&&(t.visible?(t.hide(),document.body.style.removeProperty("padding-bottom")):t.show(),R())},children:(0,a.jsxs)("svg",{className:u("kb-icon"),viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"2.75",y:"6.75",width:"18.5",height:"11.5",rx:"2.25"}),(0,a.jsx)("path",{d:"M6.25 10.25h1.5M10.25 10.25h1.5M14.25 10.25h1.5M17.25 10.25h1.5"}),(0,a.jsx)("path",{d:"M6.25 13h1.5M10.25 13h3.5M17.25 13h1.5"}),(0,a.jsx)("path",{d:"M8.5 15.75h7"})]})}):null]}),(0,a.jsxs)("div",{className:u("tips-block"),children:[(0,a.jsx)("div",{className:u("tips-label"),children:m.components.latexEditor.tipsLabel()}),(0,a.jsxs)("div",{className:u("tips"),children:[(0,a.jsxs)("button",{type:"button",className:u("tip"),"data-latex-tip":"frac",onClick:()=>S("\\frac{#?}{#?}"),children:[(0,a.jsx)("kbd",{children:"frac"})," ",m.components.latexEditor.tipFraction()]}),(0,a.jsxs)("button",{type:"button",className:u("tip"),"data-latex-tip":"power",onClick:()=>S("^{#?}"),children:[(0,a.jsx)("kbd",{children:"^"})," ",m.components.latexEditor.tipPower()]}),(0,a.jsxs)("button",{type:"button",className:u("tip"),"data-latex-tip":"sqrt",onClick:()=>S("\\sqrt{#?}"),children:[(0,a.jsx)("kbd",{children:"sqrt"})," ",m.components.latexEditor.tipRoot()]})]})]}),(0,a.jsxs)("div",{className:u("footer"),children:[(0,a.jsx)(d.A,{className:u("btn"),onClick:()=>i?.(),children:m.common.cancel()}),(0,a.jsx)(d.A,{className:u("btn"),type:"primary","data-editor-insert":"latex",disabled:!E,onClick:()=>{q()},children:h?m.common.save():m.components.latexEditor.insert()})]})]})}}};
File without changes