@planningcenter/chat-react-native 3.15.0-rc.6 → 3.15.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/display/avatar.d.ts +3 -1
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +2 -2
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +3 -1
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +2 -2
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/primitive/avatar_primitive.d.ts +2 -0
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +20 -19
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/polyfills/events/CustomEvent.d.ts +21 -0
- package/build/polyfills/events/CustomEvent.d.ts.map +1 -0
- package/build/polyfills/events/CustomEvent.js +22 -0
- package/build/polyfills/events/CustomEvent.js.map +1 -0
- package/build/polyfills/events/Event.d.ts +49 -0
- package/build/polyfills/events/Event.d.ts.map +1 -0
- package/build/polyfills/events/Event.js +125 -0
- package/build/polyfills/events/Event.js.map +1 -0
- package/build/polyfills/events/EventHandlerAttributes.d.ts +8 -0
- package/build/polyfills/events/EventHandlerAttributes.d.ts.map +1 -0
- package/build/polyfills/events/EventHandlerAttributes.js +46 -0
- package/build/polyfills/events/EventHandlerAttributes.js.map +1 -0
- package/build/polyfills/events/EventTarget.d.ts +33 -0
- package/build/polyfills/events/EventTarget.d.ts.map +1 -0
- package/build/polyfills/events/EventTarget.js +238 -0
- package/build/polyfills/events/EventTarget.js.map +1 -0
- package/build/polyfills/events/internals/EventInternals.d.ts +30 -0
- package/build/polyfills/events/internals/EventInternals.d.ts.map +1 -0
- package/build/polyfills/events/internals/EventInternals.js +76 -0
- package/build/polyfills/events/internals/EventInternals.js.map +1 -0
- package/build/polyfills/events/internals/EventTargetInternals.d.ts +9 -0
- package/build/polyfills/events/internals/EventTargetInternals.d.ts.map +1 -0
- package/build/polyfills/events/internals/EventTargetInternals.js +11 -0
- package/build/polyfills/events/internals/EventTargetInternals.js.map +1 -0
- package/build/polyfills/webidl/PlatformObjects.d.ts +31 -0
- package/build/polyfills/webidl/PlatformObjects.d.ts.map +1 -0
- package/build/polyfills/webidl/PlatformObjects.js +39 -0
- package/build/polyfills/webidl/PlatformObjects.js.map +1 -0
- package/package.json +5 -5
- package/src/__tests__/event-polyfill.test.ts +314 -0
- package/src/components/display/avatar.tsx +5 -1
- package/src/components/display/avatar_group.tsx +5 -1
- package/src/components/primitive/avatar_primitive.tsx +35 -19
- package/src/index.tsx +2 -0
- package/src/polyfills/events/CustomEvent.ts +32 -0
- package/src/polyfills/events/Event.ts +186 -0
- package/src/polyfills/events/EventHandlerAttributes.ts +67 -0
- package/src/polyfills/events/EventTarget.ts +360 -0
- package/src/polyfills/events/README.md +1 -0
- package/src/polyfills/events/internals/EventInternals.ts +95 -0
- package/src/polyfills/events/internals/EventTargetInternals.ts +16 -0
- package/src/polyfills/webidl/PlatformObjects.ts +50 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal implementation details for the `EventTarget` module.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type Event from '../Event'
|
|
6
|
+
import type EventTarget from '../EventTarget'
|
|
7
|
+
import { setIsTrusted } from './EventInternals'
|
|
8
|
+
|
|
9
|
+
export const EVENT_TARGET_GET_THE_PARENT_KEY: unique symbol = Symbol('EventTarget[get the parent]')
|
|
10
|
+
|
|
11
|
+
export const INTERNAL_DISPATCH_METHOD_KEY: unique symbol = Symbol('EventTarget[dispatch]')
|
|
12
|
+
|
|
13
|
+
export function dispatchTrustedEvent(eventTarget: EventTarget, event: Event): void {
|
|
14
|
+
setIsTrusted(event, true)
|
|
15
|
+
return eventTarget[INTERNAL_DISPATCH_METHOD_KEY](event)
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const IS_PLATFORM_OBJECT_KEY = Symbol('isPlatformObject')
|
|
9
|
+
const CLONE_PLATFORM_OBJECT_KEY = Symbol('clonePlatformObject')
|
|
10
|
+
|
|
11
|
+
type CloneFn<T extends object> = (value: T) => T
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Marks the given object or instances of the given class as platform objects.
|
|
15
|
+
*
|
|
16
|
+
* Optionally, it sets the clone function for that platform object, which is a
|
|
17
|
+
* simplification of the serializable attribute of the Web interface.
|
|
18
|
+
*/
|
|
19
|
+
export function setPlatformObject<T extends object>(
|
|
20
|
+
obj: { prototype: unknown },
|
|
21
|
+
options?: { clone: CloneFn<T> }
|
|
22
|
+
): void
|
|
23
|
+
export function setPlatformObject<T extends object>(obj: T, options?: { clone: CloneFn<T> }): void
|
|
24
|
+
export function setPlatformObject(obj: any, options?: { clone: (value: any) => any }): void {
|
|
25
|
+
if (typeof obj === 'function') {
|
|
26
|
+
;(obj.prototype as any)[IS_PLATFORM_OBJECT_KEY] = true
|
|
27
|
+
if (options) {
|
|
28
|
+
;(obj.prototype as any)[CLONE_PLATFORM_OBJECT_KEY] = options.clone
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
;(obj as any)[IS_PLATFORM_OBJECT_KEY] = true
|
|
32
|
+
if (options) {
|
|
33
|
+
;(obj as any)[CLONE_PLATFORM_OBJECT_KEY] = options.clone
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Indicates if the given object is a platform object.
|
|
40
|
+
*/
|
|
41
|
+
export function isPlatformObject<T extends object>(obj: T): boolean {
|
|
42
|
+
return IS_PLATFORM_OBJECT_KEY in (obj as any)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns the clone function for the given platform object, if it was set.
|
|
47
|
+
*/
|
|
48
|
+
export function getPlatformObjectClone<T extends object>(obj: T): ((value: T) => T) | undefined {
|
|
49
|
+
return (obj as any)[CLONE_PLATFORM_OBJECT_KEY]
|
|
50
|
+
}
|