Skip to content

Conversation

@dwelle
Copy link
Member

@dwelle dwelle commented Feb 10, 2025

<Excalidraw
  onDuplicate={(elements, prevElements) => {
    const prevElementsMap = arrayToMap(prevElements);
    return elements.map((el) => ({
      ...el,
      backgroundColor: !prevElementsMap.has(el.id)
        ? el.backgroundColor === "red"
          ? "yellow"
          : "red"
        : el.backgroundColor,
    }));
  }}
/>

excal-onduplicate

@vercel
Copy link

vercel bot commented Feb 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview Feb 10, 2025 2:19pm
excalidraw-package-example ✅ Ready (Inspect) Visit Preview Feb 10, 2025 2:19pm
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview Feb 10, 2025 2:19pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 2:19pm

@github-actions
Copy link

github-actions bot commented Feb 10, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 66.88% (🎯 60%) 68788 / 102841
🟢 Statements 66.88% (🎯 60%) 68788 / 102841
🟢 Functions 63.71% (🎯 63%) 1961 / 3078
🟢 Branches 79.8% (🎯 70%) 8313 / 10417
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/excalidraw/index.tsx 81.48% 88.88% 75% 81.48% 95-99, 158-207
packages/excalidraw/types.ts 100% 100% 100% 100%
packages/excalidraw/actions/actionDuplicateSelection.tsx 92.75% 89.47% 85.71% 92.75% 55-70, 75-82, 196-197
packages/excalidraw/components/App.tsx 70.1% 76.49% 71.5% 70.1% 509-510, 622-631, 731-732, 750-751, 772-832, 835-841, 854-857, 860-936, 939-958, 961-966, 974-984, 986-987, 992-993, 997-999, 1013, 1020-1285, 1344-1348, 1352-1356, 1377-1378, 1395-1440, 1466, 1476, 1483-1486, 1495-1499, 1529-1535, 1549, 1620-1630, 1635-1650, 1654-1701, 1797-1802, 1831-1836, 1839-1869, 1877-1902, 1915-2006, 2009-2017, 2020-2079, 2082-2123, 2126-2131, 2166-2167, 2190-2191, 2223-2224, 2228-2229, 2249-2257, 2262-2275, 2281-2282, 2286, 2291-2299, 2301-2309, 2321, 2356-2357, 2370-2371, 2393-2394, 2401, 2422-2424, 2484-2486, 2489-2494, 2499-2500, 2540-2548, 2553-2562, 2606-2608, 2711-2712, 2716, 2719-2720, 2728-2731, 2740-2753, 2759-2762, 2765, 2767-2768, 2775-2776, 2782-2783, 2786-2787, 2798, 2800-2804, 2807-2808, 2811-2812, 2823-2831, 2836-2837, 2888-2889, 2903-2909, 2915-2923, 2927-2935, 2939-2940, 2943-2976, 2979-2991, 3002-3003, 3014-3015, 3032-3036, 3040-3043, 3050-3052, 3070-3077, 3080, 3082-3087, 3091-3093, 3139-3140, 3147-3149, 3151-3174, 3200, 3206, 3234-3236, 3275-3278, 3281-3282, 3299-3301, 3323-3324, 3330-3334, 3340-3421, 3475, 3479, 3514-3515, 3574, 3584-3602, 3605-3611, 3614-3615, 3621-3637, 3677-3702, 3785-3786, 3809-3823, 3831-3837, 3851-3852, 3858-3871, 3928-3929, 4001-4011, 4047, 4196-4197, 4199-4206, 4240-4244, 4246-4247, 4249-4252, 4273-4274, 4281-4282, 4304-4314, 4324-4326, 4328, 4416-4419, 4441-4449, 4453-4455, 4465-4466, 4468-4488, 4495-4518, 4521-4527, 4544-4547, 4562-4569, 4666-4670, 4674, 4682-4683, 4688-4692, 4725-4726, 4729-4730, 4742-4746, 4751-4752, 4758-4768, 4773-4800, 4805-4816, 4916-4917, 5001, 5026, 5052-5054, 5125-5126, 5144-5145, 5336-5337, 5340-5341, 5354-5355, 5402, 5463-5467, 5520-5527, 5529-5530, 5535-5601, 5645, 5702, 5729, 5736-5737, 5750-5753, 5784-5787, 5840-5843, 5846-5850, 5852-5859, 5876-5885, 5888-5889, 6007-6008, 6011, 6013-6018, 6024-6026, 6028, 6037, 6039, 6061-6066, 6068-6071, 6075-6076, 6085-6101, 6103, 6105-6108, 6112-6208, 6212-6213, 6228-6229, 6268-6275, 6302-6303, 6322-6323, 6351, 6353-6383, 6390-6391, 6413-6414, 6433, 6435-6478, 6483-6484, 6486-6487, 6503-6504, 6510-6511, 6515-6518, 6521-6522, 6536-6562, 6570-6571, 6575-6578, 6580-6584, 6602-6606, 6653-6658, 6660-6662, 6678, 6680-6693, 6718-6721, 6776, 6793-6794, 6796-6819, 6834-6835, 6949-6977, 7033-7034, 7097-7098, 7114-7115, 7134-7135, 7229, 7235-7236, 7259-7278, 7287-7296, 7310, 7459-7497, 7501-7551, 7566, 7575, 7609-7615, 7642-7644, 7816-7819, 7841-7871, 7884, 7886-7894, 7908, 7910-7918, 7925-7928, 7936-7941, 7950-7951, 7969-7986, 8033-8034, 8037-8039, 8042-8043, 8066-8067, 8073-8074, 8101-8102, 8185-8186, 8237-8250, 8254-8340, 8419-8422, 8448-8449, 8458-8460, 8516, 8539-8545, 8556-8567, 8595-8601, 8634, 8676, 8682, 8697-8704, 8707-8714, 8774, 8787, 8876-8877, 8898-8900, 8903, 8917-8941, 9050-9064, 9087-9111, 9120-9159, 9172-9173, 9183-9190, 9208-9215, 9269-9274, 9283-9307, 9309-9310, 9384-9385, 9392, 9394-9430, 9459, 9520, 9560-9562, 9587-9592, 9594-9595, 9600-9602, 9605-9625, 9639-9640, 9646-9655, 9660, 9664-9668, 9677-9681, 9684-9689, 9693-9700, 9729, 9731-9735, 9737-9747, 9763-9765, 9776-9784, 9788-9832, 9835-9906, 9914, 9932-9939, 9941-9963, 9978-10000, 10019-10021, 10073-10074, 10188-10192, 10194-10210, 10212-10216, 10228-10229, 10239-10255, 10274-10293, 10295-10296, 10323-10324, 10328-10329, 10339, 10341-10344, 10346-10347, 10387, 10428-10429, 10439, 10481, 10499-10507, 10518-10523, 10533-10534, 10536-10607, 10630-10631, 10663-10666, 10761-10768, 10794-10795, 10845-10916, 10964-10965, 10974-10977, 10982-10983, 11004-11006, 11008-11012, 11050
Generated in workflow #4280 for commit b3b5329 by the Vitest Coverage Report Action

Copy link
Contributor

@barnabasmolnar barnabasmolnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

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.

3 participants