emojis! 🧑‍🎨 🎨 ✏️ (#2814)

everyone ❤️'s emojis:
https://dropbox.tech/application/dropbox-paper-emojis-and-exformation


https://github.com/tldraw/tldraw/assets/469604/8f99f485-de98-44d1-93cb-6eb9c2d87d99




### Change Type

- [x] `minor` — New feature

### Test Plan

1. Test adding lots of emojis!

### Release Notes

- Adds emoji picker to text fields.
This commit is contained in:
Mime Čuvalo 2024-02-13 14:46:55 +00:00 committed by GitHub
parent c4ffa05b12
commit 32f641c1d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 426 additions and 15 deletions

View file

@ -1140,6 +1140,8 @@ export class Group2d extends Geometry2d {
// (undocumented)
getArea(): number;
// (undocumented)
getLabel(): Geometry2d;
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean;

View file

@ -22688,6 +22688,38 @@
"isAbstract": false,
"name": "getArea"
},
{
"kind": "Method",
"canonicalReference": "@tldraw/editor!Group2d#getLabel:member(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "getLabel(): "
},
{
"kind": "Reference",
"text": "Geometry2d",
"canonicalReference": "@tldraw/editor!Geometry2d:class"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"isProtected": false,
"overloadIndex": 1,
"parameters": [],
"isOptional": false,
"isAbstract": false,
"name": "getLabel"
},
{
"kind": "Method",
"canonicalReference": "@tldraw/editor!Group2d#getVertices:member(1)",

View file

@ -70,6 +70,10 @@ export class Group2d extends Geometry2d {
return this.children[0].area
}
getLabel() {
return this.children.filter((c) => c.isLabel)[0]
}
toSimpleSvgPath() {
let path = ''
for (const child of this.children) {

View file

@ -8,7 +8,7 @@ import { Atom, atom, react } from '@tldraw/state'
// `true` by default in development and staging, and `false` in production.
/** @internal */
export const featureFlags: Record<string, DebugFlag<boolean>> = {
// canMoveArrowLabel: createFeatureFlag('canMoveArrowLabel'),
emojiMenu: createFeatureFlag('emojiMenu'),
}
/** @internal */
@ -111,16 +111,16 @@ function createDebugValue<T>(
})
}
// function createFeatureFlag(
// name: string,
// defaults: Defaults<boolean> = { all: true, production: false }
// ) {
// return createDebugValueBase({
// name,
// defaults,
// shouldStoreForSession: true,
// })
// }
function createFeatureFlag(
name: string,
defaults: Defaults<boolean> = { all: true, production: false }
) {
return createDebugValueBase({
name,
defaults,
shouldStoreForSession: true,
})
}
function createDebugValueBase<T>(def: DebugFlagDef<T>): DebugFlag<T> {
const defaultValue = getDefaultValue(def)