瀏覽代碼

feat: update AiEditor name

zhupei 1 年之前
父節點
當前提交
940d1af370
共有 53 個文件被更改,包括 148 次插入1393 次删除
  1. 0 504
      LICENSE
  2. 3 3
      README.md
  3. 0 732
      changes.md
  4. 0 0
      dist/index.cjs
  5. 66 66
      dist/index.d.ts
  6. 4 4
      dist/index.js
  7. 0 8
      index.html
  8. 1 1
      package.json
  9. 2 2
      src/ai/AiGlobalConfig.ts
  10. 1 1
      src/ai/AiModelManager.ts
  11. 1 1
      src/ai/core/AiModel.ts
  12. 1 1
      src/ai/core/DefaultAiMessageListener.ts
  13. 1 1
      src/ai/custom/CustomAiModel.ts
  14. 1 1
      src/ai/gitee/GiteeAiModel.ts
  15. 1 1
      src/ai/openai/OpenaiAiModel.ts
  16. 1 1
      src/ai/spark/SparkAiModel.ts
  17. 1 1
      src/ai/wenxin/WenXinAiModel.ts
  18. 1 1
      src/components/AbstractBubbleMenu.ts
  19. 1 1
      src/components/AbstractMenuButton.ts
  20. 3 3
      src/components/Footer.ts
  21. 1 1
      src/components/Header.ts
  22. 1 1
      src/components/bubbles/ImageBubbleMenu.ts
  23. 1 1
      src/components/bubbles/LinkBubbleMenu.ts
  24. 1 1
      src/components/bubbles/TableBubbleMenu.ts
  25. 1 1
      src/components/bubbles/TextSelectionBubbleMenu.ts
  26. 1 1
      src/components/bubbles/items/selection/AI.ts
  27. 1 1
      src/components/bubbles/items/selection/Translate.ts
  28. 4 4
      src/components/bubbles/types.ts
  29. 1 1
      src/components/menus/Ai.ts
  30. 1 1
      src/components/menus/Attachment.ts
  31. 1 1
      src/components/menus/Custom.ts
  32. 1 1
      src/components/menus/Emoji.ts
  33. 1 1
      src/components/menus/FontFamily.ts
  34. 1 1
      src/components/menus/FontSize.ts
  35. 1 1
      src/components/menus/Group.ts
  36. 1 1
      src/components/menus/Image.ts
  37. 1 1
      src/components/menus/LineHeight.ts
  38. 1 1
      src/components/menus/Video.ts
  39. 16 16
      src/core/LinwitDocEditor.ts
  40. 6 6
      src/core/getBubbleMenus.ts
  41. 2 2
      src/core/getExtensions.ts
  42. 1 1
      src/extensions/AiCommandExt.ts
  43. 1 1
      src/extensions/AttachmentExt.ts
  44. 1 1
      src/extensions/ImageExt.ts
  45. 1 1
      src/extensions/PasteExt.ts
  46. 2 2
      src/extensions/SaveExt.ts
  47. 1 1
      src/extensions/VideoExt.ts
  48. 1 2
      src/i18n/zh.ts
  49. 1 1
      src/index.ts
  50. 2 2
      src/main.ts
  51. 1 1
      src/util/base64Uploader.ts
  52. 1 1
      src/util/fileUploader.ts
  53. 1 1
      src/util/initToolbarKeys.ts

+ 0 - 504
LICENSE

@@ -1,504 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
-    USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random
-  Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!

+ 3 - 3
README.md

@@ -27,9 +27,9 @@ import 'linwitdoc-editor/dist/index.css'
 
 注意:
 
-1. `aiEditor`换为`linwitDocEditor`
-2. `aie-`已换为为`linwiteditor-`
-
+1. `AiEditor`已换为`LinwitDocEditor`
+2. `aiEditor`换为`linwitDocEditor`
+3. `aie-`已换为为`linwiteditor-`
 
 ## 什么是 AIEditor
 

+ 0 - 732
changes.md

@@ -1,732 +0,0 @@
-# AiEditor ChangeLog
-
-## v1.3.6 20250312:
-- feat: Added alwaysEnabledToolbarKeys configuration to specify that certain buttons are always enabled
-- feat: Optimized the AI command menu to make its code more concise
-- feat: aie-undo duplicate definition problem
-- fix: When selecting an existing image in the editor first and then inserting another image, the "Applying a mismatched transaction" error appears
-- fix: Fixed some typos in AI prompt words that may cause AI to misunderstand
-- fix: Image configuration defaultSize does not work
-- fix: Code block does not wrap after AI automatically comments
-
----
-- 新增:添加 alwaysEnabledToolbarKeys 配置,用于指定某些按钮永远处于不被禁用
-- 优化:优化 AI 命令菜单,使其代码更加简洁
-- 优化:aie-undo 重复定义的问题
-- 修复:当先选择编辑器里已存在的图片,再插入一张图片时,出现 "Applying a mismatched transaction" 错误
-- 修复:修复 AI 提示词的一些错别字,可能导致 AI 理解错误的问题
-- 修复:图片配置 defaultSize 不起作用的问题
-- 修复:代码块通过 AI 自动注释之后代码不换行问题修改
-
-
-
-## v1.3.5 20250212:
-- feat: Optimize the experience and cancel the pop-up of the floating menu in the code block
-- feat: Optimize the tools and methods such as organizeHTMLContent
-- feat: In read-only mode, do not disable the "Print" and "Full Screen" buttons
-- fix: taskList cannot be converted to markdown, and taskList of markdown cannot be converted to html
-- fix: The problem that the strikethrough in html cannot be converted to `~~`
-- fix: Fix the problem that removeEmptyParagraphs accidentally deletes images in some cases
-
----
-- 优化: 优化体验,取消浮动菜单在代码块的弹出
-- 优化:优化 organizeHTMLContent 等工具方法
-- 优化:在只读模式下,不禁用 “打印” 和 “全屏” 按钮
-- 修复:taskList 无法转换为 markdown,markdown 的 taskList 也无法转换为 html 的问题
-- 修复:html 中的删除线无法转换为 `~~` 的问题
-- 修复:修复 removeEmptyParagraphs 在某些情况下误删图片的情况
-
-
-
-## v1.3.4 20250102:
-- feat: Added custom color and color selection functions to the highlight block
-- feat: htmlUtil added createElement method
-- feat: AIMenu added onClick configuration support
-- feat: Added onFullscreen event listener configuration support
-- feat: Optimize InnerEditor's options assignment
-- feat: Optimize markdown's parsing of highlight blocks
-- feat: Optimize AIMenu's default prompt words
-- fix: The problem of inserting content in the click event of the custom image in the toolbar reported an error
-- fix: The event of AiCommand is undefined
-- fix: The mention function cannot display the label
-
----
-- 新增:高亮块新增自定义颜色和选择颜色的功能
-- 新增:htmlUtil 添加 createElement 方法
-- 新增:AIMenu 添加 onClick 配置的支持
-- 新增:添加 onFullscreen 的事件监听的配置支持
-- 优化:优化 InnerEditor 的 options 赋值
-- 优化:优化 markdown 对高亮块的解析
-- 优化:优化 AIMenu 的默认提示词
-- 修复:在工具栏的自定义图片的点击事件插入内容报错的问题
-- 修复:AiCommand 的 event 为 undefined 的问题
-- 修复:提及(mention)功能无法显示 label 的问题
-
-
-
-## v1.3.3 20241221:
-- feat: Add link configuration to images
-- feat: Add alt, title and other attribute configuration to images
-- feat: Add onClick configuration support to AIMenu
-- fix: When migrating edited data from wangEditor to AIEditor, some images are not displayed
-- fix: When there are multiple editor instances on the same page, the number of characters counted is inaccurate
-- fix: When the menu is in the active state, the corners are not rounded.
-- fix: fix parse init html error if the content is text only
-- doc: update ai command docs
-- doc: update comment docs
-
----
-- 新增:图片添加链接配置的功能
-- 新增:图片添加 alt、title 等属性配置的功能
-- 新增:AIMenu 添加 onClick 配置的支持
-- 修复:wangEditor 编辑数据迁移到 AIEditor 时,某些图片不显示的问题
-- 修复:当同一个页面存在多个编辑器实例时,右下角统计字符数不准确
-- 修复:菜单在 active 的状态时,不是圆角的。
-- 修复:修复当初始化内容为存文本时 html 解析错误的问题
-- 文档:更新 ai command 的相关文档
-- 文档:更新评论(批注)的相关文档
-
-
-
-## v1.2.9 20241212:
-- feat: Added changeTheme() method for dynamic theme switching
-- feat: Optimized the color variables related to dark and light themes
-- feat: Adjusted the size of emoji to use the toolbarSize configuration
-- feat: Optimized the related tool methods of htmlUtil and mdUtil
-- fix: When getting markdown, the image content cannot be correctly converted to markdown
-- fix: When getting markdown, the table cannot be correctly converted to markdown in some cases
-
----
-- 新增:添加 changeTheme() 方法,用于动态切换主题
-- 优化:优化暗色与亮色主题的相关颜色变量
-- 优化:调整 emoji 的大小以在使用 toolbarSize 的配置
-- 优化:优化 htmlUtil 和 mdUtil 的相关工具方法
-- 修复:获取 markdown 时,图片内容无法正确转换为 markdown
-- 修复:获取 markdown 时,表格在某些情况下无法正确转换为 markdown
-
-
-
-## v1.2.8 20241203:
-- feat: Added support for the Shift-Tab de-indentation shortcut key in code blocks
-- feat: Added support for the `:::` syntax of Markdown
-- feat: Updated related dependencies to the latest version
-- feat: Modified the model in OpenaiModelConfig to be required
-- fix: The editor cannot be selected when editing is prohibited under the Android operating system
-- fix: When inserting an empty ordered list, it cannot be inserted
-- fix: The markdown content output by AI cannot be inserted correctly
-- doc: Updated some description errors in the document
-- doc: Corrected the configuration errors related to openai in the document
-
----
-- 新增:代码块添加 Shift-Tab 取消缩进快捷键的支持
-- 新增:添加 Markdown 的 `:::` 语法的支持
-- 优化:更新相关依赖到最新版本
-- 优化:修改 OpenaiModelConfig 中的 model 为必填
-- 修复:编辑器在 Android 操作系统下,且禁止编辑时无法选择的问题
-- 修复:当插入一个空的有序列表时,无法被插入的问题
-- 修复:AI 输出的 markdown 内容无法被正确插入的问题
-- 文档:更新文档的一些描述错误
-- 文档:修正文档关于 openai 的相关配置错误
-
-
-
-## v1.2.7 20241121:
-- fix: When configuring contentIsMarkdown, it may affect the reload problem
-- fix: When markdown parses images, the images will be wrapped in p tags, resulting in incorrect parsing
-- fix: The problem of prompting domain errors when using spark lite models
-- feat: Openai has added a customUrl configuration function to facilitate users to customize the configuration URL
-- feat: When there is an empty p tag in the table, its height is incorrect
-- feat: Upgrade related dependencies to the latest version
-
----
-- 修复: 当配置 contentIsMarkdown 时,可能会影响再次加载的问题
-- 修复: markdown 在解析图片时,图片会被 p 标签包裹导致无法正确解析的问题
-- 修复:使用 spark lite 模型提示 domain 错误的问题
-- 优化: openai 新增 customUrl 配置的功能,方便用户自定义配置 url
-- 优化:table 中存在空的 p 标签时,其高度不正确的问题
-- 优化:升级相关依赖到最新版本
-
-
-
-## v1.2.6 20241114:
-- fix: Fixed the line break issue when AI translation and AI output replacement content
-- fix: Fixed the issue of not being able to select content on Android devices (IOS does not have this problem)
-- feat: The title of the menu group is changed to an optional configuration, and will not pop up when it is not filled in
-
----
-- 修复: 修复 AI 翻译、AI 输出替换内容时换行的问题
-- 修复: 修复在 Android 设备下无法选择内容的问题(IOS 没有这个问题)
-- 优化:菜单组的 title 修改为可选配置,当不填写时不弹出显示
-
-
-
-## v1.2.5 20241031:
-- fix: CodeBlock Extensions error sometime
-- fix: optimize paste extension and fix paste with data-pm-slice is error
-- fix: fix tab key conflict with ordered lists
-
----
-- 修复:代码插件在某些情况下错处的问题
-- 修复:优化粘贴内容插件并修复粘贴文本时独占一行的问题
-- 修复:修复 tab 键和列表冲突的问题
-
-
-
-## v1.2.3 20241024:
-- feat: added more language files for i18n
-- feat: custom ai model support http ReadableStream
-- feat: Added toolbarSize to control toolbar button size
-- fix: When the editor editable is false, disable the toolbar
-- chore: update dependencies
-- chore: optimize styles
-
----
-- 新增: 新增更多的语言支持,目前已经支持 中文、英文、德语、葡萄牙语、西班牙语、印度语、印尼语、日语、韩语、泰语、越南语
-- 新增: 自定义大语言模型支持 http ReadableStream
-- 新增: 添加 toolbarSize 配置用于控制工具栏按钮的大小
-- 修复: 当编辑器设置 editable 为 false, 禁用工具栏
-- 优化: 更新依赖到最新版本
-- 优化: 优化样式细节
-
-
-
-## v1.2.2 20241018:
-- feat: add new option "textCounter"
-- feat: add temperature and maxTokens config for aiModel
-- refactor: optimize paste extensions and add new option "removeEmptyParagraphs" for paste
-- refactor: Optimize ClassNameExt to make the new paragraph does not carry the className of the previous
-- refactor: remove align attribute in image
-- refactor: use div replace p to wrapper image
-- refactor: remove empty value attributes
-- fix: image can not show in edit disable
-- fix: image border is 1px smaller after resizing
-- fix: SparkAiModel error if use v1.1
-
---- 
-- 新增: 添加新的配置 "textCounter" 用于自定义文字数量的统计
-- 新增: AI 新增 temperature 和 maxTokens 的配置功能
-- 优化: 粘贴的功能添加新的 "removeEmptyParagraphs" 配置,用于移除空段落
-- 优化: 优化 ClassNameExt 插件,使之在新的段落里不携带上一个段落的 class 名称
-- 优化: 图片移除 align 属性,否则可能发生样式错误的问题
-- 优化: 使用 div 替代 p 包裹图片
-- 优化: 图片移除空属性值的属性
-- 修复: 图片无法在只读模式下显示的问题
-- 修复: 图片在拖拽大小后,其宽度会小 1px 的问题
-- 修复: 星火大模型无法使用其最低版本 v1.1 的问题
-
-
-
-## v1.2.0 20241016:
-- feat: Enhanced pasting from Excel, WPS, LibreOffice, Number, and Tencent Docs table content
-- feat: add new options "image.bubbleMenuEnable"
-- feat: add "htmlPasteConfig.clearLineBreaks" options
-- refactor: refactor markdown features
-- refactor: add "finished" flag to the SmoothAppender
-- refactor: "pasteAsText" feature not remove the "p" tag
-- refactor: rename "removeHtmlTag" to htmlUtil
-- refactor: optimize textSelectionBubble
-- refactor: optimize createAiClient() in AI models
-- refactor: optimize initToolbarKeys.ts
-- refactor: optimize SparkAiModel.ts
-- fix: OpenaiAiModel parse message error sometimes
-- fix: fixed "&nbsp" will be attached sometime if pastedAsText config enable
-
----
-- 新增: 增强来至于 Excel, WPS, LibreOffice, Number 和 腾讯文档的表格粘贴功能
-- 新增: 添加新的配置 "image.bubbleMenuEnable"
-- 新增: 添加新的配置 "htmlPasteConfig.clearLineBreaks"
-- 优化: 重构 markdown 的相关功能
-- 优化: 优化 SmoothAppender 输入时间过长的问题
-- 优化: 优化 "pasteAsText" 功能保留 "p" 标签不被移除
-- 优化: 重命名 "removeHtmlTag" 为 htmlUtil
-- 优化: 优化 textSelectionBubble
-- 优化: 优化 createAiClient() 方法
-- 优化: 优化 initToolbarKeys.ts
-- 优化: 优化 SparkAiModel.ts
-- 修复: 修复 OpenaiAiModel 的消息在某些情况下解析错误的问题
-- 修复: 修复在 pastedAsText 配置的情况下,"&nbsp" 会被粘贴的问题
-
-
-
-## v1.1.7 20241002:
-- feat: add SmoothAppender for textarea
-- refactor: optimize AiEditor.onTransaction() method
-- refactor: rename "PasteExt" extension Name to adapter v2.8.0
-- refactor: optimize BubbleMenuPlugin.ts
-- refactor: update linkBubbleMenu pluginKey's name
-
----
-- 新增: 新增 SmoothAppender 使得 AI 输入更加湿滑
-- 优化: 优化 AiEditor.onTransaction() 的相关代码
-- 优化: 重命名 "PasteExt" 插件的名称以适配 v2.8.0
-- 优化: 优化 BubbleMenuPlugin.ts 的核心逻辑
-- 优化: 重命名 linkBubbleMenu 插件的名称
-
-
-
-## v1.1.6 20240928:
-- feat: Hide the emoji panel when clicking an emoji.
-- feat: add html paste config and close https://github.com/aieditor-team/AiEditor/issues/92
-- refactor: add icons in Translate action buttons
-- fix: cat not show bubble menu on Cmd+A text selection command, close https://github.com/aieditor-team/AiEditor/issues/91
-
----
-- 优化:当点击 emoji 表情的时候,隐藏 emoji 面板
-- 优化:Html 粘贴添加更多的配置功能
-- 优化:为翻译面板的操作按钮添加统一的图标
-- 修复:通过快捷键 CMD+A 全选时,无法弹出选择操作浮动菜单的问题
-
-
-
-## v1.1.5 20240926:
-- refactor: optimize textSelectionBubbleMenu only update at the mouseup event
-- refactor: update dependencies
-- fix: fixed the translated buttons would trigger form submission
-
----
-- 优化:优化文字选中弹出菜单仅在鼠标松开的时候进行弹出
-- 优化:更新相关依赖到最新版本
-- 修复:修复翻译的按钮会触发表单提交的问题
-
-
-## v1.1.4 20240925:
-- feat: add ClassName extension for custom node class attribute
-- feat: add custom AI icon in bubble menu
-- refactor: refactor translate bubble menu
-- refactor: refactor ai bubble panel
-- refactor: add more common emojis 
-
---- 
-- 新增:新增 ClassName 插件,用于自定义节点的 class 样式
-- 新增:添加自定义泡泡菜单的 AI ICON 的功能
-- 优化:重构 翻译 功能的交互逻辑
-- 优化:重构 AI 弹出菜单的交互细节
-- 优化:添加更多场景的 emoji 表情
-
-
-
-## v1.1.3 20240923:
-- feat: add translate bubble menu items
-- feat: add "pasteAsText" config support
-- feat: add de and pt langs, thanks to @TobiasKrais
-- feat: add Emoji config support
-- fix: fix GiteeAiModel parse ai message error
-- refactor: optimize AiEditor.ts and Header.ts
-- refactor: optimize styles in Emoji.ts/Heading.ts/AbstractDropdownMenuButton.ts, thanks to @TobiasKrais
-- refactor: optimize ai panel position
-- chore: create npm-publish.yml
-- chore: remove comment code
-
---- 
-
-- 新增: 浮动菜单新增翻译功能,以及自定义翻译语言
-- 新增: 新增 "pasteAsText" 配置的功能,在粘贴时自动清除样式
-- 新增: 新增德语和葡萄牙语的配置,感谢 @TobiasKrais
-- 新增: 新增 emoji 自定义配置的功能
-- 修复: 修复 GiteeAiModel 在某些情况下解析错误的问题
-- 优化: 优化 AiEditor.ts 及 Header.ts 代码
-- 优化: 优化 Emoji.ts/Heading.ts/AbstractDropdownMenuButton.ts 的样式代码, @TobiasKrais
-- 优化: 优化 文字选中以及 ai 弹出菜单的位置
-- 优化: 创建 npm-publish.yml 用于自动发布的功能
-- 优化: 上传部分注释代码
-
-
-
-## v1.1.1 20240915:
-- feat: Increase the indent to 2em instead of 10px
-- feat: add FontSize defaultValue config
-- feat: add "align" config with image from server response.
-- feat: add server response to config the image and video width
-- feat: add custom to set lineHeights support
-- feat: add "toolbarExcludeKeys" config
-- feat: add resize button in the image bubble menus
-- refactor: optimize AbstractDropdownMenuButton.ts height to "fit-content"
-- fix: fix the bubble menu is active in table or image
-- fix: AbstractDropdownMenuButton active index error when aieditor init
-- fix: TableBubbleMenu can not show when double-click the cell
-- fix:fix the image Bubble Menus position not correct.
-- doc:add line height config docs
-- doc:add "toolbarExcludeKeys" config
-
----
-
-- 新增: 增加缩进改为 2em,而不是 10px
-- 新增: 新增默认字号大小的设置的功能
-- 新增: 新增支持图片上传时,服务器返回图片的对其方式
-- 新增: 新增图片或视频上传时,服务器返回图片的宽度和高度
-- 新增: 新增自定义行高设置的功能
-- 新增: 新增通过 "toolbarExcludeKeys" 配置自定义排除菜单的功能
-- 新增: 新增图片浮动菜单可以快速调整图片大小为 50% 75% 100% 的功能
-- 优化: 设置 AbstractDropdownMenuButton 的高度为 "fit-content"
-- 修复: 图片和表格的浮动菜单,点击时会处于 “选中” 状态的问题
-- 修复: AbstractDropdownMenuButton 在初始化时,默认选中不正确的问题
-- 修复: 表格的单元格双击选中时无法弹出表格操作菜单的问题
-- 修复:图片弹出的操作浮动菜单不是 100% 居中的问题
-- 文档: 添加自定义行高设置的相关文档
-- 文档: 添加 "toolbarExcludeKeys" 配置的相关文档
-
-
-
-## v1.1.0 20240909:
-- feat: add "onClick" config support for ai menu to custom menu item click event.
-- feat: add commands() method for aieditor
-- fix: onCreateBefore for custom extensions
-- fix: remove console.log in gitee ai
-
----
-
-- 新增: 自定义 AI 菜单添加 "onClick" 配置的支持
-- 新增: AIEditor 对象添加 commands() 方法
-- 修复: onCreateBefore 自定义扩展不生效的问题
-- 修复: Gitee AI 有 console.log 打印的问题
-
-
-
-
-## v1.0.16 20240903:
-- feat: add menu group config support
-- refactor: optimize image export wrapper in "p" tag
-- refactor: rename "uploadFile" to "fileUploader"
-- refactor: define a "Uploader" type and refactor extensions
-- fix: fix spark ai can not support v4.0
-- fix: image pasted from web will insert two images
-- fix: lineHeight active is not correct.
-- fix: i18n config error:delete-table -> 删除表格
-
----
-
-- 新增: 工具栏菜单自定义分组的功能
-- 优化: 重构导出图片被 p 标签包裹
-- 优化: 重命名 "uploadFile" 为 "fileUploader"
-- 优化: 定义 "Uploader" 类型并重构相关插件
-- 修复: 修复星火大模型无法使用 v4.0 的问题
-- 修复: 修复粘贴从网络复制的图片会出现显示 2 张的问题
-- 修复: 修复行高回显不正确的问题
-- 修复: 修复国际化配置不正确的问题 delete-table -> 删除表格
-
-
-
-## v1.0.15 20240828:
-- feat: Image custom properties and lazy loading
-- feat: add gitee ai model support, use the serverless api
-- refactor: optimize ImageExt.ts
-- chore: upgrade dependencies
-
----
-
-- 新增:新增自定义图片属性的支持
-- 新增:新增使用 Gitee AI 大模型的支持
-- 优化:优化 图片 插件
-- 优化:升级相关依赖到最新版本
-
-
-
-## v1.0.14 20240812:
-- feat: codeBlock add languages and prompts config
-- feat: add demos for svelte
-- fix: img align not effective if export to html
-- chore: upgrade dependencies
-- doc: update source-code document
-- doc: add svelte docs
-
----
-
-- 新增:codeBlock 代码块添加自定义代码语言和 prompt 提示词的功能
-- 新增:添加 svelte 框架使用的 demo 示例
-- 修复:图片对其方式导出为 html 时不生效的问题
-- 文档:添加和 svelte 框架集成的相关文档
-
-
-
-## v1.0.13 20240714:
-- feat: add AIPanelMenus config support
-- optimize: update video attribute controls
-- fix: AI Menus init error
-- docs: add Japanese README
-
----
-
-- 新增:新增 AIPanelMenus 配置的支持,用于配置 AI 泡泡菜单
-- 优化:优化视频节点的控制属性
-- 修复:修复 AI 菜单初始化错误的问题
-- 文档:新增日文的 readme
-
-
-
-## v1.0.11 20240702:
-- feat: Added onBlur and onFocus configurations for AIEditor #39
-- feat: Added the function of customizing the selected floating menu
-- feat: Added the function of AIEditor.getAttributes() method
-- optimize: Refactored the international display of AI panel
-- optimize: Refactored AbstractBubbleMenu.ts to make it simpler and easier to use
-- fix: Fixed the problem of multiple additions of Header under KeepAlive of Vue #37
-
----
-
-- 新增:新增 AIEditor 的 onBlur 和 onFocus 配置 #39
-- 新增:新增自定义选中的浮动菜单的功能
-- 新增:新增 AIEditor.getAttributes() 方法的功能
-- 优化:重构 AI 面板的国际化显示
-- 优化:重构 AbstractBubbleMenu.ts 使之更加简单易用
-- 修复:修复 Vue 的 KeepAlive 下 Header 多次添加的问题 #37
-
-
-
-## v1.0.10 20240620:
-- 新增:新增浮动菜单的开关和菜单项配置功能
-- 新增:新增链接的浮动菜单项配置功能
-- 新增:新增图片的浮动菜单项配置功能
-- 优化:重构 AI 模块,抛出更多的方法类,方便外部直接调用
-- 优化:重构 AbstractBubbleMenu.ts 使之更加简单易用
-- 文档:现在浮动菜单的相关配置功能
-
-
-
-## v1.0.8 20240613:
-- 新增:AiModel 添加 chatWithPayload 方法用于传入自定义的 ai 参数信息
-- 新增:源码编辑的功能菜单,及其配置。感谢 @jx
-- 新增:添加是否可以对整个编辑器拖拽放大缩小的开关配置
-- 优化:优化 a 标签在暗色主题下的样式问题,感谢 @lwleen
-- 优化:编辑的滚动条样式,感谢 @lwleen
-- 优化:移除无用的配置 cbName 和 cbUrl 
-
-
-
-## v1.0.6 20240607:
-- 新增:AI 大模型新增对 Openai 和 月之暗面 的支持
-- 新增:编辑元素新增对 Figure 和 Figcaption 元素的支持
-- 新增:AI Prompt 提示词自定义添加对 {content} 占位符的支持
-- 优化:修改星火大模型默认版本为 v3.5
-- 优化:重构自定义大模型 CustomAiModelConfig 的方法名称和参数
-- 优化:重命名 AI 模块里的某些方法和参数,使之更加通俗易懂
-- 优化:优化代码里的一些单词拼写错误
-- 优化:优化 AIEditor 内部的一些样式名称,防止产生可能的冲突
-
-
-
-## v1.0.4 20240528:
-- 新增:textSelectionBubbleMenu 添加开关配置的支持
-- 优化:在只读模式下,应该关闭掉选中文字菜单的弹出
-- 优化:当 AI 大模型配置错误的时候,给出更友好的错误提示
-- 优化:选中文字菜单时,自动判断弹出的菜单是否遮挡了顶部菜单,并在下方弹出
-- 优化:选中空白内容,但为选中任何文字时,错误的弹出操作菜单的问题
-- 优化:更新相关的依赖到最新版本
-- 修复:AI 菜单在某些场景下出现错位的问题,感谢 @monksoul
-- 文档:添加 React 对 AiEditor 的封装为组件的相关文档,感谢 @monksoul
-
-
-
-## v1.0.1 20240522:
-- 优化:默认 AIEditor 导出更多的类,方便用户开发
-- 修复:图片、附件、视频的 uploadFormName 配置无效的问题
-- 修复:CodeBlock 的菜单无法正切换国际化的问题
-- 文档:添加和各类 UI 框架集成的相关文档
-
-
-
-## v1.0.0 20240329:
-- 新增:上传附件、图片、视频添加自定义 formName 的配置能力
-- 新增:选择文字内容后,弹出的 AI 菜单添加默认操作项的功能
-- 优化:上传附件、图片、视频的 uploadHeaders 支持配置为一个方法
-- 优化:升级相关依赖到最新版本
-- 文档:添加修改文件、图片和视频的相关错别字
-- 文档:添加关于 uploadHeaders 可配置为方法的相关文档
-
-
-
-## v1.0.0-rc.9 20240324:
-- 新增:自定义大语言模型添加 headers 配置的支持
-- 优化:优化 ai 翻译的 prompt 内容,以保证能够正确翻译多国语言
-- 优化:移除代码中一些多余的日志输出
-- 修复:修正表格的弹出菜单在某些情况下无法正确弹出的问题
-- 文档:修正快速开始的 ai 配置不正确(未同步最新版本)的问题
-- 文档:添加关于自定义大模型的相关文档
-
-
-
-## v1.0.0-rc.8 20240317:
-- 新增:添加自定义对接任意大模型的支持
-- 新增:添加文心一言大模型的支持,感谢 @bendantada
-- 新增:星火大模型添加对 v3.5 的支持
-- 新增:AI 客户端新增 SSE 客户端的支持
-- 优化:AI 菜单,AI 命令添加自动选择大语言模型的支持
-- 文档:修正图片上传的示例错误代码
-- 文档:更新配置 models 的相关错误示例
-
-
-
-## v1.0.0-rc.7 20240109:
-- 新增:添加当 uploader 的 onUploadBefore 返回 false 时,中断文件上传
-- 新增:Ai 模块添加自定义 AiModelFactory 的配置,方便引用第三方 Ai 大模型
-- 优化:修改  AiEditor.insert 的参数为 any 类型
-- 优化:重命名 AiModelFactory 为 AiModelManager
-- 修复:修改全屏按钮在某些情况下不起作用的问题,感谢 @ashuicoder
-- 修复:高亮块、链接、引用获得焦点时,菜单没有被激活的问题
-- 修复:选中文字弹出菜单,菜单内的操作没有根据选择内容激活的问题
-
-
-
-## v1.0.0-rc.6 20240102:
-- 新增:添加 onSave 的配置,可以用于监听用户按 ctrl + s 的保存操作
-- 优化:修改 editable 配置为可选
-- 优化:添加 AiModelManager 以及 SparkAiModel 导出
-- 修复:修改在 editable 为 false 下,代码块的 ai 功能依然可用的问题
-- 文档:修正 onCreateClientUrl
-
-
-
-## v1.0.0-rc.5 20240101:
-- 新增:CustomMenu 添加 onCreate 方法,方便对自定义菜单进行初始化
-- 新增:添加 setContent() 以及 setEditable() 方法
-- 优化:重构 AI 菜单功能及其 UI 样式
-- 优化:重构 / 弹出 UI 菜单样式以及交互方式
-- 优化:重写 AI 模块,重构 AI 抽象菜单
-- 样式:@某某某 弹出的 UI 样式
-- 样式:优化 taskList 的 ui 样式
-- 文档:添加只读模式的相关文档
-- 文档:更新 ai 配置的相关文档
-
-
-
-## v1.0.0-rc.4 20231222:
-- 修复:当 AiEditor 嵌入到 Form 时,点击某些按钮会触发 Form 提交的问题
-- 修复:从网页复制的内容粘贴到编辑器,图片无法被粘贴进来的问题
-- 修复:点击表格、图片时,会有多个弹出菜单位置冲突的问题
-
-
-
-## v1.0.0-rc.2 20231220:
-- 新增:自定义菜单添加 id 和 className 类名配置的支持
-- 新增:AiEditor 添加 onDestroy 监听的配置支持
-- 优化:上传组件重命名 onBeforeUpload 为 onUploadBefore
-- 修复:在 React 的 StrictMode 下,无法使用 AiEditor 自定义布局的问题
-- 文档:添加自定义布局的相关文档内容
-
-
-
-## v1.0.0-rc.1 20231219:
-- 新增:AI 功能添加选择文字时,对文字进行在定义 Prompt 操作的功能
-- 新增:添加选中文字内容时,弹出操作菜单的功能
-- 新增:AiEditor 添加 onCreateBefore 的钩子函数,方便初始化插件
-- 修复:同一个页面下,初始化多个 editor 实例时出错的问题
-- 修复:修复保持 html 后,通过 html 再次初始化编辑器无法准确解析视频组件的问题
-- 优化:重构 AbstractBubbleMenu.ts 的相关属性和逻辑
-- 优化:重构 ai 组件,使之能够适配更多的业务场景
-- 样式:优化编辑器诸多样式细节
-- 文档:添加链接配置 ref/class 等相关配置的文档
-
-
-
-## v1.0.0-beta.10 20231213:
-- 新增:添加自定义 menu 菜单的支持
-- 新增:图片添加 defaultSize 和 allowBase64 配置的支持
-- 优化:优化 "getOutline()" 方法的逻辑,添加获取 id 的支持
-- 优化:类腾讯文档风格的 demo 实例添加目录显示的功能
-
-
-
-## v1.0.0-beta.9 20231208:
-- 新增:图片、视频和附件新增 uploaderEvent 监听配置的支持
-- 新增:“链接” 功能添加自定义 ref、class 等配置的支持
-- 新增:添加头部、编辑区的自定义布局支持
-- 新增:添加 “类腾讯文档” 风格的 demo 示例代码
-- 新增:AiEditor 添加 "onCreated" 方法用于监听初始化
-- 优化:优化 aiEditor 和其他应用使用,在打印内容时可能出现内容错乱的问题
-- 优化:重命名 menus 为 header,和 footer 统一命名
-- 样式:优化 “表格” 在暗色模式下显示不正确的问题
-- 文档:更新关于 uploaderEvent 的相关文档
-- 文档:图片添加关于自定义 uploader 的代码示例
-
-
-
-## v1.0.0-beta.8 20231207:
-- 新增:`代码块` 新增 AI 自动添加注释的功能
-- 新增:`代码块` 新增 AI 解释代码含义的功能
-- 新增:AiEditor 添加 `getSelectedText()` 用于获取选择的文字
-- 新增:图片、视频、附件上传添加 `dataProcessor` 配置用于二次处理服务器请求的功能
-- 修复:`代码块` 在第一次初始化时,无法选择代码语言的问题
-- 样式:修改 `引用`(`blockquote`)在暗色模式下的样式问题
-- 文档:添加关于 `dataProcessor` 的相关文档
-
-
-
-## v1.0.0-beta.7 20231204:
-- 新增:AiEditor 添加 getMarkdown() 方法,用于获得 markdown 内容
-- 新增:AiEditor 添加 getOutline() 方法,用于获得文章的目录内容
-- 新增:AiEditor.focusPos(pos) 方法用于定位当前焦点到指定位置
-- 新增:添加 "高亮块" 功能,类型 vuepress 的 `:::`
-- 修复:修改附件上传时,未配置上传 url 的情况下出现错误的问题
-- 修复:字号大小设置菜单无法设置到默认字号的问题
-- 修复:自定义 AI 菜单时,添加 4 个以上菜单会出现滚动条的问题
-- 优化:AiEditor 类合并 insertHtml 和 insertMarkdown 为 insert 方法
-- 优化:优化编辑区的链接、图片、表格的浮动菜单有警告输出的问题
-- 优化:重命名工具类的 Title 为 Heading
-- 样式:优化链接弹出编辑框网址输入栏不对齐的问题
-- 样式:弹出框等元素添加 3px 圆角,使之在 UI 效果上更精致
-- 样式:修改内容编辑区的表格有一个横向滚动条的问题
-- 样式:优化菜单中插入表格的鼠标移动样式
-- 文档:更细 AiEditor 的 API 方法列表
-- 文档:readme 添加英文版本的内容
-
-
-
-## v1.0.0-beta.6 20231201:
-- 新增:增强对 AI 输出自动进行 markdown 转换的功能
-- 新增:AiEditor 的相关操作方法支持链式调用的功能
-- 新增:添加 "aiEditor.insertMarkdown()" 用于插入 markdown 内容
-- 新增:支持直接粘贴 markdown 内容自动转换为可视化编辑的功能
-- 新增:增强在输入时更多的 markdown 功能转换
-- 优化:重命名 "arEditor.insert()" 方法为 "insertHtml()"
-- 文档:添加代码示例的相关链接
-- 文档:更新 AI 功能的相关文档
-
-
-
-## v1.0.0-beta.5 20231129:
-- 新增:为 aieditor 添加全新的 logo
-- 新增:添加 1i8n 国际化支持
-- 新增:添加 vue 和 aieditor 整合的示例代码和文档
-- 新增:添加 react 和 aieditor 整合的示例代码和文档
-- 新增:AiEditor 类添加 `insert(html)`、`clear()`、`focus()`、`destroy()` 等更多方法
-- 优化:修改菜单中选择的默认样式和图标
-- 优化:移除代码中一些无用的 log 输出
-- 修复:修复工具栏中下拉菜单无法联动默认样式的问题
-- 修复:插入表格时,显示问题 #I8JMYU
-- 文档:同步更新许多文档
-
-
-
-## v1.0.0-beta.3 20231127:
-- 新增:完善文档站点 https://aieditor.dev 并上线
-- 新增:添加内容编辑自动保存到 localStorage 功能及其相关 API
-- 新增:字体颜色、背景颜色等的最近颜色现在添加自动保存到 localStorage 功能
-- 新增:插入表格添加鼠标移动显示行和列的功能
-- 优化:重构 ai 菜单的 svg 代码结构
-- 优化:重命名 ai 配置中的 command 为 commands
-- 优化:优化暗色模式下,一些组件比如 Popover 显示不正确的问题
-- 优化:优化许多样式细节
-
-
-
-## v1.0.0-beta.2 20231120:
-- 新增:添加输入 "/" 时弹出 AI 菜单的功能
-- 新增:AiEditor 添加 onChange 的回调配置
-- 新增:星火大模型添加 ws 和 wss 协议配置的支持
-- 新增:星火大模型添加自定义 URL 数据签名的支持
-- 新增:编辑器右下角添加自由拖拽放大或缩小整个编辑器的支持
-- 新增:添加传统模式下,比如 Layui 集成的示例
-- 新增:顶部菜单以及操作菜单添加鼠标移动有操作提示的支持
-- 新增:图片添加多图选择上传显示的功能
-- 新增:支持从电脑复制图片到编辑器粘贴上传的功能(之前已支持拖拽上传和选择上传)
-- 新增:添加选择某段文字后,点击菜单时选区样式消失的问题
-- 优化:优化 @某某某(提及)时的暗色样式错误
-- 修复:Base64Uploader 显示模拟上传时显示错误
-- 修复:暗色模式下,全屏编辑时,编辑区显示亮色的问题
-- 修复:@某某某(提及)通过鼠标点击选择用户时,显示 "@null" 的问题
-- 修复:链接弹出菜单点击取消链接时,错误的弹出编辑框的问题
-- 修复:Firefox 浏览器下某些 icon 无法显示的问题
-
-
-
-## v1.0.0-beta.1 20231110:
-完善基本功能

文件差異過大導致無法顯示
+ 0 - 0
dist/index.cjs


+ 66 - 66
dist/index.d.ts

@@ -42,53 +42,6 @@ export declare interface AiClientListener {
     onMessage: (bodyString: string) => void;
 }
 
-export declare class AiEditor {
-    customLayout: boolean;
-    innerEditor: InnerEditor;
-    container: HTMLDivElement;
-    header: Header;
-    mainEl: HTMLDivElement;
-    footer: Footer;
-    options: AiEditorOptions;
-    eventComponents: AiEditorEventListener[];
-    constructor(_: AiEditorOptions);
-    private initI18nAndInnerEditor;
-    protected initInnerEditor(): void;
-    protected getExtensions(): Extensions;
-    protected onCreate(props: EditorEvents['create']): void;
-    protected onTransaction(transEvent: EditorEvents['transaction']): void;
-    getHtml(): string;
-    getJson(): JSONContent;
-    getText(): string;
-    getSelectedText(): string;
-    getMarkdown(): any;
-    getOptions(): AiEditorOptions;
-    getAttributes(name: string): Record<string, any>;
-    setAttributes(name: string, attributes: Record<string, any>): void;
-    isActive(nameOrAttrs: any, attrs?: {}): boolean;
-    commands(): SingleCommands;
-    commandsChain(): ChainedCommands_2;
-    getOutline(): any[];
-    focus(): this;
-    focusPos(pos: number): this;
-    focusStart(): this;
-    focusEnd(): this;
-    isFocused(): boolean;
-    blur(): this;
-    insert(content: any): this;
-    insertMarkdown(content: string): this;
-    setEditable(editable: boolean): this;
-    setContent(content: string): this;
-    setMarkdownContent(content: string): this;
-    clear(): this;
-    isEmpty(): boolean;
-    changeLang(lang: string): this;
-    changeTheme(theme?: "dark" | "light"): void;
-    removeRetention(): this;
-    destroy(): void;
-    isDestroyed(): boolean;
-}
-
 export declare interface AiEditorEvent {
     type: string;
     value: any;
@@ -113,14 +66,14 @@ export declare type AiEditorOptions = {
     placeholder?: string;
     theme?: "light" | "dark";
     onMentionQuery?: (query: string) => any[] | Promise<any[]>;
-    onCreateBefore?: (editor: AiEditor, extensions: Extensions) => void | Extensions;
-    onCreated?: (editor: AiEditor) => void;
-    onChange?: (editor: AiEditor) => void;
-    onTransaction?: (editor: AiEditor, transaction: Transaction) => void;
-    onFocus?: (editor: AiEditor) => void;
-    onBlur?: (editor: AiEditor) => void;
-    onDestroy?: (editor: AiEditor) => void;
-    onSave?: (editor: AiEditor) => boolean;
+    onCreateBefore?: (editor: LinwitDocEditor, extensions: Extensions) => void | Extensions;
+    onCreated?: (editor: LinwitDocEditor) => void;
+    onChange?: (editor: LinwitDocEditor) => void;
+    onTransaction?: (editor: LinwitDocEditor, transaction: Transaction) => void;
+    onFocus?: (editor: LinwitDocEditor) => void;
+    onBlur?: (editor: LinwitDocEditor) => void;
+    onDestroy?: (editor: LinwitDocEditor) => void;
+    onSave?: (editor: LinwitDocEditor) => boolean;
     onFullscreen?: (isFullscreen: boolean) => void;
     toolbarKeys?: (string | CustomMenu | MenuGroup)[];
     alwaysEnabledToolbarKeys?: string[];
@@ -150,7 +103,7 @@ export declare type AiEditorOptions = {
     };
     uploader?: Uploader;
     image?: {
-        customMenuInvoke?: (editor: AiEditor) => void;
+        customMenuInvoke?: (editor: LinwitDocEditor) => void;
         uploadUrl?: string;
         uploadHeaders?: (() => Record<string, any>) | Record<string, any>;
         uploadFormName?: string;
@@ -162,7 +115,7 @@ export declare type AiEditorOptions = {
         bubbleMenuItems?: (string | BubbleMenuItem)[];
     };
     video?: {
-        customMenuInvoke?: (editor: AiEditor) => void;
+        customMenuInvoke?: (editor: LinwitDocEditor) => void;
         uploadUrl?: string;
         uploadHeaders?: (() => Record<string, any>) | Record<string, any>;
         uploadFormName?: string;
@@ -170,7 +123,7 @@ export declare type AiEditorOptions = {
         uploaderEvent?: UploaderEvent;
     };
     attachment?: {
-        customMenuInvoke?: (editor: AiEditor) => void;
+        customMenuInvoke?: (editor: LinwitDocEditor) => void;
         uploadUrl?: string;
         uploadHeaders?: (() => Record<string, any>) | Record<string, any>;
         uploadFormName?: string;
@@ -227,7 +180,7 @@ export declare interface AiMenu {
     prompt?: string;
     text?: "selected" | "focusBefore";
     model?: string;
-    onClick?: (event: MouseEvent, editor: AiEditor) => void;
+    onClick?: (event: MouseEvent, editor: LinwitDocEditor) => void;
     children?: AiMenu[];
 }
 
@@ -288,9 +241,9 @@ export declare type BubbleMenuItem = {
     title?: string;
     icon: string;
     holder?: any;
-    isActive?: (editor: AiEditor) => boolean;
-    onInit?: (editor: AiEditor, tippyInstance: Instance, parentEle: HTMLElement) => any;
-    onClick?: (editor: AiEditor, tippyInstance: Instance, parentEle: HTMLElement, holder: any) => void;
+    isActive?: (editor: LinwitDocEditor) => boolean;
+    onInit?: (editor: LinwitDocEditor, tippyInstance: Instance, parentEle: HTMLElement) => any;
+    onClick?: (editor: LinwitDocEditor, tippyInstance: Instance, parentEle: HTMLElement, holder: any) => void;
 };
 
 export declare class CustomAiModel extends AiModel {
@@ -315,8 +268,8 @@ export declare interface CustomMenu {
     icon?: string;
     html?: string;
     tip?: string;
-    onClick?: (event: MouseEvent, editor: AiEditor) => void;
-    onCreate?: (button: HTMLElement, editor: AiEditor) => void;
+    onClick?: (event: MouseEvent, editor: LinwitDocEditor) => void;
+    onCreate?: (button: HTMLElement, editor: LinwitDocEditor) => void;
 }
 
 declare type DefaultToolbarKey = (typeof defaultToolbarKeys)[number];
@@ -351,8 +304,8 @@ export declare interface HtmlPasteConfig {
 }
 
 export declare class InnerEditor extends Editor {
-    linwitDocEditor: AiEditor;
-    constructor(linwitDocEditor: AiEditor, options?: Partial<EditorOptions>);
+    linwitDocEditor: LinwitDocEditor;
+    constructor(linwitDocEditor: LinwitDocEditor, options?: Partial<EditorOptions>);
     parseHtml(html: string): Fragment;
     parseMarkdown(markdown: string): Fragment;
     insertMarkdown(markdown: string): void;
@@ -364,6 +317,53 @@ declare type LanguageItem = {
     alias?: string[];
 };
 
+export declare class LinwitDocEditor {
+    customLayout: boolean;
+    innerEditor: InnerEditor;
+    container: HTMLDivElement;
+    header: Header;
+    mainEl: HTMLDivElement;
+    footer: Footer;
+    options: AiEditorOptions;
+    eventComponents: AiEditorEventListener[];
+    constructor(_: AiEditorOptions);
+    private initI18nAndInnerEditor;
+    protected initInnerEditor(): void;
+    protected getExtensions(): Extensions;
+    protected onCreate(props: EditorEvents['create']): void;
+    protected onTransaction(transEvent: EditorEvents['transaction']): void;
+    getHtml(): string;
+    getJson(): JSONContent;
+    getText(): string;
+    getSelectedText(): string;
+    getMarkdown(): any;
+    getOptions(): AiEditorOptions;
+    getAttributes(name: string): Record<string, any>;
+    setAttributes(name: string, attributes: Record<string, any>): void;
+    isActive(nameOrAttrs: any, attrs?: {}): boolean;
+    commands(): SingleCommands;
+    commandsChain(): ChainedCommands_2;
+    getOutline(): any[];
+    focus(): this;
+    focusPos(pos: number): this;
+    focusStart(): this;
+    focusEnd(): this;
+    isFocused(): boolean;
+    blur(): this;
+    insert(content: any): this;
+    insertMarkdown(content: string): this;
+    setEditable(editable: boolean): this;
+    setContent(content: string): this;
+    setMarkdownContent(content: string): this;
+    clear(): this;
+    isEmpty(): boolean;
+    changeLang(lang: string): this;
+    changeTheme(theme?: "dark" | "light"): void;
+    removeRetention(): this;
+    destroy(): void;
+    isDestroyed(): boolean;
+}
+
 export declare interface MenuGroup {
     title?: string;
     icon?: string;

+ 4 - 4
dist/index.js

@@ -18285,13 +18285,13 @@ class Dg extends HTMLElement {
   }
   updateCharacters() {
     this.draggable ? this.innerHTML = `<div style="display: flex"> 
-                                <span> Powered by AiEditor, Characters: ${this.count} </span>
+                                <span> Powered by LinwitDocEditor, Characters: ${this.count} </span>
                                 <div style="width: 20px;height: 20px;overflow: hidden">
                                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 16L6 10H18L12 16Z"></path></svg>
                                 </div>
                             </div>
                             ` : this.innerHTML = `<div style="display: flex;"> 
-                                <span style="margin-right: 10px"> Powered by AiEditor, Characters: ${this.count} </span>
+                                <span style="margin-right: 10px"> Powered by LinwitDocEditor, Characters: ${this.count} </span>
                             </div>
                             `;
   }
@@ -76128,7 +76128,7 @@ const BL = new Oe("mention"), UL = xe.create({
   "image-keep-current": "保持当前",
   "image-original-size": "图片原始大小",
   //// ai
-  "placeholder-tell-ai-what-to-do-next": "告诉 AI 下一步应该如何?比如:帮我翻译成英语",
+  "placeholder-tell-ai-what-to-do-next": "告诉 AI 下一步应该做什么",
   "tip-you-can-enter-text-above-or-select-the-operation-below": "提示:您可以在上面输入文字或者选择下方的操作",
   "you-can-do-the-following": "您可以进行以下操作:",
   "improve-writing": "改进写作",
@@ -80582,10 +80582,10 @@ class rB {
   }
 }
 export {
-  rB as AiEditor,
   zn as AiModelManager,
   tR as CustomAiModel,
   V4 as InnerEditor,
+  rB as LinwitDocEditor,
   nR as OpenaiAiModel,
   Qv as SparkAiModel,
   Zv as WenXinAiModel

+ 0 - 8
index.html

@@ -24,14 +24,6 @@
                 localStorage.setItem("lang", "zh");
             }
         }
-
-        var _hmt = _hmt || [];
-        (function () {
-            var hm = document.createElement("script");
-            hm.src = "https://hm.baidu.com/hm.js?9fd447a0f9e62a84d1b752a2cacb2c6b";
-            var s = document.getElementsByTagName("script")[0];
-            s.parentNode.insertBefore(hm, s);
-        })();
     </script>
         <style>
             .aie-theme-light {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "linwitdoc-editor",
-  "version": "1.5.1",
+  "version": "1.5.2",
   "type": "module",
   "keywords": [
     "editor",

+ 2 - 2
src/ai/AiGlobalConfig.ts

@@ -1,7 +1,7 @@
 import {AiModelConfig} from "./core/AiModelConfig.ts";
 import {AiModelFactory} from "./AiModelFactory.ts";
 import {AIBubbleMenuItem, TranslateMenuItem} from "../components/bubbles/types.ts";
-import {AiEditor} from "../core/AiEditor.ts";
+import {LinwitDocEditor} from "../core/LinwitDocEditor.ts";
 
 export interface AiMenu {
     icon: string,
@@ -9,7 +9,7 @@ export interface AiMenu {
     prompt?: string,
     text?: "selected" | "focusBefore",
     model?: string,
-    onClick?: (event: MouseEvent, editor: AiEditor) => void,
+    onClick?: (event: MouseEvent, editor: LinwitDocEditor) => void,
     children?: AiMenu[],
 }
 

+ 1 - 1
src/ai/AiModelManager.ts

@@ -4,7 +4,7 @@ import {SparkAiModel} from "./spark/SparkAiModel.ts";
 import {WenXinAiModel} from "./wenxin/WenXinAiModel.ts";
 import {CustomAiModel} from "./custom/CustomAiModel.ts";
 import {OpenaiAiModel} from "./openai/OpenaiAiModel.ts";
-import {InnerEditor} from "../core/AiEditor.ts";
+import {InnerEditor} from "../core/LinwitDocEditor.ts";
 import {GiteeAiModel} from "./gitee/GiteeAiModel.ts";
 
 export class AiModelManager {

+ 1 - 1
src/ai/core/AiModel.ts

@@ -2,7 +2,7 @@ import {AiMessageListener} from "./AiMessageListener.ts";
 import {AiClient} from "./AiClient.ts";
 import {AiGlobalConfig} from "../AiGlobalConfig.ts";
 import {AiModelConfig} from "./AiModelConfig.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 
 export abstract class AiModel {

+ 1 - 1
src/ai/core/DefaultAiMessageListener.ts

@@ -1,7 +1,7 @@
 import {AiMessage} from "./AiMessage.ts";
 import {AiMessageListener} from "./AiMessageListener.ts";
 import {Editor} from "@tiptap/core";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 import {getText} from "../../util/getText.ts";
 
 export interface AiMessageParserOptions {

+ 1 - 1
src/ai/custom/CustomAiModel.ts

@@ -6,7 +6,7 @@ import {CustomAiModelConfig} from "./CustomAiModelConfig.ts";
 import {SseClient} from "../core/client/sse/SseClient.ts";
 import {AiClientListener} from "../core/AiClientListener.ts";
 import {WebSocketClient} from "../core/client/ws/WebSocketClient.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 import {HttpStreamSocketClient} from "../core/client/http/HttpSocketClient.ts";
 
 export class CustomAiModel extends AiModel {

+ 1 - 1
src/ai/gitee/GiteeAiModel.ts

@@ -3,7 +3,7 @@ import {AiMessageListener} from "../core/AiMessageListener.ts";
 import {AiModel} from "../core/AiModel.ts";
 import {AiGlobalConfig} from "../AiGlobalConfig.ts";
 import {SseClient} from "../core/client/sse/SseClient.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 import {GiteeModelConfig} from "./GiteeModelConfig.ts";
 
 

+ 1 - 1
src/ai/openai/OpenaiAiModel.ts

@@ -4,7 +4,7 @@ import {AiModel} from "../core/AiModel.ts";
 import {AiGlobalConfig} from "../AiGlobalConfig.ts";
 import {OpenaiModelConfig} from "./OpenaiModelConfig.ts";
 import {SseClient} from "../core/client/sse/SseClient.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 
 export class OpenaiAiModel extends AiModel {

+ 1 - 1
src/ai/spark/SparkAiModel.ts

@@ -10,7 +10,7 @@ import hmacSHA256 from 'crypto-js/hmac-sha256';
 // @ts-ignore
 import Base64 from 'crypto-js/enc-base64';
 import {uuid} from "../../util/uuid.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 export class SparkAiModel extends AiModel {
 

+ 1 - 1
src/ai/wenxin/WenXinAiModel.ts

@@ -4,7 +4,7 @@ import {AiModel} from "../core/AiModel.ts";
 import {HttpStreamSocketClient} from "../core/client/http/HttpSocketClient.ts";
 import {AiGlobalConfig} from "../AiGlobalConfig.ts";
 import {WenXinAiModelConfig} from "./WenXinAiModelConfig.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 
 export class WenXinAiModel extends AiModel {

+ 1 - 1
src/components/AbstractBubbleMenu.ts

@@ -1,4 +1,4 @@
-import {AiEditorOptions, AiEditorEventListener, InnerEditor} from "../core/AiEditor.ts";
+import {AiEditorOptions, AiEditorEventListener, InnerEditor} from "../core/LinwitDocEditor.ts";
 import {Editor, EditorEvents} from "@tiptap/core";
 import tippy, {Instance} from "tippy.js";
 import {BubbleMenuItem} from "./bubbles/types.ts";

+ 1 - 1
src/components/AbstractMenuButton.ts

@@ -1,4 +1,4 @@
-import {AiEditorOptions, AiEditorEventListener, InnerEditor} from "../core/AiEditor.ts";
+import {AiEditorOptions, AiEditorEventListener, InnerEditor} from "../core/LinwitDocEditor.ts";
 import {Editor, EditorEvents} from "@tiptap/core";
 // @ts-ignore
 import {ChainedCommands} from "@tiptap/core/dist/packages/core/src/types";

+ 3 - 3
src/components/Footer.ts

@@ -1,4 +1,4 @@
-import {AiEditorOptions, AiEditorEventListener} from "../core/AiEditor.ts";
+import {AiEditorOptions, AiEditorEventListener} from "../core/LinwitDocEditor.ts";
 import {EditorEvents} from "@tiptap/core";
 
 
@@ -67,12 +67,12 @@ export class Footer extends HTMLElement implements AiEditorEventListener {
     updateCharacters() {
         if (!this.draggable) {
             this.innerHTML = `<div style="display: flex;"> 
-                                <span style="margin-right: 10px"> Powered by AiEditor, Characters: ${this.count} </span>
+                                <span style="margin-right: 10px"> Powered by LinwitDocEditor, Characters: ${this.count} </span>
                             </div>
                             `;
         } else {
             this.innerHTML = `<div style="display: flex"> 
-                                <span> Powered by AiEditor, Characters: ${this.count} </span>
+                                <span> Powered by LinwitDocEditor, Characters: ${this.count} </span>
                                 <div style="width: 20px;height: 20px;overflow: hidden">
                                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 16L6 10H18L12 16Z"></path></svg>
                                 </div>

+ 1 - 1
src/components/Header.ts

@@ -1,4 +1,4 @@
-import {AiEditorOptions, AiEditorEventListener} from "../core/AiEditor.ts";
+import {AiEditorOptions, AiEditorEventListener} from "../core/LinwitDocEditor.ts";
 import {EditorEvents} from "@tiptap/core";
 import {Undo} from "./menus/Undo";
 import {AbstractMenuButton} from "./AbstractMenuButton.ts";

+ 1 - 1
src/components/bubbles/ImageBubbleMenu.ts

@@ -1,6 +1,6 @@
 import {AbstractBubbleMenu} from "../AbstractBubbleMenu.ts";
 import {EditorEvents} from "@tiptap/core";
-import {AiEditorOptions} from "../../core/AiEditor.ts";
+import {AiEditorOptions} from "../../core/LinwitDocEditor.ts";
 import {AllImageMenuItems} from "./items/image/AllImageMenuItems.ts";
 
 export class ImageBubbleMenu extends AbstractBubbleMenu {

+ 1 - 1
src/components/bubbles/LinkBubbleMenu.ts

@@ -1,6 +1,6 @@
 import {AbstractBubbleMenu} from "../AbstractBubbleMenu.ts";
 import {EditorEvents} from "@tiptap/core";
-import {AiEditorOptions} from "../../core/AiEditor.ts";
+import {AiEditorOptions} from "../../core/LinwitDocEditor.ts";
 import {AllLinkMenuItems} from "./items/link/AllLinkMenuItems.ts";
 
 

+ 1 - 1
src/components/bubbles/TableBubbleMenu.ts

@@ -2,7 +2,7 @@ import {AbstractBubbleMenu} from "../AbstractBubbleMenu.ts";
 import {Editor, EditorEvents} from "@tiptap/core";
 import {CellSelection, TableMap} from '@tiptap/pm/tables';
 import {EditorView} from "@tiptap/pm/view";
-import {AiEditorOptions} from "../../core/AiEditor.ts";
+import {AiEditorOptions} from "../../core/LinwitDocEditor.ts";
 
 export class TableBubbleMenu extends AbstractBubbleMenu {
     constructor() {

+ 1 - 1
src/components/bubbles/TextSelectionBubbleMenu.ts

@@ -1,6 +1,6 @@
 import {AbstractBubbleMenu} from "../AbstractBubbleMenu.ts";
 import {EditorEvents} from "@tiptap/core";
-import {AiEditorOptions} from "../../core/AiEditor.ts";
+import {AiEditorOptions} from "../../core/LinwitDocEditor.ts";
 import {AllSelectionMenuItems} from "./items/selection/AllSelectionMenuItems.ts";
 import {BubbleMenuItem} from "./types.ts";
 import {removeIf} from "../../util/removeIf.ts";

+ 1 - 1
src/components/bubbles/items/selection/AI.ts

@@ -1,6 +1,6 @@
 import {AIBubbleMenuItem, BubbleMenuItem} from "../../types.ts";
 import {t} from "i18next";
-import {InnerEditor} from "../../../../core/AiEditor.ts";
+import {InnerEditor} from "../../../../core/LinwitDocEditor.ts";
 import {AiModelManager} from "../../../../ai/AiModelManager.ts";
 import {Svgs} from "../../../../commons/Svgs.ts";
 import {AiClient} from "../../../../ai/core/AiClient.ts";

+ 1 - 1
src/components/bubbles/items/selection/Translate.ts

@@ -1,6 +1,6 @@
 import {BubbleMenuItem, TranslateMenuItem} from "../../types.ts";
 import {t} from "i18next";
-import {InnerEditor} from "../../../../core/AiEditor.ts";
+import {InnerEditor} from "../../../../core/LinwitDocEditor.ts";
 import {AiModelManager} from "../../../../ai/AiModelManager.ts";
 import {AiClient} from "../../../../ai/core/AiClient.ts";
 import tippy, {Instance} from "tippy.js";

+ 4 - 4
src/components/bubbles/types.ts

@@ -1,4 +1,4 @@
-import {AiEditor} from "../../core/AiEditor.ts";
+import {LinwitDocEditor} from "../../core/LinwitDocEditor.ts";
 import {Instance} from "tippy.js";
 
 export type BubbleMenuItem = {
@@ -6,9 +6,9 @@ export type BubbleMenuItem = {
     title?: string,
     icon: string,
     holder?: any,
-    isActive?: (editor: AiEditor) => boolean,
-    onInit?: (editor: AiEditor, tippyInstance: Instance, parentEle: HTMLElement) => any;
-    onClick?: (editor: AiEditor, tippyInstance: Instance, parentEle: HTMLElement, holder: any) => void;
+    isActive?: (editor: LinwitDocEditor) => boolean,
+    onInit?: (editor: LinwitDocEditor, tippyInstance: Instance, parentEle: HTMLElement) => any;
+    onClick?: (editor: LinwitDocEditor, tippyInstance: Instance, parentEle: HTMLElement, holder: any) => void;
 }
 
 export type AIBubbleMenuItem = {

+ 1 - 1
src/components/menus/Ai.ts

@@ -1,6 +1,6 @@
 import {AbstractDropdownMenuButton} from "../AbstractDropdownMenuButton.ts";
 import {Editor, EditorEvents} from "@tiptap/core";
-import {AiEditorOptions} from "../../core/AiEditor.ts";
+import {AiEditorOptions} from "../../core/LinwitDocEditor.ts";
 import {AiModelManager} from "../../ai/AiModelManager.ts";
 import {AiMenu} from "../../ai/AiGlobalConfig.ts";
 import {DefaultAiMessageListener} from "../../ai/core/DefaultAiMessageListener.ts";

+ 1 - 1
src/components/menus/Attachment.ts

@@ -1,5 +1,5 @@
 import {AbstractMenuButton} from "../AbstractMenuButton.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 export class Attachment extends AbstractMenuButton {
 

+ 1 - 1
src/components/menus/Custom.ts

@@ -1,5 +1,5 @@
 import {AbstractMenuButton} from "../AbstractMenuButton.ts";
-import {CustomMenu, InnerEditor} from "../../core/AiEditor.ts";
+import {CustomMenu, InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 export class Custom extends AbstractMenuButton {
 

+ 1 - 1
src/components/menus/Emoji.ts

@@ -1,5 +1,5 @@
 import {EditorEvents} from "@tiptap/core";
-import {AiEditorOptions, InnerEditor} from "../../core/AiEditor.ts";
+import {AiEditorOptions, InnerEditor} from "../../core/LinwitDocEditor.ts";
 import {AbstractMenuButton} from "../AbstractMenuButton.ts";
 import tippy, {Instance} from "tippy.js";
 

+ 1 - 1
src/components/menus/FontFamily.ts

@@ -1,6 +1,6 @@
 import {AbstractDropdownMenuButton} from "../AbstractDropdownMenuButton.ts";
 import {Editor, EditorEvents} from "@tiptap/core";
-import {AiEditorOptions, NameAndValue} from "../../core/AiEditor.ts";
+import {AiEditorOptions, NameAndValue} from "../../core/LinwitDocEditor.ts";
 import {t} from "i18next";
 
 

+ 1 - 1
src/components/menus/FontSize.ts

@@ -1,6 +1,6 @@
 import {Editor, EditorEvents} from "@tiptap/core";
 import {AbstractDropdownMenuButton} from "../AbstractDropdownMenuButton.ts";
-import {AiEditorOptions, NameAndValue} from "../../core/AiEditor.ts";
+import {AiEditorOptions, NameAndValue} from "../../core/LinwitDocEditor.ts";
 import {t} from "i18next";
 
 

+ 1 - 1
src/components/menus/Group.ts

@@ -1,5 +1,5 @@
 import {EditorEvents} from "@tiptap/core";
-import {AiEditorOptions, MenuGroup} from "../../core/AiEditor.ts";
+import {AiEditorOptions, MenuGroup} from "../../core/LinwitDocEditor.ts";
 import {AbstractMenuButton} from "../AbstractMenuButton.ts";
 import {initToolbarKeys} from "../../util/initToolbarKeys.ts";
 import tippy, {Instance} from "tippy.js";

+ 1 - 1
src/components/menus/Image.ts

@@ -1,5 +1,5 @@
 import {AbstractMenuButton} from "../AbstractMenuButton.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 export class Image extends AbstractMenuButton {
 

+ 1 - 1
src/components/menus/LineHeight.ts

@@ -1,6 +1,6 @@
 import {Editor, EditorEvents} from "@tiptap/core";
 import {AbstractDropdownMenuButton} from "../AbstractDropdownMenuButton.ts";
-import {AiEditorOptions} from "../../core/AiEditor.ts";
+import {AiEditorOptions} from "../../core/LinwitDocEditor.ts";
 
 
 const titles = ["1.0", "1.25", "1.5", "2.0", "2.5", "3.0"];

+ 1 - 1
src/components/menus/Video.ts

@@ -1,5 +1,5 @@
 import {AbstractMenuButton} from "../AbstractMenuButton.ts";
-import {InnerEditor} from "../../core/AiEditor.ts";
+import {InnerEditor} from "../../core/LinwitDocEditor.ts";
 
 export class Video extends AbstractMenuButton {
 

+ 16 - 16
src/core/AiEditor.ts → src/core/LinwitDocEditor.ts

@@ -77,8 +77,8 @@ export interface CustomMenu {
     icon?: string
     html?: string
     tip?: string
-    onClick?: (event: MouseEvent, editor: AiEditor) => void
-    onCreate?: (button: HTMLElement, editor: AiEditor) => void
+    onClick?: (event: MouseEvent, editor: LinwitDocEditor) => void
+    onCreate?: (button: HTMLElement, editor: LinwitDocEditor) => void
 }
 
 export interface MenuGroup {
@@ -107,14 +107,14 @@ export type AiEditorOptions = {
     placeholder?: string,
     theme?: "light" | "dark",
     onMentionQuery?: (query: string) => any[] | Promise<any[]>,
-    onCreateBefore?: (editor: AiEditor, extensions: Extensions) => void | Extensions,
-    onCreated?: (editor: AiEditor) => void,
-    onChange?: (editor: AiEditor) => void,
-    onTransaction?: (editor: AiEditor, transaction: Transaction) => void,
-    onFocus?: (editor: AiEditor) => void,
-    onBlur?: (editor: AiEditor) => void,
-    onDestroy?: (editor: AiEditor) => void,
-    onSave?: (editor: AiEditor) => boolean,
+    onCreateBefore?: (editor: LinwitDocEditor, extensions: Extensions) => void | Extensions,
+    onCreated?: (editor: LinwitDocEditor) => void,
+    onChange?: (editor: LinwitDocEditor) => void,
+    onTransaction?: (editor: LinwitDocEditor, transaction: Transaction) => void,
+    onFocus?: (editor: LinwitDocEditor) => void,
+    onBlur?: (editor: LinwitDocEditor) => void,
+    onDestroy?: (editor: LinwitDocEditor) => void,
+    onSave?: (editor: LinwitDocEditor) => boolean,
     onFullscreen?: (isFullscreen: boolean) => void,
     toolbarKeys?: (string | CustomMenu | MenuGroup)[],
     alwaysEnabledToolbarKeys?: string[],
@@ -144,7 +144,7 @@ export type AiEditorOptions = {
     },
     uploader?: Uploader,
     image?: {
-        customMenuInvoke?: (editor: AiEditor) => void;
+        customMenuInvoke?: (editor: LinwitDocEditor) => void;
         uploadUrl?: string,
         uploadHeaders?: (() => Record<string, any>) | Record<string, any>,
         uploadFormName?: string,
@@ -156,7 +156,7 @@ export type AiEditorOptions = {
         bubbleMenuItems?: (string | BubbleMenuItem)[],
     },
     video?: {
-        customMenuInvoke?: (editor: AiEditor) => void;
+        customMenuInvoke?: (editor: LinwitDocEditor) => void;
         uploadUrl?: string,
         uploadHeaders?: (() => Record<string, any>) | Record<string, any>,
         uploadFormName?: string,
@@ -164,7 +164,7 @@ export type AiEditorOptions = {
         uploaderEvent?: UploaderEvent,
     },
     attachment?: {
-        customMenuInvoke?: (editor: AiEditor) => void;
+        customMenuInvoke?: (editor: LinwitDocEditor) => void;
         uploadUrl?: string,
         uploadHeaders?: (() => Record<string, any>) | Record<string, any>,
         uploadFormName?: string,
@@ -200,9 +200,9 @@ const defaultOptions: Partial<AiEditorOptions> = {
 
 export class InnerEditor extends Tiptap {
 
-    linwitDocEditor: AiEditor;
+    linwitDocEditor: LinwitDocEditor;
 
-    constructor(linwitDocEditor: AiEditor, options: Partial<EditorOptions> = {}) {
+    constructor(linwitDocEditor: LinwitDocEditor, options: Partial<EditorOptions> = {}) {
         super(options);
         this.linwitDocEditor = linwitDocEditor;
     }
@@ -226,7 +226,7 @@ export class InnerEditor extends Tiptap {
     }
 }
 
-export class AiEditor {
+export class LinwitDocEditor {
 
     customLayout: boolean = false;
 

+ 6 - 6
src/core/getBubbleMenus.ts

@@ -1,5 +1,5 @@
 import {Extension, Extensions, getTextBetween, posToDOMRect} from "@tiptap/core";
-import {AiEditor} from "./AiEditor.ts";
+import {LinwitDocEditor} from "./LinwitDocEditor.ts";
 import {BubbleMenuOptions, BubbleMenuPlugin} from "../components/bubbles/BubbleMenuPlugin.ts";
 
 import {LinkBubbleMenu} from "../components/bubbles/LinkBubbleMenu.ts";
@@ -47,7 +47,7 @@ function createBubbleMenu(name: string, options: BubbleMenuOptions) {
 }
 
 
-const createTextSelectionBubbleMenu = (linwitDocEditor: AiEditor) => {
+const createTextSelectionBubbleMenu = (linwitDocEditor: LinwitDocEditor) => {
     const elementTagName = linwitDocEditor.options.textSelectionBubbleMenu?.elementTagName || "linwiteditor-bubble-text";
     const menuEl = document.createElement(elementTagName) as TextSelectionBubbleMenu;
     linwitDocEditor.eventComponents.push(menuEl);
@@ -85,7 +85,7 @@ const createTextSelectionBubbleMenu = (linwitDocEditor: AiEditor) => {
 }
 
 
-const createLinkBubbleMenu = (linwitDocEditor: AiEditor) => {
+const createLinkBubbleMenu = (linwitDocEditor: LinwitDocEditor) => {
     const menuEl = document.createElement("linwiteditor-bubble-link") as AbstractBubbleMenu;
     linwitDocEditor.eventComponents.push(menuEl);
     return createBubbleMenu("linkBubble", {
@@ -106,7 +106,7 @@ const createLinkBubbleMenu = (linwitDocEditor: AiEditor) => {
 }
 
 
-const createImageBubbleMenu = (linwitDocEditor: AiEditor) => {
+const createImageBubbleMenu = (linwitDocEditor: LinwitDocEditor) => {
     const menuEl = document.createElement("linwiteditor-bubble-image") as AbstractBubbleMenu;
     linwitDocEditor.eventComponents.push(menuEl);
     return createBubbleMenu("imageBubble", {
@@ -143,7 +143,7 @@ const createImageBubbleMenu = (linwitDocEditor: AiEditor) => {
 }
 
 
-const createTableBubbleMenu = (linwitDocEditor: AiEditor) => {
+const createTableBubbleMenu = (linwitDocEditor: LinwitDocEditor) => {
     const menuEl = document.createElement("linwiteditor-bubble-table") as AbstractBubbleMenu;
     linwitDocEditor.eventComponents.push(menuEl);
     return createBubbleMenu("tableBubble", {
@@ -178,7 +178,7 @@ const createTableBubbleMenu = (linwitDocEditor: AiEditor) => {
 }
 
 
-export const getBubbleMenus = (linwitDocEditor: AiEditor): Extensions => {
+export const getBubbleMenus = (linwitDocEditor: LinwitDocEditor): Extensions => {
     const bubbleMenus: Extensions = [];
     if (linwitDocEditor.options.editable === false) {
         return bubbleMenus;

+ 2 - 2
src/core/getExtensions.ts

@@ -29,7 +29,7 @@ import {IFrameExt} from "../extensions/IFrameExt.ts";
 import {getBubbleMenus} from "./getBubbleMenus.ts";
 import {Placeholder} from "@tiptap/extension-placeholder";
 import {createMention} from "../extensions/MentionExt.ts";
-import {AiEditor, AiEditorOptions} from "./AiEditor.ts";
+import {LinwitDocEditor, AiEditorOptions} from "./LinwitDocEditor.ts";
 import {AiCommandExt, defaultCommands} from "../extensions/AiCommandExt.ts";
 import {SelectionMarkerExt} from "../extensions/SelectionMarkerExt.ts";
 import {ContainerExt, defaultItems} from "../extensions/ContainerExt.ts";
@@ -40,7 +40,7 @@ import {FigcaptionExt} from "../extensions/FigcaptionExt.ts";
 import {PasteExt} from "../extensions/PasteExt.ts";
 import {ClassNameExt} from "../extensions/ClassNameExt.ts";
 
-export const getExtensions = (editor: AiEditor, options: AiEditorOptions): Extensions => {
+export const getExtensions = (editor: LinwitDocEditor, options: AiEditorOptions): Extensions => {
     // the Collaboration extension comes with its own history handling
     const ret: Extensions = [StarterKit.configure({
         codeBlock: false,

+ 1 - 1
src/extensions/AiCommandExt.ts

@@ -5,7 +5,7 @@ import Suggestion, {SuggestionOptions, SuggestionProps} from '@tiptap/suggestion
 
 import tippy, {Instance} from "tippy.js";
 import {AiModelManager} from "../ai/AiModelManager.ts";
-import {AiEditorOptions, InnerEditor} from "../core/AiEditor.ts";
+import {AiEditorOptions, InnerEditor} from "../core/LinwitDocEditor.ts";
 import {DefaultAiMessageListener} from "../ai/core/DefaultAiMessageListener.ts";
 import {AiMenu} from "../ai/AiGlobalConfig.ts";
 

+ 1 - 1
src/extensions/AttachmentExt.ts

@@ -4,7 +4,7 @@ import {DecorationSet} from "prosemirror-view";
 import {createAttachmentDecoration} from "../util/decorations.ts";
 import {Extension} from "@tiptap/core";
 import {getUploader} from "../util/getUploader.ts";
-import {Uploader, UploaderEvent} from "../core/AiEditor.ts";
+import {Uploader, UploaderEvent} from "../core/LinwitDocEditor.ts";
 
 export interface AttachmentOptions {
     HTMLAttributes: Record<string, any>,

+ 1 - 1
src/extensions/ImageExt.ts

@@ -9,7 +9,7 @@ import {TextSelection} from "prosemirror-state";
 import {uuid} from "../util/uuid.ts";
 import {createMediaDecoration} from "../util/decorations.ts";
 import {getUploader} from "../util/getUploader.ts";
-import {Uploader, UploaderEvent} from "../core/AiEditor.ts";
+import {Uploader, UploaderEvent} from "../core/LinwitDocEditor.ts";
 import {getWidthUnit} from '../util/getWidthUnit.ts';
 
 declare module '@tiptap/core' {

+ 1 - 1
src/extensions/PasteExt.ts

@@ -1,7 +1,7 @@
 import {Plugin} from 'prosemirror-state'
 import {Extension} from "@tiptap/core";
 import {PluginKey} from "@tiptap/pm/state";
-import {InnerEditor} from "../core/AiEditor.ts";
+import {InnerEditor} from "../core/LinwitDocEditor.ts";
 import {Slice} from '@tiptap/pm/model';
 import {cleanHtml, clearDataMpSlice, isExcelDocument, removeEmptyParagraphs, removeHtmlTags} from "../util/htmlUtil.ts";
 

+ 2 - 2
src/extensions/SaveExt.ts

@@ -1,9 +1,9 @@
 import {Extension} from "@tiptap/core";
-import {AiEditor, InnerEditor} from "../core/AiEditor.ts";
+import {LinwitDocEditor, InnerEditor} from "../core/LinwitDocEditor.ts";
 
 
 export interface SaveExtOptions {
-    onSave?: (e: AiEditor) => boolean,
+    onSave?: (e: LinwitDocEditor) => boolean,
 }
 
 export const SaveExt = Extension.create<SaveExtOptions>({

+ 1 - 1
src/extensions/VideoExt.ts

@@ -5,7 +5,7 @@ import {uuid} from "../util/uuid.ts";
 import {DecorationSet} from "prosemirror-view";
 import {createMediaDecoration} from "../util/decorations.ts";
 import {getUploader} from "../util/getUploader.ts";
-import {Uploader, UploaderEvent} from "../core/AiEditor.ts";
+import {Uploader, UploaderEvent} from "../core/LinwitDocEditor.ts";
 
 export interface VideoOptions {
     HTMLAttributes: Record<string, any>,

+ 1 - 2
src/i18n/zh.ts

@@ -108,7 +108,7 @@ export const zh  =  {
     "image-original-size":"图片原始大小",
 
     //// ai
-    "placeholder-tell-ai-what-to-do-next":"告诉 AI 下一步应该如何?比如:帮我翻译成英语",
+    "placeholder-tell-ai-what-to-do-next":"告诉 AI 下一步应该做什么",
     "tip-you-can-enter-text-above-or-select-the-operation-below":"提示:您可以在上面输入文字或者选择下方的操作",
     "you-can-do-the-following":"您可以进行以下操作:",
     "improve-writing":"改进写作",
@@ -126,5 +126,4 @@ export const zh  =  {
     "ai-optimization":"AI 优化",
     "ai-proofreading":"AI 校对",
     "ai-translation":"AI 翻译",
-
 }

+ 1 - 1
src/index.ts

@@ -1,4 +1,4 @@
-export * from './core/AiEditor.ts';
+export * from './core/LinwitDocEditor.ts';
 export * from './ai/AiGlobalConfig.ts';
 export * from './ai/AiModelFactory.ts';
 export * from './ai/AiModelManager.ts';

+ 2 - 2
src/main.ts

@@ -1,9 +1,9 @@
 // import { openai } from "./chatgpt.ts";
-import {AiEditor} from "./core/AiEditor.ts";
+import {LinwitDocEditor} from "./core/LinwitDocEditor.ts";
 // import { config } from "./spark.ts";
 // import {OpenaiModelConfig} from "./ai/openai/OpenaiModelConfig.ts";
 // @ts-ignore
-window.linwitDocEditor = new AiEditor({
+window.linwitDocEditor = new LinwitDocEditor({
     element: "#linwitDocEditor",
     placeholder: "点击输入内容...",
     contentRetention: true,

+ 1 - 1
src/util/base64Uploader.ts

@@ -1,4 +1,4 @@
-import { Uploader } from "../core/AiEditor";
+import { Uploader } from "../core/LinwitDocEditor";
 
 export const base64Uploader : Uploader = (file: File, _uploadUrl: string, _headers: Record<string, any>, _formName: string): Promise<Record<string, any>> => {
     let reader = new FileReader;

+ 1 - 1
src/util/fileUploader.ts

@@ -1,4 +1,4 @@
-import { Uploader } from "../core/AiEditor";
+import { Uploader } from "../core/LinwitDocEditor";
 
 export const fileUploader: Uploader = (file: File, uploadUrl: string, headers: Record<string, any>, formName: string): Promise<Record<string, any>> => {
     const formData = new FormData();

+ 1 - 1
src/util/initToolbarKeys.ts

@@ -1,4 +1,4 @@
-import {AiEditorOptions, CustomMenu, InnerEditor, MenuGroup} from "../core/AiEditor.ts";
+import {AiEditorOptions, CustomMenu, InnerEditor, MenuGroup} from "../core/LinwitDocEditor.ts";
 import {AbstractMenuButton} from "../components/AbstractMenuButton.ts";
 import {t} from "i18next";
 import tippy from "tippy.js";

部分文件因文件數量過多而無法顯示