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

feat: add prop surrounds with range #5729

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

electroluxcode
Copy link
Contributor

Description
feat: add prop surrounds with range

微信截图_20240924135706

Issue

fix #4283

Example
A GIF or video showing the old and new behaviors after this pull request is merged. Or a code sample showing the usage of a new API. (If you don't include this, your pull request will not be reviewed as quickly, because it's much too hard to figure out exactly what is going wrong, and it makes maintenance much harder.)

let data = {
	"anchor": {
		"path": [ 0, 0 ],
		"offset": 0
	},
	"focus": {
		"path": [ 0, 0 ],
		"offset": 5
	}
}

let target = {
	"anchor": {
		"path": [ 0, 0 ],
		"offset": 0
	},
	"focus": {
		"path": [ 0, 0 ],
		"offset": 8
	}
}
Range.surrounds(data, target)

Context
If your change is non-trivial, please include a description of how the new logic works, and why you decided to solve it the way you did. (This is incredibly helpful so that reviewers don't have to guess your intentions based on the code, and without it your pull request will likely not be reviewed as quickly.)

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

Copy link

changeset-bot bot commented Sep 24, 2024

🦋 Changeset detected

Latest commit: 4d7afd7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
slate Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dylans
Copy link
Collaborator

dylans commented Sep 26, 2024

@electroluxcode thanks, please add a changeset and then I can land this!

@dylans dylans merged commit b1a1021 into ianstormtaylor:main Sep 26, 2024
11 checks passed
@github-actions github-actions bot mentioned this pull request Sep 26, 2024
This was referenced Oct 16, 2024
z2devil pushed a commit to z2devil/slate that referenced this pull request Dec 6, 2024
* feat: add prop surrounds with range

* Create small-carrots-jam.md

* fix: docx about range.included

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
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.

Proposal: Rename Range.includes to Range.intersects and add Range.surrounds to remove confusion
2 participants