{"id":16974665,"url":"https://github.com/WindRunnerMax/BlockKit","last_synced_at":"2025-04-12T00:32:05.355Z","repository":{"id":223682871,"uuid":"761229703","full_name":"WindRunnerMax/BlockKit","owner":"WindRunnerMax","description":"WYSIWYG Editor Widget","archived":false,"fork":false,"pushed_at":"2025-04-05T03:39:50.000Z","size":6116,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T04:24:11.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://WindRunnerMax.github.io/BlockKit/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WindRunnerMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-21T13:37:26.000Z","updated_at":"2025-04-05T03:39:25.000Z","dependencies_parsed_at":"2024-03-06T15:28:01.025Z","dependency_job_id":"16870fc8-c569-4ff1-a194-5ce297763092","html_url":"https://github.com/WindRunnerMax/BlockKit","commit_stats":{"total_commits":102,"total_committers":1,"mean_commits":102.0,"dds":0.0,"last_synced_commit":"f13923c697bd55dfbd09a8caed2ff38dbbe04976"},"previous_names":["windrunnermax/blockskit","windrunnermax/blockkit"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindRunnerMax%2FBlockKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindRunnerMax%2FBlockKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindRunnerMax%2FBlockKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindRunnerMax%2FBlockKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WindRunnerMax","download_url":"https://codeload.github.com/WindRunnerMax/BlockKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501409,"owners_count":21114674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T01:07:28.011Z","updated_at":"2025-04-12T00:32:05.341Z","avatar_url":"https://github.com/WindRunnerMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlockKit\n\n\u003cp\u003e\n\u003ca href=\"https://github.com/WindRunnerMax/BlockKit\"\u003eGitHub\u003c/a\u003e\n\u003cspan\u003e｜\u003c/span\u003e\n\u003ca href=\"https://windrunnermax.github.io/BlockKit/\"\u003eDEMO\u003c/a\u003e\n\u003cspan\u003e｜\u003c/span\u003e\n\u003ca href=\"./NOTE.md\"\u003eNOTE\u003c/a\u003e\n\u003cspan\u003e｜\u003c/span\u003e\n\u003ca href=\"https://github.com/WindRunnerMax/BlockKit/issues/1\"\u003eBLOG\u003c/a\u003e\n\u003c/p\u003e\n\n从零实现的富文本编辑器 `WYSIWYG Editor` \n\n## Why?\n\n纸上得来终觉浅，绝知此事要躬行。\n\n最初，希望基于 [Quill](https://github.com/slab/quill) 实现块结构组织的编辑器，却被跨行的选区问题所困扰。\n\n后来，希望基于 [Embed Blot](https://github.com/slab/parchment) 设计插件实现块结构的嵌套，却被复杂交互所需要的视图层实现掣肘。\n\n最终，希望能以 [Quill](https://github.com/slab/quill)、[Slate](https://github.com/ianstormtaylor/slate)、[EtherPad](https://github.com/ether/etherpad-lite) 的核心理念为参考，从零实现富文本编辑器，以便能够解决相关的问题，并且将一些想法付诸实现：\n\n- 现有编辑器引擎通常具有完整的`API`文档，却鲜有开发过程中的问题记录。因此希望能够将开发过程中的问题都记录下来，用以解决两个问题：为什么要这么设计、这种设计方案有什么优劣。\n\n- 嵌套的数据结构能够更好地对齐`DOM`表达，然而这样对于数据的操作却变得更加复杂。扁平的数据结构且独立分包设计，无论是在编辑器中操作，还是在服务端数据解析，都可以更加方便地处理。\n\n- 多数编辑器实现了自己的视图层，而重新设计视图层需要面临渲染问题，无法复用组件生态且存在新的学习成本。因此需要实现可扩展视图层的核心模式，在编辑器的设计上可以支持多种视图层的接入实现。\n\n- 无论是`OT`还是`CRDT`协同调度都不是简单的问题，编辑器内部的数据设计可能无法用于实时协同编辑。因此协同设计必须要从底层数据结构出发，在编辑器模块实现细节设计，整体方案上都需要考虑数据一致性。\n\n- 编辑器的模块可能是硬编码的，不容易对格式进行自定义。因此明确核心界限与插件优先架构的架构非常重要，核心实现和自定义模块之间的界限需要更加清晰，这就意味着任何富文本格式都应该通过插件的方式来实现。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWindRunnerMax%2FBlockKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWindRunnerMax%2FBlockKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWindRunnerMax%2FBlockKit/lists"}