|
|
|
@ -51,7 +51,16 @@ import {
|
|
|
|
hydrate_block_anchor,
|
|
|
|
hydrate_block_anchor,
|
|
|
|
set_current_hydration_fragment
|
|
|
|
set_current_hydration_fragment
|
|
|
|
} from './hydration.js';
|
|
|
|
} from './hydration.js';
|
|
|
|
import { array_from, define_property, get_descriptor, get_descriptors, is_array } from './utils.js';
|
|
|
|
import {
|
|
|
|
|
|
|
|
array_from,
|
|
|
|
|
|
|
|
define_property,
|
|
|
|
|
|
|
|
get_descriptor,
|
|
|
|
|
|
|
|
get_descriptors,
|
|
|
|
|
|
|
|
is_array,
|
|
|
|
|
|
|
|
object_assign,
|
|
|
|
|
|
|
|
object_entries,
|
|
|
|
|
|
|
|
object_keys
|
|
|
|
|
|
|
|
} from './utils.js';
|
|
|
|
import { is_promise } from '../common.js';
|
|
|
|
import { is_promise } from '../common.js';
|
|
|
|
import { bind_transition, trigger_transitions } from './transitions.js';
|
|
|
|
import { bind_transition, trigger_transitions } from './transitions.js';
|
|
|
|
|
|
|
|
|
|
|
|
@ -1196,7 +1205,7 @@ export function bind_prop(props, prop, value) {
|
|
|
|
const signal = expose(() => current_props[prop]);
|
|
|
|
const signal = expose(() => current_props[prop]);
|
|
|
|
if (is_signal(signal)) {
|
|
|
|
if (is_signal(signal)) {
|
|
|
|
set(signal, value);
|
|
|
|
set(signal, value);
|
|
|
|
} else if (Object.getOwnPropertyDescriptor(current_props, prop)?.set !== undefined) {
|
|
|
|
} else if (get_descriptor(current_props, prop)?.set !== undefined) {
|
|
|
|
current_props[prop] = value;
|
|
|
|
current_props[prop] = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -2406,7 +2415,7 @@ function get_setters(element) {
|
|
|
|
* @returns {Record<string, unknown>}
|
|
|
|
* @returns {Record<string, unknown>}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export function spread_attributes(dom, prev, attrs, lowercase_attributes, css_hash) {
|
|
|
|
export function spread_attributes(dom, prev, attrs, lowercase_attributes, css_hash) {
|
|
|
|
const next = Object.assign({}, ...attrs);
|
|
|
|
const next = object_assign({}, ...attrs);
|
|
|
|
const has_hash = css_hash.length !== 0;
|
|
|
|
const has_hash = css_hash.length !== 0;
|
|
|
|
for (const key in prev) {
|
|
|
|
for (const key in prev) {
|
|
|
|
if (!(key in next)) {
|
|
|
|
if (!(key in next)) {
|
|
|
|
@ -2502,7 +2511,7 @@ export function spread_attributes(dom, prev, attrs, lowercase_attributes, css_ha
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export function spread_dynamic_element_attributes(node, prev, attrs, css_hash) {
|
|
|
|
export function spread_dynamic_element_attributes(node, prev, attrs, css_hash) {
|
|
|
|
if (node.tagName.includes('-')) {
|
|
|
|
if (node.tagName.includes('-')) {
|
|
|
|
const next = Object.assign({}, ...attrs);
|
|
|
|
const next = object_assign({}, ...attrs);
|
|
|
|
if (prev !== null) {
|
|
|
|
if (prev !== null) {
|
|
|
|
for (const key in prev) {
|
|
|
|
for (const key in prev) {
|
|
|
|
if (!(key in next)) {
|
|
|
|
if (!(key in next)) {
|
|
|
|
@ -2670,7 +2679,7 @@ export function createRoot(component, options) {
|
|
|
|
const result =
|
|
|
|
const result =
|
|
|
|
/** @type {Exports & { $destroy: () => void; $set: (props: Partial<Props>) => void; }} */ ({
|
|
|
|
/** @type {Exports & { $destroy: () => void; $set: (props: Partial<Props>) => void; }} */ ({
|
|
|
|
$set: (props) => {
|
|
|
|
$set: (props) => {
|
|
|
|
for (const [prop, value] of Object.entries(props)) {
|
|
|
|
for (const [prop, value] of object_entries(props)) {
|
|
|
|
if (prop in _sources) {
|
|
|
|
if (prop in _sources) {
|
|
|
|
set(_sources[prop], value);
|
|
|
|
set(_sources[prop], value);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -2682,7 +2691,7 @@ export function createRoot(component, options) {
|
|
|
|
$destroy
|
|
|
|
$destroy
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
for (const key of Object.keys(accessors || {})) {
|
|
|
|
for (const key of object_keys(accessors || {})) {
|
|
|
|
define_property(result, key, {
|
|
|
|
define_property(result, key, {
|
|
|
|
get() {
|
|
|
|
get() {
|
|
|
|
// @ts-expect-error TS doesn't know key exists on accessor
|
|
|
|
// @ts-expect-error TS doesn't know key exists on accessor
|
|
|
|
|