Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste Elements always as Elements even if we are writting in a textarea #4

Closed
wants to merge 4 commits into from

Conversation

ccanos
Copy link

@ccanos ccanos commented Feb 1, 2024

  • In App.tsx:2244 it checks if we are about to paste inside a text area and if so, it just returns from this function.
  • In App.tsx:2260 excalidraw parses the clipboard data and it may return valid excalidraw elements.
  • That let file = ... in App.tsx:2263 is there because they were losing files from the clipboard because of... the comment tries to explain it...
  • parseClipboardEvent and parseClipboard were async functions but they didn't have any await inside them.
  • So there is no need for that let file at all... I have moved those 2 lines together anyway to avoid more refactoring, but the only thing I need is to parse the clipboard content to see if there are elements inside and not return if so.

This may not be a full/proper solution so I have created an @alkemio/excalidraw package version @0.17.0-alkemio-3-beta to test it properly

@ccanos ccanos requested a review from me-andre February 1, 2024 16:11
Copy link

github-actions bot commented Feb 1, 2024

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 73.6% / 70% 44842 / 60919
🟢 Statements 73.6% / 70% 44842 / 60919
🟢 Functions 69.78% / 68% 1432 / 2052
🟢 Branches 81.06% / 70% 5639 / 6956
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/clipboard.ts 57.41% 72.05% 61.53% 57.41% 51-53, 79-80, 91-92, 94-95, 106-109, 111-112, 133-137, 142-145, 153, 155-160, 171-180, 231-235, 238-290, 322-323, 351-352, 374-401, 404-436, 440-479
src/components/App.tsx 73.19% 76.02% 73.05% 73.19% 420-421, 605-606, 632-692, 695-701, 704-707, 710-782, 785-804, 812-824, 829-830, 834-836, 855-957, 1017-1018, 1049-1054, 1059-1103, 1108, 1132, 1142, 1149-1152, 1187-1188, 1266-1272, 1364-1369, 1372-1402, 1405-1445, 1491-1492, 1510-1511, 1548-1549, 1553-1554, 1570-1577, 1582-1595, 1601-1602, 1607-1615, 1617-1625, 1637, 1667-1671, 1684-1685, 1707-1708, 1715, 1776-1778, 1781-1786, 1791-1792, 1827-1835, 1912-1914, 1975-1976, 1989-1992, 1995, 1997-1998, 2005-2006, 2012-2013, 2021-2022, 2025-2026, 2029-2032, 2035-2038, 2049-2057, 2062-2063, 2119-2120, 2134-2140, 2146-2154, 2158-2166, 2170-2171, 2174-2211, 2214-2226, 2237-2238, 2252, 2254-2255, 2267-2271, 2275-2278, 2285-2287, 2305-2312, 2315, 2317-2322, 2326-2328, 2344-2345, 2347-2356, 2382, 2388, 2427-2428, 2445-2447, 2469-2470, 2476-2479, 2485-2560, 2632-2633, 2638-2641, 2704, 2714-2732, 2735-2741, 2744-2745, 2751-2764, 2850-2851, 2853-2854, 2859-2861, 2868-2869, 2890-2904, 2909-2928, 2951-2952, 2985-2987, 3012, 3031-3035, 3046-3047, 3050-3054, 3056-3057, 3059-3062, 3087-3088, 3097-3099, 3101, 3176-3179, 3201-3203, 3213-3214, 3216-3236, 3239-3245, 3262-3265, 3271-3274, 3284-3291, 3295-3296, 3301, 3329-3333, 3337, 3342-3343, 3348-3352, 3384-3385, 3388-3389, 3397-3401, 3405-3415, 3420-3447, 3452-3463, 3522, 3548-3549, 3640, 3817-3818, 3821-3822, 3830, 3842, 3844-3845, 3886-3890, 3941-3947, 3953-4016, 4058, 4107, 4165, 4213-4216, 4219-4225, 4227-4230, 4245-4254, 4257-4258, 4339-4340, 4343, 4345-4346, 4352-4354, 4356, 4365, 4387-4392, 4394-4397, 4401-4402, 4412-4499, 4502-4503, 4517-4518, 4569-4570, 4597-4598, 4628-4654, 4661-4662, 4685-4686, 4706, 4708-4709, 4725-4726, 4732-4733, 4737-4740, 4743-4744, 4759-4786, 4794, 4796, 4798-4802, 4861-4866, 4868-4870, 4886, 4888-4899, 4924-4927, 4986-4987, 4989-5012, 5027-5028, 5140-5169, 5234-5238, 5261-5262, 5282-5283, 5376, 5382-5383, 5406-5425, 5440, 5573, 5596-5647, 5662, 5671, 5705-5711, 5726-5728, 5869-5873, 5897-5925, 5961, 5963-5970, 5977-5980, 5993, 6016-6017, 6020-6021, 6026-6028, 6031-6032, 6057-6058, 6086-6087, 6169-6170, 6219-6232, 6292-6295, 6321-6322, 6367, 6385-6391, 6398-6401, 6424-6429, 6500-6503, 6509, 6524-6531, 6534-6541, 6597, 6671-6672, 6692-6694, 6697, 6711-6735, 6841-6860, 6870-6909, 6922-6923, 6932-6939, 6953-6965, 6978-6983, 7035-7063, 7065-7066, 7140-7144, 7151, 7153-7189, 7218, 7268, 7287-7289, 7314-7319, 7321-7322, 7327-7358, 7361-7385, 7399-7400, 7406-7415, 7420, 7424-7428, 7437-7438, 7441-7446, 7450-7457, 7487, 7489-7493, 7495-7505, 7521-7523, 7534-7542, 7546-7582, 7585-7656, 7664, 7682-7689, 7691-7707, 7722-7744, 7763-7765, 7810-7811, 7841-7842, 7858, 7935-7938, 7940-7956, 7958-7962, 7974-7975, 7985-8001, 8035-8036, 8040-8052, 8062, 8064-8067, 8069-8070, 8110, 8131-8132, 8158, 8161, 8201, 8212-8219, 8235-8236, 8268-8271, 8340-8350, 8352-8362, 8393-8400, 8426-8427, 8468-8522, 8566-8567, 8576-8579, 8584-8585, 8606-8608, 8610-8614, 8652
src/element/textWysiwyg.tsx 85.45% 80.39% 84.21% 85.45% 60-61, 63-64, 149-150, 260-264, 343-366, 391-397, 399-401, 405, 512-514, 528-529, 538-543, 570-571, 579-580, 603, 609-637, 654, 656, 659-664, 691-694
Generated in workflow #2

@ccanos
Copy link
Author

ccanos commented Apr 19, 2024

Closed in favor of #5

@ccanos ccanos closed this Apr 19, 2024
@ccanos ccanos deleted the client-pasteElementsOnTextArea branch April 24, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant