leksy-editor 2.6.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -3
- package/backend.d.ts +2 -0
- package/dist/backend/index.js +2 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/index.mjs +2 -0
- package/dist/backend/index.mjs.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +478 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +478 -0
- package/dist/index.mjs.map +1 -0
- package/index.d.ts +2 -0
- package/package.json +30 -4
- package/types/backend.d.ts +89 -0
- package/types/index.d.ts +200 -0
- package/constant.js +0 -967
- package/contribution.md +0 -57
- package/gallery.js +0 -107
- package/index.js +0 -1028
- package/plugin.js +0 -1355
- package/style.css +0 -721
- package/tab.js +0 -709
- package/utilities.js +0 -4359
package/contribution.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Contribution Guide
|
|
2
|
-
|
|
3
|
-
Thank you for contributing to Leksy Editor.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
Leksy Editor is a JavaScript editor package with example integrations for React and Vue. The main source files live in the repository root, and example apps are available in the `examples/` directory.
|
|
8
|
-
|
|
9
|
-
## Getting Started
|
|
10
|
-
|
|
11
|
-
1. Fork the repository.
|
|
12
|
-
2. Clone your fork locally.
|
|
13
|
-
3. Install dependencies:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
npm install
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
4. Review the example projects if your change affects framework integrations:
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
cd examples/react && npm install
|
|
23
|
-
cd ../vue-cdn && npm install
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Contribution Workflow
|
|
27
|
-
|
|
28
|
-
1. Create a feature branch for your work.
|
|
29
|
-
2. Keep changes focused and avoid unrelated refactors.
|
|
30
|
-
3. Update documentation when behavior, APIs, or examples change.
|
|
31
|
-
4. Verify the impacted flows manually before opening a pull request.
|
|
32
|
-
|
|
33
|
-
## Code Guidelines
|
|
34
|
-
|
|
35
|
-
- Follow the existing code style and file structure.
|
|
36
|
-
- Prefer small, readable changes over large rewrites.
|
|
37
|
-
- Preserve backward compatibility unless the change is intentional and documented.
|
|
38
|
-
- If you add or change a plugin-related behavior, confirm the editor still works in the example apps.
|
|
39
|
-
|
|
40
|
-
## Testing
|
|
41
|
-
|
|
42
|
-
This repository does not currently include an automated test suite. Before submitting a change:
|
|
43
|
-
|
|
44
|
-
- Run the package locally and validate the affected editor behavior.
|
|
45
|
-
- Check the relevant example app when applicable.
|
|
46
|
-
- Confirm there are no obvious console errors or broken interactions.
|
|
47
|
-
|
|
48
|
-
## Pull Request Checklist
|
|
49
|
-
|
|
50
|
-
- The change is limited to the intended scope.
|
|
51
|
-
- Documentation has been updated if needed.
|
|
52
|
-
- Example usage has been reviewed if the public API changed.
|
|
53
|
-
- Manual verification has been completed.
|
|
54
|
-
|
|
55
|
-
## Contributor Reference
|
|
56
|
-
|
|
57
|
-
Profile: [Chetan Gupta](https://github.com/chetanguptamrt)
|
package/gallery.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const giphy = {
|
|
3
|
-
search: async (options, search, page=1) => {
|
|
4
|
-
try {
|
|
5
|
-
const response = await fetch(`https://api.giphy.com/v1/gifs/search?api_key=${options.giphyApiKey}&q=${encodeURIComponent(search)}&limit=50&offset=${(page - 1) * 50}`)
|
|
6
|
-
if (response.ok) {
|
|
7
|
-
const { data, pagination } = await response.json()
|
|
8
|
-
return {
|
|
9
|
-
images: data.map(gif => ({ src: gif.images.fixed_height_small.url })),
|
|
10
|
-
totalPages: Math.ceil(pagination.total_count / 50) || 1,
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return { images: [], totalPages: 1 };
|
|
14
|
-
} catch (error) {
|
|
15
|
-
console.error(error)
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
suggestions: async (options, page=1) => {
|
|
19
|
-
try {
|
|
20
|
-
const response = await fetch(`https://api.giphy.com/v1/gifs/trending?api_key=${options.giphyApiKey}&limit=10&offset=${(page - 1) * 10}`)
|
|
21
|
-
if (response.ok) {
|
|
22
|
-
const { data, pagination } = await response.json()
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
images: data.map(gif => ({ src: gif.images.fixed_height_small.url })),
|
|
26
|
-
totalPages: Math.ceil(pagination.total_count / 10) || 1
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return { images: [], totalPages: 1 }
|
|
30
|
-
} catch (error) {
|
|
31
|
-
console.error(error)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const pexels = {
|
|
37
|
-
search: async (options, search, page = 1) => {
|
|
38
|
-
try {
|
|
39
|
-
const response = await fetch(`https://api.pexels.com/v1/search?query=${encodeURIComponent(search)}&per_page=50&page=${page}`, { headers: { Authorization: options.pexelsApiKey } })
|
|
40
|
-
if (response.ok) {
|
|
41
|
-
const { photos, total_results } = await response.json()
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
images: photos.map(photo => ({ src: photo.src.medium })),
|
|
45
|
-
totalPages: Math.ceil(total_results / 50) || 1
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else return { images: [], totalPages: 1 }
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error(error)
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
suggestions: async (options, page = 1) => {
|
|
54
|
-
try {
|
|
55
|
-
const response = await fetch(`https://api.pexels.com/v1/curated?per_page=10&page=${page}`, { headers: { Authorization: options.pexelsApiKey } })
|
|
56
|
-
if (response.ok) {
|
|
57
|
-
const { photos, total_results } = await response.json()
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
images: photos.map(photo => ({ src: photo.src.medium })),
|
|
61
|
-
totalPages: Math.ceil(total_results / 10) || 1
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else return { images: [], totalPages: 1 }
|
|
65
|
-
} catch (error) {
|
|
66
|
-
console.error(error)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const tenor = {
|
|
72
|
-
search: async (options, search, next="") => {
|
|
73
|
-
try {
|
|
74
|
-
const response = await fetch(`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(search)}&key=${options.tenorApiKey}&limit=50&pos=${next}`);
|
|
75
|
-
if (response.ok) {
|
|
76
|
-
const data = await response.json();
|
|
77
|
-
return {
|
|
78
|
-
images: data.results.map(gif => ({ src: gif.media_formats.webp.url })),
|
|
79
|
-
next:data.next
|
|
80
|
-
}
|
|
81
|
-
} else return { images: [], next: "" }
|
|
82
|
-
} catch (error) {
|
|
83
|
-
console.error(error)
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
suggestions: async (options, next="") => {
|
|
87
|
-
try {
|
|
88
|
-
const response = await fetch(`https://tenor.googleapis.com/v2/featured?key=${options.tenorApiKey}&limit=10&pos=${next}`);
|
|
89
|
-
if (response.ok) {
|
|
90
|
-
const data = await response.json();
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
images: data.results.map(gif => ({ src: gif.media_formats.webp.url })),
|
|
94
|
-
next:data.next
|
|
95
|
-
}
|
|
96
|
-
} else return { images: [], next: "" }
|
|
97
|
-
} catch (error) {
|
|
98
|
-
console.error(error)
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export {
|
|
104
|
-
giphy,
|
|
105
|
-
pexels,
|
|
106
|
-
tenor,
|
|
107
|
-
}
|