MCPcopy
hub / github.com/resend/react-email / from

Method from

packages/editor/src/core/serializer/email-mark.ts:60–69  ·  view source on GitHub ↗
(
    mark: Mark<O, S>,
    renderToReactEmail: MarkRendererComponent,
  )

Source from the content-addressed store, hash-verified

58 }
59
60 static from<O, S>(
61 mark: Mark<O, S>,
62 renderToReactEmail: MarkRendererComponent,
63 ): EmailMark<O, S> {
64 const customMark = EmailMark.create({} as ConfigParameter<O, S>);
65 // This only makes a shallow copy, so if there's nested objects here mutating things will be dangerous
66 Object.assign(customMark, { ...mark });
67 customMark.config = { ...mark.config, renderToReactEmail };
68 return customMark;
69 }
70
71 // Subclass return types for configure/extend; safe at runtime. TipTap's Mark typings cause TS2416 when returning EmailMark.
72 // @ts-expect-error - EmailMark is a valid Mark subclass; base typings don't support subclass return types

Callers 15

inlineStylesFunction · 0.45
TailwindFunction · 0.45
getDependencyPathsFunction · 0.45
readFunction · 0.45
removeForbiddenElementsFunction · 0.45
scrubUnsafeUrlAttributesFunction · 0.45
sanitizeNodeFunction · 0.45
sanitizeElementFunction · 0.45
email-mark.spec.tsFile · 0.45
email-node.spec.tsFile · 0.45
useDocumentColorsFunction · 0.45

Calls 1

createMethod · 0.45

Tested by 5

readFunction · 0.36
waitForSpacingSectionFunction · 0.36
getPerSidePaddingButtonFunction · 0.36
waitForBackgroundSectionFunction · 0.36
waitForColumnsSectionFunction · 0.36