0.1.4-beta.88.9795 • Published 4 months ago

lexical-svelte-runes v0.1.4-beta.88.9795

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

the main check test branch

i forked lexical repo for tracking purpose fork, ideally we need to catch up commit by commit by i guess it is fine that we just add whatever is needed.

QuickStart

pnpm install lexical-svelte-runes@latest @unocss/reset
<script lang="ts">
	import '@unocss/reset/tailwind-compat.css'; //using unocss reset
	//import 'uno.css';
	import 'lexical-svelte-runes/uno.css'; // import all the generated classname, if you have uno or tailwind, you can ignore this
	import 'lexical-svelte-runes/index.css'; // react playground css
	import * as Editor from 'lexical-svelte-runes/editor';

	import { createHistoryContext } from 'lexical-svelte-runes/playground/context/SharedHistoryContext.js';
	import type { Settings } from 'lexical-svelte-runes/playground/appSettings.js';

	let { ...props }: Settings = $props(); // check Settings type for all the settings!

	createHistoryContext();
</script>

<Editor.SettingsContext settings={props}>
	<Editor.SharedAutocompleteContext>
		<Editor.LexicalComposer>
			<div class="editor-shell w-full">
				<Editor.Editor />
			</div>
		</Editor.LexicalComposer>
	</Editor.SharedAutocompleteContext>
</Editor.SettingsContext>

Goal

when importing a new plugin to lexical-svelte-runes, we can use external library instead of copy all the logic from react playground to keep code clean but at the same time we want to 'make sure the structure of our code is similar to react's so that it is easy to debug/maintain, a lot of times we can simply check the commits in rect to copy the changes over.

  • migrate to melt-ui/shadcn for components
  • use external library instead creating our own
    • image resize library
    • colorPicker components
    • ...
  • use feature based folder architecture instead of plugin folder and nodes folder
    • /dialog
        node.svelte
        plugin.svelte.ts

TODO

  1. codebase needs cleanup remove unused files,dependencies
  2. imports more components from lexical playground
  3. setup git actions & releases...

Contribute How-to

  1. since we use runes to polyfill react hook & svelte runes, it is super easy to port an component, simply copy the tsx into the right folder, then run autoFix.js to clean the import (removing $ by renaming imports) then fix the code to make it svelte-ish ! remember the output of useState const [fn,setFn]=useState() are both function just like solidjs

steps (wip)

