-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release v0.2 with form-type Feelbacks
SDKs bumped to v0.2.0 - feat: added FeelbackMessage and FeelbackTaggedMessage components - feat: style improvements with per-component styling possible Samples - added nextjs with bare template - added nextra with doc template
- Loading branch information
1 parent
e23023a
commit 289dd08
Showing
85 changed files
with
5,449 additions
and
733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
"mjml", | ||
"mobx", | ||
"nestjs", | ||
"nextra", | ||
"nocheck", | ||
"nodenext", | ||
"outdir", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
# astro-feelback changelog | ||
|
||
## 0.2.0 Major release | ||
- feat: added FeelbackMessage and FeelbackTaggedMessage components | ||
- feat: style improvements with per-component styling possible | ||
|
||
Check the [documentation](https://www.feelback.dev/docs) for full details. | ||
|
||
## 0.1.0 Initial release | ||
Check the [readme](readme.md) for the documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
import type { TargetContent } from "../src"; | ||
import Component from "./parts/Component.astro"; | ||
import SwitchResult from "./parts/SwitchResult.astro"; | ||
type Props = TargetContent & { | ||
class?: string; | ||
title?: string; | ||
textAnswer?: string; | ||
}; | ||
const { | ||
class: className, | ||
title = "Send feedback", | ||
textAnswer = "Thanks for your feedback", | ||
...target | ||
/* */ | ||
} = Astro.props; | ||
--- | ||
|
||
<Component component="form" class={className} {...target}> | ||
<SwitchResult textAnswer={textAnswer}> | ||
<slot /> | ||
</SwitchResult> | ||
</Component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
import type { TargetContent } from "../src"; | ||
import Component from "./parts/Component.astro"; | ||
import SwitchResult from "./parts/SwitchResult.astro"; | ||
import TriggerButton from "./parts/TriggerButton.astro"; | ||
import MessageForm from "./forms/MessageForm.astro"; | ||
import FeelbackForm from "./FeelbackForm.astro"; | ||
type Props = TargetContent & { | ||
layout?: "button-switch" | "button-dialog" | "inline"; | ||
title?: string; | ||
label?: string; | ||
minLength?: number; | ||
maxLength?: number; | ||
textAnswer?: string; | ||
placeholder?: string; | ||
}; | ||
const { | ||
layout = "inline", | ||
label = "Send feedback", | ||
title = "Send feedback", | ||
textAnswer = "Thanks for your feedback", | ||
placeholder = "Type your message", | ||
minLength, | ||
maxLength, | ||
...target | ||
} = Astro.props; | ||
const behavior = layout === "button-dialog" ? "dialog" : layout === "button-switch" ? "switch" : undefined; | ||
const formAttrs = { | ||
title, | ||
placeholder, | ||
minLength, | ||
maxLength, | ||
}; | ||
const btnCancelAttrs = | ||
layout === "button-switch" | ||
? { | ||
"data-behavior-action": "switch", | ||
"data-behavior-target": ".trigger-btn", | ||
"data-behavior-source": ".feelback-form", | ||
} | ||
: { | ||
"data-behavior-action": "cancel", | ||
}; | ||
--- | ||
|
||
{ | ||
(layout === "button-dialog" || layout === "button-switch") && ( | ||
<Component component="form" class={`feelback-message layout-${layout}`} behavior={behavior} {...target}> | ||
<SwitchResult textAnswer={textAnswer}> | ||
<TriggerButton | ||
action={layout === "button-dialog" ? "dialog" : "switch"} | ||
target=".feelback-form" | ||
label={label} | ||
/> | ||
<MessageForm {...formAttrs} class={`hidden${layout === "button-dialog" ? " dialog" : ""}`}> | ||
<button slot="btn-cancel" class="feelback-btn btn-cancel" title="Cancel" {...btnCancelAttrs}> | ||
Cancel | ||
</button> | ||
</MessageForm> | ||
</SwitchResult> | ||
</Component> | ||
) | ||
} | ||
|
||
{ | ||
layout === "inline" && ( | ||
<FeelbackForm class="feelback-message layout-inline" textAnswer={textAnswer} {...target}> | ||
<MessageForm {...formAttrs} /> | ||
</FeelbackForm> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
import type { TargetContent } from "../src"; | ||
import Component from "./parts/Component.astro"; | ||
import SwitchResult from "./parts/SwitchResult.astro"; | ||
import TriggerButton from "./parts/TriggerButton.astro"; | ||
import TaggedMessageForm, { PresetName } from "./forms/TaggedMessageForm.astro"; | ||
import FeelbackForm from "./FeelbackForm.astro"; | ||
type Props = TargetContent & { | ||
layout?: "button-switch" | "button-dialog" | "inline"; | ||
preset?: PresetName; | ||
title?: string; | ||
label?: string; | ||
minLength?: number; | ||
maxLength?: number; | ||
textAnswer?: string; | ||
placeholder?: string; | ||
}; | ||
const { | ||
layout = "inline", | ||
label = "Send feedback", | ||
title = "Send feedback", | ||
textAnswer = "Thanks for your feedback", | ||
placeholder = "Type your message", | ||
preset = "feedback", | ||
minLength, | ||
maxLength, | ||
...target | ||
} = Astro.props; | ||
const behavior = layout === "button-dialog" ? "dialog" : layout === "button-switch" ? "switch" : undefined; | ||
const formAttrs = { | ||
preset, | ||
title, | ||
placeholder, | ||
minLength, | ||
maxLength, | ||
}; | ||
const btnCancelAttrs = | ||
layout === "button-switch" | ||
? { | ||
"data-behavior-action": "switch", | ||
"data-behavior-target": ".trigger-btn", | ||
"data-behavior-source": ".feelback-form", | ||
} | ||
: { | ||
"data-behavior-action": "cancel", | ||
}; | ||
--- | ||
|
||
{ | ||
(layout === "button-dialog" || layout === "button-switch") && ( | ||
<Component component="form" class={`feelback-tagged-message layout-${layout}`} behavior={behavior} {...target}> | ||
<SwitchResult textAnswer={textAnswer}> | ||
<TriggerButton | ||
action={layout === "button-dialog" ? "dialog" : "switch"} | ||
target=".feelback-form" | ||
label={label} | ||
/> | ||
<TaggedMessageForm {...formAttrs} class={`hidden${layout === "button-dialog" ? " dialog" : ""}`}> | ||
<button slot="btn-cancel" class="feelback-btn btn-cancel" title="Cancel" {...btnCancelAttrs}> | ||
Cancel | ||
</button> | ||
</TaggedMessageForm> | ||
</SwitchResult> | ||
</Component> | ||
) | ||
} | ||
|
||
{ | ||
layout === "inline" && ( | ||
<FeelbackForm class="feelback-tagged-message layout-inline" textAnswer={textAnswer} {...target}> | ||
<TaggedMessageForm {...formAttrs} /> | ||
</FeelbackForm> | ||
) | ||
} |
Oops, something went wrong.