@docvyu/sdk 0.0.6 → 0.1.0
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/README.md +47 -32
- package/dist/cdn/docvyu.js +2268 -120
- package/dist/cdn/docvyu.min.js +1 -1
- package/dist/cjs/DocvyuEditor-BOTw6i4d.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react/index.js +1 -1
- package/dist/esm/DocvyuEditor-CDLqMpaq.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/react/index.js +1 -1
- package/dist/types/app/DocvyuApp.d.ts +187 -0
- package/dist/types/app/index.d.ts +0 -2
- package/dist/types/core/DocvyuEditor.d.ts +402 -57
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/i18n/types.d.ts +128 -0
- package/dist/wasm/docvyu_core.d.ts +8 -182
- package/dist/wasm/docvyu_core.js +1 -1
- package/dist/wasm/docvyu_core_bg.wasm +0 -0
- package/dist/wasm/docvyu_core_bg.wasm.d.ts +0 -56
- package/package.json +2 -2
- package/wasm/docvyu_core.d.ts +8 -182
- package/wasm/docvyu_core.js +1297 -200
- package/wasm/docvyu_core_bg.wasm +0 -0
- package/wasm/docvyu_core_bg.wasm.d.ts +0 -56
- package/dist/cjs/DocvyuEditor-CwMF2qhs.js +0 -1
- package/dist/esm/DocvyuEditor-CCAFPhSl.js +0 -1
- package/dist/types/app/DocvyuApp.test.d.ts +0 -1
- package/dist/types/app/styles.d.ts +0 -10
- package/dist/types/app/template.d.ts +0 -9
- package/dist/types/core/DocvyuEditor.test.d.ts +0 -4
- package/dist/types/i18n/I18nManager.test.d.ts +0 -4
- package/dist/types/license/LicenseManager.test.d.ts +0 -4
- package/dist/wasm/docuweave_core.d.ts +0 -207
- package/dist/wasm/docuweave_core.js +0 -988
- package/dist/wasm/docuweave_core_bg.wasm +0 -0
- package/dist/wasm/docuweave_core_bg.wasm.d.ts +0 -59
package/wasm/docvyu_core_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,59 +1,3 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_editor_free: (a: number, b: number) => void;
|
|
5
|
-
export const __wbg_selectionstylestate_free: (a: number, b: number) => void;
|
|
6
|
-
export const editor_get_numbering_format_id: (a: number) => number;
|
|
7
|
-
export const editor_get_page_size: (a: number, b: number) => void;
|
|
8
|
-
export const editor_get_ruler_unit: (a: number) => number;
|
|
9
|
-
export const editor_get_zoom: (a: number) => number;
|
|
10
|
-
export const editor_has_bullet_list: (a: number) => number;
|
|
11
|
-
export const editor_has_numbered_list: (a: number) => number;
|
|
12
|
-
export const editor_has_numbering: (a: number) => number;
|
|
13
|
-
export const editor_load_docx_and_render: (a: number, b: number, c: number) => void;
|
|
14
|
-
export const editor_new: (a: number, b: number, c: number) => void;
|
|
15
|
-
export const editor_on_key_down: (a: number, b: number, c: number) => void;
|
|
16
|
-
export const editor_on_mouse_click: (a: number, b: number, c: number) => void;
|
|
17
|
-
export const editor_on_mouse_drag: (a: number, b: number, c: number) => void;
|
|
18
|
-
export const editor_remove_numbering: (a: number) => void;
|
|
19
|
-
export const editor_reset_font_color: (a: number) => void;
|
|
20
|
-
export const editor_reset_font_family: (a: number) => void;
|
|
21
|
-
export const editor_reset_font_size: (a: number) => void;
|
|
22
|
-
export const editor_save_document: (a: number, b: number) => void;
|
|
23
|
-
export const editor_select_document: (a: number) => void;
|
|
24
|
-
export const editor_select_paragraph: (a: number) => void;
|
|
25
|
-
export const editor_select_word: (a: number) => void;
|
|
26
|
-
export const editor_selection_style_state: (a: number) => number;
|
|
27
|
-
export const editor_set_bold: (a: number, b: number) => void;
|
|
28
|
-
export const editor_set_bullet_list: (a: number, b: number) => void;
|
|
29
|
-
export const editor_set_cursor_visible: (a: number, b: number) => void;
|
|
30
|
-
export const editor_set_font_color: (a: number, b: number, c: number) => void;
|
|
31
|
-
export const editor_set_font_family: (a: number, b: number, c: number) => void;
|
|
32
|
-
export const editor_set_font_size: (a: number, b: number) => void;
|
|
33
|
-
export const editor_set_italic: (a: number, b: number) => void;
|
|
34
|
-
export const editor_set_numbered_list: (a: number, b: number) => void;
|
|
35
|
-
export const editor_set_numbered_list_format: (a: number, b: number, c: number) => void;
|
|
36
|
-
export const editor_set_page_margins: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
37
|
-
export const editor_set_page_size: (a: number, b: number, c: number) => void;
|
|
38
|
-
export const editor_set_paragraph_alignment: (a: number, b: number, c: number) => void;
|
|
39
|
-
export const editor_set_ruler_unit: (a: number, b: number) => void;
|
|
40
|
-
export const editor_set_underline: (a: number, b: number) => void;
|
|
41
|
-
export const editor_set_zoom: (a: number, b: number) => void;
|
|
42
|
-
export const editor_toggle_ruler_unit: (a: number) => void;
|
|
43
|
-
export const editor_zoom_in: (a: number) => void;
|
|
44
|
-
export const editor_zoom_out: (a: number) => void;
|
|
45
|
-
export const selectionstylestate_bold_all: (a: number) => number;
|
|
46
|
-
export const selectionstylestate_bold_any: (a: number) => number;
|
|
47
|
-
export const selectionstylestate_font_color: (a: number, b: number) => void;
|
|
48
|
-
export const selectionstylestate_font_family: (a: number, b: number) => void;
|
|
49
|
-
export const selectionstylestate_font_size: (a: number, b: number) => void;
|
|
50
|
-
export const selectionstylestate_italic_all: (a: number) => number;
|
|
51
|
-
export const selectionstylestate_italic_any: (a: number) => number;
|
|
52
|
-
export const selectionstylestate_paragraph_alignment: (a: number, b: number) => void;
|
|
53
|
-
export const selectionstylestate_underline_all: (a: number) => number;
|
|
54
|
-
export const selectionstylestate_underline_any: (a: number) => number;
|
|
55
|
-
export const __wbindgen_export: (a: number, b: number) => number;
|
|
56
|
-
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
57
|
-
export const __wbindgen_export3: (a: number) => void;
|
|
58
|
-
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
59
|
-
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t={loadDocument:!0,saveDocument:!0,editText:!0,formatting:!0,lists:!0,pageSettings:!0,zoom:!0,showWatermark:!0,maxDocumentSize:5242880,maxDocsPerMonth:10,grayLabel:!1,prioritySupport:!1},i={starter:t,professional:{loadDocument:!0,saveDocument:!0,editText:!0,formatting:!0,lists:!0,pageSettings:!0,zoom:!0,showWatermark:!1,maxDocumentSize:0,maxDocsPerMonth:10,grayLabel:!1,prioritySupport:!0},enterprise:{loadDocument:!0,saveDocument:!0,editText:!0,formatting:!0,lists:!0,pageSettings:!0,zoom:!0,showWatermark:!1,maxDocumentSize:0,maxDocsPerMonth:0,grayLabel:!0,prioritySupport:!0}},a=function(){try{if("undefined"!=typeof process&&process.env){const e=process.env.VITE_DOCVYU_LICENSE_SERVER||process.env.NEXT_PUBLIC_DOCVYU_LICENSE_SERVER;if(e&&"undefined"!==e)return e}}catch{}try{"undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("DocvyuEditor-CwMF2qhs.js",document.baseURI).href}catch{}return"https://docvyu-license.luis-tapia-a.workers.dev/v1/license"}(),o="docvyu_license_cache";class r{constructor(e={}){this.status=null,this.fingerprint=null,this.serverUsageCount=0,this.config={apiKey:e.apiKey,licenseServerUrl:e.licenseServerUrl||a,offlineMode:e.offlineMode??!1}}async initialize(){return this.fingerprint=await this.generateFingerprint(),this.config.apiKey?this.initializeWithApiKey():this.initializeStarterTier()}async initializeWithApiKey(){const e=this.getCachedLicense();if(e&&e.apiKey===this.config.apiKey){const t=Date.now();if(e.expiresAt>t)return this.status=e.status,this.status}try{return this.status=await this.validateWithServer(),this.cacheLicense(this.status),this.status}catch(t){return this.config.offlineMode&&e?(this.status=e.status,this.status):this.initializeStarterTier()}}async initializeStarterTier(){try{const e=await this.getServerUsage();this.serverUsageCount=e.used;const i=Math.max(0,e.limit-e.used);return this.status={isValid:i>0,tier:"starter",remainingUses:i,unlimited:!1,features:t,expiresAt:null,error:i<=0?"Monthly document limit exceeded. Please upgrade to continue.":void 0},this.status}catch(e){return this.status={isValid:!1,tier:"starter",remainingUses:0,unlimited:!1,features:t,expiresAt:null,error:"Could not verify usage. Please check your internet connection."},this.status}}getStatus(){return this.status?this.status:{isValid:!1,tier:"starter",remainingUses:0,unlimited:!1,features:t,expiresAt:null,error:"License not initialized"}}hasFeature(e){return!!this.getStatus().features[e]}async recordUsage(){if(this.status?.unlimited)return 1/0;try{const e=await this.recordServerUsage();return this.serverUsageCount=e.used,this.status&&(this.status.remainingUses=e.remaining,e.remaining<=0&&(this.status.isValid=!1,this.status.error="Monthly document limit exceeded. Please upgrade to continue.")),e.remaining}catch(e){return this.status&&(this.status.remainingUses=0,this.status.isValid=!1,this.status.error="Could not verify usage. Please check your internet connection."),0}}getRemainingUses(){return this.status?.unlimited?1/0:this.status?.remainingUses??0}isUsageLimitExceeded(){return!this.status?.unlimited&&this.getRemainingUses()<=0}async getServerUsage(){const e=await fetch(`${this.config.licenseServerUrl}/usage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fingerprint:this.fingerprint,action:"get"})});if(!e.ok)throw new Error(`Failed to get usage: ${e.status}`);return e.json()}async recordServerUsage(){const e=await fetch(`${this.config.licenseServerUrl}/usage`,{method:"POST",headers:{"Content-Type":"application/json",...this.config.apiKey?{Authorization:`Bearer ${this.config.apiKey}`}:{}},body:JSON.stringify({fingerprint:this.fingerprint,action:"record",apiKey:this.config.apiKey})});if(!e.ok)throw new Error(`Failed to record usage: ${e.status}`);return e.json()}async validateWithServer(){const e=await fetch(`${this.config.licenseServerUrl}/validate`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({apiKey:this.config.apiKey,fingerprint:this.fingerprint,timestamp:Date.now()})});if(!e.ok){if(401===e.status||403===e.status)return{isValid:!1,tier:"starter",remainingUses:0,unlimited:!1,features:t,expiresAt:null,error:"Invalid API key"};throw new Error(`License validation failed: ${e.status}`)}const a=await e.json();return{isValid:a.valid,tier:a.tier||"starter",remainingUses:a.remainingUses??1/0,unlimited:a.unlimited??!1,features:i[a.tier]||t,expiresAt:a.expiresAt?new Date(a.expiresAt):null}}getCachedLicense(){if("undefined"==typeof localStorage)return null;try{const e=localStorage.getItem(o);return e?JSON.parse(e):null}catch{return null}}cacheLicense(e){if("undefined"==typeof localStorage)return;if(!this.config.apiKey)return;const t={status:e,apiKey:this.config.apiKey,cachedAt:Date.now(),expiresAt:Date.now()+864e5};try{localStorage.setItem(o,JSON.stringify(t))}catch{}}async generateFingerprint(){const e=[];"undefined"!=typeof navigator&&(e.push(navigator.userAgent),e.push(navigator.language),e.push(String(navigator.hardwareConcurrency||"")),e.push(navigator.platform||"")),"undefined"!=typeof screen&&(e.push(`${screen.width}x${screen.height}`),e.push(String(screen.colorDepth)));try{e.push(Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}try{const t=document.createElement("canvas"),i=t.getContext("2d");i&&(i.textBaseline="top",i.font="14px Arial",i.fillText("DocVyu",0,0),e.push(t.toDataURL()))}catch{}const t=e.join("|");return this.hashString(t)}async hashString(e){if("undefined"!=typeof crypto&&crypto.subtle){const t=(new TextEncoder).encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")}let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t&=t;return Math.abs(t).toString(16)}}const n={en:{general:{loading:"Loading...",error:"Error",success:"Success",cancel:"Cancel",confirm:"Confirm",save:"Save",close:"Close",retry:"Retry",poweredBy:"Powered by"},editor:{title:"DocVyu Editor",untitledDocument:"Untitled Document",loadingEditor:"Loading editor...",initializingEditor:"Initializing editor...",documentLoaded:"Document loaded successfully",documentSaved:"Document saved successfully",noDocumentLoaded:"No document loaded"},toolbar:{file:"File",edit:"Edit",view:"View",format:"Format",help:"Help",newDocument:"New Document",openDocument:"Open Document",saveDocument:"Save Document",downloadDocument:"Download Document",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select All",home:"Home",insert:"Insert",layout:"Layout",clipboard:"Clipboard",font:"Font",paragraph:"Paragraph",editing:"Editing",find:"Find",replace:"Replace",size:"Size",numberingFormat:"Numbering Format"},formatting:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontSize:"Font Size",fontFamily:"Font Family",fontColor:"Font Color",backgroundColor:"Background Color",alignment:"Alignment",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Justify",bulletList:"Bullet List",numberedList:"Numbered List",increaseIndent:"Increase Indent",decreaseIndent:"Decrease Indent",lineSpacing:"Line Spacing",paragraphSpacing:"Paragraph Spacing"},pageSettings:{title:"Page Settings",pageSize:"Page Size",margins:"Margins",marginTop:"Top",marginBottom:"Bottom",marginLeft:"Left",marginRight:"Right",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",customSize:"Custom Size",letter:"Letter",legal:"Legal",a4:"A4",a5:"A5",b5:"B5"},zoom:{zoomIn:"Zoom In",zoomOut:"Zoom Out",zoomLevel:"Zoom Level",fitToPage:"Fit to Page",fitToWidth:"Fit to Width"},ruler:{centimeters:"Centimeters",inches:"Inches",toggleUnit:"Toggle Unit"},license:{freeTier:"Free",starterTier:"Starter",professionalTier:"Professional",enterpriseTier:"Enterprise",documentsRemaining:"{count} documents remaining this month",unlimitedDocuments:"Unlimited documents",upgradeNow:"Upgrade Now",licenseValid:"License is valid",licenseExpired:"License has expired",licenseInvalid:"Invalid license",invalidLicense:"Invalid or expired license. Please check your API key.",notValidated:"License not validated. Please ensure you are connected to the internet.",usageLimitExceeded:"Usage Limit Exceeded",usageLimitExceededMessage:"You have reached your monthly document limit. Please upgrade your plan to continue.",checkingLicense:"Checking license..."},watermark:{poweredBy:"Powered by DocVyu"},errors:{editorNotInitialized:"Editor not initialized. Please call initialize() first.",documentLoadFailed:"Failed to load document",documentSaveFailed:"Failed to save document",featureNotAvailable:"This feature is not available in your current plan. Please upgrade to access it.",documentTooLarge:"Document size exceeds the limit for your plan",networkError:"Network error. Please check your connection.",invalidApiKey:"Invalid API key",licenseFetchFailed:"Failed to fetch license information",wasmLoadFailed:"Failed to load WebAssembly module",canvasNotFound:"Canvas element not found"},accessibility:{editorLabel:"Document Editor",toolbarLabel:"Editor Toolbar",formattingToolbar:"Formatting Toolbar",pageNavigation:"Page Navigation",currentPage:"Page {current}",totalPages:"of {total}"},statusBar:{ready:"Ready",pageOf:"Page {current} of {total}",words:"{count} words",selectLanguage:"Select language"}},es:{general:{loading:"Cargando...",error:"Error",success:"Éxito",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",close:"Cerrar",retry:"Reintentar",poweredBy:"Desarrollado por"},editor:{title:"Editor DocVyu",untitledDocument:"Documento sin título",loadingEditor:"Cargando editor...",initializingEditor:"Inicializando editor...",documentLoaded:"Documento cargado exitosamente",documentSaved:"Documento guardado exitosamente",noDocumentLoaded:"No hay documento cargado"},toolbar:{file:"Archivo",edit:"Editar",view:"Ver",format:"Formato",help:"Ayuda",newDocument:"Nuevo Documento",openDocument:"Abrir Documento",saveDocument:"Guardar Documento",downloadDocument:"Descargar Documento",undo:"Deshacer",redo:"Rehacer",cut:"Cortar",copy:"Copiar",paste:"Pegar",selectAll:"Seleccionar Todo",home:"Inicio",insert:"Insertar",layout:"Diseño",clipboard:"Portapapeles",font:"Fuente",paragraph:"Párrafo",editing:"Edición",find:"Buscar",replace:"Reemplazar",size:"Tamaño",numberingFormat:"Formato de Numeración"},formatting:{bold:"Negrita",italic:"Cursiva",underline:"Subrayado",strikethrough:"Tachado",fontSize:"Tamaño de Fuente",fontFamily:"Familia de Fuente",fontColor:"Color de Fuente",backgroundColor:"Color de Fondo",alignment:"Alineación",alignLeft:"Alinear a la Izquierda",alignCenter:"Centrar",alignRight:"Alinear a la Derecha",alignJustify:"Justificar",bulletList:"Lista con Viñetas",numberedList:"Lista Numerada",increaseIndent:"Aumentar Sangría",decreaseIndent:"Disminuir Sangría",lineSpacing:"Interlineado",paragraphSpacing:"Espaciado de Párrafo"},pageSettings:{title:"Configuración de Página",pageSize:"Tamaño de Página",margins:"Márgenes",marginTop:"Superior",marginBottom:"Inferior",marginLeft:"Izquierdo",marginRight:"Derecho",orientation:"Orientación",portrait:"Vertical",landscape:"Horizontal",customSize:"Tamaño Personalizado",letter:"Carta",legal:"Legal",a4:"A4",a5:"A5",b5:"B5"},zoom:{zoomIn:"Acercar",zoomOut:"Alejar",zoomLevel:"Nivel de Zoom",fitToPage:"Ajustar a Página",fitToWidth:"Ajustar al Ancho"},ruler:{centimeters:"Centímetros",inches:"Pulgadas",toggleUnit:"Cambiar Unidad"},license:{freeTier:"Gratuito",starterTier:"Inicial",professionalTier:"Profesional",enterpriseTier:"Empresarial",documentsRemaining:"{count} documentos restantes este mes",unlimitedDocuments:"Documentos ilimitados",upgradeNow:"Actualizar Ahora",licenseValid:"La licencia es válida",licenseExpired:"La licencia ha expirado",licenseInvalid:"Licencia inválida",invalidLicense:"Licencia inválida o expirada. Por favor verifica tu clave API.",notValidated:"Licencia no validada. Por favor asegúrate de estar conectado a internet.",usageLimitExceeded:"Límite de Uso Excedido",usageLimitExceededMessage:"Has alcanzado tu límite mensual de documentos. Por favor actualiza tu plan para continuar.",checkingLicense:"Verificando licencia..."},watermark:{poweredBy:"Desarrollado con DocVyu"},errors:{editorNotInitialized:"Editor no inicializado. Por favor llama a initialize() primero.",documentLoadFailed:"Error al cargar el documento",documentSaveFailed:"Error al guardar el documento",featureNotAvailable:"Esta función no está disponible en tu plan actual. Por favor actualiza para acceder.",documentTooLarge:"El tamaño del documento excede el límite de tu plan",networkError:"Error de red. Por favor verifica tu conexión.",invalidApiKey:"Clave API inválida",licenseFetchFailed:"Error al obtener información de la licencia",wasmLoadFailed:"Error al cargar el módulo WebAssembly",canvasNotFound:"Elemento canvas no encontrado"},accessibility:{editorLabel:"Editor de Documentos",toolbarLabel:"Barra de Herramientas del Editor",formattingToolbar:"Barra de Formato",pageNavigation:"Navegación de Páginas",currentPage:"Página {current}",totalPages:"de {total}"},statusBar:{ready:"Listo",pageOf:"Página {current} de {total}",words:"{count} palabras",selectLanguage:"Seleccionar idioma"}},pt:{general:{loading:"Carregando...",error:"Erro",success:"Sucesso",cancel:"Cancelar",confirm:"Confirmar",save:"Salvar",close:"Fechar",retry:"Tentar novamente",poweredBy:"Desenvolvido por"},editor:{title:"Editor DocVyu",untitledDocument:"Documento sem título",loadingEditor:"Carregando editor...",initializingEditor:"Inicializando editor...",documentLoaded:"Documento carregado com sucesso",documentSaved:"Documento salvo com sucesso",noDocumentLoaded:"Nenhum documento carregado"},toolbar:{file:"Arquivo",edit:"Editar",view:"Visualizar",format:"Formatar",help:"Ajuda",newDocument:"Novo Documento",openDocument:"Abrir Documento",saveDocument:"Salvar Documento",downloadDocument:"Baixar Documento",undo:"Desfazer",redo:"Refazer",cut:"Recortar",copy:"Copiar",paste:"Colar",selectAll:"Selecionar Tudo",home:"Início",insert:"Inserir",layout:"Layout",clipboard:"Área de Transferência",font:"Fonte",paragraph:"Parágrafo",editing:"Edição",find:"Localizar",replace:"Substituir",size:"Tamanho",numberingFormat:"Formato de Numeração"},formatting:{bold:"Negrito",italic:"Itálico",underline:"Sublinhado",strikethrough:"Riscado",fontSize:"Tamanho da Fonte",fontFamily:"Família da Fonte",fontColor:"Cor da Fonte",backgroundColor:"Cor de Fundo",alignment:"Alinhamento",alignLeft:"Alinhar à Esquerda",alignCenter:"Centralizar",alignRight:"Alinhar à Direita",alignJustify:"Justificar",bulletList:"Lista com Marcadores",numberedList:"Lista Numerada",increaseIndent:"Aumentar Recuo",decreaseIndent:"Diminuir Recuo",lineSpacing:"Espaçamento entre Linhas",paragraphSpacing:"Espaçamento de Parágrafo"},pageSettings:{title:"Configurações de Página",pageSize:"Tamanho da Página",margins:"Margens",marginTop:"Superior",marginBottom:"Inferior",marginLeft:"Esquerda",marginRight:"Direita",orientation:"Orientação",portrait:"Retrato",landscape:"Paisagem",customSize:"Tamanho Personalizado",letter:"Carta",legal:"Ofício",a4:"A4",a5:"A5",b5:"B5"},zoom:{zoomIn:"Aumentar Zoom",zoomOut:"Diminuir Zoom",zoomLevel:"Nível de Zoom",fitToPage:"Ajustar à Página",fitToWidth:"Ajustar à Largura"},ruler:{centimeters:"Centímetros",inches:"Polegadas",toggleUnit:"Alternar Unidade"},license:{freeTier:"Gratuito",starterTier:"Inicial",professionalTier:"Profissional",enterpriseTier:"Empresarial",documentsRemaining:"{count} documentos restantes este mês",unlimitedDocuments:"Documentos ilimitados",upgradeNow:"Atualizar Agora",licenseValid:"Licença válida",licenseExpired:"Licença expirada",licenseInvalid:"Licença inválida",invalidLicense:"Licença inválida ou expirada. Por favor, verifique sua chave API.",notValidated:"Licença não validada. Por favor, verifique sua conexão com a internet.",usageLimitExceeded:"Limite de Uso Excedido",usageLimitExceededMessage:"Você atingiu seu limite mensal de documentos. Por favor, atualize seu plano para continuar.",checkingLicense:"Verificando licença..."},watermark:{poweredBy:"Desenvolvido com DocVyu"},errors:{editorNotInitialized:"Editor não inicializado. Por favor, chame initialize() primeiro.",documentLoadFailed:"Falha ao carregar o documento",documentSaveFailed:"Falha ao salvar o documento",featureNotAvailable:"Este recurso não está disponível no seu plano atual. Por favor, atualize para acessar.",documentTooLarge:"O tamanho do documento excede o limite do seu plano",networkError:"Erro de rede. Por favor, verifique sua conexão.",invalidApiKey:"Chave API inválida",licenseFetchFailed:"Falha ao obter informações da licença",wasmLoadFailed:"Falha ao carregar o módulo WebAssembly",canvasNotFound:"Elemento canvas não encontrado"},accessibility:{editorLabel:"Editor de Documentos",toolbarLabel:"Barra de Ferramentas do Editor",formattingToolbar:"Barra de Formatação",pageNavigation:"Navegação de Páginas",currentPage:"Página {current}",totalPages:"de {total}"},statusBar:{ready:"Pronto",pageOf:"Página {current} de {total}",words:"{count} palavras",selectLanguage:"Selecionar idioma"}}},s={locale:"en",fallbackLocale:"en",customTranslations:{}};class l{constructor(e={}){this.listeners=new Set,this.config={...s,...e},this.currentTranslations=this.buildTranslations()}static getInstance(e){return l.instance?e&&l.instance.configure(e):l.instance=new l(e),l.instance}static reset(){l.instance=null}configure(e){this.config={...this.config,...e},this.currentTranslations=this.buildTranslations(),this.notifyListeners()}getLocale(){return this.config.locale}setLocale(e){this.config.locale!==e&&(this.config.locale=e,this.currentTranslations=this.buildTranslations(),this.notifyListeners())}getAvailableLocales(){return Object.keys(n)}getTranslations(){return this.currentTranslations}t(e,t){const i=this.getNestedValue(this.currentTranslations,e);if(void 0===i){const i=this.getNestedValue(n[this.config.fallbackLocale],e);return void 0===i?e:this.interpolate(i,t)}return this.interpolate(i,t)}onLocaleChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}detectAndSetLocale(){const e=this.detectBrowserLocale();return e?(this.setLocale(e),e):this.config.locale}detectBrowserLocale(){if("undefined"==typeof navigator)return null;const e=navigator.languages||[navigator.language];for(const t of e){const e=t.split("-")[0].toLowerCase();if(this.getAvailableLocales().includes(e))return e}return null}buildTranslations(){const e=n[this.config.locale]||n[this.config.fallbackLocale],t=this.config.customTranslations?.[this.config.locale];return t?this.deepMerge(e,t):e}getNestedValue(e,t){const i=t.split(".");let a=e;for(const e of i){if(null==a)return;a=a[e]}return"string"==typeof a?a:void 0}interpolate(e,t){return t?e.replace(/\{(\w+)\}/g,(e,i)=>{const a=t[i];return void 0!==a?String(a):`{${i}}`}):e}deepMerge(e,t){const i={...e};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const o=t[a],r=e[a];null===o||"object"!=typeof o||Array.isArray(o)||null===r||"object"!=typeof r||Array.isArray(r)?void 0!==o&&(i[a]=o):i[a]=this.deepMerge(r,o)}return i}notifyListeners(){for(const e of this.listeners)e(this.config.locale)}}function c(e){return l.getInstance(e)}function d(e,t){return l.getInstance().t(e,t)}function u(e){l.getInstance().setLocale(e)}l.instance=null;class h{constructor(e){this.wasmEditor=null,this.isInitialized=!1,this.licenseValidated=!1,this.cursorBlinkInterval=null,this.cursorVisible=!0,this.localeUnsubscribe=null,this.config=e,this.licenseManager=new r({apiKey:e.apiKey,licenseServerUrl:e.licenseServerUrl,offlineMode:e.offlineMode});const t=c({locale:e.locale||"en",customTranslations:e.customTranslations});if(e.autoDetectLocale&&t.detectAndSetLocale(),e.onLocaleChange&&(this.localeUnsubscribe=t.onLocaleChange(e.onLocaleChange)),"string"==typeof e.canvas){const t=document.getElementById(e.canvas);if(!(t&&t instanceof HTMLCanvasElement))throw new Error(d("errors.canvasNotFound"));this.canvas=t,this.canvasId=e.canvas}else this.canvas=e.canvas,this.canvas.id||(this.canvas.id=`docvyu-canvas-${Date.now()}`),this.canvasId=this.canvas.id}async initialize(e,t){const i=await this.licenseManager.initialize();this.licenseValidated=!0;const a={valid:i.isValid,tier:i.tier,remaining:i.remainingUses,watermark:i.features.showWatermark,error:i.error};if(this.config.onLicenseChange&&this.config.onLicenseChange(a),this.licenseManager.isUsageLimitExceeded())throw this.config.onUsageLimitExceeded&&this.config.onUsageLimitExceeded(),new Error(d("license.usageLimitExceededMessage"));if(!i.isValid)throw new Error(i.error||d("license.invalidLicense"));return await e(),this.wasmEditor=new t(this.canvasId),this.isInitialized=!0,this.config.zoom&&this.wasmEditor.set_zoom(this.config.zoom),"inches"===this.config.rulerUnit&&this.wasmEditor.set_ruler_unit(1),this.startCursorBlink(),a}async loadDocument(e){this.ensureInitialized(),this.ensureFeature("loadDocument");const t=e instanceof ArrayBuffer?new Uint8Array(e):e;if(this.licenseManager.isUsageLimitExceeded())throw this.config.onUsageLimitExceeded&&this.config.onUsageLimitExceeded(),new Error(d("license.usageLimitExceededMessage"));const i=this.licenseManager.getStatus().features.maxDocumentSize;if(i>0&&t.length>i)throw new Error(d("errors.documentTooLarge"));await this.licenseManager.recordUsage(),this.config.onLicenseChange&&this.config.onLicenseChange(this.getLicenseInfo()),this.wasmEditor.load_docx_and_render(t),this.config.onLoad&&this.config.onLoad()}saveDocument(){this.ensureInitialized(),this.ensureFeature("saveDocument");const e=this.wasmEditor.save_document();return this.config.onSave&&this.config.onSave(e),e}downloadDocument(e="document.docx"){const t=this.saveDocument(),i=new Blob([new Uint8Array(t)],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)}setBold(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_bold(e),this.notifySelectionChange()}setItalic(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_italic(e),this.notifySelectionChange()}setUnderline(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_underline(e),this.notifySelectionChange()}setFontSize(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_font_size(e),this.notifySelectionChange()}resetFontSize(){this.ensureInitialized(),this.wasmEditor.reset_font_size(),this.notifySelectionChange()}setFontFamily(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_font_family(e),this.notifySelectionChange()}resetFontFamily(){this.ensureInitialized(),this.wasmEditor.reset_font_family(),this.notifySelectionChange()}setFontColor(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_font_color(e),this.notifySelectionChange()}resetFontColor(){this.ensureInitialized(),this.wasmEditor.reset_font_color(),this.notifySelectionChange()}setAlignment(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_paragraph_alignment(e),this.notifySelectionChange()}setBulletList(e){this.ensureInitialized(),this.ensureFeature("lists"),this.wasmEditor.set_bullet_list(e),this.notifySelectionChange()}setNumberedList(e){this.ensureInitialized(),this.ensureFeature("lists"),this.wasmEditor.set_numbered_list(e),this.notifySelectionChange()}setNumberedListFormat(e){this.ensureInitialized(),this.ensureFeature("lists"),this.wasmEditor.set_numbered_list_format(e),this.notifySelectionChange()}removeNumbering(){this.ensureInitialized(),this.wasmEditor.remove_numbering(),this.notifySelectionChange()}setMargins(e){this.ensureInitialized(),this.ensureFeature("pageSettings"),this.wasmEditor.set_page_margins(e.left,e.right,e.top,e.bottom)}setPageSize(e){this.ensureInitialized(),this.ensureFeature("pageSettings"),"custom"!==e&&this.wasmEditor.set_page_size(e)}getPageSize(){return this.ensureInitialized(),this.wasmEditor.get_page_size()}setZoom(e){this.ensureInitialized(),this.ensureFeature("zoom"),this.wasmEditor.set_zoom(e)}getZoom(){return this.ensureInitialized(),this.wasmEditor.get_zoom()}zoomIn(){this.ensureInitialized(),this.ensureFeature("zoom"),this.wasmEditor.zoom_in()}zoomOut(){this.ensureInitialized(),this.ensureFeature("zoom"),this.wasmEditor.zoom_out()}setRulerUnit(e){this.ensureInitialized(),this.wasmEditor.set_ruler_unit("inches"===e?1:0)}getRulerUnit(){return this.ensureInitialized(),1===this.wasmEditor.get_ruler_unit()?"inches":"centimeters"}toggleRulerUnit(){this.ensureInitialized(),this.wasmEditor.toggle_ruler_unit()}selectWord(){this.ensureInitialized(),this.wasmEditor.select_word(),this.notifySelectionChange()}selectParagraph(){this.ensureInitialized(),this.wasmEditor.select_paragraph(),this.notifySelectionChange()}selectAll(){this.ensureInitialized(),this.wasmEditor.select_document(),this.notifySelectionChange()}getSelectionState(){this.ensureInitialized();const e=this.wasmEditor.selection_style_state();return{bold:e.bold_all(),italic:e.italic_all(),underline:e.underline_all(),fontSize:e.font_size(),fontFamily:e.font_family(),fontColor:e.font_color(),alignment:e.paragraph_alignment(),hasBulletList:this.wasmEditor.has_bullet_list(),hasNumberedList:this.wasmEditor.has_numbered_list(),numberingFormatId:this.wasmEditor.get_numbering_format_id()}}handleMouseClick(e,t){this.ensureInitialized(),this.wasmEditor.on_mouse_click(e,t),this.resetCursorBlink(),this.notifySelectionChange()}handleMouseDrag(e,t){this.ensureInitialized(),this.wasmEditor.on_mouse_drag(e,t),this.notifySelectionChange()}handleKeyDown(e){this.ensureInitialized(),this.ensureFeature("editText"),this.wasmEditor.on_key_down(e),this.resetCursorBlink(),this.notifySelectionChange()}getLicenseInfo(){const e=this.licenseManager.getStatus();return{valid:e.isValid,tier:e.tier,remaining:e.remainingUses,watermark:e.features.showWatermark,error:e.error}}shouldShowWatermark(){return this.licenseManager.getStatus().features.showWatermark}getWatermarkText(){return d("watermark.poweredBy")}setLocale(e){u(e)}getLocale(){return l.getInstance().getLocale()}translate(e,t){return d(e,t)}destroy(){this.stopCursorBlink(),this.localeUnsubscribe&&(this.localeUnsubscribe(),this.localeUnsubscribe=null),this.wasmEditor&&(this.wasmEditor.free(),this.wasmEditor=null),this.isInitialized=!1}ensureInitialized(){if(!this.licenseValidated)throw new Error(d("license.notValidated"));if(!this.isInitialized||!this.wasmEditor)throw new Error(d("errors.editorNotInitialized"))}ensureLicenseValid(){if(!this.licenseValidated)throw new Error(d("license.notValidated"));const e=this.licenseManager.getStatus();if(!e.isValid)throw new Error(e.error||d("license.invalidLicense"))}ensureFeature(e){if(!this.licenseManager.hasFeature(e))throw new Error(d("errors.featureNotAvailable"))}notifySelectionChange(){this.config.onSelectionChange&&this.isInitialized&&this.config.onSelectionChange(this.getSelectionState())}startCursorBlink(){this.stopCursorBlink(),this.cursorVisible=!0,this.cursorBlinkInterval=window.setInterval(()=>{this.cursorVisible=!this.cursorVisible,this.wasmEditor&&this.wasmEditor.set_cursor_visible(this.cursorVisible)},530)}stopCursorBlink(){null!==this.cursorBlinkInterval&&(clearInterval(this.cursorBlinkInterval),this.cursorBlinkInterval=null)}resetCursorBlink(){this.cursorVisible=!0,this.wasmEditor&&this.wasmEditor.set_cursor_visible(!0),this.startCursorBlink()}}exports.DocvyuEditor=h,exports.LicenseManager=r,exports.createEditor=function(e){return new h(e)},exports.getAvailableLocales=function(){return l.getInstance().getAvailableLocales()},exports.initI18n=c,exports.onLocaleChange=function(e){return l.getInstance().onLocaleChange(e)},exports.setLocale=u,exports.t=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={loadDocument:!0,saveDocument:!0,editText:!0,formatting:!0,lists:!0,pageSettings:!0,zoom:!0,showWatermark:!0,maxDocumentSize:5242880,maxDocsPerMonth:10,grayLabel:!1,prioritySupport:!1},t={starter:e,professional:{loadDocument:!0,saveDocument:!0,editText:!0,formatting:!0,lists:!0,pageSettings:!0,zoom:!0,showWatermark:!1,maxDocumentSize:0,maxDocsPerMonth:10,grayLabel:!1,prioritySupport:!0},enterprise:{loadDocument:!0,saveDocument:!0,editText:!0,formatting:!0,lists:!0,pageSettings:!0,zoom:!0,showWatermark:!1,maxDocumentSize:0,maxDocsPerMonth:0,grayLabel:!0,prioritySupport:!0}},i=function(){try{if("undefined"!=typeof process&&process.env){const e=process.env.VITE_DOCVYU_LICENSE_SERVER||process.env.NEXT_PUBLIC_DOCVYU_LICENSE_SERVER;if(e&&"undefined"!==e)return e}}catch{}try{if(void 0!==import.meta&&import.meta.env){const e=import.meta.env.VITE_DOCVYU_LICENSE_SERVER;if(e&&"undefined"!==e)return e}}catch{}return"https://docvyu-license.luis-tapia-a.workers.dev/v1/license"}(),a="docvyu_license_cache";class o{constructor(e={}){this.status=null,this.fingerprint=null,this.serverUsageCount=0,this.config={apiKey:e.apiKey,licenseServerUrl:e.licenseServerUrl||i,offlineMode:e.offlineMode??!1}}async initialize(){return this.fingerprint=await this.generateFingerprint(),this.config.apiKey?this.initializeWithApiKey():this.initializeStarterTier()}async initializeWithApiKey(){const e=this.getCachedLicense();if(e&&e.apiKey===this.config.apiKey){const t=Date.now();if(e.expiresAt>t)return this.status=e.status,this.status}try{return this.status=await this.validateWithServer(),this.cacheLicense(this.status),this.status}catch(t){return this.config.offlineMode&&e?(this.status=e.status,this.status):this.initializeStarterTier()}}async initializeStarterTier(){try{const t=await this.getServerUsage();this.serverUsageCount=t.used;const i=Math.max(0,t.limit-t.used);return this.status={isValid:i>0,tier:"starter",remainingUses:i,unlimited:!1,features:e,expiresAt:null,error:i<=0?"Monthly document limit exceeded. Please upgrade to continue.":void 0},this.status}catch(t){return this.status={isValid:!1,tier:"starter",remainingUses:0,unlimited:!1,features:e,expiresAt:null,error:"Could not verify usage. Please check your internet connection."},this.status}}getStatus(){return this.status?this.status:{isValid:!1,tier:"starter",remainingUses:0,unlimited:!1,features:e,expiresAt:null,error:"License not initialized"}}hasFeature(e){return!!this.getStatus().features[e]}async recordUsage(){if(this.status?.unlimited)return 1/0;try{const e=await this.recordServerUsage();return this.serverUsageCount=e.used,this.status&&(this.status.remainingUses=e.remaining,e.remaining<=0&&(this.status.isValid=!1,this.status.error="Monthly document limit exceeded. Please upgrade to continue.")),e.remaining}catch(e){return this.status&&(this.status.remainingUses=0,this.status.isValid=!1,this.status.error="Could not verify usage. Please check your internet connection."),0}}getRemainingUses(){return this.status?.unlimited?1/0:this.status?.remainingUses??0}isUsageLimitExceeded(){return!this.status?.unlimited&&this.getRemainingUses()<=0}async getServerUsage(){const e=await fetch(`${this.config.licenseServerUrl}/usage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fingerprint:this.fingerprint,action:"get"})});if(!e.ok)throw new Error(`Failed to get usage: ${e.status}`);return e.json()}async recordServerUsage(){const e=await fetch(`${this.config.licenseServerUrl}/usage`,{method:"POST",headers:{"Content-Type":"application/json",...this.config.apiKey?{Authorization:`Bearer ${this.config.apiKey}`}:{}},body:JSON.stringify({fingerprint:this.fingerprint,action:"record",apiKey:this.config.apiKey})});if(!e.ok)throw new Error(`Failed to record usage: ${e.status}`);return e.json()}async validateWithServer(){const i=await fetch(`${this.config.licenseServerUrl}/validate`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({apiKey:this.config.apiKey,fingerprint:this.fingerprint,timestamp:Date.now()})});if(!i.ok){if(401===i.status||403===i.status)return{isValid:!1,tier:"starter",remainingUses:0,unlimited:!1,features:e,expiresAt:null,error:"Invalid API key"};throw new Error(`License validation failed: ${i.status}`)}const a=await i.json();return{isValid:a.valid,tier:a.tier||"starter",remainingUses:a.remainingUses??1/0,unlimited:a.unlimited??!1,features:t[a.tier]||e,expiresAt:a.expiresAt?new Date(a.expiresAt):null}}getCachedLicense(){if("undefined"==typeof localStorage)return null;try{const e=localStorage.getItem(a);return e?JSON.parse(e):null}catch{return null}}cacheLicense(e){if("undefined"==typeof localStorage)return;if(!this.config.apiKey)return;const t={status:e,apiKey:this.config.apiKey,cachedAt:Date.now(),expiresAt:Date.now()+864e5};try{localStorage.setItem(a,JSON.stringify(t))}catch{}}async generateFingerprint(){const e=[];"undefined"!=typeof navigator&&(e.push(navigator.userAgent),e.push(navigator.language),e.push(String(navigator.hardwareConcurrency||"")),e.push(navigator.platform||"")),"undefined"!=typeof screen&&(e.push(`${screen.width}x${screen.height}`),e.push(String(screen.colorDepth)));try{e.push(Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}try{const t=document.createElement("canvas"),i=t.getContext("2d");i&&(i.textBaseline="top",i.font="14px Arial",i.fillText("DocVyu",0,0),e.push(t.toDataURL()))}catch{}const t=e.join("|");return this.hashString(t)}async hashString(e){if("undefined"!=typeof crypto&&crypto.subtle){const t=(new TextEncoder).encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")}let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t&=t;return Math.abs(t).toString(16)}}const r={en:{general:{loading:"Loading...",error:"Error",success:"Success",cancel:"Cancel",confirm:"Confirm",save:"Save",close:"Close",retry:"Retry",poweredBy:"Powered by"},editor:{title:"DocVyu Editor",untitledDocument:"Untitled Document",loadingEditor:"Loading editor...",initializingEditor:"Initializing editor...",documentLoaded:"Document loaded successfully",documentSaved:"Document saved successfully",noDocumentLoaded:"No document loaded"},toolbar:{file:"File",edit:"Edit",view:"View",format:"Format",help:"Help",newDocument:"New Document",openDocument:"Open Document",saveDocument:"Save Document",downloadDocument:"Download Document",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select All",home:"Home",insert:"Insert",layout:"Layout",clipboard:"Clipboard",font:"Font",paragraph:"Paragraph",editing:"Editing",find:"Find",replace:"Replace",size:"Size",numberingFormat:"Numbering Format"},formatting:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontSize:"Font Size",fontFamily:"Font Family",fontColor:"Font Color",backgroundColor:"Background Color",alignment:"Alignment",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Justify",bulletList:"Bullet List",numberedList:"Numbered List",increaseIndent:"Increase Indent",decreaseIndent:"Decrease Indent",lineSpacing:"Line Spacing",paragraphSpacing:"Paragraph Spacing"},pageSettings:{title:"Page Settings",pageSize:"Page Size",margins:"Margins",marginTop:"Top",marginBottom:"Bottom",marginLeft:"Left",marginRight:"Right",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",customSize:"Custom Size",letter:"Letter",legal:"Legal",a4:"A4",a5:"A5",b5:"B5"},zoom:{zoomIn:"Zoom In",zoomOut:"Zoom Out",zoomLevel:"Zoom Level",fitToPage:"Fit to Page",fitToWidth:"Fit to Width"},ruler:{centimeters:"Centimeters",inches:"Inches",toggleUnit:"Toggle Unit"},license:{freeTier:"Free",starterTier:"Starter",professionalTier:"Professional",enterpriseTier:"Enterprise",documentsRemaining:"{count} documents remaining this month",unlimitedDocuments:"Unlimited documents",upgradeNow:"Upgrade Now",licenseValid:"License is valid",licenseExpired:"License has expired",licenseInvalid:"Invalid license",invalidLicense:"Invalid or expired license. Please check your API key.",notValidated:"License not validated. Please ensure you are connected to the internet.",usageLimitExceeded:"Usage Limit Exceeded",usageLimitExceededMessage:"You have reached your monthly document limit. Please upgrade your plan to continue.",checkingLicense:"Checking license..."},watermark:{poweredBy:"Powered by DocVyu"},errors:{editorNotInitialized:"Editor not initialized. Please call initialize() first.",documentLoadFailed:"Failed to load document",documentSaveFailed:"Failed to save document",featureNotAvailable:"This feature is not available in your current plan. Please upgrade to access it.",documentTooLarge:"Document size exceeds the limit for your plan",networkError:"Network error. Please check your connection.",invalidApiKey:"Invalid API key",licenseFetchFailed:"Failed to fetch license information",wasmLoadFailed:"Failed to load WebAssembly module",canvasNotFound:"Canvas element not found"},accessibility:{editorLabel:"Document Editor",toolbarLabel:"Editor Toolbar",formattingToolbar:"Formatting Toolbar",pageNavigation:"Page Navigation",currentPage:"Page {current}",totalPages:"of {total}"},statusBar:{ready:"Ready",pageOf:"Page {current} of {total}",words:"{count} words",selectLanguage:"Select language"}},es:{general:{loading:"Cargando...",error:"Error",success:"Éxito",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",close:"Cerrar",retry:"Reintentar",poweredBy:"Desarrollado por"},editor:{title:"Editor DocVyu",untitledDocument:"Documento sin título",loadingEditor:"Cargando editor...",initializingEditor:"Inicializando editor...",documentLoaded:"Documento cargado exitosamente",documentSaved:"Documento guardado exitosamente",noDocumentLoaded:"No hay documento cargado"},toolbar:{file:"Archivo",edit:"Editar",view:"Ver",format:"Formato",help:"Ayuda",newDocument:"Nuevo Documento",openDocument:"Abrir Documento",saveDocument:"Guardar Documento",downloadDocument:"Descargar Documento",undo:"Deshacer",redo:"Rehacer",cut:"Cortar",copy:"Copiar",paste:"Pegar",selectAll:"Seleccionar Todo",home:"Inicio",insert:"Insertar",layout:"Diseño",clipboard:"Portapapeles",font:"Fuente",paragraph:"Párrafo",editing:"Edición",find:"Buscar",replace:"Reemplazar",size:"Tamaño",numberingFormat:"Formato de Numeración"},formatting:{bold:"Negrita",italic:"Cursiva",underline:"Subrayado",strikethrough:"Tachado",fontSize:"Tamaño de Fuente",fontFamily:"Familia de Fuente",fontColor:"Color de Fuente",backgroundColor:"Color de Fondo",alignment:"Alineación",alignLeft:"Alinear a la Izquierda",alignCenter:"Centrar",alignRight:"Alinear a la Derecha",alignJustify:"Justificar",bulletList:"Lista con Viñetas",numberedList:"Lista Numerada",increaseIndent:"Aumentar Sangría",decreaseIndent:"Disminuir Sangría",lineSpacing:"Interlineado",paragraphSpacing:"Espaciado de Párrafo"},pageSettings:{title:"Configuración de Página",pageSize:"Tamaño de Página",margins:"Márgenes",marginTop:"Superior",marginBottom:"Inferior",marginLeft:"Izquierdo",marginRight:"Derecho",orientation:"Orientación",portrait:"Vertical",landscape:"Horizontal",customSize:"Tamaño Personalizado",letter:"Carta",legal:"Legal",a4:"A4",a5:"A5",b5:"B5"},zoom:{zoomIn:"Acercar",zoomOut:"Alejar",zoomLevel:"Nivel de Zoom",fitToPage:"Ajustar a Página",fitToWidth:"Ajustar al Ancho"},ruler:{centimeters:"Centímetros",inches:"Pulgadas",toggleUnit:"Cambiar Unidad"},license:{freeTier:"Gratuito",starterTier:"Inicial",professionalTier:"Profesional",enterpriseTier:"Empresarial",documentsRemaining:"{count} documentos restantes este mes",unlimitedDocuments:"Documentos ilimitados",upgradeNow:"Actualizar Ahora",licenseValid:"La licencia es válida",licenseExpired:"La licencia ha expirado",licenseInvalid:"Licencia inválida",invalidLicense:"Licencia inválida o expirada. Por favor verifica tu clave API.",notValidated:"Licencia no validada. Por favor asegúrate de estar conectado a internet.",usageLimitExceeded:"Límite de Uso Excedido",usageLimitExceededMessage:"Has alcanzado tu límite mensual de documentos. Por favor actualiza tu plan para continuar.",checkingLicense:"Verificando licencia..."},watermark:{poweredBy:"Desarrollado con DocVyu"},errors:{editorNotInitialized:"Editor no inicializado. Por favor llama a initialize() primero.",documentLoadFailed:"Error al cargar el documento",documentSaveFailed:"Error al guardar el documento",featureNotAvailable:"Esta función no está disponible en tu plan actual. Por favor actualiza para acceder.",documentTooLarge:"El tamaño del documento excede el límite de tu plan",networkError:"Error de red. Por favor verifica tu conexión.",invalidApiKey:"Clave API inválida",licenseFetchFailed:"Error al obtener información de la licencia",wasmLoadFailed:"Error al cargar el módulo WebAssembly",canvasNotFound:"Elemento canvas no encontrado"},accessibility:{editorLabel:"Editor de Documentos",toolbarLabel:"Barra de Herramientas del Editor",formattingToolbar:"Barra de Formato",pageNavigation:"Navegación de Páginas",currentPage:"Página {current}",totalPages:"de {total}"},statusBar:{ready:"Listo",pageOf:"Página {current} de {total}",words:"{count} palabras",selectLanguage:"Seleccionar idioma"}},pt:{general:{loading:"Carregando...",error:"Erro",success:"Sucesso",cancel:"Cancelar",confirm:"Confirmar",save:"Salvar",close:"Fechar",retry:"Tentar novamente",poweredBy:"Desenvolvido por"},editor:{title:"Editor DocVyu",untitledDocument:"Documento sem título",loadingEditor:"Carregando editor...",initializingEditor:"Inicializando editor...",documentLoaded:"Documento carregado com sucesso",documentSaved:"Documento salvo com sucesso",noDocumentLoaded:"Nenhum documento carregado"},toolbar:{file:"Arquivo",edit:"Editar",view:"Visualizar",format:"Formatar",help:"Ajuda",newDocument:"Novo Documento",openDocument:"Abrir Documento",saveDocument:"Salvar Documento",downloadDocument:"Baixar Documento",undo:"Desfazer",redo:"Refazer",cut:"Recortar",copy:"Copiar",paste:"Colar",selectAll:"Selecionar Tudo",home:"Início",insert:"Inserir",layout:"Layout",clipboard:"Área de Transferência",font:"Fonte",paragraph:"Parágrafo",editing:"Edição",find:"Localizar",replace:"Substituir",size:"Tamanho",numberingFormat:"Formato de Numeração"},formatting:{bold:"Negrito",italic:"Itálico",underline:"Sublinhado",strikethrough:"Riscado",fontSize:"Tamanho da Fonte",fontFamily:"Família da Fonte",fontColor:"Cor da Fonte",backgroundColor:"Cor de Fundo",alignment:"Alinhamento",alignLeft:"Alinhar à Esquerda",alignCenter:"Centralizar",alignRight:"Alinhar à Direita",alignJustify:"Justificar",bulletList:"Lista com Marcadores",numberedList:"Lista Numerada",increaseIndent:"Aumentar Recuo",decreaseIndent:"Diminuir Recuo",lineSpacing:"Espaçamento entre Linhas",paragraphSpacing:"Espaçamento de Parágrafo"},pageSettings:{title:"Configurações de Página",pageSize:"Tamanho da Página",margins:"Margens",marginTop:"Superior",marginBottom:"Inferior",marginLeft:"Esquerda",marginRight:"Direita",orientation:"Orientação",portrait:"Retrato",landscape:"Paisagem",customSize:"Tamanho Personalizado",letter:"Carta",legal:"Ofício",a4:"A4",a5:"A5",b5:"B5"},zoom:{zoomIn:"Aumentar Zoom",zoomOut:"Diminuir Zoom",zoomLevel:"Nível de Zoom",fitToPage:"Ajustar à Página",fitToWidth:"Ajustar à Largura"},ruler:{centimeters:"Centímetros",inches:"Polegadas",toggleUnit:"Alternar Unidade"},license:{freeTier:"Gratuito",starterTier:"Inicial",professionalTier:"Profissional",enterpriseTier:"Empresarial",documentsRemaining:"{count} documentos restantes este mês",unlimitedDocuments:"Documentos ilimitados",upgradeNow:"Atualizar Agora",licenseValid:"Licença válida",licenseExpired:"Licença expirada",licenseInvalid:"Licença inválida",invalidLicense:"Licença inválida ou expirada. Por favor, verifique sua chave API.",notValidated:"Licença não validada. Por favor, verifique sua conexão com a internet.",usageLimitExceeded:"Limite de Uso Excedido",usageLimitExceededMessage:"Você atingiu seu limite mensal de documentos. Por favor, atualize seu plano para continuar.",checkingLicense:"Verificando licença..."},watermark:{poweredBy:"Desenvolvido com DocVyu"},errors:{editorNotInitialized:"Editor não inicializado. Por favor, chame initialize() primeiro.",documentLoadFailed:"Falha ao carregar o documento",documentSaveFailed:"Falha ao salvar o documento",featureNotAvailable:"Este recurso não está disponível no seu plano atual. Por favor, atualize para acessar.",documentTooLarge:"O tamanho do documento excede o limite do seu plano",networkError:"Erro de rede. Por favor, verifique sua conexão.",invalidApiKey:"Chave API inválida",licenseFetchFailed:"Falha ao obter informações da licença",wasmLoadFailed:"Falha ao carregar o módulo WebAssembly",canvasNotFound:"Elemento canvas não encontrado"},accessibility:{editorLabel:"Editor de Documentos",toolbarLabel:"Barra de Ferramentas do Editor",formattingToolbar:"Barra de Formatação",pageNavigation:"Navegação de Páginas",currentPage:"Página {current}",totalPages:"de {total}"},statusBar:{ready:"Pronto",pageOf:"Página {current} de {total}",words:"{count} palavras",selectLanguage:"Selecionar idioma"}}},n={locale:"en",fallbackLocale:"en",customTranslations:{}};class s{constructor(e={}){this.listeners=new Set,this.config={...n,...e},this.currentTranslations=this.buildTranslations()}static getInstance(e){return s.instance?e&&s.instance.configure(e):s.instance=new s(e),s.instance}static reset(){s.instance=null}configure(e){this.config={...this.config,...e},this.currentTranslations=this.buildTranslations(),this.notifyListeners()}getLocale(){return this.config.locale}setLocale(e){this.config.locale!==e&&(this.config.locale=e,this.currentTranslations=this.buildTranslations(),this.notifyListeners())}getAvailableLocales(){return Object.keys(r)}getTranslations(){return this.currentTranslations}t(e,t){const i=this.getNestedValue(this.currentTranslations,e);if(void 0===i){const i=this.getNestedValue(r[this.config.fallbackLocale],e);return void 0===i?e:this.interpolate(i,t)}return this.interpolate(i,t)}onLocaleChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}detectAndSetLocale(){const e=this.detectBrowserLocale();return e?(this.setLocale(e),e):this.config.locale}detectBrowserLocale(){if("undefined"==typeof navigator)return null;const e=navigator.languages||[navigator.language];for(const t of e){const e=t.split("-")[0].toLowerCase();if(this.getAvailableLocales().includes(e))return e}return null}buildTranslations(){const e=r[this.config.locale]||r[this.config.fallbackLocale],t=this.config.customTranslations?.[this.config.locale];return t?this.deepMerge(e,t):e}getNestedValue(e,t){const i=t.split(".");let a=e;for(const e of i){if(null==a)return;a=a[e]}return"string"==typeof a?a:void 0}interpolate(e,t){return t?e.replace(/\{(\w+)\}/g,(e,i)=>{const a=t[i];return void 0!==a?String(a):`{${i}}`}):e}deepMerge(e,t){const i={...e};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const o=t[a],r=e[a];null===o||"object"!=typeof o||Array.isArray(o)||null===r||"object"!=typeof r||Array.isArray(r)?void 0!==o&&(i[a]=o):i[a]=this.deepMerge(r,o)}return i}notifyListeners(){for(const e of this.listeners)e(this.config.locale)}}function l(e){return s.getInstance(e)}function c(e,t){return s.getInstance().t(e,t)}function d(e){s.getInstance().setLocale(e)}function u(){return s.getInstance().getAvailableLocales()}function h(e){return s.getInstance().onLocaleChange(e)}s.instance=null;class m{constructor(e){this.wasmEditor=null,this.isInitialized=!1,this.licenseValidated=!1,this.cursorBlinkInterval=null,this.cursorVisible=!0,this.localeUnsubscribe=null,this.config=e,this.licenseManager=new o({apiKey:e.apiKey,licenseServerUrl:e.licenseServerUrl,offlineMode:e.offlineMode});const t=l({locale:e.locale||"en",customTranslations:e.customTranslations});if(e.autoDetectLocale&&t.detectAndSetLocale(),e.onLocaleChange&&(this.localeUnsubscribe=t.onLocaleChange(e.onLocaleChange)),"string"==typeof e.canvas){const t=document.getElementById(e.canvas);if(!(t&&t instanceof HTMLCanvasElement))throw new Error(c("errors.canvasNotFound"));this.canvas=t,this.canvasId=e.canvas}else this.canvas=e.canvas,this.canvas.id||(this.canvas.id=`docvyu-canvas-${Date.now()}`),this.canvasId=this.canvas.id}async initialize(e,t){const i=await this.licenseManager.initialize();this.licenseValidated=!0;const a={valid:i.isValid,tier:i.tier,remaining:i.remainingUses,watermark:i.features.showWatermark,error:i.error};if(this.config.onLicenseChange&&this.config.onLicenseChange(a),this.licenseManager.isUsageLimitExceeded())throw this.config.onUsageLimitExceeded&&this.config.onUsageLimitExceeded(),new Error(c("license.usageLimitExceededMessage"));if(!i.isValid)throw new Error(i.error||c("license.invalidLicense"));return await e(),this.wasmEditor=new t(this.canvasId),this.isInitialized=!0,this.config.zoom&&this.wasmEditor.set_zoom(this.config.zoom),"inches"===this.config.rulerUnit&&this.wasmEditor.set_ruler_unit(1),this.startCursorBlink(),a}async loadDocument(e){this.ensureInitialized(),this.ensureFeature("loadDocument");const t=e instanceof ArrayBuffer?new Uint8Array(e):e;if(this.licenseManager.isUsageLimitExceeded())throw this.config.onUsageLimitExceeded&&this.config.onUsageLimitExceeded(),new Error(c("license.usageLimitExceededMessage"));const i=this.licenseManager.getStatus().features.maxDocumentSize;if(i>0&&t.length>i)throw new Error(c("errors.documentTooLarge"));await this.licenseManager.recordUsage(),this.config.onLicenseChange&&this.config.onLicenseChange(this.getLicenseInfo()),this.wasmEditor.load_docx_and_render(t),this.config.onLoad&&this.config.onLoad()}saveDocument(){this.ensureInitialized(),this.ensureFeature("saveDocument");const e=this.wasmEditor.save_document();return this.config.onSave&&this.config.onSave(e),e}downloadDocument(e="document.docx"){const t=this.saveDocument(),i=new Blob([new Uint8Array(t)],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)}setBold(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_bold(e),this.notifySelectionChange()}setItalic(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_italic(e),this.notifySelectionChange()}setUnderline(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_underline(e),this.notifySelectionChange()}setFontSize(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_font_size(e),this.notifySelectionChange()}resetFontSize(){this.ensureInitialized(),this.wasmEditor.reset_font_size(),this.notifySelectionChange()}setFontFamily(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_font_family(e),this.notifySelectionChange()}resetFontFamily(){this.ensureInitialized(),this.wasmEditor.reset_font_family(),this.notifySelectionChange()}setFontColor(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_font_color(e),this.notifySelectionChange()}resetFontColor(){this.ensureInitialized(),this.wasmEditor.reset_font_color(),this.notifySelectionChange()}setAlignment(e){this.ensureInitialized(),this.ensureFeature("formatting"),this.wasmEditor.set_paragraph_alignment(e),this.notifySelectionChange()}setBulletList(e){this.ensureInitialized(),this.ensureFeature("lists"),this.wasmEditor.set_bullet_list(e),this.notifySelectionChange()}setNumberedList(e){this.ensureInitialized(),this.ensureFeature("lists"),this.wasmEditor.set_numbered_list(e),this.notifySelectionChange()}setNumberedListFormat(e){this.ensureInitialized(),this.ensureFeature("lists"),this.wasmEditor.set_numbered_list_format(e),this.notifySelectionChange()}removeNumbering(){this.ensureInitialized(),this.wasmEditor.remove_numbering(),this.notifySelectionChange()}setMargins(e){this.ensureInitialized(),this.ensureFeature("pageSettings"),this.wasmEditor.set_page_margins(e.left,e.right,e.top,e.bottom)}setPageSize(e){this.ensureInitialized(),this.ensureFeature("pageSettings"),"custom"!==e&&this.wasmEditor.set_page_size(e)}getPageSize(){return this.ensureInitialized(),this.wasmEditor.get_page_size()}setZoom(e){this.ensureInitialized(),this.ensureFeature("zoom"),this.wasmEditor.set_zoom(e)}getZoom(){return this.ensureInitialized(),this.wasmEditor.get_zoom()}zoomIn(){this.ensureInitialized(),this.ensureFeature("zoom"),this.wasmEditor.zoom_in()}zoomOut(){this.ensureInitialized(),this.ensureFeature("zoom"),this.wasmEditor.zoom_out()}setRulerUnit(e){this.ensureInitialized(),this.wasmEditor.set_ruler_unit("inches"===e?1:0)}getRulerUnit(){return this.ensureInitialized(),1===this.wasmEditor.get_ruler_unit()?"inches":"centimeters"}toggleRulerUnit(){this.ensureInitialized(),this.wasmEditor.toggle_ruler_unit()}selectWord(){this.ensureInitialized(),this.wasmEditor.select_word(),this.notifySelectionChange()}selectParagraph(){this.ensureInitialized(),this.wasmEditor.select_paragraph(),this.notifySelectionChange()}selectAll(){this.ensureInitialized(),this.wasmEditor.select_document(),this.notifySelectionChange()}getSelectionState(){this.ensureInitialized();const e=this.wasmEditor.selection_style_state();return{bold:e.bold_all(),italic:e.italic_all(),underline:e.underline_all(),fontSize:e.font_size(),fontFamily:e.font_family(),fontColor:e.font_color(),alignment:e.paragraph_alignment(),hasBulletList:this.wasmEditor.has_bullet_list(),hasNumberedList:this.wasmEditor.has_numbered_list(),numberingFormatId:this.wasmEditor.get_numbering_format_id()}}handleMouseClick(e,t){this.ensureInitialized(),this.wasmEditor.on_mouse_click(e,t),this.resetCursorBlink(),this.notifySelectionChange()}handleMouseDrag(e,t){this.ensureInitialized(),this.wasmEditor.on_mouse_drag(e,t),this.notifySelectionChange()}handleKeyDown(e){this.ensureInitialized(),this.ensureFeature("editText"),this.wasmEditor.on_key_down(e),this.resetCursorBlink(),this.notifySelectionChange()}getLicenseInfo(){const e=this.licenseManager.getStatus();return{valid:e.isValid,tier:e.tier,remaining:e.remainingUses,watermark:e.features.showWatermark,error:e.error}}shouldShowWatermark(){return this.licenseManager.getStatus().features.showWatermark}getWatermarkText(){return c("watermark.poweredBy")}setLocale(e){d(e)}getLocale(){return s.getInstance().getLocale()}translate(e,t){return c(e,t)}destroy(){this.stopCursorBlink(),this.localeUnsubscribe&&(this.localeUnsubscribe(),this.localeUnsubscribe=null),this.wasmEditor&&(this.wasmEditor.free(),this.wasmEditor=null),this.isInitialized=!1}ensureInitialized(){if(!this.licenseValidated)throw new Error(c("license.notValidated"));if(!this.isInitialized||!this.wasmEditor)throw new Error(c("errors.editorNotInitialized"))}ensureLicenseValid(){if(!this.licenseValidated)throw new Error(c("license.notValidated"));const e=this.licenseManager.getStatus();if(!e.isValid)throw new Error(e.error||c("license.invalidLicense"))}ensureFeature(e){if(!this.licenseManager.hasFeature(e))throw new Error(c("errors.featureNotAvailable"))}notifySelectionChange(){this.config.onSelectionChange&&this.isInitialized&&this.config.onSelectionChange(this.getSelectionState())}startCursorBlink(){this.stopCursorBlink(),this.cursorVisible=!0,this.cursorBlinkInterval=window.setInterval(()=>{this.cursorVisible=!this.cursorVisible,this.wasmEditor&&this.wasmEditor.set_cursor_visible(this.cursorVisible)},530)}stopCursorBlink(){null!==this.cursorBlinkInterval&&(clearInterval(this.cursorBlinkInterval),this.cursorBlinkInterval=null)}resetCursorBlink(){this.cursorVisible=!0,this.wasmEditor&&this.wasmEditor.set_cursor_visible(!0),this.startCursorBlink()}}function g(e){return new m(e)}export{m as D,o as L,g as c,u as g,l as i,h as o,d as s,c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DocVyu SDK - Complete Editor Styles
|
|
3
|
-
*
|
|
4
|
-
* This module provides all CSS styles for the editor UI
|
|
5
|
-
*/
|
|
6
|
-
export declare const editorStyles = "\n/* DocVyu SDK - Complete Editor Styles */\n\n:root {\n --docvyu-ribbon-bg: #f3f3f3;\n --docvyu-ribbon-border: #d1d1d1;\n --docvyu-ribbon-tab-active: #ffffff;\n --docvyu-ribbon-tab-hover: #e5e5e5;\n --docvyu-button-hover: #c7e0f4;\n --docvyu-button-active: #a3d3ff;\n --docvyu-accent-color: #0078d4;\n --docvyu-text-primary: #1a1a1a;\n --docvyu-text-secondary: #616161;\n --docvyu-canvas-bg: #e0e0e0;\n --docvyu-page-shadow: rgba(0, 0, 0, 0.15);\n --docvyu-divider-color: #c8c8c8;\n --docvyu-status-bar-bg: #f0f0f0;\n}\n\n.docvyu-container {\n font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 12px;\n color: var(--docvyu-text-primary);\n background: var(--docvyu-canvas-bg);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.docvyu-container * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n/* ===== Title Bar ===== */\n.docvyu-title-bar {\n background: var(--docvyu-accent-color);\n color: white;\n height: 32px;\n display: flex;\n align-items: center;\n padding: 0 12px;\n gap: 12px;\n flex-shrink: 0;\n}\n\n.docvyu-logo {\n font-weight: 600;\n font-size: 13px;\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.docvyu-logo-img {\n width: 20px;\n height: 20px;\n object-fit: contain;\n}\n\n.docvyu-logo svg {\n width: 18px;\n height: 18px;\n}\n\n.docvyu-title-bar-actions {\n display: flex;\n gap: 4px;\n}\n\n.docvyu-title-btn {\n background: transparent;\n border: none;\n color: white;\n width: 28px;\n height: 24px;\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 0.15s;\n}\n\n.docvyu-title-btn:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.docvyu-title-btn:active {\n background: rgba(255, 255, 255, 0.3);\n}\n\n.docvyu-title-btn svg {\n width: 16px;\n height: 16px;\n}\n\n.docvyu-document-name {\n flex: 1;\n text-align: center;\n font-size: 12px;\n opacity: 0.95;\n}\n\n/* ===== Menu Bar ===== */\n.docvyu-menu-bar {\n background: var(--docvyu-ribbon-bg);\n border-bottom: 1px solid var(--docvyu-ribbon-border);\n height: 28px;\n display: flex;\n align-items: center;\n padding: 0 8px;\n gap: 4px;\n flex-shrink: 0;\n}\n\n.docvyu-menu-item {\n padding: 4px 10px;\n border-radius: 3px;\n cursor: pointer;\n font-size: 12px;\n color: var(--docvyu-text-primary);\n transition: background 0.1s;\n}\n\n.docvyu-menu-item:hover {\n background: var(--docvyu-ribbon-tab-hover);\n}\n\n/* ===== Ribbon ===== */\n.docvyu-ribbon {\n background: var(--docvyu-ribbon-bg);\n border-bottom: 1px solid var(--docvyu-ribbon-border);\n flex-shrink: 0;\n}\n\n.docvyu-ribbon-tabs {\n display: flex;\n border-bottom: 1px solid var(--docvyu-ribbon-border);\n padding: 0 8px;\n}\n\n.docvyu-ribbon-tab {\n padding: 6px 16px;\n font-size: 12px;\n cursor: pointer;\n border: none;\n background: none;\n color: var(--docvyu-text-primary);\n border-bottom: 2px solid transparent;\n transition: all 0.15s;\n}\n\n.docvyu-ribbon-tab:hover {\n background: var(--docvyu-ribbon-tab-hover);\n}\n\n.docvyu-ribbon-tab.active {\n background: var(--docvyu-ribbon-tab-active);\n border-bottom-color: var(--docvyu-accent-color);\n}\n\n.docvyu-ribbon-content {\n display: flex;\n padding: 8px 12px;\n gap: 16px;\n background: white;\n min-height: 90px;\n}\n\n/* ===== Ribbon Groups ===== */\n.docvyu-ribbon-group {\n display: flex;\n flex-direction: column;\n border-right: 1px solid var(--docvyu-divider-color);\n padding-right: 16px;\n}\n\n.docvyu-ribbon-group:last-child {\n border-right: none;\n}\n\n.docvyu-ribbon-group-content {\n display: flex;\n gap: 4px;\n flex: 1;\n align-items: flex-start;\n}\n\n.docvyu-ribbon-group-label {\n font-size: 10px;\n color: var(--docvyu-text-secondary);\n text-align: center;\n padding-top: 4px;\n text-transform: capitalize;\n}\n\n/* ===== Ribbon Buttons ===== */\n.docvyu-ribbon-btn {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n min-width: 44px;\n height: 66px;\n border: 1px solid transparent;\n background: none;\n border-radius: 3px;\n cursor: pointer;\n gap: 4px;\n transition: all 0.1s;\n}\n\n.docvyu-ribbon-btn:hover {\n background: var(--docvyu-button-hover);\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-ribbon-btn.active {\n background: var(--docvyu-button-active);\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-ribbon-btn svg {\n width: 32px;\n height: 32px;\n color: var(--docvyu-text-primary);\n}\n\n.docvyu-ribbon-btn span {\n font-size: 10px;\n color: var(--docvyu-text-primary);\n}\n\n/* Small buttons in a row */\n.docvyu-ribbon-btn-small {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 1px solid transparent;\n background: none;\n border-radius: 3px;\n cursor: pointer;\n transition: all 0.1s;\n}\n\n.docvyu-ribbon-btn-small:hover {\n background: var(--docvyu-button-hover);\n border-color: #b3d7f3;\n}\n\n.docvyu-ribbon-btn-small.active {\n background: var(--docvyu-button-active);\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-ribbon-btn-small svg {\n width: 16px;\n height: 16px;\n color: var(--docvyu-text-primary);\n}\n\n/* Button rows */\n.docvyu-ribbon-btn-row {\n display: flex;\n gap: 2px;\n}\n\n.docvyu-ribbon-btn-column {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n/* ===== Dropdowns/Selects ===== */\n.docvyu-ribbon-select {\n height: 26px;\n padding: 0 8px;\n border: 1px solid var(--docvyu-divider-color);\n border-radius: 3px;\n font-size: 12px;\n background: white;\n cursor: pointer;\n min-width: 100px;\n}\n\n.docvyu-ribbon-select:hover {\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-ribbon-select:focus {\n outline: none;\n border-color: var(--docvyu-accent-color);\n box-shadow: 0 0 0 1px var(--docvyu-accent-color);\n}\n\n.docvyu-font-size-select {\n min-width: 55px;\n}\n\n/* Color picker */\n.docvyu-color-picker-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n}\n\n.docvyu-ribbon-color-btn {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 1px solid transparent;\n background: none;\n border-radius: 3px;\n cursor: pointer;\n padding: 2px;\n}\n\n.docvyu-ribbon-color-btn:hover {\n background: var(--docvyu-button-hover);\n border-color: #b3d7f3;\n}\n\n.docvyu-ribbon-color-btn svg {\n width: 14px;\n height: 14px;\n}\n\n.docvyu-color-indicator {\n width: 14px;\n height: 3px;\n background: currentColor;\n margin-top: 1px;\n}\n\n.docvyu-hidden-color-input {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n pointer-events: none;\n}\n\n/* ===== Document Area ===== */\n.docvyu-document-area {\n flex: 1;\n overflow: auto;\n background: var(--docvyu-canvas-bg);\n display: flex;\n justify-content: center;\n padding: 20px;\n}\n\n.docvyu-canvas-wrapper {\n box-shadow: 0 2px 8px var(--docvyu-page-shadow);\n}\n\n.docvyu-container canvas {\n display: block;\n background: white;\n cursor: text;\n}\n\n/* ===== Status Bar ===== */\n.docvyu-status-bar {\n background: var(--docvyu-status-bar-bg);\n border-top: 1px solid var(--docvyu-ribbon-border);\n height: 24px;\n display: flex;\n align-items: center;\n padding: 0 12px;\n font-size: 11px;\n color: var(--docvyu-text-secondary);\n flex-shrink: 0;\n gap: 20px;\n}\n\n.docvyu-status-item {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.docvyu-status-spacer {\n flex: 1;\n}\n\n/* ===== Branding ===== */\n.docvyu-branding {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 0 12px;\n color: var(--docvyu-text-secondary);\n font-size: 10px;\n border-left: 1px solid var(--docvyu-divider-color);\n margin-right: 8px;\n}\n\n.docvyu-branding-logo {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n}\n\n.docvyu-branding strong {\n color: var(--docvyu-accent-color);\n font-weight: 600;\n}\n\n.docvyu-zoom-controls {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.docvyu-zoom-btn {\n width: 20px;\n height: 20px;\n border: none;\n background: none;\n cursor: pointer;\n border-radius: 3px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.docvyu-zoom-btn:hover {\n background: var(--docvyu-ribbon-tab-hover);\n}\n\n.docvyu-zoom-btn svg {\n width: 14px;\n height: 14px;\n}\n\n/* ===== Ruler Unit Button ===== */\n.docvyu-ruler-unit-btn {\n padding: 2px 8px;\n border: 1px solid var(--docvyu-divider-color);\n background: var(--docvyu-ribbon-bg);\n cursor: pointer;\n border-radius: 3px;\n font-size: 11px;\n color: var(--docvyu-text-primary);\n margin-right: 12px;\n min-width: 36px;\n text-align: center;\n}\n\n.docvyu-ruler-unit-btn:hover {\n background: var(--docvyu-ribbon-tab-hover);\n border-color: var(--docvyu-accent-color);\n}\n\n/* ===== Language Selector ===== */\n.docvyu-language-selector {\n display: flex;\n align-items: center;\n margin-right: 8px;\n}\n\n.docvyu-language-selector select {\n padding: 2px 6px;\n border: 1px solid var(--docvyu-divider-color);\n background: var(--docvyu-ribbon-bg);\n cursor: pointer;\n border-radius: 3px;\n font-size: 11px;\n color: var(--docvyu-text-primary);\n min-width: 100px;\n appearance: none;\n -webkit-appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23616161' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right 4px center;\n padding-right: 20px;\n}\n\n.docvyu-language-selector select:hover {\n background-color: var(--docvyu-ribbon-tab-hover);\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-language-selector select:focus {\n outline: none;\n border-color: var(--docvyu-accent-color);\n box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);\n}\n\n/* ===== File Actions (hidden input) ===== */\n.docvyu-hidden-file-input {\n display: none;\n}\n\n/* ===== Margins Popover ===== */\n.docvyu-margins-popover {\n display: none;\n position: absolute;\n top: 100%;\n left: 0;\n background: white;\n border: 1px solid var(--docvyu-ribbon-border);\n border-radius: 4px;\n padding: 12px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n z-index: 1000;\n min-width: 200px;\n}\n\n.docvyu-margins-popover.open {\n display: block;\n}\n\n.docvyu-margins-popover h4 {\n font-size: 12px;\n font-weight: 600;\n margin-bottom: 10px;\n color: var(--docvyu-text-primary);\n}\n\n.docvyu-margin-input-group {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n margin-bottom: 12px;\n}\n\n.docvyu-margin-input-item {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.docvyu-margin-input-item label {\n font-size: 10px;\n color: var(--docvyu-text-secondary);\n}\n\n.docvyu-margin-input-item input {\n width: 100%;\n height: 26px;\n padding: 0 8px;\n border: 1px solid var(--docvyu-divider-color);\n border-radius: 3px;\n font-size: 12px;\n}\n\n.docvyu-margin-input-item input:focus {\n outline: none;\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-apply-btn {\n width: 100%;\n padding: 6px 12px;\n background: var(--docvyu-accent-color);\n color: white;\n border: none;\n border-radius: 3px;\n cursor: pointer;\n font-size: 12px;\n}\n\n.docvyu-apply-btn:hover {\n background: #106ebe;\n}\n\n/* ===== Page Size Popover ===== */\n.docvyu-page-size-popover {\n display: none;\n position: absolute;\n top: 100%;\n left: 0;\n background: white;\n border: 1px solid var(--docvyu-ribbon-border);\n border-radius: 4px;\n padding: 12px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n z-index: 1000;\n min-width: 180px;\n}\n\n.docvyu-page-size-popover.open {\n display: block;\n}\n\n.docvyu-page-size-popover h4 {\n font-size: 12px;\n font-weight: 600;\n margin-bottom: 10px;\n color: var(--docvyu-text-primary);\n}\n\n.docvyu-page-size-options {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.docvyu-page-size-option {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: 8px 10px;\n border: 1px solid transparent;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n transition: background 0.15s, border-color 0.15s;\n text-align: left;\n width: 100%;\n}\n\n.docvyu-page-size-option:hover {\n background: var(--docvyu-button-hover);\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-page-size-option.active {\n background: var(--docvyu-button-active);\n border-color: var(--docvyu-accent-color);\n}\n\n.docvyu-size-name {\n font-size: 12px;\n font-weight: 500;\n color: var(--docvyu-text-primary);\n}\n\n.docvyu-size-dims {\n font-size: 10px;\n color: var(--docvyu-text-secondary);\n margin-top: 2px;\n}\n\n/* ===== Numbering Dropdown ===== */\n.docvyu-dropdown-wrapper {\n position: relative;\n display: flex;\n align-items: stretch;\n}\n\n.docvyu-dropdown-arrow {\n width: 14px;\n height: 100%;\n padding: 0;\n border: none;\n background: transparent;\n color: var(--docvyu-text-secondary);\n cursor: pointer;\n font-size: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 0 3px 3px 0;\n margin-left: -1px;\n}\n\n.docvyu-dropdown-arrow:hover {\n background: var(--docvyu-button-hover);\n}\n\n.docvyu-numbering-popover {\n display: none;\n position: absolute;\n top: 100%;\n left: 0;\n background: white;\n border: 1px solid var(--docvyu-ribbon-border);\n border-radius: 4px;\n padding: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n z-index: 1000;\n min-width: 120px;\n}\n\n.docvyu-numbering-popover.open {\n display: block;\n}\n\n.docvyu-numbering-option {\n padding: 6px 10px;\n font-size: 12px;\n cursor: pointer;\n border-radius: 3px;\n color: var(--docvyu-text-primary);\n white-space: nowrap;\n}\n\n.docvyu-numbering-option:hover {\n background: var(--docvyu-button-hover);\n}\n\n.docvyu-numbering-option.active {\n background: var(--docvyu-button-active);\n}\n\n/* ===== Cursor Blink Animation ===== */\n@keyframes docvyu-cursor-blink {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n}\n\n.docvyu-cursor-blink {\n animation: docvyu-cursor-blink 1s step-end infinite;\n}\n\n/* ===== Responsive ===== */\n@media (max-width: 900px) {\n .docvyu-ribbon-group-label {\n display: none;\n }\n\n .docvyu-ribbon-btn {\n min-width: 36px;\n padding: 4px;\n }\n\n .docvyu-ribbon-btn span {\n display: none;\n }\n}\n\n/* ===== License Info ===== */\n.docvyu-license-info {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 11px;\n margin-right: 12px;\n}\n\n.docvyu-license-tier {\n padding: 2px 8px;\n border-radius: 4px;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 10px;\n}\n\n.docvyu-license-tier.starter {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n}\n\n.docvyu-license-tier.professional {\n background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);\n color: white;\n}\n\n.docvyu-license-tier.enterprise {\n background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);\n color: white;\n}\n\n.docvyu-remaining {\n color: var(--docvyu-text-secondary);\n}\n\n.docvyu-watermark-notice {\n color: #e67700;\n font-size: 10px;\n}\n";
|
|
7
|
-
/**
|
|
8
|
-
* Inject styles into the document
|
|
9
|
-
*/
|
|
10
|
-
export declare function injectStyles(): void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DocVyu SDK - Complete Editor HTML Template
|
|
3
|
-
*
|
|
4
|
-
* This module provides the complete HTML structure for the editor UI
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Generate the complete editor HTML template
|
|
8
|
-
*/
|
|
9
|
-
export declare function generateEditorTemplate(containerId: string): string;
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Unit for ruler display
|
|
5
|
-
*/
|
|
6
|
-
export enum RulerUnit {
|
|
7
|
-
Centimeters = 0,
|
|
8
|
-
Inches = 1,
|
|
9
|
-
}
|
|
10
|
-
export class Editor {
|
|
11
|
-
free(): void;
|
|
12
|
-
[Symbol.dispose](): void;
|
|
13
|
-
set_italic(enable: boolean): void;
|
|
14
|
-
on_key_down(key: string): void;
|
|
15
|
-
select_word(): void;
|
|
16
|
-
/**
|
|
17
|
-
* Get current page size name (or "custom" if not matching any preset)
|
|
18
|
-
*/
|
|
19
|
-
get_page_size(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Check if the current paragraph has any numbering
|
|
22
|
-
*/
|
|
23
|
-
has_numbering(): boolean;
|
|
24
|
-
on_mouse_drag(click_x: number, click_y: number): void;
|
|
25
|
-
save_document(): Uint8Array;
|
|
26
|
-
set_font_size(size: number): void;
|
|
27
|
-
/**
|
|
28
|
-
* Set page size using predefined sizes
|
|
29
|
-
* Sizes: "letter", "legal", "a4", "a5", "b5"
|
|
30
|
-
*/
|
|
31
|
-
set_page_size(size_name: string): void;
|
|
32
|
-
set_underline(enable: boolean): void;
|
|
33
|
-
/**
|
|
34
|
-
* Get current ruler unit
|
|
35
|
-
*/
|
|
36
|
-
get_ruler_unit(): RulerUnit;
|
|
37
|
-
on_mouse_click(click_x: number, click_y: number): void;
|
|
38
|
-
set_font_color(color: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Set ruler unit (centimeters or inches)
|
|
41
|
-
*/
|
|
42
|
-
set_ruler_unit(unit: RulerUnit): void;
|
|
43
|
-
/**
|
|
44
|
-
* Check if the current paragraph has bullet list numbering
|
|
45
|
-
*/
|
|
46
|
-
has_bullet_list(): boolean;
|
|
47
|
-
reset_font_size(): void;
|
|
48
|
-
select_document(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Set bullet list for the current selection or cursor position
|
|
51
|
-
* Uses num_id=101 by convention for bullet lists
|
|
52
|
-
*/
|
|
53
|
-
set_bullet_list(enable: boolean): void;
|
|
54
|
-
set_font_family(family: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Remove numbering from the current selection or cursor position
|
|
57
|
-
*/
|
|
58
|
-
remove_numbering(): void;
|
|
59
|
-
reset_font_color(): void;
|
|
60
|
-
select_paragraph(): void;
|
|
61
|
-
set_page_margins(left: number, right: number, top: number, bottom: number): void;
|
|
62
|
-
/**
|
|
63
|
-
* Check if the current paragraph has numbered list numbering (not bullet)
|
|
64
|
-
*/
|
|
65
|
-
has_numbered_list(): boolean;
|
|
66
|
-
reset_font_family(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Set numbered list for the current selection or cursor position
|
|
69
|
-
* Uses num_id=102 by convention for numbered lists (1.)
|
|
70
|
-
*/
|
|
71
|
-
set_numbered_list(enable: boolean): void;
|
|
72
|
-
/**
|
|
73
|
-
* Toggle ruler unit between centimeters and inches
|
|
74
|
-
*/
|
|
75
|
-
toggle_ruler_unit(): void;
|
|
76
|
-
set_cursor_visible(visible: boolean): void;
|
|
77
|
-
load_docx_and_render(data: Uint8Array): void;
|
|
78
|
-
selection_style_state(): SelectionStyleState;
|
|
79
|
-
/**
|
|
80
|
-
* Get the current numbering format ID (101-108 for standard, or mapped from document)
|
|
81
|
-
*/
|
|
82
|
-
get_numbering_format_id(): number | undefined;
|
|
83
|
-
set_paragraph_alignment(alignment: string): void;
|
|
84
|
-
/**
|
|
85
|
-
* Set numbered list with a specific format
|
|
86
|
-
* Formats: "decimal" (1.), "decimal-paren" (1)), "decimal-paren-both" ((1)),
|
|
87
|
-
* "upper-letter" (A.), "lower-letter" (a.),
|
|
88
|
-
* "upper-roman" (I.), "lower-roman" (i.)
|
|
89
|
-
*/
|
|
90
|
-
set_numbered_list_format(format: string): void;
|
|
91
|
-
constructor(canvas_id: string);
|
|
92
|
-
/**
|
|
93
|
-
* Zoom in by 10%
|
|
94
|
-
*/
|
|
95
|
-
zoom_in(): void;
|
|
96
|
-
/**
|
|
97
|
-
* Get current zoom level (1.0 = 100%)
|
|
98
|
-
*/
|
|
99
|
-
get_zoom(): number;
|
|
100
|
-
set_bold(enable: boolean): void;
|
|
101
|
-
/**
|
|
102
|
-
* Set zoom level (0.25 to 4.0, i.e., 25% to 400%)
|
|
103
|
-
*/
|
|
104
|
-
set_zoom(zoom: number): void;
|
|
105
|
-
/**
|
|
106
|
-
* Zoom out by 10%
|
|
107
|
-
*/
|
|
108
|
-
zoom_out(): void;
|
|
109
|
-
}
|
|
110
|
-
export class SelectionStyleState {
|
|
111
|
-
private constructor();
|
|
112
|
-
free(): void;
|
|
113
|
-
[Symbol.dispose](): void;
|
|
114
|
-
font_color(): string | undefined;
|
|
115
|
-
italic_all(): boolean;
|
|
116
|
-
italic_any(): boolean;
|
|
117
|
-
font_family(): string | undefined;
|
|
118
|
-
underline_all(): boolean;
|
|
119
|
-
underline_any(): boolean;
|
|
120
|
-
paragraph_alignment(): string | undefined;
|
|
121
|
-
bold_all(): boolean;
|
|
122
|
-
bold_any(): boolean;
|
|
123
|
-
font_size(): number | undefined;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
127
|
-
|
|
128
|
-
export interface InitOutput {
|
|
129
|
-
readonly memory: WebAssembly.Memory;
|
|
130
|
-
readonly __wbg_editor_free: (a: number, b: number) => void;
|
|
131
|
-
readonly __wbg_selectionstylestate_free: (a: number, b: number) => void;
|
|
132
|
-
readonly editor_get_numbering_format_id: (a: number) => number;
|
|
133
|
-
readonly editor_get_page_size: (a: number, b: number) => void;
|
|
134
|
-
readonly editor_get_ruler_unit: (a: number) => number;
|
|
135
|
-
readonly editor_get_zoom: (a: number) => number;
|
|
136
|
-
readonly editor_has_bullet_list: (a: number) => number;
|
|
137
|
-
readonly editor_has_numbered_list: (a: number) => number;
|
|
138
|
-
readonly editor_has_numbering: (a: number) => number;
|
|
139
|
-
readonly editor_load_docx_and_render: (a: number, b: number, c: number) => void;
|
|
140
|
-
readonly editor_new: (a: number, b: number, c: number) => void;
|
|
141
|
-
readonly editor_on_key_down: (a: number, b: number, c: number) => void;
|
|
142
|
-
readonly editor_on_mouse_click: (a: number, b: number, c: number) => void;
|
|
143
|
-
readonly editor_on_mouse_drag: (a: number, b: number, c: number) => void;
|
|
144
|
-
readonly editor_remove_numbering: (a: number) => void;
|
|
145
|
-
readonly editor_reset_font_color: (a: number) => void;
|
|
146
|
-
readonly editor_reset_font_family: (a: number) => void;
|
|
147
|
-
readonly editor_reset_font_size: (a: number) => void;
|
|
148
|
-
readonly editor_save_document: (a: number, b: number) => void;
|
|
149
|
-
readonly editor_select_document: (a: number) => void;
|
|
150
|
-
readonly editor_select_paragraph: (a: number) => void;
|
|
151
|
-
readonly editor_select_word: (a: number) => void;
|
|
152
|
-
readonly editor_selection_style_state: (a: number) => number;
|
|
153
|
-
readonly editor_set_bold: (a: number, b: number) => void;
|
|
154
|
-
readonly editor_set_bullet_list: (a: number, b: number) => void;
|
|
155
|
-
readonly editor_set_cursor_visible: (a: number, b: number) => void;
|
|
156
|
-
readonly editor_set_font_color: (a: number, b: number, c: number) => void;
|
|
157
|
-
readonly editor_set_font_family: (a: number, b: number, c: number) => void;
|
|
158
|
-
readonly editor_set_font_size: (a: number, b: number) => void;
|
|
159
|
-
readonly editor_set_italic: (a: number, b: number) => void;
|
|
160
|
-
readonly editor_set_numbered_list: (a: number, b: number) => void;
|
|
161
|
-
readonly editor_set_numbered_list_format: (a: number, b: number, c: number) => void;
|
|
162
|
-
readonly editor_set_page_margins: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
163
|
-
readonly editor_set_page_size: (a: number, b: number, c: number) => void;
|
|
164
|
-
readonly editor_set_paragraph_alignment: (a: number, b: number, c: number) => void;
|
|
165
|
-
readonly editor_set_ruler_unit: (a: number, b: number) => void;
|
|
166
|
-
readonly editor_set_underline: (a: number, b: number) => void;
|
|
167
|
-
readonly editor_set_zoom: (a: number, b: number) => void;
|
|
168
|
-
readonly editor_toggle_ruler_unit: (a: number) => void;
|
|
169
|
-
readonly editor_zoom_in: (a: number) => void;
|
|
170
|
-
readonly editor_zoom_out: (a: number) => void;
|
|
171
|
-
readonly selectionstylestate_bold_all: (a: number) => number;
|
|
172
|
-
readonly selectionstylestate_bold_any: (a: number) => number;
|
|
173
|
-
readonly selectionstylestate_font_color: (a: number, b: number) => void;
|
|
174
|
-
readonly selectionstylestate_font_family: (a: number, b: number) => void;
|
|
175
|
-
readonly selectionstylestate_font_size: (a: number, b: number) => void;
|
|
176
|
-
readonly selectionstylestate_italic_all: (a: number) => number;
|
|
177
|
-
readonly selectionstylestate_italic_any: (a: number) => number;
|
|
178
|
-
readonly selectionstylestate_paragraph_alignment: (a: number, b: number) => void;
|
|
179
|
-
readonly selectionstylestate_underline_all: (a: number) => number;
|
|
180
|
-
readonly selectionstylestate_underline_any: (a: number) => number;
|
|
181
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
182
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
183
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
184
|
-
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
185
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
189
|
-
/**
|
|
190
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
191
|
-
* a precompiled `WebAssembly.Module`.
|
|
192
|
-
*
|
|
193
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
194
|
-
*
|
|
195
|
-
* @returns {InitOutput}
|
|
196
|
-
*/
|
|
197
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
201
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
202
|
-
*
|
|
203
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
204
|
-
*
|
|
205
|
-
* @returns {Promise<InitOutput>}
|
|
206
|
-
*/
|
|
207
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|