(we also need to refractor the current repo, i.e move all plugins in to the same folder currently there are some naughty plugins outside )

  1. clone the lexical-svelte(the repo you are on now) repo - we will refer to the cloned repo 'svelte repo'
  2. clone official lexical repo - we will refer to the cloned repo 'react repo'
  3. go to https://playground.lexical.dev/ and pick something we dont have i.e font dropdown
  4. go to react repo, navigate to react playground package,
    1. go to toolbar and recursively copy the necessary code for font dropdown to svelte repo's toolbar
    2. go to editor.tsx , find the plugin for font dropdown (if there is one), recursively copy it over to svelte repo (you might also need to check https://github.com/facebook/lexical/tree/main/packages/lexical-react, we put put leixcal-playground and lexical-react in one package) , put it under src/playground/plugins/_, unlike react repo, we want to group by features, so all required files for a feature should be under src/plugins/_, dont need to create a separate nodes folder for nodes
    3. now you have a bunch of .tsx and .ts files under plugins/* , slowly convert each one to svelte files , for .ts you probably just need to fix the errors due to our svelte hooks !
    4. you can use autoFix to rename imports since svelte does not support $ in svelte files
    5. remember when you convert code to svelte , you can use external libs but please keep code structure as similar to the react repo as much as possible for easier debug later on!
    6. remember to add node to playgroundNodes after your ported from react's repo https://github.com/facebook/lexical/tree/main/packages/lexical-playground/src/nodes
    7. add converted plugins to the editor.tsx in svelte repo
    8. remove unused files
      1. i.e .tsx that you used autoFix.js on or some utilities that svelte don't need

todos...

  1. fully migration image inserts, captions (try use a image resize lib instead of writing custom resize logic...)
  2. excalidraw
  3. finish up autocomplete(current version is customized, i couldnt get lexical-playground's version to work)
  4. table
  5. sticky note
  6. tweet
  7. youtube videos
  8. figma
  9. charts, diagrams...
  10. columns layout
  11. lexical-devtool-core
0.1.4-beta.88.9792

4 months ago

0.1.4-beta.88.9791

4 months ago

0.1.4-beta.88.9795

4 months ago

0.1.4-beta.88.9794

4 months ago

0.1.4-beta.88.9793

4 months ago

0.1.4-beta.88.1

7 months ago

0.1.4-beta.88.2

7 months ago

0.1.4-beta.88.4

5 months ago

0.1.4-beta.88.5

5 months ago

0.1.4-beta.88.7

5 months ago

0.1.4-beta.88.8

5 months ago

0.1.4-beta.88.9

5 months ago

0.1.4-beta.88.96

5 months ago

0.1.4-beta.88.95

5 months ago

0.1.4-beta.88.97

5 months ago

0.1.4-beta.88.9711

5 months ago

0.1.4-beta.88.92

5 months ago

0.1.4-beta.88.91

5 months ago

0.1.4-beta.88.94

5 months ago

0.1.4-beta.88.93

5 months ago

0.1.4-beta.88.971

5 months ago

0.1.4-beta.88.976

5 months ago

0.1.4-beta.88.977

5 months ago

0.1.4-beta.88.978

4 months ago

0.1.4-beta.88.979

4 months ago

0.1.4-beta.88.972

5 months ago

0.1.4-beta.88.973

5 months ago

0.1.4-beta.88.974

5 months ago

0.1.4-beta.88.975

5 months ago

0.1.4-beta.88.71

5 months ago

0.1.4-beta.81

8 months ago

0.1.4-beta.85

7 months ago

0.1.4-beta.84

7 months ago

0.1.4-beta.83

7 months ago

0.1.4-beta.82

7 months ago

0.1.4-beta.87

7 months ago

0.1.4-beta.86

7 months ago

0.1.4-beta.0

10 months ago

0.1.4-beta.69.87

10 months ago

0.1.4-beta.69.86

10 months ago

0.1.4-beta.100

10 months ago

0.1.4-beta.69.84.6

10 months ago

0.1.4-beta.69.84.9

10 months ago

0.1.4-beta.69.85.1

10 months ago

0.1.4-beta.69.85.0

10 months ago

0.1.4-beta.70

10 months ago

0.1.4-beta.74

10 months ago

0.1.4-beta.73

10 months ago

0.1.4-beta.71

10 months ago

0.1.4-beta.78

9 months ago

0.1.4-beta.77

10 months ago

0.1.4-beta.76

10 months ago

0.1.4-beta.75

10 months ago

0.1.4-beta.69.87.1

10 months ago

0.1.4-beta.69.87.5

10 months ago

0.1.4-beta.69.87.3

10 months ago

0.1.4-beta.69.87.2

10 months ago

0.1.4-beta.69.87.6

10 months ago

0.1.4-beta.69.84.7

12 months ago

0.1.4-beta.69.84.5

12 months ago

0.1.4-beta.69.1

1 year ago

0.1.4-beta.69.3

1 year ago

0.1.4-beta.69.5

1 year ago

0.1.4-beta.69.6

1 year ago

0.1.4-beta.69.8

1 year ago

0.1.4-beta.69

1 year ago

0.1.4-beta.68

1 year ago

0.1.4-beta.67

1 year ago

0.1.4-beta.66

1 year ago

0.1.4-beta.65

1 year ago

0.1.4-beta.64

1 year ago

0.1.4-beta.63

1 year ago

0.1.4-beta.62

1 year ago

0.1.4-beta.61

1 year ago

0.1.4-beta.59

1 year ago

0.1.4-beta.58

1 year ago

0.1.4-beta.60

1 year ago

0.1.4-beta.48

1 year ago

0.1.4-beta.52

1 year ago

0.1.4-beta.51

1 year ago

0.1.4-beta.50

1 year ago

0.1.4-beta.56

1 year ago

0.1.4-beta.55

1 year ago

0.1.4-beta.54

1 year ago

0.1.4-beta.53

1 year ago

0.1.4-beta.57

1 year ago

0.1.4-beta.53.1

1 year ago

0.1.4-beta.55.1

1 year ago

0.1.4-beta.49

1 year ago

0.1.4-beta.47

1 year ago

0.1.4-beta.46

1 year ago

0.1.4-beta.45

1 year ago

0.1.4-beta.44

1 year ago

0.1.4-beta.43

1 year ago

0.1.4-beta.42

1 year ago

0.1.4-beta.41

1 year ago

0.1.4-beta.38

1 year ago

0.1.4-beta.37

1 year ago

0.1.4-beta.36

1 year ago

0.1.4-beta.39

1 year ago

0.1.4-beta.40

1 year ago

0.1.4-beta.34

1 year ago

0.1.4-beta.32

1 year ago

0.1.4-beta.31

1 year ago

0.1.4-beta.30

1 year ago

0.1.4-beta.29

1 year ago

0.1.4-beta.27

1 year ago

0.1.4-beta.26

1 year ago

0.1.4-beta.28

1 year ago

0.1.4-beta.23

1 year ago

0.1.4-beta.24

1 year ago

0.1.4-beta.16

1 year ago

0.1.4-beta.15

1 year ago

0.1.4-beta.19

1 year ago

0.1.4-beta.18

1 year ago

0.1.4-beta.17

1 year ago

0.1.4-beta.22

1 year ago

0.1.4-beta.21

1 year ago

0.1.4-beta.20

1 year ago

0.1.4-beta.12

1 year ago

0.1.4-beta.11

1 year ago

0.1.4-beta.10

1 year ago

0.1.4-beta.14

1 year ago

0.1.4-beta.13

1 year ago

0.1.4-beta.9

1 year ago

0.1.4-beta.7

1 year ago

0.1.4-beta.2

1 year ago

0.1.4-beta.3

1 year ago

0.1.4-beta.4

1 year ago

0.1.4-beta.5

1 year ago

0.1.4-beta.1

1 year ago

0.1.2-beta.6

2 years ago

0.1.2-beta.7

2 years ago

0.1.3-beta.0

2 years ago

0.1.2-beta.8

2 years ago

0.1.2-beta.2

2 years ago

0.1.2-beta.3

2 years ago

0.1.2-beta.1

2 years ago

0.1.2-beta.4

2 years ago

0.1.1-alpha

2 years ago

0.1.2

2 years ago

0.1.2-beta

2 years ago

0.1.3

2 years ago

0.1.1-beta

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago