diff --git a/.all-contributorsrc b/.all-contributorsrc index b0f4165cfb..55809f85bd 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -6013,7 +6013,9 @@ "profile": "https://aboutmonica.com", "contributions": [ "talk", - "example" + "example", + "doc", + "bug" ] }, { @@ -6413,6 +6415,36 @@ "contributions": [ "doc" ] + }, + { + "login": "mahaidong", + "name": "ma haidong", + "avatar_url": "https://avatars.githubusercontent.com/u/5458532?v=4", + "profile": "http://caad.xyz", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "Rishab87", + "name": "Rishab Kumar Jha", + "avatar_url": "https://avatars.githubusercontent.com/u/138858208?v=4", + "profile": "https://github.com/Rishab87", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "ImRAJAS-SAMSE", + "name": "Rajas Samse", + "avatar_url": "https://avatars.githubusercontent.com/u/122066293?v=4", + "profile": "https://github.com/ImRAJAS-SAMSE", + "contributions": [ + "code", + "doc" + ] } ], "repoType": "github", diff --git a/.github/ISSUE_TEMPLATE/1-p5.js-2.0-RFC-proposal.yml b/.github/ISSUE_TEMPLATE/1-p5.js-2.0-RFC-proposal.yml deleted file mode 100644 index f36459c09e..0000000000 --- a/.github/ISSUE_TEMPLATE/1-p5.js-2.0-RFC-proposal.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: 📃 p5.js 2.0 RFC Proposal -description: This template is for submitting a proposal to the p5.js 2.0 RFC. -title: "[p5.js 2.0 RFC Proposal]: " -labels: [p5.js 2.0] -body: - - type: textarea - attributes: - label: Increasing access - description: How would this proposal help [increase access](https://github.com/processing/p5.js/blob/main/contributor_docs/access.md) to p5.js? (If you're not sure, you can type "Unsure" here and let others from the community offer their thoughts.) - validations: - required: true - - type: markdown - attributes: - value: | - ### Acceptance criteria - The [p5.js 2.0 RFC](https://github.com/processing/p5.js/blob/dev-2.0/rfc_p5js_2.md) is a compilation of proposals for the next major version of p5.js. - - **✖️ New features**: In order to focus the community's efforts, proposals for new features will typically not be accepted into the RFC. A [New Feature Request](https://github.com/processing/p5.js/issues/new?assignees=&labels=Feature+Request&projects=&template=feature-request.yml) may still be submitted, but it will only be considered after the release of p5.js 2.0. - - **✔️Existing features**: This proposal will be accepted if the community determines it would improve an existing feature through a breaking change, a systemic change, or an overdue change. - - type: checkboxes - id: type-of-change - attributes: - label: Which types of changes would be made? - description: Please select at least one. - options: - - label: Breaking change (Add-on libraries or sketches will work differently even if their code stays the same.) - - label: Systemic change (Many features or contributor workflows will be affected.) - - label: Overdue change (Modifications will be made that have been desirable for a long time.) - - label: Unsure (The community can help to determine the type of change.) - - type: checkboxes - id: sub-area - attributes: - label: Most appropriate sub-area of p5.js? - description: Please select at least one. - options: - - label: Accessibility - - label: Color - - label: Core/Environment/Rendering - - label: Data - - label: DOM - - label: Events - - label: Image - - label: IO - - label: Math - - label: Typography - - label: Utilities - - label: WebGL - - label: Build process - - label: Unit testing - - label: Internationalization - - label: Friendly errors - - label: Other (specify if possible) - - type: textarea - attributes: - label: What's the problem? - description: Describe the problem this proposal aims to solve. (Use as much space as you need.) - validations: - required: true - - type: textarea - attributes: - label: What's the solution? - description: Describe how you would solve the problem. (For large proposals, a summary is fine; this proposal can link to sub-issues for details.) - validations: - required: true - - type: textarea - attributes: - label: Pros (updated based on community comments) - description: Indicate the advantages of implementing this proposal. If the community identifies more advantages in the comments, please add them. - value: | - Example list: - * **Consistency:** This proposal increases API consistency by... - * **Readability:** This proposal makes the source code more readable by... - * Other advantages... - validations: - required: true - - type: textarea - attributes: - label: Cons (updated based on community comments) - description: Indicate the disadvantages of implementing this proposal, if you know of any. If the community identifies disadvantages in the comments, please add them. - placeholder: None so far... - validations: - required: true - - type: dropdown - attributes: - label: Proposal status - options: - - Under review - - Accepted - - Not accepted - default: 0 - validations: - required: true - - type: markdown - attributes: - value: | - ### Implementation process - If this proposal is accepted, it will be included in the p5.js 2.0 RFC. A contributor who has participated in the discussion will then be assigned to lead the implementation, which will happen on the [dev-2.0](https://github.com/processing/p5.js/tree/dev-2.0) branch. diff --git a/.github/ISSUE_TEMPLATE/1-p5.js-2.0-bug-report.yml b/.github/ISSUE_TEMPLATE/1-p5.js-2.0-bug-report.yml new file mode 100644 index 0000000000..bb04352fa9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-p5.js-2.0-bug-report.yml @@ -0,0 +1,81 @@ +name: 📃 p5.js 2.0 Beta Bug Report +description: This template is for submitting a bug report for bugs found in the p5.js 2.0 beta releases. +title: "[p5.js 2.0 Beta Bug Report]: " +labels: [p5.js 2.0] +body: + - type: markdown + attributes: + value: | + ### What falls under this category? + There has been many changes to p5.js in 2.0 that is currently released as beta versions. If you suspect there may be a bug, please follow the below steps before opening a bug report using this template: + + 1. There are some differences in behavior between p5.js 1.x and 2.0 beta, please check the changelog and/or [proposal list](https://github.com/orgs/processing/projects/21) to see if the difference in behavior is intended. If in doubt, feel free to open the issue anyway and ask. + 2. Breaking changes may still happen between beta versions, please make sure to include the full beta version number and use the latest beta release where possible. + 3. We are not considering any new proposal for p5.js 2.0 at this stage and if you would like to request new features, please use the "New feature request" issue template. + 4. The documentation and examples may be outdated at this stage while we work on updating them. + - type: checkboxes + id: sub-area + attributes: + label: Most appropriate sub-area of p5.js? + description: You may select more than one. + options: + - label: Accessibility + - label: Color + - label: Core/Environment/Rendering + - label: Data + - label: DOM + - label: Events + - label: Image + - label: IO + - label: Math + - label: Typography + - label: Utilities + - label: WebGL + - label: Build process + - label: Unit testing + - label: Internationalization + - label: Friendly errors + - label: Other (specify if possible) + - type: input + attributes: + label: p5.js version + description: You can find this in the first line of the p5.js file. + validations: + required: false + - type: input + attributes: + label: Web browser and version + description: In the address bar, on Chrome enter "chrome://version", on Firefox enter "about:support". On Safari, use "About Safari". + validations: + required: false + - type: input + attributes: + label: Operating system + description: "Ex: Windows/MacOSX/Linux/Android/iOS along with version" + validations: + required: false + - type: textarea + attributes: + label: Steps to reproduce this + description: Include a simple code snippet that demonstrates the problem, along with any console errors produced. If this isn't possible, then simply describe the issue as best you can! + value: "### Steps: + + 1. + + 2. + + 3. + + + ### Snippet: + + + ```js + + + // Paste your code here :) + + + ```" + validations: + required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 87b554fdca..45b15440c0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,8 +18,8 @@ Resolves #[Add issue number here] --> - [ ] `npm run lint` passes -- [ ] [Inline documentation] is included / updated +- [ ] [Inline reference] is included / updated - [ ] [Unit tests] are included / updated -[Inline documentation]: https://github.com/processing/p5.js/blob/main/contributor_docs/inline_documentation.md +[Inline reference]: https://p5js.org/contribute/contributing_to_the_p5js_reference/ [Unit tests]: https://github.com/processing/p5.js/tree/main/contributor_docs#unit-tests diff --git a/README.md b/README.md index 0f0827f282..19505fbabc 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ function draw() { ## About -p5.js is built and organized to prioritize [accessibility, inclusivity, community, and joy](https://p5js.org/community). Similar to sketching, p5.js has a full set of tools to draw. It also supports creating audio-visual, interactive, experimental, and generative works for the web. p5.js enables thinking of a web page as your sketch. p5.js is accessible in multiple languages and has an expansive [documentation](https://p5js.org/reference/) with visual examples. You can find [tutorials](https://p5js.org/learn/) on the p5.js website and start coding right now in the [p5.js web editor](https://editor.p5js.org/). You can extend p5.js with many community-created [libraries](https://p5js.org/libraries/) that bring different capabilities. Its community provides endless inspiration and support for creators. +p5.js is built and organized to prioritize [accessibility, inclusivity, community, and joy](https://p5js.org/community). Similar to sketching, p5.js has a full set of tools to draw. It also supports creating audio-visual, interactive, experimental, and generative works for the web. p5.js enables thinking of a web page as your sketch. p5.js is accessible in multiple languages and has an expansive [documentation](https://p5js.org/reference/) with visual examples. You can find [tutorials](https://p5js.org/tutorials/) on the p5.js website and start coding right now in the [p5.js web editor](https://editor.p5js.org/). You can extend p5.js with many community-created [libraries](https://p5js.org/libraries/) that bring different capabilities. Its community provides endless inspiration and support for creators. p5.js encourages iterative and exploratory code for creative expression. Its friendly, diverse community shares art, code, and learning resources to help elevate all voices. We share our values in open source and access for all, to learn, create, imagine, design, share and code freely. @@ -71,17 +71,18 @@ Anyone interested can volunteer to be a steward! There are no specific requireme p5.js was created by [Lauren Lee McCarthy](https://github.com/lmccart) in 2013 as a new interpretation of Processing for the context of the web. Since then we have allowed ourselves space to deviate and grow, while drawing inspiration from Processing and our shared community. p5.js is sustained by a community of contributors, with support from the Processing Foundation. p5.js follows a rotating leadership model started in 2020, and [Qianqian Ye](https://github.com/qianqianye) has been leading p5.js since 2021. Learn more about the [people](https://p5js.org/people/) behind p5.js. Current Lead/Mentor -* [@qianqianye](https://github.com/qianqianye) - p5.js Lead,2021-present +* [@ksen0](https://github.com/ksen0) - p5.js Lead,2024-present * [@limzykenneth](https://github.com/limzykenneth) - p5.js Mentor,2023-present Lead/Mentor Alumni * [@lmccart](https://github.com/lmccart)- p5.js Creator +* [@qianqianye](https://github.com/qianqianye) - p5.js Lead,2021-2024 * [@outofambit](https://github.com/outofambit) - p5.js Co-Lead 2021-22, Mentor 2022-2023 * [@mcturner1995](https://github.com/mcturner1995) - p5.js Lead 2020 | Area | Steward(s) | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| Overall | [@qianqianye](https://github.com/qianqianye) | +| Overall | [@ksen0](https://github.com/ksen0) | | [Accessibility](https://github.com/processing/p5.js/tree/main/src/accessibility) | [@calebfoss](https://github.com/calebfoss), [@cosmicbhejafry](https://github.com/cosmicbhejafry), [@apoorva-a98](https://github.com/apoorva-a98), [@tedkmburu](https://github.com/tedkmburu), [@Zarkv](https://github.com/Zarkv), [@SkylerW99](https://github.com/SkylerW99), [@itsjoopark](https://github.com/itsjoopark), [@hannahvy](https://github.com/hannahvy), [@nhasalajoshi](https://github.com/nhasalajoshi)| | [Color](https://github.com/processing/p5.js/tree/main/src/color) | [@paulaxisabel](https://github.com/paulaxisabel), [@SoundaryaKoutharapu](https://github.com/SoundaryaKoutharapu), [@mrbrack](https://github.com/mrbrack), [@TJ723](https://github.com/TJ723), [@Zarkv](https://github.com/Zarkv), [@SkylerW99](https://github.com/SkylerW99), [@ramya202000](https://github.com/ramya202000), [@hannahvy](https://github.com/hannahvy), [@robin-haxx](https://github.com/robin-haxx), [@hiddenenigma](https://github.com/hiddenenigma) | | [Core](https://github.com/processing/p5.js/tree/main/src/core)/Environment/Rendering | [@limzykenneth](https://github.com/limzykenneth), [@davepagurek](https://github.com/davepagurek), [@ChihYungChang](https://github.com/ChihYungChang), [@teragramgius](https://github.com/teragramgius), [@tuminzee](https://github.com/tuminzee), [@Zarkv](https://github.com/Zarkv), [@robin-haxx](https://github.com/robin-haxx), [@Gaurav-1306](https://github.com/Gaurav-1306) | @@ -1016,7 +1017,7 @@ We recognize all types of contributions. This project follows the [all-contribut PiyushChandra17
PiyushChandra17

💻 🐛 👀 Daniel Grantham
Daniel Grantham

💻 - Monica Powell
Monica Powell

📢 💡 + Monica Powell
Monica Powell

📢 💡 📖 🐛 Rohan Julka
Rohan Julka

💻 Mr. Algorithm
Mr. Algorithm

📖 sambensim
sambensim

📖 @@ -1074,6 +1075,11 @@ We recognize all types of contributions. This project follows the [all-contribut blackboxlogic
blackboxlogic

📖 ℤ

📖 dhanush
dhanush

📖 + ma haidong
ma haidong

🐛 💻 + Rishab Kumar Jha
Rishab Kumar Jha

🐛 💻 + + + Rajas Samse
Rajas Samse

💻 📖 diff --git a/contributor_docs/es/contributor_guidelines.md b/contributor_docs/es/contributor_guidelines.md index 1ccdc372a2..3d4d1b51c7 100644 --- a/contributor_docs/es/contributor_guidelines.md +++ b/contributor_docs/es/contributor_guidelines.md @@ -396,7 +396,7 @@ Si vas a trabajar en pruebas unitarias, por favor consulta [aquí](https://githu ### Documentación en línea -Si vas a trabajar en la documentación en línea, por favor consulta [aquí](https://github.com/processing/p5.js/blob/main/contributor_docs/inline_documentation.md). +Si vas a trabajar en la documentación en línea, por favor consulta [aquí](https://p5js.org/contribute/contributing_to_the_p5js_reference/). ### Accesibilidad diff --git a/contributor_docs/hi/README.md b/contributor_docs/hi/README.md index 1d6930692d..ff65b5214c 100644 --- a/contributor_docs/hi/README.md +++ b/contributor_docs/hi/README.md @@ -35,7 +35,7 @@ p5.js में योगदान देने में आपकी रुच - [p5js.org संदर्भ](https://p5js.org/reference/) स्रोत कोड में ही [इनलाइन प्रलेखन](./inline_documentation.md) से उत्पन्न होता है। इसमें पाठ विवरण और पैरामीटर के साथ-साथ कोड स्निपेट उदाहरण भी शामिल हैं। हम कोड और प्रलेखन को निकटता से रखने के लिए यह सब इनलाइन रखते हैं, और इस विचार को सुदृढ़ करने के लिए कि कोड में योगदान देने की तुलना में प्रलेखन में योगदान करना अधिक महत्वपूर्ण है (यदि अधिक नहीं)। जब लाइब्रेरी निर्मित हो जाता है, तो यह इनलाइन प्रलेखन और उदाहरणों की जांच करता है ताकि यह सुनिश्चित हो सके कि वे कोड के व्यवहार के तरीके से मेल खाते हैं। योगदान करने के लिए, आप [inline_documentation.md](./inline_documentation.md) पृष्ठ को देखकर शुरू कर सकते हैं। - The [p5js.org उदाहरण](http://p5js.org/examples) पृष्ठ में लंबे उदाहरण हैं जो p5.js. सीखने के लिए उपयोगी हो सकते हैं। योगदान करने के लिए, आप [add_examples.md](https://github.com/processing/p5.js-website/blob/main/contributor_docs/Adding_examples.md) पृष्ठ को देखकर शुरू कर सकते हैं। -- The [p5js.org सीखिए](https://p5js.org/learn) पृष्ठ में p5.js और प्रोग्रामिंग की अवधारणाओं को सीखने में मदद करने के लिए ट्यूटोरियल हैं। योगदान करने के लिए, आप [p5.js ट्यूटोरियल में योगदान करने के लिए गाइड](https://p5js.org/learn/tutorial-guide.html) देखकर शुरू कर सकते हैं। +- The [p5js.org सीखिए](https://p5js.org/tutorials) पृष्ठ में p5.js और प्रोग्रामिंग की अवधारणाओं को सीखने में मदद करने के लिए ट्यूटोरियल हैं। योगदान करने के लिए, आप [p5.js ट्यूटोरियल में योगदान करने के लिए गाइड](https://p5js.org/learn/tutorial-guide.html) देखकर शुरू कर सकते हैं। - आप देखेंगे कि वर्तमान में p5.js वेबसाइट कुछ अलग भाषाओं का समर्थन करती है। इसे अंतर्राष्ट्रीयकरण (या संक्षेप में i18n) कहा जाता है। आप इस दस्तावेज़ के बारे में [i18n_contribution](https://github.com/processing/p5.js-website/blob/main/contributor_docs/i18n_contention.md) पृष्ठ पर अधिक पढ़ सकते हैं। diff --git a/contributor_docs/hi/contributor_guidelines.md b/contributor_docs/hi/contributor_guidelines.md index e0cf1b87c4..2fec0b39f4 100644 --- a/contributor_docs/hi/contributor_guidelines.md +++ b/contributor_docs/hi/contributor_guidelines.md @@ -391,7 +391,7 @@ git commit -m "Add documentation example to circle() function" ### इनलाइन दस्तावेज़ीकरण -यदि आप इनलाइन दस्तावेज़ीकरण पर काम करने जा रहे हैं, तो कृपया [यहां](https://github.com/processing/p5.js/blob/main/contributor_docs/inline_documentation.md) देखें। +यदि आप इनलाइन दस्तावेज़ीकरण पर काम करने जा रहे हैं, तो कृपया [यहां](https://p5js.org/contribute/contributing_to_the_p5js_reference/) देखें। ### अभिगम्यता diff --git a/contributor_docs/ja/README.md b/contributor_docs/ja/README.md index f60eec25d1..0859e93c1b 100644 --- a/contributor_docs/ja/README.md +++ b/contributor_docs/ja/README.md @@ -35,7 +35,7 @@ p5.jsプロジェクトには、このコードリポジトリ以外にもいく - [p5js.org/reference](https://p5js.org/reference/):[inline documentation](./inline_documentation.md)のソースコードから生成されます。それには、テキストの説明とパラメータ、添付されたコードスニペットの例が含まれています。コードと参照文献を密接に連携させるために、これらすべてのインラインドキュメントとコードを一緒に配置し、参照文献への貢献がコードへの貢献と少なくとも同じくらい重要であるという考えを強化しています。ライブラリをビルドすると、インライン参照文献と例がコードの動作と一致するかどうかをチェックします。貢献するには、まず[inline_documentation.md](./inline_documentation.md)ページをチェックしてください。 - [p5js.org/examples](http://p5js.org/examples)ページには、p5.jsを学ぶのに役立つより長い例が含まれています。貢献するには、まず[adding_examples.md](https://github.com/processing/p5.js-website/blob/main/contributor_docs/Adding_examples.md)をチェックしてください。 -- [p5js.org/learn](https://p5js.org/learn)ページには、p5.jsやプログラミングの概念を学ぶのに役立つチュートリアルが含まれています。貢献するには、まず[p5.js tutorial guide](https://p5js.org/learn/tutorial-guide.html)をチェックしてください。 +- [p5js.org/tutorials](https://p5js.org/tutorials)ページには、p5.jsやプログラミングの概念を学ぶのに役立つチュートリアルが含まれています。貢献するには、まず[p5.js tutorial guide](https://p5js.org/learn/tutorial-guide.html)をチェックしてください。 - p5.jsウェブサイトが現在いくつかの異なる言語をサポートしていることに気付くかもしれません。これは国際化(i18n)と呼ばれます。[i18n_contribution](https://github.com/processing/p5.js-website/blob/main/contributor_docs/i18n_contribution.md)ページで詳細を学ぶことができます。 # GitHub Issue プロセス diff --git a/contributor_docs/ja/web_accessibility.md b/contributor_docs/ja/web_accessibility.md index f601655c5f..f0836dcb44 100644 --- a/contributor_docs/ja/web_accessibility.md +++ b/contributor_docs/ja/web_accessibility.md @@ -1,6 +1,6 @@ # p5.js のウェブアクセシビリティ -このドキュメントは、p5.js のウェブアクセシビリティ機能の構造を説明し、貢献者、メンテナー、およびその他の関係者が使用するためのものです。画面リーダーで作品をアクセシブルにすることに興味がある場合は、[チュートリアル](https://p5js.org/learn),を参照してください。または、画面リーダーで p5.js を使用する場合は、[画面リーダー用の p5.js チュートリアル](https://p5js.org/learn/p5-screen-reader.html)をご覧ください。 +このドキュメントは、p5.js のウェブアクセシビリティ機能の構造を説明し、貢献者、メンテナー、およびその他の関係者が使用するためのものです。画面リーダーで作品をアクセシブルにすることに興味がある場合は、[チュートリアル](https://p5js.org/tutorials),を参照してください。または、画面リーダーで p5.js を使用する場合は、[画面リーダー用の p5.js チュートリアル](https://p5js.org/learn/p5-screen-reader.html)をご覧ください。 ## 概要 diff --git a/contributor_docs/ko/contributor_guidelines.md b/contributor_docs/ko/contributor_guidelines.md index b99223096f..b54a7c83d9 100644 --- a/contributor_docs/ko/contributor_guidelines.md +++ b/contributor_docs/ko/contributor_guidelines.md @@ -407,7 +407,7 @@ git commit -m "Add documentation example to circle() function" ### 인라인 문서 (Inline documentation) -인라인 문서 작업을 계획하고 있다면, [여기](https://github.com/processing/p5.js/blob/main/contributor_docs/inline_documentation.md)를 참조하세요. +인라인 문서 작업을 계획하고 있다면, [여기](https://p5js.org/contribute/contributing_to_the_p5js_reference/)를 참조하세요. ### 접근성 (Accessibility) diff --git a/contributor_docs/zh-Hans/README.md b/contributor_docs/zh-Hans/README.md index d2363cbe71..1e5661d141 100644 --- a/contributor_docs/zh-Hans/README.md +++ b/contributor_docs/zh-Hans/README.md @@ -35,7 +35,7 @@ p5.js 项目除了这个代码库外还包括了以下几个其他的代码库 - [p5js.org/reference](https://p5js.org/reference/):由 [inline documentation](./inline_documentation.md) 的源代码生成。它包括了文本描述和参数以及随附的代码片段示例。我们将所有这些内联文献和代码放在一起,以使代码和参考文献保持紧密的联系,并强化这样的思想,贡献参考文献与贡献代码至少同等重要。构建库后,它将检查内联参考文献和示例,以确保它们与代码的行为方式匹配。 要做出贡献,您可以先查看 [inline_documentation.md](./inline_documentation.md) 页面。 - [p5js.org/examples](http://p5js.org/examples) 页面包含更长的示例,这些示例对于学习 p5.js 可能有用。要做出贡献,您可以先查看 [adding_examples.md](https://github.com/processing/p5.js-website/blob/main/contributor_docs/Adding_examples.md)。 -- [p5js.org/learn](https://p5js.org/learn) 页面包含可帮助您学习 p5.js 和编程概念的教程。 要做出贡献,您可以先查看 [p5.js guide to contributing to tutorials](https://p5js.org/learn/tutorial-guide.html)。 +- [p5js.org/tutorials](https://p5js.org/tutorials) 页面包含可帮助您学习 p5.js 和编程概念的教程。 要做出贡献,您可以先查看 [p5.js guide to contributing to tutorials](https://p5js.org/learn/tutorial-guide.html)。 - 您可能会注意到 p5.js 网站目前支持几种不同的语言。这称为国际化(i18n)。您可以在 [i18n_contribution](https://github.com/processing/p5.js-website/blob/main/contributor_docs/i18n_contribution.md)页面了解更多。 # GitHub Issue 流程 diff --git a/contributor_docs/zh-Hans/web_accessibility.md b/contributor_docs/zh-Hans/web_accessibility.md index bd64e5cdfb..6734a2b3c3 100644 --- a/contributor_docs/zh-Hans/web_accessibility.md +++ b/contributor_docs/zh-Hans/web_accessibility.md @@ -1,6 +1,6 @@ # p5.js 网页可访问性 -本文档描述了 p5.js 的网页可访问性功能的结构,供贡献者、维护者和其他相关方使用。如果您有兴趣使您的作品对屏幕阅读器可访问,请访问[教程](https://p5js.org/learn),或者如果您想在屏幕阅读器上使用 p5.js,请访问[使用屏幕阅读器的 p5.js 教程](https://p5js.org/learn/p5-screen-reader.html)。 +本文档描述了 p5.js 的网页可访问性功能的结构,供贡献者、维护者和其他相关方使用。如果您有兴趣使您的作品对屏幕阅读器可访问,请访问[教程](https://p5js.org/tutorials),或者如果您想在屏幕阅读器上使用 p5.js,请访问[使用屏幕阅读器的 p5.js 教程](https://p5js.org/learn/p5-screen-reader.html)。 ## 概述 diff --git a/lib/README.txt b/lib/README.txt index 6f0b7e3a38..b2116cd872 100644 --- a/lib/README.txt +++ b/lib/README.txt @@ -50,7 +50,7 @@ This README file formatted with Markdown :) # What's next? If you need more information to help get you started, please refer to our website: -https://p5js.org/get-started/ and https://p5js.org/learn/ +https://p5js.org/tutorials/get-started/ and https://p5js.org/tutorials/ An online reference to the p5.js library is available here: https://p5js.org/reference/ diff --git a/package-lock.json b/package-lock.json index 7cd922865b..7040c18256 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "p5", - "version": "1.11.2", + "version": "1.11.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "p5", - "version": "1.11.2", + "version": "1.11.3", "license": "LGPL-2.1", "devDependencies": { "@babel/core": "^7.7.7", diff --git a/package.json b/package.json index 44d91bdb0f..3de1f9e9a0 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "node --require @babel/register ./utils/sample-linter.js" ] }, - "version": "1.11.2", + "version": "1.11.3", "devDependencies": { "@babel/core": "^7.7.7", "@babel/preset-env": "^7.10.2", diff --git a/src/color/setting.js b/src/color/setting.js index ae8ee0aa90..f659f24ee1 100644 --- a/src/color/setting.js +++ b/src/color/setting.js @@ -1000,7 +1000,7 @@ p5.prototype.colorMode = function(mode, max1, max2, max3, maxA) { * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. - * @param {Number} [alpha] optional alpha value, controls transparency (0 - transparent, 255 - opaque). + * @param {Number} [alpha] alpha value, controls transparency (0 - transparent, 255 - opaque). * @chainable * @example *
@@ -1360,7 +1360,7 @@ p5.prototype.noStroke = function() { * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. - * @param {Number} [alpha] + * @param {Number} [alpha] alpha value, controls transparency (0 - transparent, 255 - opaque). * @chainable * * @example diff --git a/src/core/reference.js b/src/core/reference.js index 52ff833fd8..3ee337f7f8 100644 --- a/src/core/reference.js +++ b/src/core/reference.js @@ -1428,7 +1428,7 @@ * // Assign the frog variable a new Frog object. * fifi = new Frog(50, 50, 20); * - * describe('A frog face drawn on a gray background.'); + * describe('A frog face drawn on a blue background.'); * } * * function draw() { @@ -1467,7 +1467,7 @@ * frog1 = new Frog(25, 50, 10); * frog2 = new Frog(75, 50, 20); * - * describe('Two frog faces drawn next to each other on a gray background.'); + * describe('Two frog faces drawn next to each other on a blue background.'); * } * * function draw() { @@ -1510,7 +1510,7 @@ * // Slow the frame rate. * frameRate(1); * - * describe('Two frog faces on a gray background. The frogs hop around randomly.'); + * describe('Two frog faces on a blue background. The frogs hop around randomly.'); * } * * function draw() { @@ -1566,46 +1566,6 @@ * *
* - * // Declare two frog variables. - * let frog1; - * let frog2; - * - * function setup() { - * createCanvas(100, 100); - * - * // Assign the frog variables a new Frog object. - * frog1 = new Frog(25, 50, 10); - * frog2 = new Frog(75, 50, 20); - * - * describe('Two frog faces drawn next to each other on a gray background.'); - * } - * - * function draw() { - * background('cornflowerblue'); - * - * // Show the frogs. - * frog1.show(); - * frog2.show(); - * } - * - * class Frog { - * constructor(x, y, size) { - * this.x = x; - * this.y = y; - * this.size = size; - * } - * - * show() { - * textAlign(CENTER, CENTER); - * textSize(this.size); - * text('🐸', this.x, this.y); - * } - * } - * - *
- * - *
- * * // Create an array that will hold frogs. * let frogs = []; * @@ -1630,7 +1590,7 @@ * frameRate(1); * * describe( - * 'Five frog faces on a gray background. The frogs hop around randomly.' + * 'Five frog faces on a blue background. The frogs hop around randomly.' * ); * } * diff --git a/src/events/keyboard.js b/src/events/keyboard.js index 9e336022a9..f6e3b04703 100644 --- a/src/events/keyboard.js +++ b/src/events/keyboard.js @@ -441,15 +441,25 @@ p5.prototype.keyCode = 0; *
*/ p5.prototype._onkeydown = function(e) { - if (this._downKeys[e.which]) { - // prevent multiple firings + if (e.repeat) { + // Ignore repeated key events when holding down a key return; } + this._setProperty('isKeyPressed', true); this._setProperty('keyIsPressed', true); this._setProperty('keyCode', e.which); this._downKeys[e.which] = true; this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); + + // Track keys pressed with meta key + if (e.metaKey) { + if (!this._metaKeys) { + this._metaKeys = []; + } + this._metaKeys.push(e.which); + } + const context = this._isGlobal ? window : this; if (typeof context.keyPressed === 'function' && !e.charCode) { const executeDefault = context.keyPressed(e); @@ -458,6 +468,7 @@ p5.prototype._onkeydown = function(e) { } } }; + /** * A function that's called once when any key is released. * @@ -615,18 +626,21 @@ p5.prototype._onkeydown = function(e) { *
*/ p5.prototype._onkeyup = function(e) { + this._setProperty('isKeyPressed', false); + this._setProperty('keyIsPressed', false); + this._setProperty('_lastKeyCodePressed', this._keyCode); this._downKeys[e.which] = false; - if (!this._areDownKeys()) { - this._setProperty('isKeyPressed', false); - this._setProperty('keyIsPressed', false); + if (e.key === 'Meta') { // Meta key codes + // When meta key is released, clear all keys pressed with it + if (this._metaKeys) { + this._metaKeys.forEach(key => { + this._downKeys[key] = false; + }); + this._metaKeys = []; + } } - this._setProperty('_lastKeyCodeTyped', null); - - this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); - this._setProperty('keyCode', e.which); - const context = this._isGlobal ? window : this; if (typeof context.keyReleased === 'function') { const executeDefault = context.keyReleased(e); diff --git a/src/image/image.js b/src/image/image.js index 5773908e93..2ef00ab2b2 100644 --- a/src/image/image.js +++ b/src/image/image.js @@ -565,7 +565,7 @@ p5.prototype.encodeAndDownloadGif = function(pImg, filename) { * an object with its file type, file name, and image data as a string. For * example, the first saved frame might have the following properties: * - * `{ ext: 'png', filenmame: 'frame0', imageData: 'data:image/octet-stream;base64, abc123' }`. + * `{ ext: 'png', filename: 'frame0', imageData: 'data:image/octet-stream;base64, abc123' }`. * * The first parameter, `filename`, sets the prefix for the file names. For * example, setting the prefix to `'frame'` would generate the image files diff --git a/src/math/trigonometry.js b/src/math/trigonometry.js index 51f42d71a9..cb2af7c709 100644 --- a/src/math/trigonometry.js +++ b/src/math/trigonometry.js @@ -286,7 +286,7 @@ p5.prototype.atan2 = function(y, x) { * takes into account the current angleMode(). * * @method cos - * @param {Number} angle the angle. + * @param {Number} angle the angle in radians unless specified by angleMode(). * @return {Number} cosine of the angle. * * @example @@ -366,7 +366,7 @@ p5.prototype.cos = function(angle) { * takes into account the current angleMode(). * * @method sin - * @param {Number} angle the angle. + * @param {Number} angle the angle in radians unless specified by angleMode(). * @return {Number} sine of the angle. * * @example @@ -447,7 +447,7 @@ p5.prototype.sin = function(angle) { * angleMode(). * * @method tan - * @param {Number} angle the angle. + * @param {Number} angle the angle in radians unless specified by angleMode(). * @return {Number} tangent of the angle. * * @example diff --git a/src/webgl/loading.js b/src/webgl/loading.js index 9c37396454..9e22824da4 100755 --- a/src/webgl/loading.js +++ b/src/webgl/loading.js @@ -26,6 +26,11 @@ import './p5.Geometry'; * `loadModel('assets/model.obj')`. URLs such as * `'https://example.com/model.obj'` may be blocked due to browser security. * + * Note: When loading a `.obj` file that references materials stored in + * `.mtl` files, p5.js will attempt to load and apply those materials. + * To ensure that the `.obj` file reads the `.mtl` file correctly include the + * `.mtl` file alongside it. + * * The first way to call `loadModel()` has three optional parameters after the * file path. The first optional parameter, `successCallback`, is a function * to call once the model loads. For example, diff --git a/src/webgl/p5.Geometry.js b/src/webgl/p5.Geometry.js index 15dbcad5ca..739155301c 100644 --- a/src/webgl/p5.Geometry.js +++ b/src/webgl/p5.Geometry.js @@ -1272,8 +1272,8 @@ p5.Geometry = class Geometry { * console.log(myGeometry.uvs); * * // Notice the swaps: - * // Left vertices: [0, 0] <--> [1, 0] - * // Right vertices: [1, 0] <--> [1, 1] + * // Left vertices: [0, 0] <--> [1, 0] + * // Right vertices: [1, 0] <--> [1, 1] * ``` * * @method flipV @@ -1993,6 +1993,12 @@ p5.Geometry = class Geometry { const currEdge = this.edges[i]; const begin = this.vertices[currEdge[0]]; const end = this.vertices[currEdge[1]]; + const prevColor = (this.vertexStrokeColors.length > 0 && prevEdge) + ? this.vertexStrokeColors.slice( + prevEdge[1] * 4, + (prevEdge[1] + 1) * 4 + ) + : [0, 0, 0, 0]; const fromColor = this.vertexStrokeColors.length > 0 ? this.vertexStrokeColors.slice( currEdge[0] * 4, @@ -2056,7 +2062,7 @@ p5.Geometry = class Geometry { this.vertices[prevEdge[1]], lastValidDir, existingCap.dir.copy().mult(-1), - fromColor + prevColor ); potentialCaps.delete(prevEdge[1]); connected.add(prevEdge[1]); @@ -2065,7 +2071,7 @@ p5.Geometry = class Geometry { potentialCaps.set(prevEdge[1], { point: this.vertices[prevEdge[1]], dir: lastValidDir, - color: fromColor + color: prevColor }); } lastValidDir = undefined; diff --git a/src/webgl/p5.RendererGL.js b/src/webgl/p5.RendererGL.js index 908a056714..d3864a8171 100644 --- a/src/webgl/p5.RendererGL.js +++ b/src/webgl/p5.RendererGL.js @@ -2044,9 +2044,9 @@ p5.RendererGL = class RendererGL extends p5.Renderer { } this._defaultFontShader = new p5.Shader( this, - this._webGL2CompatibilityPrefix('vert', 'mediump') + + this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.fontVert, - this._webGL2CompatibilityPrefix('frag', 'mediump') + + this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.fontFrag ); } diff --git a/src/webgl/p5.Shader.js b/src/webgl/p5.Shader.js index 5f0b38ce66..a82f112361 100644 --- a/src/webgl/p5.Shader.js +++ b/src/webgl/p5.Shader.js @@ -46,7 +46,7 @@ import p5 from '../core/main'; * ```glsl * void main() { * HOOK_beforeVertex(); - * // Add the rest ofy our shader code here! + * // Add the rest of your shader code here! * } * ``` * @@ -333,10 +333,7 @@ p5.Shader = class { console.log(''); console.log('==== Helper functions: ===='); for (const key in this.hooks.helpers) { - console.log( - key + - this.hooks.helpers[key] - ); + console.log(key + this.hooks.helpers[key]); } } @@ -946,7 +943,7 @@ p5.Shader = class { const modelMatrix = this._renderer.uModelMatrix; const viewMatrix = this._renderer.uViewMatrix; const projectionMatrix = this._renderer.uPMatrix; - const modelViewMatrix = (modelMatrix.copy()).mult(viewMatrix); + const modelViewMatrix = modelMatrix.copy().mult(viewMatrix); this._renderer.uMVMatrix = modelViewMatrix; const modelViewProjectionMatrix = modelViewMatrix.copy(); @@ -1326,13 +1323,62 @@ p5.Shader = class { } break; case gl.SAMPLER_2D: - gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); - uniform.texture = - data instanceof p5.Texture ? data : this._renderer.getTexture(data); - gl.uniform1i(location, uniform.samplerIndex); - if (uniform.texture.src.gifProperties) { - uniform.texture.src._animateGif(this._renderer._pInst); + if (typeof data == 'number') { + if ( + data < gl.TEXTURE0 || + data > gl.TEXTURE31 || + data !== Math.ceil(data) + ) { + console.log( + '🌸 p5.js says: ' + + "You're trying to use a number as the data for a texture." + + 'Please use a texture.' + ); + return this; + } + gl.activeTexture(data); + gl.uniform1i(location, data); + } else { + gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); + uniform.texture = + data instanceof p5.Texture ? data : this._renderer.getTexture(data); + gl.uniform1i(location, uniform.samplerIndex); + if (uniform.texture.src.gifProperties) { + uniform.texture.src._animateGif(this._renderer._pInst); + } + } + break; + case gl.SAMPLER_CUBE: + case gl.SAMPLER_3D: + case gl.SAMPLER_2D_SHADOW: + case gl.SAMPLER_2D_ARRAY: + case gl.SAMPLER_2D_ARRAY_SHADOW: + case gl.SAMPLER_CUBE_SHADOW: + case gl.INT_SAMPLER_2D: + case gl.INT_SAMPLER_3D: + case gl.INT_SAMPLER_CUBE: + case gl.INT_SAMPLER_2D_ARRAY: + case gl.UNSIGNED_INT_SAMPLER_2D: + case gl.UNSIGNED_INT_SAMPLER_3D: + case gl.UNSIGNED_INT_SAMPLER_CUBE: + case gl.UNSIGNED_INT_SAMPLER_2D_ARRAY: + if (typeof data !== 'number') { + break; + } + if ( + data < gl.TEXTURE0 || + data > gl.TEXTURE31 || + data !== Math.ceil(data) + ) { + console.log( + '🌸 p5.js says: ' + + "You're trying to use a number as the data for a texture." + + 'Please use a texture.' + ); + break; } + gl.activeTexture(data); + gl.uniform1i(location, data); break; //@todo complete all types }